diff --git a/JGE/src/Qtmain.cpp b/JGE/src/Qtmain.cpp index 3decf8ff8..559b48f2c 100644 --- a/JGE/src/Qtmain.cpp +++ b/JGE/src/Qtmain.cpp @@ -1,6 +1,6 @@ #define GL_GLEXT_PROTOTYPES -#include -#include +#include +#include #ifdef Q_WS_MAEMO_5 // For volume buttons support @@ -599,14 +599,14 @@ int main(int argc, char* argv[]) g_glwidget->show(); #endif + JGECreateDefaultBindings(); + if (!InitGame()) { qCritical("Could not init the game\n"); return 1; } - JGECreateDefaultBindings(); - a.exec(); if (g_launcher) diff --git a/JGE/src/SDLmain.cpp b/JGE/src/SDLmain.cpp index a8bc06481..510029afc 100644 --- a/JGE/src/SDLmain.cpp +++ b/JGE/src/SDLmain.cpp @@ -667,6 +667,7 @@ bool SdlApp::OnInit() glEnable(GL_SCISSOR_TEST); // Enable Clipping + JGECreateDefaultBindings(); if (!InitGame()) { @@ -676,8 +677,6 @@ bool SdlApp::OnInit() OnResize(window_w, window_h); - JGECreateDefaultBindings(); - return true; }; diff --git a/JGE/src/Xmain.cpp b/JGE/src/Xmain.cpp index 118882e7b..3bc771f7c 100644 --- a/JGE/src/Xmain.cpp +++ b/JGE/src/Xmain.cpp @@ -50,8 +50,8 @@ JGameLauncher* g_launcher = NULL; //------------------------------------------------------------------------ Display* gXDisplay = NULL; -Window gXWindow = NULL; -GLXWindow glxWin = NULL; +Window gXWindow = (Window)0; +GLXWindow glxWin = (GLXWindow)0; static std::multiset gControllerState; static std::multiset gPrevControllerState; @@ -140,6 +140,7 @@ bool InitGame(void) { g_engine = JGE::GetInstance(); g_app = g_launcher->GetGameApp(); + JGECreateDefaultBindings(); g_app->Create(); g_engine->SetApp(g_app); @@ -172,7 +173,7 @@ void KillGLWindow(void) // Properly Kill The Window { if (gXWindow && gXDisplay) XDestroyWindow(gXDisplay, gXWindow); - gXWindow = NULL; + gXWindow = (Window)0; } @@ -369,8 +370,6 @@ int main(int argc, char* argv[]) XSelectInput(gXDisplay, gXWindow, KeyPressMask | KeyReleaseMask | StructureNotifyMask); XkbSetDetectableAutoRepeat(gXDisplay, True, NULL); - JGECreateDefaultBindings(); - static uint64_t tickCount; while (!g_engine->IsDone()) { diff --git a/JGE/src/iOS/EAGLView.m b/JGE/src/iOS/EAGLView.m index 2a2590912..72c64f24f 100755 --- a/JGE/src/iOS/EAGLView.m +++ b/JGE/src/iOS/EAGLView.m @@ -265,12 +265,13 @@ void DestroyGame(void) JRenderer::Set3DFlag(true); } + JGECreateDefaultBindings(); + if (!InitGame()) { //return 1; } - JGECreateDefaultBindings(); started = TRUE; } diff --git a/JGE/src/main.cpp b/JGE/src/main.cpp index 426677771..83aced279 100644 --- a/JGE/src/main.cpp +++ b/JGE/src/main.cpp @@ -323,7 +323,6 @@ void Run() sceRtcGetCurrentTick(&lastTime); oldButtons = veryOldButtons = 0; - JGECreateDefaultBindings(); while (!g_engine->mDone) { @@ -383,6 +382,7 @@ int main(int argc, char *argv[]) JLOG("JGE::GetInstance()"); g_engine = JGE::GetInstance(); g_engine->SetARGV(argc, argv); + JGECreateDefaultBindings(); JLOG("Create Game"); game = launcher->GetGameApp();