Texture¶
-
class Texture¶
A texture object.
Public Functions
-
explicit Texture(SDL_Texture *texture)¶
Create a texture.
See also
See also
See also
Note
This function is not meant to be used by the user.
- Parameters:
texture – The SDL texture.
-
SDL_Texture *getSDLTexture() const¶
Get the SDL texture.
Note
This function is not meant to be used by the user.
- Returns:
The SDL texture.
-
void setSize(const math::Vec2 &size)¶
Set the size of the texture rect.
- Parameters:
size – The size of the texture rect.
-
void scaleBy(float factor)¶
Scale the texture rect by a factor.
- Parameters:
factor – The factor to scale by.
-
void fitWidth(float width)¶
Fit the texture rect to a width while maintaining the aspect ratio.
- Parameters:
width – The width to fit to.
-
void fitHeight(float height)¶
Fit the texture rect to a height while maintaining the aspect ratio.
- Parameters:
height – The height to fit to.
-
explicit Texture(SDL_Texture *texture)¶