6 #include "../Maths/Vec2.h" 20 Sprite(
int r,
int g,
int b);
25 Sprite(SDL_Surface* inSurfaceData);
37 Sprite(std::string fileLocation);
44 Sprite(std::string fileLocation,
bool magentaAlpha);
Vec2 getDimensions()
Gets the Sprite dimensions.
Definition: Sprite.cpp:140
GLuint obj
The VBO for the rectangle.
Definition: Sprite.h:82
~Sprite()
Destructs Sprite.
Definition: Sprite.cpp:126
Contains the Vec2 structure with functions and overloaded operators.
Definition: Vec2.h:8
void pushToScreen(Vec2 pos)
Pushes the image to the Renderer at the XY Coordinates.
Definition: Sprite.cpp:145
std::string shaderID
The Shader ID.
Definition: Sprite.h:86
void draw(Vec2 pos)
A function to draw to a position on the screen.
Definition: Sprite.cpp:278
Creates a Sprite for use with 2D.
Definition: Sprite.h:11
void initialiseTexture()
A function to initalise a texture.
Definition: Sprite.cpp:219
SDL_Surface * surfaceData
The Surface data.
Definition: Sprite.h:78
Sprite(int r, int g, int b)
Constructs the Sprite using an RGB value. This will create a 1x1 rectangle of that colour that can be...
Definition: Sprite.cpp:11
SDL_Surface * getSurface()
Gets a pointer to the Sprite surface.
Definition: Sprite.cpp:135
GLuint textureID
The Texture.
Definition: Sprite.h:84
void initaliseVBO(Vec2 pos, Vec2 scale)
A function to initalise a VBO for the sprite.
Definition: Sprite.cpp:170
Vec2 dimensions
The Texture dimensions.
Definition: Sprite.h:80
void scaleSprite(Vec2 scale)
Scale the image to the dimensions inputed.
Definition: Sprite.cpp:154