mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
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:
@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
@ -42,8 +43,8 @@ public:
|
||||
virtual bool PeekMessages() { return false; }
|
||||
};
|
||||
|
||||
extern cInterfaceBase *GLInterface;
|
||||
extern std::unique_ptr<cInterfaceBase> GLInterface;
|
||||
|
||||
// This function has to be defined along the Host_ functions from Core/Host.h.
|
||||
// Current canonical implementation: DolphinWX/GLInterface/GLInterface.cpp.
|
||||
cInterfaceBase* HostGL_CreateGLInterface();
|
||||
std::unique_ptr<cInterfaceBase> HostGL_CreateGLInterface();
|
||||
|
Reference in New Issue
Block a user