summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWmain.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-01-26 15:09:07 +1000
committerStenzek <stenzek@gmail.com>2018-01-27 13:53:55 +1000
commitd96e8c9d76389411e4b17f0b7b5c4fdb0f0977f8 (patch)
tree19e321d8506a63fdaa5af4d25bc2161384e28af4 /Source/Core/VideoBackends/Software/SWmain.cpp
parent04027a7da774bfcafeff0b8565417e43e5e3c198 (diff)
VideoBackends: Combine Initialize/Prepare and Cleanup/Shutdown methods
Also allows the work previously done in Prepare to return a failure status.
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWmain.cpp37
1 files changed, 11 insertions, 26 deletions
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index 115f9a9509..a79540891f 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -88,46 +88,31 @@ 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();
-}
-
-void VideoSoftware::Video_Cleanup()
-{
- CleanupShared();
+ if (g_renderer)
+ g_renderer->Shutdown();
- 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();
+ ShutdownShared();
}
unsigned int VideoSoftware::PeekMessages()