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::Shape Class Reference

A generic 2D shape. More...

#include <Shape.hpp>

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

Public Member Functions

 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.
 

Public Attributes

Colour m_colour
 Used by all primitives.
 

Protected Attributes

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 generic 2D shape.

Definition at line 21 of file Shape.hpp.

Constructor & Destructor Documentation

◆ Shape() [1/2]

galaxy::graphics::Shape::Shape ( )

Constructor.

Definition at line 16 of file Shape.cpp.

◆ Shape() [2/2]

galaxy::graphics::Shape::Shape ( Shape && s)

Move constructor.

Definition at line 23 of file Shape.cpp.

◆ ~Shape()

galaxy::graphics::Shape::~Shape ( )
virtual

Destructor.

Definition at line 46 of file Shape.cpp.

Member Function Documentation

◆ operator=()

Shape & galaxy::graphics::Shape::operator= ( Shape && s)

Move assignment operator.

Definition at line 32 of file Shape.cpp.

+ Here is the caller graph for this function:

◆ mode()

unsigned int galaxy::graphics::Shape::mode ( ) const
nodiscard

Get OpenGL rendering mode.

Returns
Unsigned int.

Definition at line 50 of file Shape.cpp.

+ Here is the caller graph for this function:

◆ width()

float galaxy::graphics::Shape::width ( ) const
nodiscard

Get texture width.

Is cached for performance.

Returns
Width as float.

Definition at line 55 of file Shape.cpp.

+ Here is the caller graph for this function:

◆ height()

float galaxy::graphics::Shape::height ( ) const
nodiscard

Get texture height.

Is cached for performance.

Returns
Height as float.

Definition at line 60 of file Shape.cpp.

+ Here is the caller graph for this function:

◆ vao()

VertexArray & galaxy::graphics::Shape::vao ( )
nodiscard

Get vertex array object.

Returns
Const reference to VAO.

Definition at line 65 of file Shape.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_colour

Colour galaxy::graphics::Shape::m_colour

Used by all primitives.

Definition at line 84 of file Shape.hpp.

◆ m_mode

unsigned int galaxy::graphics::Shape::m_mode
protected

Type to render i.e. GL_LINES, GL_TRIANGLES, etc.

Definition at line 90 of file Shape.hpp.

◆ m_width

float galaxy::graphics::Shape::m_width
protected

Cached width.

Definition at line 95 of file Shape.hpp.

◆ m_height

float galaxy::graphics::Shape::m_height
protected

Cached height.

Definition at line 100 of file Shape.hpp.

◆ m_vao

VertexArray galaxy::graphics::Shape::m_vao
protected

Vertex Array Object.

Definition at line 105 of file Shape.hpp.


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