-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (33 loc) · 1.02 KB
/
main.cpp
File metadata and controls
42 lines (33 loc) · 1.02 KB
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
#include <DxLib.h>
#include "framework.h"
#include "SceneManager.h"
int initApplication();
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
if (initApplication() != 0) {
return -1;
}
while (true) {
ClearDrawScreen();
SceneManager::GetInstance().UpdateScene();
SceneManager::GetInstance().DrawScene();
ScreenFlip();
WaitTimer(1000 / Screen::FPS);
if (ProcessMessage() == -1) {
break;
}
}
}
int initApplication() {
SetMainWindowText(Screen::TITLE);
ChangeFontType(DX_FONTTYPE_ANTIALIASING_EDGE_16X16); //アンチエイリアシング&エッジが使えるように
ChangeWindowMode(true);
SetGraphMode(Screen::WIDTH, Screen::HEIGHT, Screen::COLORBIT);
if (DxLib_Init() == -1) {
return -1;
}
SetBackgroundColor(Screen::BACKCOLOR[0], Screen::BACKCOLOR[1], Screen::BACKCOLOR[2]);
SetDrawScreen(DX_SCREEN_BACK);
SetAlwaysRunFlag(true);
SceneManager::GetInstance().InitScene();
return 0;
}