ManaPlus
|
#include <openglimagehelper.h>
Public Member Functions | |
OpenGLImageHelper () | |
~OpenGLImageHelper () | |
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 openglimagehelper.h.
|
inline |
Definition at line 77 of file openglimagehelper.h.
OpenGLImageHelper::~OpenGLImageHelper | ( | ) |
Definition at line 62 of file openglimagehelper.cpp.
References mFreeTextureIndex, mTextures, and texturesSize.
|
static |
Definition at line 254 of file openglimagehelper.cpp.
References bindTexture(), 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, RENDER_SOFTWARE, and reportAlways.
Referenced by emuglTextureSubImage2DEXT(), and glLoad().
|
staticprotected |
< Surface is in system memory
Definition at line 202 of file openglimagehelper.cpp.
References MSDL_CreateRGBSurface, and reportAlways.
Referenced by copySurfaceToImage().
|
staticprotected |
< Surface is in system memory
Definition at line 140 of file openglimagehelper.cpp.
References MSDL_CreateRGBSurface, powerOfTwo(), and reportAlways.
Referenced by glLoad().
|
virtual |
Reimplemented from ImageHelper.
Definition at line 495 of file openglimagehelper.cpp.
References convertSurface(), graphicsManager, GraphicsManager::logError(), MSDL_FreeSurface, mTextureType, x, and y.
|
virtual |
< Surface is in system memory
Reimplemented from ImageHelper.
Definition at line 446 of file openglimagehelper.cpp.
References MSDL_CreateRGBSurface, and powerOfTwo().
Image * OpenGLImageHelper::createTextSurface | ( | SDL_Surface *const | tmpImage, |
const int | width, | ||
const int | height, | ||
const float | alpha | ||
) |
Definition at line 119 of file openglimagehelper.cpp.
References glLoad().
|
inlinestatic |
Definition at line 115 of file openglimagehelper.h.
References mInternalTextureType.
Referenced by Graphics::setOpenGLMode().
|
protected |
Definition at line 469 of file openglimagehelper.cpp.
References mFreeTextureIndex, mTextures, postInit(), and texturesSize.
Referenced by glLoad().
|
inlinestatic |
Definition at line 128 of file openglimagehelper.h.
References mTextureSize.
Referenced by AtlasManager::loadTextureAtlas(), and TestLauncher::testTextures().
|
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 309 of file openglimagehelper.cpp.
References bindTexture(), BLOCK_END, BLOCK_START, convertSurfaceNormalize(), Actions::error(), GraphicsManager::errorToString(), GraphicsManager::getLastError(), getNewTexture(), graphicsManager, Image, GraphicsManager::logError(), mBlur, mglTexImage2D, mglTexParameteri, mInternalTextureType, MSDL_FreeSurface, mTextureType, ImageHelper::mUseOpenGL, mUseTextureSampler, RENDER_GLES2_OPENGL, RENDER_GLES_OPENGL, RENDER_MODERN_OPENGL, reportAlways, and textures_count.
Referenced by createTextSurface(), and loadSurface().
|
static |
Definition at line 432 of file openglimagehelper.cpp.
References mBlur.
Referenced by GraphicsManager::createTextureSampler().
|
static |
Definition at line 486 of file openglimagehelper.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 68 of file openglimagehelper.cpp.
References ImageHelper::convertTo32Bit(), DYEPALETTEP, Dye::getAPalete(), Dye::getSPalete(), Dye::getType(), ImageHelper::loadPng(), loadSurface(), MSDL_FreeSurface, Dye::normalOGLDye(), and reportAlways.
|
virtual |
Loads an image from an SDL surface.
Reimplemented from ImageHelper.
Definition at line 114 of file openglimagehelper.cpp.
References glLoad().
Referenced by load().
|
virtual |
Reimplemented from ImageHelper.
Definition at line 481 of file openglimagehelper.cpp.
References mFreeTextureIndex, mglGenTextures, mTextures, and texturesSize.
Referenced by getNewTexture().
|
staticprotected |
Returns the first power of two equal or bigger than the input.
Definition at line 132 of file openglimagehelper.cpp.
References mTextureSize.
Referenced by convertSurfaceNormalize(), and create32BitSurface().
|
inlinestatic |
Definition at line 121 of file openglimagehelper.h.
References mBlur.
Referenced by GraphicsManager::initGraphics().
|
inlinestatic |
Definition at line 118 of file openglimagehelper.h.
References mInternalTextureType.
Referenced by GraphicsManager::updateTextureFormat().
|
inlinestatic |
Definition at line 133 of file openglimagehelper.h.
References mUseTextureSampler.
Referenced by GraphicsManager::createTextureSampler().
|
friend |
Definition at line 72 of file openglimagehelper.h.
|
friend |
Definition at line 73 of file openglimagehelper.h.
|
friend |
Definition at line 74 of file openglimagehelper.h.
Referenced by glLoad().
|
staticprotected |
Definition at line 171 of file openglimagehelper.h.
Referenced by glLoad(), initTextureSampler(), and setBlur().
|
protected |
Definition at line 167 of file openglimagehelper.h.
Referenced by getNewTexture(), postInit(), and ~OpenGLImageHelper().
|
static |
Definition at line 126 of file openglimagehelper.h.
Referenced by getInternalTextureType(), glLoad(), and setInternalTextureType().
|
protected |
Definition at line 168 of file openglimagehelper.h.
Referenced by getNewTexture(), postInit(), and ~OpenGLImageHelper().
|
staticprotected |
Definition at line 170 of file openglimagehelper.h.
Referenced by getTextureSize(), powerOfTwo(), and Graphics::setOpenGLMode().
|
static |
Definition at line 124 of file openglimagehelper.h.
Referenced by bindTexture(), copySurfaceToImage(), GraphicsManager::createFBO(), drawQuad(), drawRescaledQuad(), getTextureType(), glLoad(), Graphics::setOpenGLMode(), and NormalOpenGLGraphics::testDraw().
|
staticprotected |
Definition at line 172 of file openglimagehelper.h.
Referenced by glLoad(), and setUseTextureSampler().
|
staticprotected |
Definition at line 166 of file openglimagehelper.h.
Referenced by getNewTexture(), postInit(), and ~OpenGLImageHelper().