Archimedes/Dash Da Capo!
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TextureWrapper Class Reference

Middle-level object that is used for a lot of the map rendering. Occasionally we use it in the game directly when we want to play with transparency levels. More...

#include <TextureWrapper.h>

Public Member Functions

bool loadImage (SDL_Renderer *renderer, std::string filePath)
 
void freeMemory ()
 in case the user wants to free memory explicitly will give that functionality and prevent double deletion plus avoid direct calls to destructor. The game was never intricate enough to need this and we dropped this functionality on later classes. But we might want to extend it in the future.
 
bool setColor (Uint8 r, Uint8 g, Uint8 b)
 
bool setAlpha (Uint8 alpha)
 Sets the transparency level.
 
bool render (SDL_Renderer *renderer, int x, int y, const SDL_Rect *clip=nullptr, double angle=0.0f, SDL_Point *center=nullptr, SDL_RendererFlip flip=SDL_FLIP_NONE)
 Highly customizable rendering function.
 
SDL_Texture * getTexture () const
 

Detailed Description

Middle-level object that is used for a lot of the map rendering. Occasionally we use it in the game directly when we want to play with transparency levels.

Member Function Documentation

◆ render()

bool TextureWrapper::render ( SDL_Renderer *  renderer,
int  x,
int  y,
const SDL_Rect *  clip = nullptr,
double  angle = 0.0f,
SDL_Point *  center = nullptr,
SDL_RendererFlip  flip = SDL_FLIP_NONE 
)

Highly customizable rendering function.

Parameters
renderer
x
y
clipallows to just pick a portion of the texture
angleallows to rotate the angle
centerallows to rotate upon a central focal point
flipallows for up-down-left-right flips
Returns

◆ setAlpha()

bool TextureWrapper::setAlpha ( Uint8  alpha)

Sets the transparency level.

Parameters
alpha
Returns


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