summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWmain.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2018-02-07 23:35:54 -0800
committerGitHub <noreply@github.com>2018-02-07 23:35:54 -0800
commit096131c9085ff6cb358d03251f666536910d7806 (patch)
tree0e786cfd19885e26aba93636b99a0596d3e51d74 /Source/Core/VideoBackends/Software/SWmain.cpp
parent4636230f5a8f38b6a70d366615ab43cda11d736a (diff)
parent505d30be3d922f2fba7abe6fd9880f3c8e66767a (diff)
Merge pull request #6334 from stenzek/startup
Video Backend Initialization/Core Boot Improvements
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWmain.cpp42
1 files changed, 11 insertions, 31 deletions
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index 115f9a9509..37d626c854 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -88,50 +88,30 @@ bool VideoSoftware::Initialize(void* window_handle)
Clipper::Init();
Rasterizer::Init();
- SWRenderer::Init();
DebugUtil::Init();
+ GLInterface->MakeCurrent();
+ SWOGLWindow::s_instance->Prepare();
+
+ g_renderer = std::make_unique<SWRenderer>();
+ g_vertex_manager = std::make_unique<SWVertexLoader>();
+ g_perf_query = std::make_unique<PerfQuery>();
+ g_texture_cache = std::make_unique<TextureCache>();
return true;
}
void VideoSoftware::Shutdown()
{
- SWOGLWindow::Shutdown();
-
- ShutdownShared();
-}
+ if (g_renderer)
+ g_renderer->Shutdown();
-void VideoSoftware::Video_Cleanup()
-{
- CleanupShared();
-
- SWRenderer::Shutdown();
DebugUtil::Shutdown();
- // The following calls are NOT Thread Safe
- // And need to be called from the video thread
- SWRenderer::Shutdown();
+ SWOGLWindow::Shutdown();
g_framebuffer_manager.reset();
g_texture_cache.reset();
g_perf_query.reset();
g_vertex_manager.reset();
g_renderer.reset();
-}
-
-// This is called after Video_Initialize() from the Core
-void VideoSoftware::Video_Prepare()
-{
- GLInterface->MakeCurrent();
- SWOGLWindow::s_instance->Prepare();
-
- g_renderer = std::make_unique<SWRenderer>();
- g_vertex_manager = std::make_unique<SWVertexLoader>();
- g_perf_query = std::make_unique<PerfQuery>();
- g_texture_cache = std::make_unique<TextureCache>();
- SWRenderer::Init();
-}
-
-unsigned int VideoSoftware::PeekMessages()
-{
- return SWOGLWindow::s_instance->PeekMessages();
+ ShutdownShared();
}
}