2 #include<Multimedia/SDX.h>
3 #include<Multimedia/Color.h>
25 NoBlend = SDL_BLENDMODE_NONE,
26 Alpha = SDL_BLENDMODE_BLEND,
27 Add = SDL_BLENDMODE_ADD,
29 Mula = SDL_BLENDMODE_MOD,
43 ScreenHandle handle = 0;
46 BlendMode nowBlendMode = BlendMode::NoBlend;
48 Color clearColor = Color(0, 0, 0);
49 Color rgba = Color(255, 255, 255, 0);
51 static Screen& Single()
56 static ScreenHandle GetHandle()
58 return Single().handle;
61 static void SetRenderer(ScreenHandle handle)
63 Single().handle = handle;
67 static bool SetArea(
int x1,
int y1,
int x2,
int y2)
70 return !DxLib::SetDrawArea(x1, y1, x2, y2);
83 return !DxLib::SetCreateGraphColorBitDepth(ビット深度);
96 return !DxLib::SetCreateDrawValidGraphChannelNum(チャンネル数);
108 return !DxLib::SetDrawScreen(DX_SCREEN_BACK);
129 return !DxLib::ScreenFlip();
131 static double nextFrame = SDL_GetTicks();
132 const static double wait = 1000.0 / 60;
136 if (SDL_GetTicks() >= nextFrame)
138 nextFrame = SDL_GetTicks() + wait;
143 SDL_RenderPresent(GetHandle());
152 return !DxLib::ScreenCopy();
154 SDL_RenderPresent(GetHandle());
163 return !DxLib::ClearDrawScreen();
165 SDL_SetRenderDrawColor
168 Single().clearColor.
GetRed(),
173 SDL_RenderClear(GetHandle());
182 return !DxLib::SetDrawMode((
int)補完モード);
191 Single().nowBlendMode = ブレンドモード;
192 Single().blendParam = 設定値;
194 return !DxLib::SetDrawBlendMode((
int)ブレンドモード, 設定値);
201 static bool SaveBmp(
int x1,
int y1 ,
int x2 ,
int y2 ,
const char *ファイル名 )
204 return !DxLib::SaveDrawScreen(x1, y1, x2, y2, ファイル名);
235 DxLib::SetUseZBufferFlag(使用フラグ);
245 DxLib::SetWriteZBufferFlag(使用フラグ);
255 DxLib::SetDrawZ((
float)Z深度);
static bool SetBlendMode(BlendMode ブレンドモード, int 設定値)
ブレンド描画のモードを設定.
Definition: Screen.h:189
int GetGreen() const
緑の要素を取得.
Definition: Color.h:43
static bool Flip()
描画内容を反映.
Definition: Screen.h:126
int GetBlue() const
青の要素を取得.
Definition: Color.h:53
static bool SetBright(Color 輝度)
描画輝度を設定.
Definition: Screen.h:211
static bool SetCreateGraphColorBitDepth(int ビット深度)
作成する画像のビット深度を設定.
Definition: Screen.h:80
static void SetZUse(bool 使用フラグ)
Zバッファ使用フラグを設定.
Definition: Screen.h:232
static bool Clear()
画面を消去する.
Definition: Screen.h:160
static void SetZDepth(double Z深度)
Z描画深度0.0~1.0の範囲で設定.
Definition: Screen.h:252
static bool SetCreateValidGraphChannelNum(int チャンネル数)
スクリーン用Imageのチャンネル数を設定.
Definition: Screen.h:93
色を表すクラス.
Definition: Color.h:7
static bool SetBack()
描画先の設定.
Definition: Screen.h:105
static bool SetTransColor(Color 輝度)
透過色を設定.
Definition: Screen.h:222
static void SetZWrite(bool 使用フラグ)
Zバッファ描画フラグを設定.
Definition: Screen.h:242
int GetRed() const
赤の要素を取得.
Definition: Color.h:33
static bool SaveBmp(int x1, int y1, int x2, int y2, const char *ファイル名)
描画対象になっている画面の一部をBMP形式で保存.
Definition: Screen.h:201
static bool SetBackColor(Color 背景色)
Screen::Clear後の色を設定.
Definition: Screen.h:115
static bool SetArea(int x1, int y1, int x2, int y2)
描画範囲を設定する、設定範囲外には描画されない.
Definition: Screen.h:67
static bool SetMode(DrawMode 補完モード)
拡大描画の補完方法を設定.
Definition: Screen.h:179
static bool Copy()
裏画面の内容を、表画面にコピー.
Definition: Screen.h:149