galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Shape.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_GRAPHICS_SHAPES_SHAPE_HPP_
9#define GALAXY_GRAPHICS_SHAPES_SHAPE_HPP_
10
13
14namespace galaxy
15{
16 namespace graphics
17 {
21 class Shape
22 {
23 public:
27 Shape();
28
32 Shape(Shape&&);
33
38
42 virtual ~Shape();
43
49 [[nodiscard]]
50 unsigned int mode() const;
51
59 [[nodiscard]]
60 float width() const;
61
69 [[nodiscard]]
70 float height() const;
71
77 [[nodiscard]]
79
80 public:
85
86 protected:
90 unsigned int m_mode;
91
95 float m_width;
96
100 float m_height;
101
106 };
107 } // namespace graphics
108} // namespace galaxy
109
110#endif
Represents an RGBA colour.
Definition Colour.hpp:27
A generic 2D shape.
Definition Shape.hpp:22
virtual ~Shape()
Destructor.
Definition Shape.cpp:46
Colour m_colour
Used by all primitives.
Definition Shape.hpp:84
VertexArray m_vao
Vertex Array Object.
Definition Shape.hpp:105
Shape & operator=(Shape &&)
Move assignment operator.
Definition Shape.cpp:32
unsigned int m_mode
Type to render i.e. GL_LINES, GL_TRIANGLES, etc.
Definition Shape.hpp:90
float height() const
Get texture height.
Definition Shape.cpp:60
VertexArray & vao()
Get vertex array object.
Definition Shape.cpp:65
unsigned int mode() const
Get OpenGL rendering mode.
Definition Shape.cpp:50
float m_height
Cached height.
Definition Shape.hpp:100
Shape()
Constructor.
Definition Shape.cpp:16
float m_width
Cached width.
Definition Shape.hpp:95
float width() const
Get texture width.
Definition Shape.cpp:55
Abstraction for OpenGL vertex array objects.
Animated.cpp galaxy.
Definition Animated.cpp:16