GEJM
1.0.0.0
a 2D platformer made by students
|
#include <SDLWrapper.h>
Public Member Functions | |
SDLWrapper () | |
~SDLWrapper () | |
SDL_Texture * | loadTextureFromRenderedText (std::string textureText, SDL_Color textColor, Font font=Font::Regular) |
SDL_Texture * | loadTextureFromFile (std::string path) |
void | loadLevelTextures () |
void | unloadLevelTextures () |
Public Attributes | |
SDL_Window * | window |
SDL_Renderer * | renderer |
std::vector< TTF_Font * > | fontVector |
std::vector< SDL_Texture * > | menuTextureVector |
std::vector< SDL_Texture * > | levelTextureVector |
SDLWrapper is a class that handles window creation, resource loading and displaying graphics.
SDLWrapper::SDLWrapper | ( | ) |
Default constructor that initializes SDL, it's plugins and also loads and stores fonts and textures.
SDLWrapper implementation Default constructor that initializes SDL, it's plugins and also loads and stores fonts and textures.
SDLWrapper::~SDLWrapper | ( | ) |
Default destructor that unloads every loaded resource and quits initialized SDL subsystems.
void SDLWrapper::loadLevelTextures | ( | ) |
Loads all level textures.
SDL_Texture * SDLWrapper::loadTextureFromFile | ( | std::string | path | ) |
Loads texture from file.
path | string with path to file |
SDL_Texture * SDLWrapper::loadTextureFromRenderedText | ( | std::string | textureText, |
SDL_Color | textColor, | ||
Font | font = Font::Regular |
||
) |
Loads texture from rendered text.
textureText | string with text to render |
textColor | color of text |
font | which font to use. Defaults to Font::Regular |
void SDLWrapper::unloadLevelTextures | ( | ) |
Unloads all level textures.
std::vector<TTF_Font*> SDLWrapper::fontVector |
Vector that stores loaded fonts.
std::vector<SDL_Texture*> SDLWrapper::levelTextureVector |
Vector that stores loaded level textures.
std::vector<SDL_Texture*> SDLWrapper::menuTextureVector |
Vector that stores loaded UI textures.
SDL_Renderer* SDLWrapper::renderer |
SDL renderer handle.
SDL_Window* SDLWrapper::window |
SDL window handle.