From 913853d4415ac5c660112edce64891d4920b7b5b Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sat, 7 Sep 2013 15:57:32 -0500 Subject: [PATCH] Move the creation of the GLInterface (and hence the video backend window) from VideoPrepare to Initialize in the software plugin (as in the GL plugin). This fixes issue 6564. It also makes the emulator show up positioned correctly in the dolphin application window when using render to main. --- Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp index c63ad2e446..7fd384afa3 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp @@ -39,7 +39,6 @@ namespace SW static volatile bool fifoStateRun = false; static volatile bool emuRunningState = false; static std::mutex m_csSWVidOccupied; -static void* m_windowhandle; std::string VideoSoftware::GetName() { @@ -64,7 +63,11 @@ bool VideoSoftware::Initialize(void *&window_handle) g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str()); InitInterface(); - m_windowhandle = window_handle; + if (!GLInterface->Create(window_handle)) + { + INFO_LOG(VIDEO, "%s", "SWRenderer::Create failed\n"); + return false; + } InitBPMemory(); InitXFMemory(); @@ -160,12 +163,6 @@ void VideoSoftware::Video_Cleanup() // This is called after Video_Initialize() from the Core void VideoSoftware::Video_Prepare() { - if (!GLInterface->Create(m_windowhandle)) - { - INFO_LOG(VIDEO, "%s", "SWRenderer::Create failed\n"); - return; - } - GLInterface->MakeCurrent(); // Init extension support. #ifndef USE_GLES