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::Renderer Class Referencefinal

OpenGL 4.6 Renderer that tries to mimic vulkan pipeline. More...

#include <Renderer.hpp>

+ Collaboration diagram for galaxy::Renderer:

Public Member Functions

 Renderer ()
 Constructor.
 
 ~Renderer ()
 Destructor.
 
void prepare ()
 Called only in the update loop when we need to refresh data to render.
 
void begin_pass (RenderPass &pass)
 Binds framebuffer, viewport, sissor region and clears buffers.
 
void bind_pipeline (RenderPipeline &pipeline)
 Binds the GPU state specified in pipeline.
 
void push_cmd (RenderCmd &cmd) noexcept
 Push a renderable object.
 
void end_pass (Camera &camera)
 Renders everything configured in this pass.
 

Private Attributes

VertexBatch m_quads
 Quad vertex batch.
 
std::vector< RenderCmdm_commands
 RenderCmd storage.
 
RenderPassm_pass
 Currently active pass.
 
RenderPipelinem_pipeline
 Currently active pipeline.
 
ShaderBuffer m_uniform_storage
 Renderable uniforms buffer.
 
ShaderBuffer m_camera_storage
 Camera buffer.
 
std::vector< RenderDatam_uniform_data
 Renderable uniform data storage.
 
unsigned int m_uniform_data_index
 Uniform data current max index.
 

Detailed Description

OpenGL 4.6 Renderer that tries to mimic vulkan pipeline.

Definition at line 24 of file Renderer.hpp.

Constructor & Destructor Documentation

◆ Renderer()

galaxy::Renderer::Renderer ( )

Constructor.

Definition at line 20 of file Renderer.cpp.

+ Here is the call graph for this function:

◆ ~Renderer()

galaxy::Renderer::~Renderer ( )

Destructor.

Definition at line 36 of file Renderer.cpp.

Member Function Documentation

◆ prepare()

void galaxy::Renderer::prepare ( )

Called only in the update loop when we need to refresh data to render.

Definition at line 42 of file Renderer.cpp.

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

◆ begin_pass()

void galaxy::Renderer::begin_pass ( RenderPass & pass)

Binds framebuffer, viewport, sissor region and clears buffers.

Call this first.

Parameters
passRenderPass to bind.

Definition at line 53 of file Renderer.cpp.

+ Here is the caller graph for this function:

◆ bind_pipeline()

void galaxy::Renderer::bind_pipeline ( RenderPipeline & pipeline)

Binds the GPU state specified in pipeline.

Call this second.

Parameters
pipelineRenderPipeline to bind.

Definition at line 66 of file Renderer.cpp.

+ Here is the caller graph for this function:

◆ push_cmd()

void galaxy::Renderer::push_cmd ( RenderCmd & cmd)
noexcept

Push a renderable object.

Try not to push too many non-quads, only quads are batched.

Parameters
cmdRenderCmd to draw.

Definition at line 91 of file Renderer.cpp.

+ Here is the caller graph for this function:

◆ end_pass()

void galaxy::Renderer::end_pass ( Camera & camera)

Renders everything configured in this pass.

Parameters
cameraProjection and view matrix to render this pass with.

Definition at line 116 of file Renderer.cpp.

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

Member Data Documentation

◆ m_quads

VertexBatch galaxy::Renderer::m_quads
private

Quad vertex batch.

Definition at line 80 of file Renderer.hpp.

◆ m_commands

std::vector<RenderCmd> galaxy::Renderer::m_commands
private

RenderCmd storage.

Definition at line 85 of file Renderer.hpp.

◆ m_pass

RenderPass* galaxy::Renderer::m_pass
private

Currently active pass.

Definition at line 90 of file Renderer.hpp.

◆ m_pipeline

RenderPipeline* galaxy::Renderer::m_pipeline
private

Currently active pipeline.

Definition at line 95 of file Renderer.hpp.

◆ m_uniform_storage

ShaderBuffer galaxy::Renderer::m_uniform_storage
private

Renderable uniforms buffer.

Definition at line 100 of file Renderer.hpp.

◆ m_camera_storage

ShaderBuffer galaxy::Renderer::m_camera_storage
private

Camera buffer.

Definition at line 105 of file Renderer.hpp.

◆ m_uniform_data

std::vector<RenderData> galaxy::Renderer::m_uniform_data
private

Renderable uniform data storage.

Definition at line 110 of file Renderer.hpp.

◆ m_uniform_data_index

unsigned int galaxy::Renderer::m_uniform_data_index
private

Uniform data current max index.

Definition at line 115 of file Renderer.hpp.


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