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
galaxy::graphics::Polygon Class Referencefinal

A closed loop line collection of points. I.e. A square, triangle, etc. More...

#include <Polygon.hpp>

+ Inheritance diagram for galaxy::graphics::Polygon:
+ Collaboration diagram for galaxy::graphics::Polygon:

Public Member Functions

 Polygon ()
 Constructor.
 
 Polygon (Polygon &&)
 Move constructor.
 
Polygonoperator= (Polygon &&)
 Move assignment operator.
 
virtual ~Polygon ()
 Destructor.
 
void create (const meta::vector< glm::vec2 > &points)
 Create shape.
 
const meta::vector< glm::vec2 > & points () const
 Get list of points.
 
- Public Member Functions inherited from galaxy::graphics::Shape
 Shape ()
 Constructor.
 
 Shape (Shape &&)
 Move constructor.
 
Shapeoperator= (Shape &&)
 Move assignment operator.
 
virtual ~Shape ()
 Destructor.
 
unsigned int mode () const
 Get OpenGL rendering mode.
 
float width () const
 Get texture width.
 
float height () const
 Get texture height.
 
VertexArrayvao ()
 Get vertex array object.
 

Private Attributes

meta::vector< glm::vec2 > m_points
 List of points.
 

Additional Inherited Members

- Public Attributes inherited from galaxy::graphics::Shape
Colour m_colour
 Used by all primitives.
 
- Protected Attributes inherited from galaxy::graphics::Shape
unsigned int m_mode
 Type to render i.e. GL_LINES, GL_TRIANGLES, etc.
 
float m_width
 Cached width.
 
float m_height
 Cached height.
 
VertexArray m_vao
 Vertex Array Object.
 

Detailed Description

A closed loop line collection of points. I.e. A square, triangle, etc.

Definition at line 21 of file Polygon.hpp.

Constructor & Destructor Documentation

◆ Polygon() [1/2]

galaxy::graphics::Polygon::Polygon ( )

Constructor.

Definition at line 16 of file Polygon.cpp.

◆ Polygon() [2/2]

galaxy::graphics::Polygon::Polygon ( Polygon && p)

Move constructor.

Definition at line 23 of file Polygon.cpp.

◆ ~Polygon()

galaxy::graphics::Polygon::~Polygon ( )
virtual

Destructor.

Definition at line 40 of file Polygon.cpp.

Member Function Documentation

◆ operator=()

Polygon & galaxy::graphics::Polygon::operator= ( Polygon && p)

Move assignment operator.

Definition at line 29 of file Polygon.cpp.

+ Here is the call graph for this function:

◆ create()

void galaxy::graphics::Polygon::create ( const meta::vector< glm::vec2 > & points)

Create shape.

Parameters
pointsList of points. The first point and the last point will be joined.

Definition at line 44 of file Polygon.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ points()

const meta::vector< glm::vec2 > & galaxy::graphics::Polygon::points ( ) const
nodiscard

Get list of points.

Returns
List of points making up shape.

Definition at line 76 of file Polygon.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_points

meta::vector<glm::vec2> galaxy::graphics::Polygon::m_points
private

List of points.

Definition at line 63 of file Polygon.hpp.


The documentation for this class was generated from the following files: