|
@@ -35,9 +35,10 @@ void Game::Initialize()
|
|
|
}
|
|
|
|
|
|
SDL_GetCurrentDisplayMode(0, &displayMode);
|
|
|
- this->windowsHeight = displayMode.h;
|
|
|
this->windowsWidth = displayMode.w;
|
|
|
+ this->windowsHeight = displayMode.h;
|
|
|
printf("%d:%d\n", displayMode.w, displayMode.h);
|
|
|
+
|
|
|
this->window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
|
|
this->windowsWidth, this->windowsHeight, SDL_WINDOW_BORDERLESS);
|
|
|
if (!window)
|
|
@@ -74,6 +75,8 @@ void Game::Destroy()
|
|
|
|
|
|
void Game::Run()
|
|
|
{
|
|
|
+ this->Setup();
|
|
|
+
|
|
|
while(this->isRunning)
|
|
|
{
|
|
|
this->ProcessInput();
|
|
@@ -82,6 +85,11 @@ void Game::Run()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void Game::Setup()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
void Game::ProcessInput()
|
|
|
{
|
|
|
SDL_Event event;
|
|
@@ -115,8 +123,13 @@ void Game::Update()
|
|
|
|
|
|
void Game::Render()
|
|
|
{
|
|
|
- SDL_SetRenderDrawColor(this->renderer, 255, 64, 127, 255);
|
|
|
+ SDL_SetRenderDrawColor(this->renderer, 21, 21, 21, 255);
|
|
|
SDL_RenderClear(this->renderer);
|
|
|
|
|
|
+ SDL_Rect player = { 10, 10, 20, 20 };
|
|
|
+ SDL_SetRenderDrawColor(this->renderer, 127, 255, 64, 255);
|
|
|
+ SDL_RenderFillRect(this->renderer, &player);
|
|
|
+
|
|
|
SDL_RenderPresent(this->renderer);
|
|
|
}
|
|
|
+
|