PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
RectangleShape.hpp
Go to the documentation of this file.
1 #ifndef RectangleShape_HPP
2 #define RectangleShape_HPP
3 
4 #include "GL/glew.h"
5 #include <glm/glm.hpp>
8 #include "core/GLStates.hpp"
9 
10 namespace pk
11 {
12 
20 {
21  private:
27 
33  void updateNormals(GLfloat * vertices, unsigned int verticeCount, unsigned int stride);
34 
40  void updateGeometry();
41 
42  public:
52  RectangleShape(GLfloat width, GLfloat height);
53 
54  virtual ~RectangleShape();
55 
61  void setFillColor(glm::vec4 fillColor);
62 
70  glm::vec4 &getFillColor(){ return m_fillColor; };
71 
77  void setVertexColors(GLfloat colors [16]);
78 
86  GLfloat* getVertexColors(){ return m_vertexColors; };
87 
94  void draw(GLStates& states);
95 
96  private:
97  glm::vec4 m_fillColor;
98  GLfloat m_vertexColors [16];
99 };
100 
101 }
102 
103 #endif // RectangleShape_HPP
void draw(GLStates &states)
Draw the RectangleShape to the screen.
Definition: RectangleShape.hpp:86
Definition: Game.hpp:7
Decorator class for creating easing OpenGL transformations for game objects.
Definition: GLTransformable.hpp:51
Definition: GLDrawable.hpp:16
void updateGeometry()
Update the internal geometry of the RectangleShape.
Create a drawable RectangleShape using OpenGL. For more complex OpenGL geometry see the Mesh class...
Definition: RectangleShape.hpp:19
void setFillColor(glm::vec4 fillColor)
virtual ~RectangleShape()
Stores the states used to draw OpenGL objects.
Definition: GLStates.hpp:16
glm::vec4 & getFillColor()
Get the current fill color for the RectangleShape.
Definition: RectangleShape.hpp:70
void updateNormals(GLfloat *vertices, unsigned int verticeCount, unsigned int stride)
Update the internal lighting normals of the RectangleShape.
Definition: RectangleShape.hpp:26
GLfloat m_vertexColors[16]
Array of individual vertex colors.
Definition: RectangleShape.hpp:98
RectangleShape()
Default constructor - INACCESSIBLE!
Definition: RectangleShape.hpp:26
glm::vec4 m_fillColor
Rectangle fill color.
Definition: RectangleShape.hpp:97
GLfloat * getVertexColors()
Get the current vertex colors for the RectangleShape.
Definition: RectangleShape.hpp:86
void setVertexColors(GLfloat colors [16])
Set the individual values for the vertex colors of the RectangleShape.
Definition: RectangleShape.hpp:70