|
@@ -13,6 +13,8 @@
|
|
|
Game::Game()
|
|
|
{
|
|
|
this->isRunning = false;
|
|
|
+ this->windowsHeight = 0;
|
|
|
+ this->windowsWidth = 0;
|
|
|
}
|
|
|
|
|
|
Game::~Game()
|
|
@@ -23,6 +25,7 @@ Game::~Game()
|
|
|
void Game::Initialize()
|
|
|
{
|
|
|
int ret;
|
|
|
+ SDL_DisplayMode displayMode;
|
|
|
|
|
|
ret = SDL_Init(SDL_INIT_EVERYTHING);
|
|
|
if (ret)
|
|
@@ -31,8 +34,12 @@ void Game::Initialize()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ SDL_GetCurrentDisplayMode(0, &displayMode);
|
|
|
+ this->windowsHeight = displayMode.h;
|
|
|
+ this->windowsWidth = displayMode.w;
|
|
|
+ printf("%d:%d\n", displayMode.w, displayMode.h);
|
|
|
this->window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
|
|
- 800, 600, SDL_WINDOW_BORDERLESS);
|
|
|
+ this->windowsWidth, this->windowsHeight, SDL_WINDOW_BORDERLESS);
|
|
|
if (!window)
|
|
|
{
|
|
|
fprintf(stderr, "SDL window creation error.\n");
|
|
@@ -46,6 +53,8 @@ void Game::Initialize()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ SDL_SetWindowFullscreen(this->window, SDL_WINDOW_FULLSCREEN);
|
|
|
+
|
|
|
this->isRunning = true;
|
|
|
}
|
|
|
|