2 #include<Multimedia/SDX.h>
3 #include<Multimedia/Color.h>
4 #include<Multimedia/Image.h>
5 #include<Multimedia/Font.h>
6 #include<Utility/VariadicStream.h>
7 #include<Framework/Shape.h>
19 static Font defaultFont;
22 static void RGBACulculate(
int 赤 ,
int 緑 ,
int 青)
25 SDL_SetRenderDrawColor
35 static Image& circleTexture(
bool 塗りつぶしフラグ)
40 if (circleA.handle ==
nullptr)
43 font.
Load(SystemFont::Gothic, 1000);
45 SDL_Surface* surfaceA = TTF_RenderUTF8_Blended( font.
GetHandle(),
"●", {255,255,255,255});
47 circleA.part.w = surfaceA->w;
48 circleA.part.h = surfaceA->h;
49 SDL_FreeSurface(surfaceA);
51 SDL_Surface* surfaceB = TTF_RenderUTF8_Blended(font.
GetHandle(),
"○", { 255, 255, 255, 255 });
53 circleB.part.w = surfaceB->w;
54 circleB.part.h = surfaceB->h;
55 SDL_FreeSurface(surfaceB);
89 return !SDL_RenderDrawLine(
Screen::GetHandle(), (
int)始点.x, (
int)始点.y, (
int)終点.x, (
int)終点.y);
95 SDL_Rect buf = { (int)領域.GetLeft(),(int)領域.GetTop(),(int)領域.
GetW(),(int)領域.
GetH() };
110 circleTexture(塗りつぶしフラグ).
DrawExtend({ 円形.x - 円形.radius, 円形.y - 円形.radius }, { 円形.x + 円形.radius, 円形.y + 円形.radius });
118 circleTexture(塗りつぶしフラグ).
DrawExtend({ 中心.x - 幅 / 2, 中心.y - 高さ / 2 }, { 中心.x + 幅 / 2, 中心.y + 高さ / 2 });
126 SDL_RenderDrawLine(
Screen::GetHandle(), (
int)頂点A.x, (
int)頂点A.y, (
int)頂点B.x, (
int)頂点B.y);
127 SDL_RenderDrawLine(
Screen::GetHandle(), (
int)頂点B.x, (
int)頂点B.y, (
int)頂点C.x, (
int)頂点C.y);
128 SDL_RenderDrawLine(
Screen::GetHandle(), (
int)頂点C.x, (
int)頂点C.y, (
int)頂点A.x, (
int)頂点A.y);
141 return SDL_Color{ 0, 0, 0 };
149 buf.
Draw( 座標 ,
false);
157 defaultFont.
Draw( 座標 ,色 , 描画する文字列 );
static void Circle(const Circle &円形, Color 色, bool 塗りつぶしフラグ)
中心と半径を指定して円を描画.
Definition: Drawing.h:107
static void Oval(const Point &中心, int 幅, int 高さ, Color 色, bool 塗りつぶしフラグ)
中心と外接する四角形の大きさを指定して楕円を描画.
Definition: Drawing.h:115
int GetGreen() const
緑の要素を取得.
Definition: Color.h:31
矩形を表す図形クラス.
Definition: Shape.h:536
bool Draw(const Point &座標, bool 反転フラグ=false) const
指定座標に描画.
Definition: Image.h:164
static RendererHandle GetHandle()
スクリーンハンドルを取得.
Definition: Screen.h:77
double GetW() const
幅を取得.
Definition: Shape.h:616
FontHandle GetHandle() const
フォントのハンドルを取得.
Definition: Font.h:64
bool DrawExtend(const Point &座標A, const Point &座標B) const
指定矩形内に描画.
Definition: Image.h:178
int GetBlue() const
青の要素を取得.
Definition: Color.h:37
static Screen & Single()
シングルトンなインスタンスを取得.
Definition: Screen.h:70
リソースを読み込まずに描画を行う関数群.
Definition: Drawing.h:13
点を表す図形クラス.
Definition: Shape.h:129
static ColorData GetPixel(const Point &座標)
指定座標の色を取得[未実装].
Definition: Drawing.h:139
フォントデータを表すクラス.
Definition: Font.h:23
static void Triangle(const Point &頂点A, const Point &頂点B, const Point &頂点C, Color 色, bool 塗りつぶしフラグ)
頂点を3つ指定して三角形を描画.
Definition: Drawing.h:123
static void Pixel(const Point &座標, Color 色)
指定座標に点を描画.
Definition: Drawing.h:132
static void SetDefaultFont(const char *フォント名, int 大きさ)
デフォルトのフォントを設定する.
Definition: Drawing.h:79
画像データを表すクラス.
Definition: Image.h:38
色を表すクラス.
Definition: Color.h:7
bool Draw(const Point &座標, Color 色, VariadicStream 描画する文字列) const override
文字を描画.
Definition: Font.h:135
bool Release() const
フォントをメモリから開放する.
Definition: Font.h:55
bool Release()
イメージをメモリから開放.
Definition: Image.h:113
int GetRed() const
赤の要素を取得.
Definition: Color.h:25
可変数引数な文字列を処理するクラス.
Definition: VariadicStream.h:8
static void ImageFile(const Point &座標, const char *ファイル名, bool 透過フラグ=true)
画像を一時的にメモリに読み込んで描画.
Definition: Drawing.h:146
static void String(const Point &座標, Color 色, VariadicStream 描画する文字列)
文字を描画.
Definition: Drawing.h:155
static Font & GetFont()
デフォルトのフォントを取得する[SDL].
Definition: Drawing.h:73
円を表す図形クラス.
Definition: Shape.h:789
static bool Line(const Point &始点, const Point &終点, Color 色, int 太さ)
始点と終点を結ぶ直線を描画.
Definition: Drawing.h:86
bool Load(const char *フォント名, int 大きさ, int 太さ=1, int 改行高さ=0, FontType フォントタイプ=FontType::Normal)
メモリ上にフォントを作成する.
Definition: Font.h:43
double GetH() const
高さを取得.
Definition: Shape.h:621
static bool Rect(const Rect &領域, Color 色, bool 塗りつぶしフラグ)
左上の座標と大きさを指定して矩形を描画.
Definition: Drawing.h:93