VideoBackends: Simplify initialization and deinitialization of resources

Approximately three or four times now, the issue of pointers being
in an inconsistent state been an issue in the video backend renderers
with regards to tripping up other developers.

Global (ugh) resources are put into a unique_ptr and will always have a
well-defined state of being - null or not null
This commit is contained in:
Lioncash
2015-12-20 21:49:49 -05:00
parent 1fbab188ad
commit f295182833
25 changed files with 104 additions and 86 deletions

View File

@ -5,6 +5,7 @@
// Stub implementation of the Host_* callbacks for tests. These implementations
// do nothing except return default values when required.
#include <memory>
#include <string>
#include "Common/GL/GLInterfaceBase.h"
@ -26,4 +27,4 @@ bool Host_RendererIsFullscreen() { return false; }
void Host_ConnectWiimote(int, bool) {}
void Host_SetWiiMoteConnectionState(int) {}
void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}
cInterfaceBase* HostGL_CreateGLInterface() { return nullptr; }
std::unique_ptr<cInterfaceBase> HostGL_CreateGLInterface() { return nullptr; }