![]() |
PROTO::KLUDGE
0.1
Quick prototyping library for games using SDL and OpenGL.
|
#include <GLSprite.hpp>
Public Member Functions | |
GLSprite () | |
Default constructor - not the one you're looking for. See below. More... | |
GLSprite (GLTexture &t, GLRect rect) | |
virtual | ~GLSprite () |
void | setTextureRect (GLRect r) |
GLRect & | getTextureRect () |
GLTexture * | getTexture () |
void | setFillColor (glm::vec4 fillColor) |
glm::vec4 & | getFillColor () |
Get the current fill color for the GLSprite. More... | |
void | setVertexColors (GLfloat colors [16]) |
Set the individual values for the vertex colors of the GLSprite. More... | |
GLfloat * | getVertexColors () |
Get the current vertex colors for the GLSprite. More... | |
void | draw (GLStates &states) |
Draw the GLSprite to the screen. More... | |
![]() | |
GLDrawable () | |
virtual | ~GLDrawable () |
![]() | |
GLTransformable () | |
Default constructor. More... | |
virtual | ~GLTransformable () |
void | setRect (GLRect r) |
Set the bounding rectangle for the GLTransformable object. Useful for calculating origin and size definitions. More... | |
GLRect & | getRect () |
Get the current bounding rectangle of the GLTransformable object. More... | |
void | setWidth (GLfloat w) |
Convenient function for setting the width of the GLTransformable. More... | |
GLfloat & | getWidth () |
Get the width of the GLTransformable. More... | |
void | setHeight (GLfloat h) |
GLfloat & | getHeight () |
Get the height of the GLTransformable. More... | |
void | setOrigin (glm::vec2 origin) |
Set the origin of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
glm::vec2 & | getOrigin () |
Get the origin of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
void | setPosition (glm::vec2 position) |
Set the position of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
const glm::vec2 & | getPosition () |
Get the position of the GLTransformable in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
void | move (glm::vec2 offset) |
Move the GLTransformable by a constant offset value in screen coordinates (NOT normalized coordinates such as clip coordinates for example). More... | |
void | setAngle (float angle) |
Set the angle of the GLTransformable (in degrees, NOT radians). More... | |
float | getAngle () |
Get the angle of the GLTransformable (in degrees, NOT radians). More... | |
void | rotate (float degrees) |
Rotate the GLTransformable by a constant value (in degrees, NOT radians). (in degrees, NOT radians). More... | |
void | setScale (glm::vec2 scale) |
Set the scale of the GLTransformable. More... | |
glm::vec2 | getScale () |
Get the scale of the GLTransformable. More... | |
void | scale (glm::vec2 scale) |
Scale the GLTransformable by a constant factor specified as a glm::vec2 of floats. More... | |
void | clear () |
Clear the buffers and reset the GLTransformable to an uninitialized state. More... | |
Private Member Functions | |
void | updateNormals (GLfloat *vertices, unsigned int verticeCount, unsigned int stride) |
Update the internal lighting normals of the GLSprite. More... | |
void | updateGeometry () |
Update the internal geometry of the GLSprite. More... | |
Private Attributes | |
GLTexture * | m_texture |
A pointer to a GLTexture to use for the GLSprite. More... | |
GLRect | m_textureRect |
Stores the value of the GLTexture's texture rect. More... | |
glm::vec4 | m_fillColor |
Fill color. More... | |
GLfloat | m_vertexColors [16] |
Array of individual vertex colors. More... | |
Additional Inherited Members | |
![]() | |
GLTransformData | m_data |
Internal transform data for GLTransformable inherited classes. More... | |
pk::GLSprite::GLSprite | ( | ) |
Default constructor - not the one you're looking for. See below.
|
virtual |
|
virtual |
Draw the GLSprite to the screen.
GLStates& | states - reference to an OpenGl states struct. |
Implements pk::GLDrawable.
|
inline |
Get the current fill color for the GLSprite.
|
inline |
|
inline |
|
inline |
Get the current vertex colors for the GLSprite.
void pk::GLSprite::setFillColor | ( | glm::vec4 | fillColor | ) |
|
inline |
void pk::GLSprite::setVertexColors | ( | GLfloat | colors[16] | ) |
Set the individual values for the vertex colors of the GLSprite.
|
private |
Update the internal geometry of the GLSprite.
|
private |
Update the internal lighting normals of the GLSprite.
|
private |
Fill color.
|
private |
Array of individual vertex colors.