FifeGUI 0.2.0
A C++ GUI library designed for games.
fcn::ImageLoader Class Referenceabstract

#include <imageloader.hpp>

Inheritance diagram for fcn::ImageLoader:
fcn::sdl2::ImageLoader fcn::opengl::ImageLoader

Public Member Functions

 ImageLoader (ImageLoader &&)=default
 ImageLoader (ImageLoader const &)=default
Imageload (std::string const &filename)
virtual Imageload (std::string const &filename, bool convertToDisplayFormat)=0
ImageLoader & operator= (ImageLoader &&)=default
ImageLoader & operator= (ImageLoader const &)=default

Detailed Description

Abstract interface for loading image assets.

FifeGUI contains implementations of ImageLoader for common libraries like the SDL library. To make FifeGUI usable with other libraries, an ImageLoader class must be implemented.

To make FifeGUIuse an image loader, the image loader needs to be passed to the Image class using the static method Image::setImageLoader.

See also
Image::setImageLoader, Image::getImageLoader, OpenGLSDLImageLoader, SDLImageLoader

Definition at line 33 of file imageloader.hpp.

Member Function Documentation

◆ load() [1/2]

Image * fcn::ImageLoader::load ( std::string const & filename)
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.

Parameters
filenameThe filename of the image to load.

Definition at line 59 of file imageloader.hpp.

References load().

Referenced by load().

◆ load() [2/2]

virtual Image * fcn::ImageLoader::load ( std::string const & filename,
bool convertToDisplayFormat )
pure virtual

Loads an image, optionally converting it to display format.

Parameters
filenameThe filename of the image to load.
convertToDisplayFormatTrue if the image should be converted to display format, false otherwise.

Implemented in fcn::opengl::ImageLoader, and fcn::sdl2::ImageLoader.


The documentation for this class was generated from the following file: