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 Namespace Reference

Classes

class  Animation
 2D animation information. More...
 
class  Camera
 Orthographic 2D camera. More...
 
class  ChromaticAberration
 Chromatic Aberration pass. More...
 
class  Circle
 A circle. More...
 
class  Colour
 Represents an RGBA colour. More...
 
class  Ellipse
 An elliptical circle. More...
 
class  FilmicGrain
 Film grain effect. More...
 
class  Font
 A font is a MSDF atlas of glyphs. More...
 
class  FontContext
 MSDF OpenGL configuration. More...
 
struct  Frame
 Single frame of an animation. More...
 
class  Framebuffer
 OpenGL framebuffer to render to. More...
 
class  GammaCorrection
 GammaCorrection effect. More...
 
class  GaussianBlur
 Gaussian Blur pass. More...
 
class  InstanceBuffer
 Abstraction for OpenGL vertex buffer objects. More...
 
class  Point
 A single point. More...
 
class  Polygon
 A closed loop line collection of points. I.e. A square, triangle, etc. More...
 
class  Polyline
 An open looped line of points. More...
 
class  PostEffect
 Manages post processing effects to apply to combined scene. More...
 
class  PostProcess
 Manages post processing effects to apply to combined scene. More...
 
struct  RenderCommand
 Data to be passed to the renderer. More...
 
struct  RenderData
 Uniform data passed to shader from entity. More...
 
class  Renderer
 2D OpenGL renderer. More...
 
class  RenderTexture
 Draw to an opengl texture instead of the screen. More...
 
class  Shader
 OpenGL Shader Program. More...
 
class  ShaderStorageBuffer
 Abstraction for OpenGL buffer objects. More...
 
class  Shape
 A generic 2D shape. More...
 
class  Sharpen
 Sharpening effect. More...
 
class  SMAA
 Submorphological Anti Aliasing. More...
 
class  Text
 String of glyphs rendered with a font. More...
 
class  Texture
 OpenGL 2D Texture. More...
 
class  Texture2D
 Standard opengl texture. More...
 
class  TextureArray
 OpenGL texture array. More...
 
class  TextureView
 OpenGL 2D TextureView. More...
 
class  Transform
 Defines the 2D transformation of an entity. More...
 
struct  Vertex
 Represents a single vertex point. More...
 
class  VertexArray
 Abstraction for OpenGL vertex array objects. More...
 
class  VertexBatch
 Batches together vertex data to reduce draw calls. More...
 
class  VertexBuffer
 Abstraction for OpenGL vertex buffer objects. More...
 

Concepts

concept  is_posteffect
 Constraint to ensure type is a Post Effect.
 

Enumerations

enum class  DrawHint : GLenum { STATIC_DRAW = GL_STATIC_DRAW , DYNAMIC_DRAW = GL_DYNAMIC_DRAW , STREAM_DRAW = GL_STREAM_DRAW }
 OpenGL driver data buffer storage flags. More...
 
enum class  AttributeBinding : unsigned int { POSITION_POINT = 0u , TEXEL_POINT = 1u , OFFSET_POINT = 2u }
 Stores the location of shader attribute binding point for the VAO. More...
 
enum class  BufferBinding : unsigned int { VERTEX_BUFFER_POINT = 0 , INSTANCE_BUFFER_POINT = 1 }
 Stores the location of a buffer's binding point for the VAO. More...
 
enum class  TextureMode : int { REPEAT = GL_REPEAT , MIRRORED_REPEAT = GL_MIRRORED_REPEAT , CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE , CLAMP_TO_BORDER = GL_CLAMP_TO_BORDER }
 Texture wrapping modes. More...
 
enum class  TextureFilter : short { NEAREST , TRILINEAR }
 Mipmap filtering. More...
 

Functions

template<>
void Shader::set_uniform< std::uint64_t > (const std::string &name, const std::uint64_t &a)
 
template<>
void Shader::set_uniform< glm::mat3 > (const std::string &name, const glm::mat3 &a)
 
template<>
void Shader::set_uniform< glm::mat4 > (const std::string &name, const glm::mat4 &a)
 
template<>
void Shader::set_uniform< glm::vec2 > (const std::string &name, const glm::vec2 &a)
 
template<>
void Shader::set_uniform< glm::vec3 > (const std::string &name, const glm::vec3 &a)
 
template<>
void Shader::set_uniform< glm::vec4 > (const std::string &name, const glm::vec4 &a)
 
template<>
void Shader::set_uniform< std::array< float, 4 > > (const std::string &name, const std::array< float, 4 > &a)
 
template<>
void Shader::set_uniform< graphics::Colour > (const std::string &name, const graphics::Colour &a)
 
std::array< Vertex, 4 > gen_quad_vertices (const float width, const float height)
 Generate some default verticies.
 
std::array< unsigned int, 6 > gen_default_indices ()
 Generate some default indicies.
 
template<meta::is_arithmetic Type>
float map_x_texel (const Type x, const float width)
 Takes in a x positon texture coord and maps it to a texel.
 
template<meta::is_arithmetic Type>
float map_y_texel (const Type y, const float height)
 Takes in a y positon texture coord and maps it to a texel.
 

Enumeration Type Documentation

◆ DrawHint

enum class galaxy::graphics::DrawHint : GLenum
strong

OpenGL driver data buffer storage flags.

Enumerator
STATIC_DRAW GL_STATIC_DRAW 
DYNAMIC_DRAW GL_DYNAMIC_DRAW 
STREAM_DRAW GL_STREAM_DRAW 

Definition at line 20 of file Enums.hpp.

◆ AttributeBinding

enum class galaxy::graphics::AttributeBinding : unsigned int
strong

Stores the location of shader attribute binding point for the VAO.

Enumerator
POSITION_POINT 0u 

Position data.

TEXEL_POINT 1u 

Texel data.

OFFSET_POINT 2u 

Instance offset data.

Definition at line 30 of file Enums.hpp.

◆ BufferBinding

enum class galaxy::graphics::BufferBinding : unsigned int
strong

Stores the location of a buffer's binding point for the VAO.

Enumerator
VERTEX_BUFFER_POINT 

Normal VBO.

INSTANCE_BUFFER_POINT 

Instance offsets.

Definition at line 51 of file Enums.hpp.

◆ TextureMode

enum class galaxy::graphics::TextureMode : int
strong

Texture wrapping modes.

Enumerator
REPEAT GL_REPEAT 

GL_REPEAT.

MIRRORED_REPEAT GL_MIRRORED_REPEAT 

GL_MIRRORED_REPEAT.

CLAMP_TO_EDGE GL_CLAMP_TO_EDGE 

GL_CLAMP_TO_EDGE.

CLAMP_TO_BORDER GL_CLAMP_TO_BORDER 

GL_CLAMP_TO_BORDER.

Definition at line 67 of file Enums.hpp.

◆ TextureFilter

enum class galaxy::graphics::TextureFilter : short
strong

Mipmap filtering.

Enumerator
NEAREST 

Nearest-neighbour.

TRILINEAR 

Trilinear.

Definition at line 93 of file Enums.hpp.

Function Documentation

◆ Shader::set_uniform< std::uint64_t >()

template<>
void galaxy::graphics::Shader::set_uniform< std::uint64_t > ( const std::string & name,
const std::uint64_t & a )
inline

Definition at line 303 of file Shader.hpp.

◆ Shader::set_uniform< glm::mat3 >()

template<>
void galaxy::graphics::Shader::set_uniform< glm::mat3 > ( const std::string & name,
const glm::mat3 & a )
inline

Definition at line 309 of file Shader.hpp.

◆ Shader::set_uniform< glm::mat4 >()

template<>
void galaxy::graphics::Shader::set_uniform< glm::mat4 > ( const std::string & name,
const glm::mat4 & a )
inline

Definition at line 315 of file Shader.hpp.

◆ Shader::set_uniform< glm::vec2 >()

template<>
void galaxy::graphics::Shader::set_uniform< glm::vec2 > ( const std::string & name,
const glm::vec2 & a )
inline

Definition at line 321 of file Shader.hpp.

◆ Shader::set_uniform< glm::vec3 >()

template<>
void galaxy::graphics::Shader::set_uniform< glm::vec3 > ( const std::string & name,
const glm::vec3 & a )
inline

Definition at line 327 of file Shader.hpp.

◆ Shader::set_uniform< glm::vec4 >()

template<>
void galaxy::graphics::Shader::set_uniform< glm::vec4 > ( const std::string & name,
const glm::vec4 & a )
inline

Definition at line 333 of file Shader.hpp.

◆ Shader::set_uniform< std::array< float, 4 > >()

template<>
void galaxy::graphics::Shader::set_uniform< std::array< float, 4 > > ( const std::string & name,
const std::array< float, 4 > & a )
inline

Definition at line 339 of file Shader.hpp.

◆ Shader::set_uniform< graphics::Colour >()

template<>
void galaxy::graphics::Shader::set_uniform< graphics::Colour > ( const std::string & name,
const graphics::Colour & a )
inline

Definition at line 345 of file Shader.hpp.

+ Here is the call graph for this function:

◆ gen_quad_vertices()

std::array< Vertex, 4 > galaxy::graphics::gen_quad_vertices ( const float width,
const float height )

Generate some default verticies.

Parameters
widthWidth of quad.
heightHeight of quad.
Returns
Vertices mapped from TOP LEFT to BOTTOM LEFT CLOCKWISE.

Definition at line 14 of file Vertex.cpp.

+ Here is the caller graph for this function:

◆ gen_default_indices()

std::array< unsigned int, 6 > galaxy::graphics::gen_default_indices ( )

Generate some default indicies.

Returns
Indices mapping vertices from TOP LEFT to BOTTOM LEFT CLOCKWISE.

Definition at line 37 of file Vertex.cpp.

+ Here is the caller graph for this function:

◆ map_x_texel()

template<meta::is_arithmetic Type>
float galaxy::graphics::map_x_texel ( const Type x,
const float width )
inlinenodiscard

Takes in a x positon texture coord and maps it to a texel.

Template Parameters
TypeType of the variable.
Parameters
xPosition of texture coord.
widthTexture width.
Returns
OpenGL shader compatible texel.

Definition at line 66 of file Vertex.hpp.

+ Here is the caller graph for this function:

◆ map_y_texel()

template<meta::is_arithmetic Type>
float galaxy::graphics::map_y_texel ( const Type y,
const float height )
inlinenodiscard

Takes in a y positon texture coord and maps it to a texel.

Template Parameters
TypeType of the variable.
Parameters
yPosition of texture coord.
heightTexture height.
Returns
OpenGL shader compatible texel.

Definition at line 83 of file Vertex.hpp.

+ Here is the caller graph for this function: