PlottingOpenGL::IBatchRenderer
PlottingOpenGL::IBatchRenderer
Abstract base interface for all batch renderers. More…
#include <IBatchRenderer.hpp>
Inherited by PlottingOpenGL::BatchLineRenderer, PlottingOpenGL::GlyphRenderer, PlottingOpenGL::PolyLineRenderer, PlottingOpenGL::RectangleRenderer, PlottingOpenGL::StreamingPolyLineRenderer
Public Functions
| Name | |
|---|---|
| virtual | ~IBatchRenderer() =default |
| virtual bool | initialize() =0 Initialize GPU resources (VAOs, VBOs, shaders). |
| virtual void | cleanup() =0 Release all GPU resources. |
| virtual bool | isInitialized() const =0 Check if the renderer has been successfully initialized. |
| virtual void | render(glm::mat4 const & view_matrix, glm::mat4 const & projection_matrix) =0 Render the current batch with the given View and Projection matrices. |
| virtual bool | hasData() const =0 Check if there is any data to render. |
| virtual void | clearData() =0 Clear all uploaded data (but keep GPU resources allocated). |
Protected Functions
| Name | |
|---|---|
| IBatchRenderer() =default | |
| IBatchRenderer(IBatchRenderer const & ) =delete | |
| IBatchRenderer & | operator=(IBatchRenderer const & ) =delete |
| IBatchRenderer(IBatchRenderer && ) =delete | |
| IBatchRenderer & | operator=(IBatchRenderer && ) =delete |
Detailed Description
class PlottingOpenGL::IBatchRenderer;Abstract base interface for all batch renderers.
See: PolyLineRenderer, GlyphRenderer, RectangleRenderer
This interface defines the lifecycle and rendering contract for GPU-accelerated batch renderers. Implementations handle specific primitive types (polylines, glyphs, rectangles) and manage their own GPU resources (VBOs, VAOs, shaders).
Lifecycle:
- Construction (renderer created but not initialized)
- initialize() - Allocate GPU resources (must be called with valid GL context)
- uploadData() - Upload batch data to GPU (called when data changes)
- render() - Issue draw calls (called each frame)
- cleanup() - Release GPU resources (call before context destruction)
Thread Safety: All methods must be called from the thread with the active OpenGL context.
Public Functions Documentation
function ~IBatchRenderer
virtual ~IBatchRenderer() =defaultfunction initialize
virtual bool initialize() =0Initialize GPU resources (VAOs, VBOs, shaders).
Return: true if initialization succeeded
Reimplemented by: PlottingOpenGL::BatchLineRenderer::initialize, PlottingOpenGL::GlyphRenderer::initialize, PlottingOpenGL::PolyLineRenderer::initialize, PlottingOpenGL::RectangleRenderer::initialize, PlottingOpenGL::StreamingPolyLineRenderer::initialize
Must be called with a valid, current OpenGL context. Can be called multiple times (will reinitialize if needed).
function cleanup
virtual void cleanup() =0Release all GPU resources.
Reimplemented by: PlottingOpenGL::BatchLineRenderer::cleanup, PlottingOpenGL::GlyphRenderer::cleanup, PlottingOpenGL::PolyLineRenderer::cleanup, PlottingOpenGL::RectangleRenderer::cleanup, PlottingOpenGL::StreamingPolyLineRenderer::cleanup
Should be called before the OpenGL context is destroyed. Safe to call even if initialize() was never called.
function isInitialized
virtual bool isInitialized() const =0Check if the renderer has been successfully initialized.
Reimplemented by: PlottingOpenGL::BatchLineRenderer::isInitialized, PlottingOpenGL::GlyphRenderer::isInitialized, PlottingOpenGL::PolyLineRenderer::isInitialized, PlottingOpenGL::RectangleRenderer::isInitialized, PlottingOpenGL::StreamingPolyLineRenderer::isInitialized
function render
virtual void render(
glm::mat4 const & view_matrix,
glm::mat4 const & projection_matrix
) =0Render the current batch with the given View and Projection matrices.
Parameters:
- view_matrix Global camera/view transformation
- projection_matrix Projection to NDC
Reimplemented by: PlottingOpenGL::BatchLineRenderer::render, PlottingOpenGL::GlyphRenderer::render, PlottingOpenGL::PolyLineRenderer::render, PlottingOpenGL::RectangleRenderer::render, PlottingOpenGL::StreamingPolyLineRenderer::render
The Model matrix is stored per-batch in the renderable data structure and will be combined with the provided VP matrices.
function hasData
virtual bool hasData() const =0Check if there is any data to render.
Return: true if the renderer has data uploaded and ready to draw
Reimplemented by: PlottingOpenGL::BatchLineRenderer::hasData, PlottingOpenGL::GlyphRenderer::hasData, PlottingOpenGL::PolyLineRenderer::hasData, PlottingOpenGL::RectangleRenderer::hasData, PlottingOpenGL::StreamingPolyLineRenderer::hasData
function clearData
virtual void clearData() =0Clear all uploaded data (but keep GPU resources allocated).
Reimplemented by: PlottingOpenGL::BatchLineRenderer::clearData, PlottingOpenGL::GlyphRenderer::clearData, PlottingOpenGL::PolyLineRenderer::clearData, PlottingOpenGL::RectangleRenderer::clearData, PlottingOpenGL::StreamingPolyLineRenderer::clearData
Protected Functions Documentation
function IBatchRenderer
IBatchRenderer() =defaultfunction IBatchRenderer
IBatchRenderer(
IBatchRenderer const &
) =deletefunction operator=
IBatchRenderer & operator=(
IBatchRenderer const &
) =deletefunction IBatchRenderer
IBatchRenderer(
IBatchRenderer &&
) =deletefunction operator=
IBatchRenderer & operator=(
IBatchRenderer &&
) =deleteUpdated on 2026-11-13 at 20:25:41 +0000