diff options
| author | Matthew Parlane <parlane@gmail.com> | 2013-01-28 22:00:47 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2013-01-28 22:00:47 +1300 |
| commit | 2dd077028fdaa296827864e70252b4e992b26c65 (patch) | |
| tree | 6a65b5dc0c1566239f603bf1590a2eace73b46e6 /Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp | |
| parent | ed9ef874e581aa2ff5c47ec58e7b741e160b026e (diff) | |
| parent | a8d4c78cec87e864cfa5410f14687d13308e38d7 (diff) | |
Merge branch 'master' into wii-network
Diffstat (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp | 64 |
1 files changed, 23 insertions, 41 deletions
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp index ae2a4db3f5..332e83d0e8 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp @@ -70,7 +70,7 @@ void VideoSoftware::ShowConfig(void *_hParent) bool VideoSoftware::Initialize(void *&window_handle) { - g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str()); + g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str()); InitInterface(); if (!GLInterface->Create(window_handle)) @@ -79,18 +79,16 @@ bool VideoSoftware::Initialize(void *&window_handle) return false; } - InitBPMemory(); - InitXFMemory(); - SWCommandProcessor::Init(); - SWPixelEngine::Init(); - OpcodeDecoder::Init(); - Clipper::Init(); - Rasterizer::Init(); - if (g_SWVideoConfig.bHwRasterizer) - HwRasterizer::Init(); - else - SWRenderer::Init(); - DebugUtil::Init(); + InitBPMemory(); + InitXFMemory(); + SWCommandProcessor::Init(); + SWPixelEngine::Init(); + OpcodeDecoder::Init(); + Clipper::Init(); + Rasterizer::Init(); + HwRasterizer::Init(); + SWRenderer::Init(); + DebugUtil::Init(); return true; } @@ -134,10 +132,8 @@ void VideoSoftware::EmuStateChange(EMUSTATE_CHANGE newState) void VideoSoftware::Shutdown() { - if (g_SWVideoConfig.bHwRasterizer) - HwRasterizer::Shutdown(); - else - SWRenderer::Shutdown(); + HwRasterizer::Shutdown(); + SWRenderer::Shutdown(); GLInterface->Shutdown(); } @@ -145,35 +141,21 @@ void VideoSoftware::Shutdown() void VideoSoftware::Video_Prepare() { GLInterface->MakeCurrent(); - // Init extension support. - { + // Init extension support. + // Required for WGL SwapInterval #ifndef USE_GLES if (glewInit() != GLEW_OK) { - ERROR_LOG(VIDEO, "glewInit() failed!Does your video card support OpenGL 2.x?"); - return; - } - - // Handle VSync on/off -#ifdef _WIN32 - if (WGLEW_EXT_swap_control) - wglSwapIntervalEXT(VSYNC_ENABLED); - else - ERROR_LOG(VIDEO, "no support for SwapInterval (framerate clamped to monitor refresh rate)Does your video card support OpenGL 2.x?"); -#elif defined(HAVE_X11) && HAVE_X11 - if (glXSwapIntervalSGI) - glXSwapIntervalSGI(VSYNC_ENABLED); - else - ERROR_LOG(VIDEO, "no support for SwapInterval (framerate clamped to monitor refresh rate)"); -#endif -#endif + ERROR_LOG(VIDEO, "glewInit() failed!Does your video card support OpenGL 2.x?"); + return; } +#endif + // Handle VSync on/off + GLInterface->SwapInterval(VSYNC_ENABLED); - if (g_SWVideoConfig.bHwRasterizer) - HwRasterizer::Prepare(); - else - SWRenderer::Prepare(); + HwRasterizer::Prepare(); + SWRenderer::Prepare(); - INFO_LOG(VIDEO, "Video backend initialized."); + INFO_LOG(VIDEO, "Video backend initialized."); } // Run from the CPU thread (from VideoInterface.cpp) |
