[gens-sdl] Added "typedef BaseClass super;" to all derived classes.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 15:33:49 +0000 (11:33 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 15:33:49 +0000 (11:33 -0400)
This makes it easier to access functions in the direct superclass.

GLShader, GLShaderFastBlur: Added an equivalent to Q_DISABLE_COPY().

src/gens-sdl/GLBackend.hpp
src/gens-sdl/GLShader.hpp
src/gens-sdl/GLShaderFastBlur.hpp
src/gens-sdl/SdlGLBackend.cpp
src/gens-sdl/SdlGLBackend.hpp
src/gens-sdl/SdlSWBackend.hpp

index badb953..8d67700 100644 (file)
@@ -39,6 +39,7 @@ class GLBackend : public VBackend {
                virtual ~GLBackend();
 
        private:
+               typedef VBackend super;
                friend class GLBackendPrivate;
                GLBackendPrivate *const d;
        private:
index af3df4b..24d08ab 100644 (file)
@@ -37,6 +37,13 @@ class GLShader
                GLShader();
                virtual ~GLShader();
 
+       private:
+               // Q_DISABLE_COPY() equivalent.
+               // TODO: Add GensSdl-specific version of Q_DISABLE_COPY().
+               GLShader(const GLShader &);
+               GLShader &operator=(const GLShader &);
+
+       public:
                /**
                 * Initialize the shader.
                 * This must be run from within a valid GL context!
index e21c1a4..1dc0dab 100644 (file)
@@ -29,6 +29,17 @@ namespace GensSdl {
 class GLShaderFastBlur : public GLShader
 {
        public:
+               GLShaderFastBlur() : super() { }
+
+       private:
+               typedef GLShader super;
+       private:
+               // Q_DISABLE_COPY() equivalent.
+               // TODO: Add GensSdl-specific version of Q_DISABLE_COPY().
+               GLShaderFastBlur(const GLShaderFastBlur &);
+               GLShaderFastBlur &operator=(const GLShaderFastBlur &);
+
+       public:
                /**
                 * Initialize the shader.
                 * This must be run from within a valid GL context!
index ed1aea6..1eacbdf 100644 (file)
@@ -40,7 +40,8 @@ using LibGens::MdFb;
 namespace GensSdl {
 
 SdlGLBackend::SdlGLBackend()
-       : m_window(nullptr)
+       : super()
+       , m_window(nullptr)
        , m_glContext(nullptr)
 {
        // Initialize the SDL window.
@@ -99,7 +100,7 @@ void SdlGLBackend::set_window_title(const char *title)
 void SdlGLBackend::update(bool fb_dirty)
 {
        // Run the GLBackend update first.
-       GLBackend::update(fb_dirty);
+       super::update(fb_dirty);
 
        // Swap the GL buffers.
        SDL_GL_SwapWindow(m_window);
index 236b84d..5f34779 100644 (file)
@@ -44,6 +44,8 @@ class SdlGLBackend : public GLBackend {
                virtual ~SdlGLBackend();
 
        private:
+               typedef GLBackend super;
+       private:
                // Q_DISABLE_COPY() equivalent.
                // TODO: Add GensSdl-specific version of Q_DISABLE_COPY().
                SdlGLBackend(const SdlGLBackend &);
index 9113fb0..3da94bb 100644 (file)
@@ -42,6 +42,8 @@ class SdlSWBackend : public VBackend {
                virtual ~SdlSWBackend();
 
        private:
+               typedef VBackend super;
+       private:
                // Q_DISABLE_COPY() equivalent.
                // TODO: Add GensSdl-specific version of Q_DISABLE_COPY().
                SdlSWBackend(const SdlSWBackend &);