diff options
| author | Mathew Maidment <mathew1800@gmail.com> | 2015-12-21 01:57:37 -0500 |
|---|---|---|
| committer | Mathew Maidment <mathew1800@gmail.com> | 2015-12-21 01:57:37 -0500 |
| commit | 365a326798853676bad3c83274744000a47cfa41 (patch) | |
| tree | acf56e852bc06711f07382821f9d115fea060b00 /Source/Core/Common/GL/GLInterface/GLInterface.cpp | |
| parent | 1fbab188adafaf46e252837153cbfa3242a8d3c7 (diff) | |
| parent | f2951828335654d0993ead998b3c547f903501dd (diff) | |
Merge pull request #3369 from lioncash/unique
VideoBackends: Simplify initialization and deinitialization of resources
Diffstat (limited to 'Source/Core/Common/GL/GLInterface/GLInterface.cpp')
| -rw-r--r-- | Source/Core/Common/GL/GLInterface/GLInterface.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/Core/Common/GL/GLInterface/GLInterface.cpp b/Source/Core/Common/GL/GLInterface/GLInterface.cpp index 8abe67dc71..b9a05fd30a 100644 --- a/Source/Core/Common/GL/GLInterface/GLInterface.cpp +++ b/Source/Core/Common/GL/GLInterface/GLInterface.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> + #include "Common/GL/GLInterfaceBase.h" #ifdef ANDROID @@ -20,19 +22,19 @@ #error Platform doesnt have a GLInterface #endif -cInterfaceBase* HostGL_CreateGLInterface() +std::unique_ptr<cInterfaceBase> HostGL_CreateGLInterface() { #ifdef ANDROID - return new cInterfaceEGLAndroid; + return std::make_unique<cInterfaceEGLAndroid>(); #elif defined(__APPLE__) - return new cInterfaceAGL; + return std::make_unique<cInterfaceAGL>(); #elif defined(_WIN32) - return new cInterfaceWGL; + return std::make_unique<cInterfaceWGL>(); #elif defined(HAVE_X11) && HAVE_X11 #if defined(USE_EGL) && USE_EGL - return new cInterfaceEGLX11; + return std::make_unique<cInterfaceEGLX11>(); #else - return new cInterfaceGLX; + return std::make_unique<cInterfaceGLX>(); #endif #else return nullptr; |
