summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-01-04 13:49:40 +0100
committerMarkus Wick <degasus@users.noreply.github.com>2016-01-04 13:49:40 +0100
commitd29b406292cdec9b7d0bf51224f76b0eb53bbcb2 (patch)
tree7fa606eb31a67b0e51cfd290bb42e411446a8042 /Source/Core/Common
parentca7160f714350ccac9f5bc4625a43c9bdedebcb6 (diff)
parentf3c05d39b9558339838f22f8fd50f0a2d946252f (diff)
Merge pull request #3433 from lioncash/gl
GLInterface: Minor changes
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/GL/GLInterface/AGL.h18
-rw-r--r--Source/Core/Common/GL/GLInterface/EGL.cpp10
-rw-r--r--Source/Core/Common/GL/GLInterface/EGL.h16
-rw-r--r--Source/Core/Common/GL/GLInterface/WGL.h21
-rw-r--r--Source/Core/Common/GL/GLInterfaceBase.h15
5 files changed, 41 insertions, 39 deletions
diff --git a/Source/Core/Common/GL/GLInterface/AGL.h b/Source/Core/Common/GL/GLInterface/AGL.h
index b08b7ec802..f9aeb77a95 100644
--- a/Source/Core/Common/GL/GLInterface/AGL.h
+++ b/Source/Core/Common/GL/GLInterface/AGL.h
@@ -13,15 +13,15 @@
class cInterfaceAGL : public cInterfaceBase
{
private:
- NSView *cocoaWin;
- NSOpenGLContext *cocoaCtx;
+ NSView* cocoaWin;
+ NSOpenGLContext* cocoaCtx;
public:
- void Swap();
- bool Create(void *window_handle, bool core);
- bool MakeCurrent();
- bool ClearCurrent();
- void Shutdown();
- void Update();
- void SwapInterval(int interval);
+ void Swap() override;
+ bool Create(void* window_handle, bool core) override;
+ bool MakeCurrent() override;
+ bool ClearCurrent() override;
+ void Shutdown() override;
+ void Update() override;
+ void SwapInterval(int interval) override;
};
diff --git a/Source/Core/Common/GL/GLInterface/EGL.cpp b/Source/Core/Common/GL/GLInterface/EGL.cpp
index 8f42c98253..202568b2e9 100644
--- a/Source/Core/Common/GL/GLInterface/EGL.cpp
+++ b/Source/Core/Common/GL/GLInterface/EGL.cpp
@@ -25,7 +25,7 @@ void* cInterfaceEGL::GetFuncAddress(const std::string& name)
void cInterfaceEGL::DetectMode()
{
- if (s_opengl_mode != MODE_DETECT)
+ if (s_opengl_mode != GLInterfaceMode::MODE_DETECT)
return;
EGLint num_configs;
@@ -136,15 +136,15 @@ bool cInterfaceEGL::Create(void *window_handle, bool core)
};
switch (s_opengl_mode)
{
- case MODE_OPENGL:
+ case GLInterfaceMode::MODE_OPENGL:
attribs[1] = EGL_OPENGL_BIT;
ctx_attribs[0] = EGL_NONE;
break;
- case MODE_OPENGLES2:
+ case GLInterfaceMode::MODE_OPENGLES2:
attribs[1] = EGL_OPENGL_ES2_BIT;
ctx_attribs[1] = 2;
break;
- case MODE_OPENGLES3:
+ case GLInterfaceMode::MODE_OPENGLES3:
attribs[1] = (1 << 6); /* EGL_OPENGL_ES3_BIT_KHR */
ctx_attribs[1] = 3;
break;
@@ -160,7 +160,7 @@ bool cInterfaceEGL::Create(void *window_handle, bool core)
exit(1);
}
- if (s_opengl_mode == MODE_OPENGL)
+ if (s_opengl_mode == GLInterfaceMode::MODE_OPENGL)
eglBindAPI(EGL_OPENGL_API);
else
eglBindAPI(EGL_OPENGL_ES_API);
diff --git a/Source/Core/Common/GL/GLInterface/EGL.h b/Source/Core/Common/GL/GLInterface/EGL.h
index f25b129d90..21f563f861 100644
--- a/Source/Core/Common/GL/GLInterface/EGL.h
+++ b/Source/Core/Common/GL/GLInterface/EGL.h
@@ -21,12 +21,12 @@ protected:
virtual EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) = 0;
virtual void ShutdownPlatform() = 0;
public:
- void SwapInterval(int Interval);
- void Swap();
- void SetMode(u32 mode) { s_opengl_mode = mode; }
- void* GetFuncAddress(const std::string& name);
- bool Create(void *window_handle, bool core);
- bool MakeCurrent();
- bool ClearCurrent();
- void Shutdown();
+ void Swap() override;
+ void SwapInterval(int interval) override;
+ void SetMode(GLInterfaceMode mode) override { s_opengl_mode = mode; }
+ void* GetFuncAddress(const std::string& name) override;
+ bool Create(void* window_handle, bool core) override;
+ bool MakeCurrent() override;
+ bool ClearCurrent() override;
+ void Shutdown() override;
};
diff --git a/Source/Core/Common/GL/GLInterface/WGL.h b/Source/Core/Common/GL/GLInterface/WGL.h
index 6a1b8c133e..b82a521b16 100644
--- a/Source/Core/Common/GL/GLInterface/WGL.h
+++ b/Source/Core/Common/GL/GLInterface/WGL.h
@@ -10,16 +10,17 @@
class cInterfaceWGL : public cInterfaceBase
{
public:
- void SwapInterval(int Interval);
- void Swap();
- void* GetFuncAddress(const std::string& name);
- bool Create(void *window_handle, bool core);
- bool MakeCurrent();
- bool ClearCurrent();
- void Shutdown();
+ void SwapInterval(int interval) override;
+ void Swap() override;
+ void* GetFuncAddress(const std::string& name) override;
+ bool Create(void* window_handle, bool core) override;
+ bool MakeCurrent() override;
+ bool ClearCurrent() override;
+ void Shutdown() override;
- void Update();
- bool PeekMessages();
+ void Update() override;
+ bool PeekMessages() override;
- HWND m_window_handle;
+private:
+ HWND m_window_handle = nullptr;
};
diff --git a/Source/Core/Common/GL/GLInterfaceBase.h b/Source/Core/Common/GL/GLInterfaceBase.h
index 8fed61f0d4..d7885635bb 100644
--- a/Source/Core/Common/GL/GLInterfaceBase.h
+++ b/Source/Core/Common/GL/GLInterfaceBase.h
@@ -9,8 +9,9 @@
#include "Common/CommonTypes.h"
-enum GLInterfaceMode {
- MODE_DETECT = 0,
+enum class GLInterfaceMode
+{
+ MODE_DETECT,
MODE_OPENGL,
MODE_OPENGLES2,
MODE_OPENGLES3,
@@ -20,15 +21,15 @@ class cInterfaceBase
{
protected:
// Window dimensions.
- u32 s_backbuffer_width;
- u32 s_backbuffer_height;
+ u32 s_backbuffer_width = 0;
+ u32 s_backbuffer_height = 0;
- u32 s_opengl_mode;
+ GLInterfaceMode s_opengl_mode = GLInterfaceMode::MODE_DETECT;
public:
virtual ~cInterfaceBase() {}
virtual void Swap() {}
- virtual void SetMode(u32 mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; }
- virtual u32 GetMode() { return s_opengl_mode; }
+ virtual void SetMode(GLInterfaceMode mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; }
+ virtual GLInterfaceMode GetMode() { return s_opengl_mode; }
virtual void* GetFuncAddress(const std::string& name) { return nullptr; }
virtual bool Create(void *window_handle, bool core = true) { return true; }
virtual bool MakeCurrent() { return true; }