A class for the UI Objects.
More...
#include <UIObject.h>
A class for the UI Objects.
- Author
- Jamie Slowgrove
UIObject::UIObject |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| |
Constructs the UIObject.
- Parameters
-
x | The x position (Top left of the object). |
y | The y position (Top left of the object). |
width | The width (Between 0 and 200). |
height | The height (Between 0 and 200). |
UIObject::UIObject |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height, |
|
|
SDL_Surface * |
surface |
|
) |
| |
Constructs the UIObject.
- Parameters
-
x | The x position (Top left of the object). |
y | The y position (Top left of the object). |
width | The width (Between 0 and 200). |
height | The height (Between 0 and 200). |
surface | A pointer to the surface for the texture. |
glm::vec2 UIObject::convertToOpenGLCoordinate |
( |
glm::vec2 |
coordinates | ) |
|
|
private |
Converts the coordinates to work with OpenGL. It takes the coordinates and converts them to a number between 0 and 2. It then takes this and -1 from each, setting it to the bottom left position. It then flips the coordinate along the y axis to get the top left position.
- Parameters
-
coordinates | The coordinates to convert. |
- Returns
- The converted coordinates.
A function to draw to the screen.
- Parameters
-
shader | A pointer to the Shader to use. |
void UIObject::initialiseObject |
( |
| ) |
|
|
private |
void UIObject::initialiseObject |
( |
SDL_Surface * |
surface | ) |
|
|
private |
Initialise the UIobject.
- Parameters
-
surface | A pointer to the surface for the texture. |
void UIObject::initialiseTexture |
( |
SDL_Surface * |
surfac | ) |
|
|
private |
Initialise the texture.
- Parameters
-
surface | A pointer to the surface for the texture. |
glm::vec2 UIObject::dimensions |
|
private |
The dimensions for the rectangle
The VBO for the rectangle
glm::vec2 UIObject::position |
|
private |
bool UIObject::textureBool |
|
private |
A boolean for if the Model contains a texture
The documentation for this class was generated from the following files: