Skip to main content

RenderingDevice Class

Abstract interface for a low-level rendering device. More...

Declaration

class helios::rendering::RenderingDevice { ... }

Derived Classes

classOpenGLDevice

OpenGL implementation of `RenderingDevice`. More...

Public Destructor Index

~RenderingDevice ()=default

Public Member Functions Index

voidinit ()=0

Initializes this rendering device. More...

voidbeginRenderPass (helios::rendering::RenderPass &renderPass) const noexcept=0

Signals this device that the application is now ready to begin a new render pass. More...

voiddoRender (helios::rendering::RenderPass &renderPass) const noexcept=0

Advises this RenderingDevice to process the specified RenderPass. More...

voidendRenderPass (helios::rendering::RenderPass &renderPass) const noexcept=0

Ends the specified render pass of this RenderingDevice. More...

voidrender (helios::rendering::RenderPass &renderPass) const

Convenience method to subsequently call `beginRenderPass`, `doRender`, and `endRenderPass` (in this order) with the specified `RenderPass`. More...

helios::rendering::text::TextRenderer &textRenderer () const noexcept=0

Returns the text renderer associated with this device. More...

helios::rendering::text::FontResourceProvider &fontResourceProvider () const noexcept=0

Returns the font resource provider associated with this device. More...

boolinitialized () const noexcept

Returns the initialized state of this rendering device. More...

Protected Member Attributes Index

boolinitialized_ = false

Reflects the initialization state of this device. More...

Protected Static Attributes Index

static const helios::util::log::Logger &logger_ = ...

The logger used with this RenderingDevice class. More...

Description

Abstract interface for a low-level rendering device.

This pure virtual class provides the fundamental API for managing the rendering pipeline and respective contracts for concrete implementations using a specific rendering backend (e.g., OpenGL, Vulkan).

## Responsibilities

  • **Initialization:** Load graphics API function pointers and prepare resources.
  • **Render Pass Management:** Begin, execute, and end render passes.
  • **Geometry Rendering:** Process `RenderCommand` objects for mesh rendering.
  • **Text Rendering:** Provide access to a `TextRenderer` for glyph-based text.

## Render Pass Lifecycle

``` beginRenderPass(pass) → doRender(pass) → endRenderPass(pass) ```

The `render()` convenience method executes all three steps in sequence.

See Also

RenderPass

See Also

RenderQueue

See Also

TextRenderer

Definition at line 49 of file RenderingDevice.ixx.

Public Destructor

~RenderingDevice()

virtual helios::rendering::RenderingDevice::~RenderingDevice ()
virtual default

Definition at line 67 of file RenderingDevice.ixx.

Public Member Functions

beginRenderPass()

virtual void helios::rendering::RenderingDevice::beginRenderPass (helios::rendering::RenderPass & renderPass)
noexcept

Signals this device that the application is now ready to begin a new render pass.

Implementing classes should prepare the rendering surface at this point and clear specific buffers.

This method should be called at the start of each frame before any drawing occurs.

Parameters
renderPass

The RenderPass that is about to be processed by the rendering device.

Definition at line 92 of file RenderingDevice.ixx.

Referenced by render.

doRender()

virtual void helios::rendering::RenderingDevice::doRender (helios::rendering::RenderPass & renderPass)
noexcept

Advises this RenderingDevice to process the specified RenderPass.

A `RenderPass` consists of `RenderCommand`s this RenderDevice executes, i.e. binding meshes, materials and shaders as well as drawing geometry.

Parameters
renderPass

A reference to the RenderPass that holds the `RenderCommand`s to be executed.

Definition at line 103 of file RenderingDevice.ixx.

Referenced by render.

endRenderPass()

virtual void helios::rendering::RenderingDevice::endRenderPass (helios::rendering::RenderPass & renderPass)
noexcept

Ends the specified render pass of this RenderingDevice.

This method should be called when the renderPass was processed by the RenderingDevice, before the window swaps the buffers.

Implementing classes should take care of unbinding frame buffers and/or flushing command buffers.

Parameters
renderPass

The RenderPass that was processed by the rendering device.

Definition at line 117 of file RenderingDevice.ixx.

Referenced by render.

fontResourceProvider()

virtual helios::rendering::text::FontResourceProvider & helios::rendering::RenderingDevice::fontResourceProvider ()
nodiscard noexcept

Returns the font resource provider associated with this device.

Use this to load fonts and access glyph data for text rendering. Fonts should be loaded before creating `TextRenderPrototype` instances that reference them.

Returns

Reference to the `FontResourceProvider` implementation.

See Also

FontResourceProvider::loadFont()

Definition at line 152 of file RenderingDevice.ixx.

Reference fontResourceProvider.

Referenced by fontResourceProvider.

init()

virtual void helios::rendering::RenderingDevice::init ()

Initializes this rendering device.

Should be called when the graphics context was created and before any rendering operations are performed.

Implementing classes should load pointers to underlying GL functions or provide similar API-specific setup.

Exceptions
std::runtime_error

if initialization of the device fails.

Definition at line 80 of file RenderingDevice.ixx.

initialized()

bool helios::rendering::RenderingDevice::initialized ()
inline nodiscard noexcept

Returns the initialized state of this rendering device.

This method is guaranteed to return `true` if the device was successfully initialized, otherwise `false`.

Returns

`true` if the device was successfully initialized, `false` otherwise.

Definition at line 162 of file RenderingDevice.ixx.

162 [[nodiscard]] bool initialized() const noexcept{
163 return initialized_;
164 };

References initialized and initialized_.

Referenced by initialized.

render()

void helios::rendering::RenderingDevice::render (helios::rendering::RenderPass & renderPass)
inline

Convenience method to subsequently call `beginRenderPass`, `doRender`, and `endRenderPass` (in this order) with the specified `RenderPass`.

Parameters
renderPass

The RenderPass to process by this RenderingDevice.

Definition at line 124 of file RenderingDevice.ixx.

124 void render(helios::rendering::RenderPass& renderPass) const {
125 beginRenderPass(renderPass);
126 doRender(renderPass);
127 endRenderPass(renderPass);
128 }

References beginRenderPass, doRender and endRenderPass.

textRenderer()

virtual helios::rendering::text::TextRenderer & helios::rendering::RenderingDevice::textRenderer ()
nodiscard noexcept

Returns the text renderer associated with this device.

Use this to register font families and access text rendering capabilities.

Returns

Reference to the `TextRenderer` implementation.

See Also

TextRenderer::addFontFamily()

Definition at line 139 of file RenderingDevice.ixx.

Protected Member Attributes

initialized_

bool helios::rendering::RenderingDevice::initialized_ = false
protected

Reflects the initialization state of this device.

Definition at line 55 of file RenderingDevice.ixx.

55 bool initialized_ = false;

Referenced by helios::ext::opengl::rendering::OpenGLDevice::init and initialized.

Protected Static Attributes

logger_

const helios::util::log::Logger& helios::rendering::RenderingDevice::logger_
protected static

The logger used with this RenderingDevice class.

Initialiser

Defaults to HELIOS_LOG_SCOPE.

Definition at line 62 of file RenderingDevice.ixx.

Referenced by helios::ext::opengl::rendering::OpenGLDevice::init.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.