GEJM  1.0.0.0
a 2D platformer made by students
Public Member Functions | Public Attributes | List of all members
SDLWrapper Class Reference

#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
 

Detailed Description

SDLWrapper is a class that handles window creation, resource loading and displaying graphics.

Constructor & Destructor Documentation

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.

Member Function Documentation

void SDLWrapper::loadLevelTextures ( )

Loads all level textures.

Returns
void
SDL_Texture * SDLWrapper::loadTextureFromFile ( std::string  path)

Loads texture from file.

Parameters
pathstring with path to file
Returns
SDL_Texture* a pointer to loaded texture
SDL_Texture * SDLWrapper::loadTextureFromRenderedText ( std::string  textureText,
SDL_Color  textColor,
Font  font = Font::Regular 
)

Loads texture from rendered text.

Parameters
textureTextstring with text to render
textColorcolor of text
fontwhich font to use. Defaults to Font::Regular
Returns
SDL_Texture* a pointer to loaded texture
See also
Font
void SDLWrapper::unloadLevelTextures ( )

Unloads all level textures.

Returns
void

Member Data Documentation

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.


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