[Fix] Game was initialized before SDL.
This commit is contained in:
parent
6b5607797b
commit
06171f3671
@ -35,7 +35,6 @@ bool Game::Init(void) {
|
|||||||
glAlphaFunc(GL_GREATER, 0.1f);
|
glAlphaFunc(GL_GREATER, 0.1f);
|
||||||
|
|
||||||
_level->Load("../Data/Map/Ugly.tmx");
|
_level->Load("../Data/Map/Ugly.tmx");
|
||||||
_player->Update();
|
|
||||||
|
|
||||||
// Return success.
|
// Return success.
|
||||||
return true;
|
return true;
|
||||||
@ -74,8 +73,6 @@ void Game::Render(void) {
|
|||||||
// Render our shit..
|
// Render our shit..
|
||||||
_level->Draw(xOffset, yOffset);
|
_level->Draw(xOffset, yOffset);
|
||||||
_player->Render();
|
_player->Render();
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::Shutdown(void) {
|
void Game::Shutdown(void) {
|
||||||
@ -85,7 +82,7 @@ void Game::Shutdown(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Game::ProcessEvents(void) {
|
void Game::ProcessEvents(void) {
|
||||||
// Should not need this, as the game class has no events to process..
|
_player->ProcessEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::OnResize(int width, int height) {
|
void Game::OnResize(int width, int height) {
|
||||||
|
@ -40,8 +40,6 @@ int main(int argc, char** argv) {
|
|||||||
// Start by opening a debug log.
|
// Start by opening a debug log.
|
||||||
Debug::openLog(true);
|
Debug::openLog(true);
|
||||||
Debug::logger->message("\n ----- Engine Loading -----");
|
Debug::logger->message("\n ----- Engine Loading -----");
|
||||||
// Our game code.
|
|
||||||
Game game;
|
|
||||||
|
|
||||||
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
|
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||||
Debug::logger->message("Error: Could not load SDL");
|
Debug::logger->message("Error: Could not load SDL");
|
||||||
@ -78,6 +76,7 @@ int main(int argc, char** argv) {
|
|||||||
Debug::logger->message("\n ----- Engine Initialization Complete -----");
|
Debug::logger->message("\n ----- Engine Initialization Complete -----");
|
||||||
Debug::logger->message("\n ----- Logic -----");
|
Debug::logger->message("\n ----- Logic -----");
|
||||||
|
|
||||||
|
Game game;
|
||||||
game.Init();
|
game.Init();
|
||||||
CreateInput();
|
CreateInput();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user