diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-15 20:54:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-15 20:54:59 +0300 |
commit | 7b26645c1b28b212c011f98a5420c0989a7f0adc (patch) | |
tree | 0a3231b3cb54f415473c9834b88657b76b2668d6 /src/resources/openglimagehelper.h | |
parent | 054ed0b25bffc50588ff8c11a0aef4ee74c8136d (diff) | |
download | plus-7b26645c1b28b212c011f98a5420c0989a7f0adc.tar.gz plus-7b26645c1b28b212c011f98a5420c0989a7f0adc.tar.bz2 plus-7b26645c1b28b212c011f98a5420c0989a7f0adc.tar.xz plus-7b26645c1b28b212c011f98a5420c0989a7f0adc.zip |
improve imagehelper class.
Diffstat (limited to 'src/resources/openglimagehelper.h')
-rw-r--r-- | src/resources/openglimagehelper.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h index 1c1f398eb..5c144809a 100644 --- a/src/resources/openglimagehelper.h +++ b/src/resources/openglimagehelper.h @@ -78,16 +78,18 @@ class OpenGLImageHelper final : public ImageHelper * @return <code>NULL</code> if an error occurred, a valid pointer * otherwise. */ - Image *load(SDL_RWops *const rw, Dye const &dye) A_WARN_UNUSED; + Image *load(SDL_RWops *const rw, + Dye const &dye) const override A_WARN_UNUSED; /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) A_WARN_UNUSED; + Image *load(SDL_Surface *const tmpImage) const override A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, - int width, int height, - const float alpha) A_WARN_UNUSED; + const int width, const int height, + const float alpha) + const override A_WARN_UNUSED; // OpenGL only public functions @@ -95,7 +97,7 @@ class OpenGLImageHelper final : public ImageHelper * Sets the target image format. Use <code>false</code> for SDL and * <code>true</code> for OpenGL. */ - static void setLoadAsOpenGL(int useOpenGL); + static void setLoadAsOpenGL(const int useOpenGL); static int getTextureType() A_WARN_UNUSED { return mTextureType; } @@ -117,26 +119,26 @@ class OpenGLImageHelper final : public ImageHelper * Tells if the image was loaded using OpenGL or SDL * @return true if OpenGL, false if SDL. */ - int useOpenGL() A_WARN_UNUSED; + int useOpenGL() const override A_WARN_UNUSED; static int getTextureSize() A_WARN_UNUSED { return mTextureSize; } - static void initTextureSampler(GLint id); + static void initTextureSampler(const GLint id); - static void setUseTextureSampler(bool b) + static void setUseTextureSampler(const bool b) { mUseTextureSampler = b; } - SDL_Surface *create32BitSurface(int width, int height); + SDL_Surface *create32BitSurface(int width, int height) const override; protected: /** * Returns the first power of two equal or bigger than the input. */ - int powerOfTwo(int input) const A_WARN_UNUSED; + int powerOfTwo(const int input) const A_WARN_UNUSED; Image *glLoad(SDL_Surface *tmpImage, - int width = 0, int height = 0) A_WARN_UNUSED; + int width = 0, int height = 0) const A_WARN_UNUSED; static int mUseOpenGL; static int mTextureSize; |