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 (SDL_Renderer *, int, int, int) |
| |
| | Texture (std::string, SDL_Renderer *) |
| |
| | 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 |
( |
SDL_Renderer * |
renderer, |
|
|
int |
r, |
|
|
int |
g, |
|
|
int |
b |
|
) |
| |
Constructs a Texture Creates a Texture using an rbg value. This will create a 1x1 rectangle of that colour that can be scaled.
- Parameters
-
| std::string | The location of the image file. |
| int | r |
| int | g |
| int | b |
| Texture::Texture |
( |
std::string |
fileName, |
|
|
SDL_Renderer * |
renderer |
|
) |
| |
Constructs a Texture Creates a Texture using an image location and a renderer. The magenta pixels of this image can represent alpha if needed. This is for use with SDL image.
- Parameters
-
| std::string | The location of the image file. |
| SDL_Renderer* | The 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. |
| SDL_Texture* Texture::textureData |
|
private |
| int Texture::textureHeight |
|
private |
| int Texture::textureWidth |
|
private |
The documentation for this class was generated from the following files: