forked from s-tama/GameCircle-GitPractice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWinMain.cpp
More file actions
43 lines (31 loc) · 835 Bytes
/
WinMain.cpp
File metadata and controls
43 lines (31 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// WinMain.cpp
//
#include "DxLib.h"
#include "Game\GameMain.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// ウインドウモードで起動
ChangeWindowMode(TRUE);
// 画面サイズの設定
SetGraphMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32);
if (DxLib_Init() == -1) // DXライブラリ初期化処理
{
return -1; // エラーが起きたら直ちに終了
}
// 描画先画面を裏画面にセット
SetDrawScreen(DX_SCREEN_BACK);
// 初期化処理
Initialize();
// メインループ
while (!ProcessMessage() && !CheckHitKey(KEY_INPUT_ESCAPE))
{
Update(); // 更新処理
Render(); // 描画処理
ScreenFlip(); // 裏画面の内容を表画面に反映させる
ClearDrawScreen(); // 画面を初期化する
}
Finalize(); // 終了処理
DxLib_End(); // DXライブラリ使用の終了処理
return 0; // ソフトの終了
}