RenderingDevice Class
Abstract interface for a low-level rendering device. More...
Declaration
Derived Classes
| class | OpenGLDevice |
|
OpenGL implementation of `RenderingDevice`. More... | |
Public Destructor Index
| ~RenderingDevice ()=default | |
Public Member Functions Index
| void | init ()=0 |
|
Initializes this rendering device. More... | |
| void | beginRenderPass (helios::rendering::RenderPass &renderPass) const noexcept=0 |
|
Signals this device that the application is now ready to begin a new render pass. More... | |
| void | doRender (helios::rendering::RenderPass &renderPass) const noexcept=0 |
|
Advises this RenderingDevice to process the specified RenderPass. More... | |
| void | endRenderPass (helios::rendering::RenderPass &renderPass) const noexcept=0 |
|
Ends the specified render pass of this RenderingDevice. More... | |
| void | render (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... | |
| bool | initialized () const noexcept |
|
Returns the initialized state of this rendering device. More... | |
Protected Member Attributes Index
| bool | initialized_ = 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
- See Also
- See Also
TextRenderer
Definition at line 49 of file RenderingDevice.ixx.
Public Destructor
~RenderingDevice()
| virtual default |
Definition at line 67 of file RenderingDevice.ixx.
Public Member Functions
beginRenderPass()
| 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()
| 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()
| 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()
| 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()
|
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()
| 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.
References initialized and initialized_.
Referenced by initialized.
render()
| 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.
References beginRenderPass, doRender and endRenderPass.
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_
| protected |
Reflects the initialization state of this device.
Definition at line 55 of file RenderingDevice.ixx.
Referenced by helios::ext::opengl::rendering::OpenGLDevice::init and initialized.
Protected Static Attributes
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.