|
FifeGUI 0.2.0
A C++ GUI library designed for games.
|
#include <imageloader.hpp>
Public Member Functions | |
| SDL_PixelFormat const & | getSDLPixelFormat () |
| Image * | load (std::string const &filename) |
| fcn::Image * | load (std::string const &filename, bool convertToDisplayFormat) override |
| void | setRenderer (SDL_Renderer *renderer) |
| void | setSDLPixelFormat (SDL_PixelFormat const &format) |
| Public Member Functions inherited from fcn::ImageLoader | |
| ImageLoader (ImageLoader &&)=default | |
| ImageLoader (ImageLoader const &)=default | |
| Image * | load (std::string const &filename) |
| ImageLoader & | operator= (ImageLoader &&)=default |
| ImageLoader & | operator= (ImageLoader const &)=default |
Protected Member Functions | |
| virtual SDL_Surface * | convertToStandardFormat (SDL_Surface *surface) |
| virtual SDL_Surface * | loadSDLSurface (std::string const &filename) |
| virtual SDL_Texture * | loadSDLTexture (std::string const &filename) |
SDL2-specific implementation of ImageLoader.
Definition at line 28 of file backends/sdl2/imageloader.hpp.
|
protectedvirtual |
Convert a surface to a standard internal format (internal).
Definition at line 95 of file imageloader.cpp.
Referenced by fcn::opengl::ImageLoader::load(), and load().
| SDL_PixelFormat const & fcn::sdl2::ImageLoader::getSDLPixelFormat | ( | ) |
Return the current SDL pixel format used for conversions.
Definition at line 156 of file imageloader.cpp.
|
inline |
Loads an image.
The single-argument overload forwards to the two-argument overload requesting conversion to display format.
NOTE: The functions Image::getPixel and Image::putPixel are only guaranteed to work before an image has been converted to display format.
| filename | The filename of the image to load. |
Definition at line 59 of file imageloader.hpp.
|
overridevirtual |
Load an image from filename.
Implements fcn::ImageLoader.
Definition at line 36 of file imageloader.cpp.
References fcn::sdl2::Image::convertToDisplayFormat(), convertToStandardFormat(), and loadSDLSurface().
|
protectedvirtual |
Load an SDL_Surface from disk (internal).
Definition at line 65 of file imageloader.cpp.
Referenced by fcn::opengl::ImageLoader::load(), and load().
|
protectedvirtual |
Load an SDL_Texture from disk (internal).
Definition at line 80 of file imageloader.cpp.
| void fcn::sdl2::ImageLoader::setRenderer | ( | SDL_Renderer * | renderer | ) |
Set the SDL renderer used when creating textures.
Definition at line 60 of file imageloader.cpp.
| void fcn::sdl2::ImageLoader::setSDLPixelFormat | ( | SDL_PixelFormat const & | format | ) |
Set the SDL pixel format used for conversions.
Definition at line 161 of file imageloader.cpp.