A class for the UI Objects.
More...
#include <UIObject.h>
A class for the UI Objects.
◆ UIObject() [1/2]
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() [2/2]
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. |
◆ ~UIObject()
◆ convertToOpenGLCoordinate()
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.
◆ draw()
void UIObject::draw |
( |
Shader * |
shader | ) |
|
A function to draw to the screen.
- Parameters
-
shader | A pointer to the Shader to use. |
◆ initialiseObject() [1/2]
void UIObject::initialiseObject |
( |
| ) |
|
|
protected |
◆ initialiseObject() [2/2]
void UIObject::initialiseObject |
( |
SDL_Surface * |
surface | ) |
|
|
protected |
Initialise the UIobject.
- Parameters
-
surface | A pointer to the surface for the texture. |
◆ initialiseTexture()
void UIObject::initialiseTexture |
( |
SDL_Surface * |
surfac | ) |
|
|
protected |
Initialise the texture.
- Parameters
-
surface | A pointer to the surface for the texture. |
◆ dimensions
The dimensions for the rectangle.
◆ obj
The VBO for the rectangle.
◆ position
◆ textureBool
bool UIObject::textureBool |
|
protected |
A boolean for if the Model contains a texture.
◆ textureID
GLuint UIObject::textureID |
|
protected |
The documentation for this class was generated from the following files: