diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 7323f7f3e5..d7a891ecd1 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -24,10 +24,7 @@ namespace OGL // Draw messages on top of the screen unsigned int VideoBackend::PeekMessages() { - if (GLInterface) - return GLInterface->PeekMessages(); - else - return 0; + return GLInterface->PeekMessages(); } // Show the current FPS diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 596a4cd86d..6d71994cf4 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -89,7 +89,6 @@ Make AA apply instantly during gameplay if possible namespace OGL { -static void* m_windowhandle; std::string VideoBackend::GetName() { @@ -150,12 +149,12 @@ void VideoBackend::ShowConfig(void *_hParent) diag.ShowModal(); #endif } + bool VideoBackend::Initialize(void *&window_handle) { InitializeShared(); InitBackendInfo(); - - m_windowhandle = window_handle; + frameCount = 0; g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str()); @@ -164,7 +163,13 @@ bool VideoBackend::Initialize(void *&window_handle) g_Config.VerifyValidity(); UpdateActiveConfig(); - + InitInterface(); + if (!GLInterface->Create(window_handle)) + return false; + + // Do our OSD callbacks + OSD::DoCallbacks(OSD::OSD_INIT); + s_BackendInitialized = true; return true; @@ -174,16 +179,6 @@ bool VideoBackend::Initialize(void *&window_handle) // Run from the graphics thread void VideoBackend::Video_Prepare() { - InitInterface(); - if (!GLInterface->Create(m_windowhandle)) - { - INFO_LOG(VIDEO, "%s", "GLInterface::Create failed\n"); - return; - } - - // Do our OSD callbacks - OSD::DoCallbacks(OSD::OSD_INIT); - GLInterface->MakeCurrent(); g_renderer = new Renderer;