Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rectangleShape.h
1 
10 #ifndef RECTANGLE_H_DEFINED
11 #define RECTANGLE_H_DEFINED
12 
13 #include "core.h"
14 #include "renderWindow.h"
15 #include "shader.h"
16 #include <Entities\component.h>
17 #include "drawable.h"
18 #include <Math\vec2.h>
19 
20 namespace rune{
21 
22 class GameApplication;
23 class SceneManager;
24 
25 class RUNE_ENGINE RectangleShape : public rune::Drawable, public rune::Component
26 {
27 private:
28 
29  rune::Color m_fillColor = rune::Color::Black;
30  rune::Vec2 origin;
31 
32  unsigned int indices[6] =
33  {
34  0, 1, 3, // first triangle
35  1, 2, 3 // second triangle
36  };
37 
38  unsigned int VBO;
39  unsigned int EBO;
40  unsigned int VAO;
41 
42  void setUpBuffers(void);
43 
44  const char* defaultRectangle =
45  {
46  #include <Shaders\defaultRectangle.glsl>
47  };
48 
49 public:
53  virtual void draw(rune::RenderWindow& window) override;
55  virtual void start() override;
59  void setFillColor(rune::Color newFillColor);
61  rune::Color getFillColor();
62 };
63 }
64 
65 #endif
rune::RectangleShape
A rectangle that can be drawn to the screen.
Definition: rectangleShape.h:26
rune::RectangleShape::rectangleShader
Shader rectangleShader
The shader that should be used to draw this rectangle.
Definition: rectangleShape.h:51
rune::Component
A component of a rune::GameObject, this class is used to add functionality to a object in the game wo...
Definition: component.h:23
rune::Shader
A shader that can be used to render objects to the screen.
Definition: shader.h:41
rune::Drawable
Interface class for creating something that can be drawn to the screen.
Definition: drawable.h:20
rune::Color::White
static Color White
White predefined color.
Definition: color.h:42
rune::RenderWindow
A window that the game can be drawn to.
Definition: renderWindow.h:26
rune::Vec2
1 x 2 vector to be used for math.
Definition: vec2.h:20
rune::Color
A color object to be applied to drawable objects.
Definition: color.h:19
rune::Color::Black
static Color Black
Black predefined color.
Definition: color.h:40
rune
The main namespace to be used for interfacing with the engine.
Definition: animator.h:21