Creates a Texture for use with a renderer Creates a Texture from an image file, this can then be used with a renderer.
More...
#include <texture.h>
|
| Texture (std::string, SDL_Renderer *, bool) |
|
| ~Texture () |
|
SDL_Texture * | getTexture () |
|
int | getWidth () |
|
int | getHeight () |
|
void | pushToScreen (SDL_Renderer *, int, int) |
|
void | pushToScreen (SDL_Renderer *, int, int, int, int) |
|
void | pushSpriteToScreen (SDL_Renderer *, int, int, int, int, int, int) |
|
void | pushSpriteToScreen (SDL_Renderer *, int, int, int, int, int, int, int, int) |
|
Creates a Texture for use with a renderer Creates a Texture from an image file, this can then be used with a renderer.
Texture::Texture |
( |
std::string |
fileName, |
|
|
SDL_Renderer * |
renderer, |
|
|
bool |
magentaAlpha |
|
) |
| |
Constructs a Texture Creates a Texture using an image location and a renderer. The magenta pixels of this image can represent alpha if needed.
- Parameters
-
std::string | The location of the image file. |
SDL_Renderer* | The renderer. |
bool | If true any magenta pixels in the image will be converted to alpha |
int Texture::getHeight |
( |
| ) |
|
Getter # Returns textureHeight
- Returns
- the value of textureHeight.
SDL_Texture * Texture::getTexture |
( |
| ) |
|
Getter # Returns a pointer to the Texture
- Returns
- a pointer to the Texture data.
int Texture::getWidth |
( |
| ) |
|
Getter # Returns textureWidth
- Returns
- the value of textureWidth.
void Texture::pushSpriteToScreen |
( |
SDL_Renderer * |
renderer, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
srcX, |
|
|
int |
srcY, |
|
|
int |
srcWidth, |
|
|
int |
srcHeight |
|
) |
| |
Pushes the image to the Renderer, to the XY Coordinates. Only displays the source rectangle inputed.
- Parameters
-
SDL_Renderer* | The renderer. |
int | x coordinate of the image. |
int | y coordinate of the image. |
int | x coordinate of the source image. |
int | y coordinate of the source image. |
int | width of the source image. |
int | height of the source image. |
void Texture::pushSpriteToScreen |
( |
SDL_Renderer * |
renderer, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
srcX, |
|
|
int |
srcY, |
|
|
int |
srcWidth, |
|
|
int |
srcHeight, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Pushes the image to the Renderer, to the XY Coordinates. Only displays the source rectangle inputed. This is scaled to the width and height inputed.
- Parameters
-
SDL_Renderer* | The renderer. |
int | x coordinate of the image. |
int | y coordinate of the image. |
int | x coordinate of the source image. |
int | y coordinate of the source image. |
int | width of the source image. |
int | height of the source image. |
int | width of the scaled image. |
int | height of the scaled image. |
void Texture::pushToScreen |
( |
SDL_Renderer * |
renderer, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Pushes the image to the Renderer, to the XY Coordinates.
- Parameters
-
SDL_Renderer* | The renderer. |
int | x coordinate of the image. |
int | y coordinate of the image. |
void Texture::pushToScreen |
( |
SDL_Renderer * |
renderer, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Pushes the image to the Renderer, to the XY Coordinates. This is scaled to the width and height inputed.
- Parameters
-
SDL_Renderer* | The renderer. |
int | x coordinate of the image. |
int | y coordinate of the image. |
int | width of the scaled image. |
int | height of the scaled image. |
The documentation for this class was generated from the following files:
- PGGAssignment1SDL/texture.h
- PGGAssignment1SDL/texture.cpp