ManaPlus
|
#include <safeopenglimagehelper.h>
Public Member Functions | |
SafeOpenGLImageHelper () | |
~SafeOpenGLImageHelper () | |
Image * | load (SDL_RWops *const rw, Dye const &dye) |
Image * | loadSurface (SDL_Surface *const tmpImage) |
Image * | createTextSurface (SDL_Surface *const tmpImage, const int width, const int height, const float alpha) |
SDL_Surface * | create32BitSurface (int width, int height) const |
void | postInit () |
void | copySurfaceToImage (const Image *const image, const int x, const int y, SDL_Surface *surface) const |
Public Member Functions inherited from ImageHelper | |
virtual | ~ImageHelper () |
Image * | load (SDL_RWops *const rw) |
virtual Image * | createTextSurface (SDL_Surface *const tmpImage, const int width, const int height, const float alpha) const |
virtual RenderType | useOpenGL () const |
Static Public Member Functions | |
static int | getTextureType () |
static int | getInternalTextureType () |
static void | setInternalTextureType (const int n) |
static void | setBlur (const bool n) |
static int | getTextureSize () |
static void | initTextureSampler (const GLint id) |
static void | setUseTextureSampler (const bool b) |
static void | invalidate (const GLuint textureId) |
static void | bindTexture (const GLuint texture) |
Static Public Member Functions inherited from ImageHelper | |
static SDL_Surface * | convertTo32Bit (SDL_Surface *const tmpImage) |
static void | dumpSurfaceFormat (const SDL_Surface *const image) |
static void | setEnableAlpha (const bool n) |
static SDL_Surface * | loadPng (SDL_RWops *const rw) |
static void | setOpenGlMode (const RenderType useOpenGL) |
Static Public Attributes | |
static int | mTextureType = 0 |
static int | mInternalTextureType = 0x8058 |
Protected Member Functions | |
Image * | glLoad (SDL_Surface *tmpImage, int width=0, int height=0) |
GLuint | getNewTexture () |
Protected Member Functions inherited from ImageHelper | |
ImageHelper () | |
Static Protected Member Functions | |
static int | powerOfTwo (const int input) |
static SDL_Surface * | convertSurfaceNormalize (SDL_Surface *tmpImage, int width, int height) |
static SDL_Surface * | convertSurface (SDL_Surface *tmpImage, int width, int height) |
Protected Attributes | |
size_t | mFreeTextureIndex |
GLuint | mTextures [texturesSize] |
Static Protected Attributes | |
static const size_t | texturesSize = 10 |
static int | mTextureSize = 0 |
static bool | mBlur = true |
static bool | mUseTextureSampler = false |
Static Protected Attributes inherited from ImageHelper | |
static bool | mEnableAlpha = true |
static RenderType | mUseOpenGL = RENDER_SOFTWARE |
Friends | |
class | CompoundSprite |
class | Graphics |
class | Image |
Defines a class for loading and storing images.
Definition at line 70 of file safeopenglimagehelper.h.
|
inline |
Definition at line 77 of file safeopenglimagehelper.h.
SafeOpenGLImageHelper::~SafeOpenGLImageHelper | ( | ) |
Definition at line 58 of file safeopenglimagehelper.cpp.
References mFreeTextureIndex, mTextures, and texturesSize.
|
static |
Definition at line 255 of file safeopenglimagehelper.cpp.
References bindTexture(), Logger::log(), logger, mTextureType, ImageHelper::mUseOpenGL, RENDER_GLES2_OPENGL, RENDER_GLES_OPENGL, RENDER_LAST, RENDER_MODERN_OPENGL, RENDER_NORMAL_OPENGL, RENDER_NULL, RENDER_SAFE_OPENGL, RENDER_SDL2_DEFAULT, and RENDER_SOFTWARE.
Referenced by glLoad().
|
staticprotected |
< Surface is in system memory
Definition at line 202 of file safeopenglimagehelper.cpp.
References Logger::log(), logger, and MSDL_CreateRGBSurface.
Referenced by copySurfaceToImage().
|
staticprotected |
< Surface is in system memory
Definition at line 138 of file safeopenglimagehelper.cpp.
References Logger::log(), logger, MSDL_CreateRGBSurface, and powerOfTwo().
Referenced by glLoad().
|
virtual |
Reimplemented from ImageHelper.
Definition at line 466 of file safeopenglimagehelper.cpp.
References convertSurface(), MSDL_FreeSurface, mTextureType, x, and y.
|
virtual |
< Surface is in system memory
Reimplemented from ImageHelper.
Definition at line 417 of file safeopenglimagehelper.cpp.
References MSDL_CreateRGBSurface, and powerOfTwo().
Image * SafeOpenGLImageHelper::createTextSurface | ( | SDL_Surface *const | tmpImage, |
const int | width, | ||
const int | height, | ||
const float | alpha | ||
) |
Definition at line 116 of file safeopenglimagehelper.cpp.
References glLoad().
|
inlinestatic |
Definition at line 115 of file safeopenglimagehelper.h.
References mInternalTextureType.
|
protected |
Definition at line 440 of file safeopenglimagehelper.cpp.
References mFreeTextureIndex, mTextures, postInit(), and texturesSize.
Referenced by glLoad().
|
inlinestatic |
|
inlinestatic |
|
protected |
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
Definition at line 306 of file safeopenglimagehelper.cpp.
References bindTexture(), BLOCK_END, BLOCK_START, convertSurfaceNormalize(), Actions::error(), GraphicsManager::errorToString(), GraphicsManager::getLastError(), getNewTexture(), graphicsManager, Image, Logger::log(), logger, mBlur, mInternalTextureType, MSDL_FreeSurface, mTextureType, mUseTextureSampler, and textures_count.
Referenced by createTextSurface(), and loadSurface().
|
static |
|
static |
Definition at line 457 of file safeopenglimagehelper.cpp.
References isGLNotNull, Logger::log(), and logger.
Loads an image from an SDL_RWops structure and recolors it.
rw | The SDL_RWops to load the image from. |
dye | The dye used to recolor the image. |
NULL
if an error occurred, a valid pointer otherwise. Reimplemented from ImageHelper.
Definition at line 64 of file safeopenglimagehelper.cpp.
References ImageHelper::convertTo32Bit(), DYEPALETTEP, Dye::getAPalete(), Dye::getSPalete(), Dye::getType(), ImageHelper::loadPng(), loadSurface(), Logger::log(), logger, MSDL_FreeSurface, and Dye::normalOGLDye().
|
virtual |
Loads an image from an SDL surface.
Reimplemented from ImageHelper.
Definition at line 111 of file safeopenglimagehelper.cpp.
References glLoad().
Referenced by load().
|
virtual |
Reimplemented from ImageHelper.
Definition at line 452 of file safeopenglimagehelper.cpp.
References mFreeTextureIndex, mTextures, and texturesSize.
Referenced by getNewTexture().
|
staticprotected |
Returns the first power of two equal or bigger than the input.
Definition at line 130 of file safeopenglimagehelper.cpp.
References mTextureSize.
Referenced by convertSurfaceNormalize(), and create32BitSurface().
|
inlinestatic |
Definition at line 121 of file safeopenglimagehelper.h.
References mBlur.
Referenced by GraphicsManager::initGraphics().
|
inlinestatic |
Definition at line 118 of file safeopenglimagehelper.h.
References mInternalTextureType.
Referenced by GraphicsManager::updateTextureFormat().
|
inlinestatic |
Definition at line 133 of file safeopenglimagehelper.h.
References mUseTextureSampler.
Referenced by GraphicsManager::createTextureSampler().
|
friend |
Definition at line 72 of file safeopenglimagehelper.h.
|
friend |
Definition at line 73 of file safeopenglimagehelper.h.
|
friend |
Definition at line 74 of file safeopenglimagehelper.h.
Referenced by glLoad().
|
staticprotected |
Definition at line 171 of file safeopenglimagehelper.h.
Referenced by glLoad(), initTextureSampler(), and setBlur().
|
protected |
Definition at line 167 of file safeopenglimagehelper.h.
Referenced by getNewTexture(), postInit(), and ~SafeOpenGLImageHelper().
|
static |
Definition at line 126 of file safeopenglimagehelper.h.
Referenced by getInternalTextureType(), glLoad(), and setInternalTextureType().
|
protected |
Definition at line 168 of file safeopenglimagehelper.h.
Referenced by getNewTexture(), postInit(), and ~SafeOpenGLImageHelper().
|
staticprotected |
Definition at line 170 of file safeopenglimagehelper.h.
Referenced by getTextureSize(), powerOfTwo(), and Graphics::setOpenGLMode().
|
static |
Definition at line 124 of file safeopenglimagehelper.h.
Referenced by bindTexture(), copySurfaceToImage(), drawQuad(), drawRescaledQuad(), getTextureType(), glLoad(), and Graphics::setOpenGLMode().
|
staticprotected |
Definition at line 172 of file safeopenglimagehelper.h.
Referenced by glLoad(), and setUseTextureSampler().
|
staticprotected |
Definition at line 166 of file safeopenglimagehelper.h.
Referenced by getNewTexture(), postInit(), and ~SafeOpenGLImageHelper().