From 134d967be2dd4ba9531abb8ba8494c3ac423ca72 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:02:45 +1000 Subject: Refactoring and cleanup of GLInterface (now GLContext) --- Source/Core/VideoBackends/Software/SWmain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 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 6ca183b57c..8781a2da9b 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -9,7 +9,7 @@ #include "Common/Common.h" #include "Common/CommonTypes.h" -#include "Common/GL/GLInterfaceBase.h" +#include "Common/GL/GLContext.h" #include "VideoBackends/Software/Clipper.h" #include "VideoBackends/Software/DebugUtil.h" @@ -88,7 +88,7 @@ bool VideoSoftware::Initialize(void* window_handle) Rasterizer::Init(); DebugUtil::Init(); - GLInterface->MakeCurrent(); + g_main_gl_context->MakeCurrent(); SWOGLWindow::s_instance->Prepare(); g_renderer = std::make_unique(); @@ -116,4 +116,4 @@ void VideoSoftware::Shutdown() g_renderer.reset(); ShutdownShared(); } -} +} // namespace SW -- cgit v1.2.3 From a3961750a7174be7402fc492367f017d845b8e1f Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:03:13 +1000 Subject: Drop Host_GetRenderSurface and pass display to backend --- Source/Core/VideoBackends/Software/SWmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 8781a2da9b..f4c0aaa641 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -78,7 +78,7 @@ void VideoSoftware::InitBackendInfo() g_Config.backend_info.AAModes = {1}; } -bool VideoSoftware::Initialize(void* window_handle) +bool VideoSoftware::Initialize(void* display_handle, void* window_handle) { InitializeShared(); -- cgit v1.2.3 From 9c57a98723997736adea94383668fbdf8a993fd8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:03:19 +1000 Subject: GLContext: Use host connection This also removes the need for a sleeping event thread. --- Source/Core/VideoBackends/Software/SWmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 f4c0aaa641..2aa099e9e9 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -82,7 +82,7 @@ bool VideoSoftware::Initialize(void* display_handle, void* window_handle) { InitializeShared(); - SWOGLWindow::Init(window_handle); + SWOGLWindow::Init(display_handle, window_handle); Clipper::Init(); Rasterizer::Init(); -- cgit v1.2.3 From eb284b5d661cab6aed770e0e51b790917249ef21 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:03:22 +1000 Subject: VideoBackends: Pass window system info from host on creation --- Source/Core/VideoBackends/Software/SWmain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 2aa099e9e9..070cf74b69 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -78,11 +78,11 @@ void VideoSoftware::InitBackendInfo() g_Config.backend_info.AAModes = {1}; } -bool VideoSoftware::Initialize(void* display_handle, void* window_handle) +bool VideoSoftware::Initialize(const WindowSystemInfo& wsi) { InitializeShared(); - SWOGLWindow::Init(display_handle, window_handle); + SWOGLWindow::Init(wsi); Clipper::Init(); Rasterizer::Init(); -- cgit v1.2.3 From dcdd02d646230e7903520a41dc9f86e57ae16dbe Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:03:26 +1000 Subject: GLContext: Remove global context pointer --- Source/Core/VideoBackends/Software/SWmain.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 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 070cf74b69..a0ad349849 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -82,16 +82,15 @@ bool VideoSoftware::Initialize(const WindowSystemInfo& wsi) { InitializeShared(); - SWOGLWindow::Init(wsi); + std::unique_ptr window = SWOGLWindow::Create(wsi); + if (!window) + return false; Clipper::Init(); Rasterizer::Init(); DebugUtil::Init(); - g_main_gl_context->MakeCurrent(); - SWOGLWindow::s_instance->Prepare(); - - g_renderer = std::make_unique(); + g_renderer = std::make_unique(std::move(window)); g_vertex_manager = std::make_unique(); g_perf_query = std::make_unique(); g_texture_cache = std::make_unique(); @@ -108,7 +107,6 @@ void VideoSoftware::Shutdown() g_renderer->Shutdown(); DebugUtil::Shutdown(); - SWOGLWindow::Shutdown(); g_framebuffer_manager.reset(); g_texture_cache.reset(); g_perf_query.reset(); -- cgit v1.2.3