From 61c3a0d9e45a587e8fb5e5770eb4db05386bed5f Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 26 Sep 2015 10:07:48 +0200 Subject: VideoSW: Split up OGL window handling This removes OSD support for video software, but it was already broken before. This commit does not try to fix coding style issues, the rewrite of this presentation API is splitted up. --- Source/Core/VideoBackends/Software/SWmain.cpp | 31 ++++----------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp') diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index ba74f320c8..7b55bb0971 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -8,9 +8,6 @@ #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/StringUtil.h" -#include "Common/GL/GLInterfaceBase.h" -#include "Common/GL/GLUtil.h" -#include "Common/GL/GLExtensions/GLExtensions.h" #include "Common/Logging/LogManager.h" #include "Core/ConfigManager.h" @@ -26,6 +23,7 @@ #include "VideoBackends/Software/OpcodeDecoder.h" #include "VideoBackends/Software/Rasterizer.h" #include "VideoBackends/Software/SWCommandProcessor.h" +#include "VideoBackends/Software/SWOGLWindow.h" #include "VideoBackends/Software/SWRenderer.h" #include "VideoBackends/Software/SWStatistics.h" #include "VideoBackends/Software/SWVertexLoader.h" @@ -81,13 +79,7 @@ bool VideoSoftware::Initialize(void *window_handle) { g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini").c_str()); - InitInterface(); - GLInterface->SetMode(GLInterfaceMode::MODE_DETECT); - if (!GLInterface->Create(window_handle, false)) - { - INFO_LOG(VIDEO, "GLInterface::Create failed."); - return false; - } + SWOGLWindow::Init(window_handle); InitBPMemory(); InitXFMemory(); @@ -165,31 +157,16 @@ void VideoSoftware::Shutdown() // Do our OSD callbacks OSD::DoCallbacks(OSD::OSD_SHUTDOWN); - GLInterface->Shutdown(); - delete GLInterface; - GLInterface = nullptr; + SWOGLWindow::Shutdown(); } void VideoSoftware::Video_Cleanup() { - GLInterface->ClearCurrent(); } // This is called after Video_Initialize() from the Core void VideoSoftware::Video_Prepare() { - GLInterface->MakeCurrent(); - - // Init extension support. - if (!GLExtensions::Init()) - { - ERROR_LOG(VIDEO, "GLExtensions::Init failed!Does your video card support OpenGL 2.0?"); - return; - } - - // Handle VSync on/off - GLInterface->SwapInterval(VSYNC_ENABLED); - // Do our OSD callbacks OSD::DoCallbacks(OSD::OSD_INIT); @@ -367,7 +344,7 @@ void VideoSoftware::RegisterCPMMIO(MMIO::Mapping* mmio, u32 base) // Draw messages on top of the screen unsigned int VideoSoftware::PeekMessages() { - return GLInterface->PeekMessages(); + return SWOGLWindow::s_instance->PeekMessages(); } } -- cgit v1.2.3