Archimedes/Dash Da Capo!
|
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 |
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.
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.
renderer | |
x | |
y | |
clip | allows to just pick a portion of the texture |
angle | allows to rotate the angle |
center | allows to rotate upon a central focal point |
flip | allows for up-down-left-right flips |
bool TextureWrapper::setAlpha | ( | Uint8 | alpha | ) |
Sets the transparency level.
alpha |