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

@ -2,12 +2,14 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <memory>
#include "Common/Assert.h"
#include "Common/GL/GLInterfaceBase.h"
#include "Common/GL/GLUtil.h"
#include "Common/Logging/Log.h"
cInterfaceBase *GLInterface;
std::unique_ptr<cInterfaceBase> GLInterface;
static GLuint attributelessVAO = 0;
static GLuint attributelessVBO = 0;