Skip to main content

OpenGLBackend Class

Applies render-pass state and executes OpenGL draw calls. More...

Declaration

class helios::opengl::OpenGLBackend { ... }

Public Constructors Index

OpenGLBackend (EngineWorld &engineWorld)

Constructs the backend bound to the engine world. More...

Public Member Functions Index

voidbeginRenderTargetBatch (const RenderTargetHandle renderTargetHandle) noexcept

Begins processing for one render-target batch. More...

voidendRenderTargetBatch (const RenderTargetHandle renderTargetHandle) noexcept

Ends processing for one render-target batch. More...

voidbeginViewportBatch (const ViewportHandle viewportHandle) noexcept

Begins processing for one viewport batch. More...

voidendViewportBatch (const ViewportHandle viewportHandle) noexcept

Ends processing for one viewport batch. More...

voidbeginShaderBatch (ShaderHandle shaderHandle) noexcept

Begins processing for one shader batch. More...

voidendShaderBatch (ShaderHandle handle) noexcept

Ends processing for one shader batch. More...

voidbeginMaterialBatch (MaterialHandle materialHandle) noexcept

Begins processing for one material batch. More...

voidendMaterialBatch (MaterialHandle handle) noexcept

Ends processing for one material batch. More...

voidbeginMeshBatch (MeshHandle meshHandle) noexcept

Begins processing for one mesh batch. More...

voidendMeshBatch (MeshHandle handle) noexcept

Ends processing for one mesh batch. More...

template <typename THandle>
voidrenderBatch (std::span< const SceneMemberRenderContext< THandle > > sceneMemberRenderContexts) noexcept

Renders non-instanced draw contexts. More...

template <typename THandle>
voidrenderBatch (std::span< const InstanceData< THandle > > instanceData) noexcept

Renders one instanced draw call for the provided instance payload. More...

voidprovideWindowHints () noexcept

Applies window hints for an OpenGL core-profile context. More...

boolinit () noexcept

Initializes OpenGL function pointers through GLFW. More...

boolisInitialized () const noexcept

Reports whether OpenGL function loading completed successfully. More...

Private Member Functions Index

std::optional< ViewProjection >viewProjection (const ViewportEntity &viewportEntity) const noexcept

Resolves view and projection matrices for a viewport's bound camera. More...

template <typename TUniformScope>
voidwriteUniformValues (ShaderEntity shaderEntity, UniformValueBag< TUniformScope > &uniformValueBag) noexcept

Uploads cached uniform values for a specific uniform scope. More...

template <typename THandle, typename TEntity>
voidclearColor (TEntity &entity) noexcept

Applies clear color and clear mask based on optional components. More...

Private Member Attributes Index

boolisInitialized_ = false

Tracks whether GL function pointers were initialized. More...

OpenGLMeshComponent< MeshHandle > *currentOpenGLMesh_ = nullptr

Cached pointer to the currently bound OpenGL mesh component. More...

UniformValueBag< UniformScope::Pass >passUniformValueBag_ {}

Cached pass-scope uniforms (typically view/projection). More...

UniformValueBag< UniformScope::Draw >drawUniformValueBag_ {}

Cached draw-scope uniforms (for example model matrix). More...

UniformValueBag< UniformScope::Material >materialUniformValueBag_ {}

Cached material-scope uniforms (for example material color). More...

RenderTargetHandlecurrentRenderTargetHandle_ {}

Currently active render target for nested viewport processing. More...

ShaderHandlecurrentShaderHandle_ {}

Currently bound shader to avoid redundant glUseProgram calls. More...

EngineWorld &engineWorld_

Engine world used to resolve render entities and components. More...

Private Static Attributes Index

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

Scoped logger used for backend diagnostics. More...

Description

Applies render-pass state and executes OpenGL draw calls.

OpenGLBackend is intentionally thin and stateful: it references existing worlds and translates ECS render data into OpenGL state changes.

Definition at line 85 of file OpenGLBackend.ixx.

Public Constructors

OpenGLBackend()

helios::opengl::OpenGLBackend::OpenGLBackend (EngineWorld & engineWorld)
inline explicit

Constructs the backend bound to the engine world.

Parameters
engineWorld

Engine world providing render resources and targets.

Definition at line 248 of file OpenGLBackend.ixx.

248 explicit OpenGLBackend(EngineWorld& engineWorld) : engineWorld_(engineWorld) {}

Public Member Functions

beginMaterialBatch()

void helios::opengl::OpenGLBackend::beginMaterialBatch (MaterialHandle materialHandle)
inline noexcept

Begins processing for one material batch.

Loads material-scope values (for example base color) into draw-scope uniforms.

Parameters
materialHandle

Material handle for this batch.

Definition at line 417 of file OpenGLBackend.ixx.

417 void beginMaterialBatch(MaterialHandle materialHandle) noexcept {
418 auto materialEntity = engineWorld_.find(materialHandle);
419 if (!materialEntity) {
420 logger_.error("MaterialEntity expected, but not found");
421 assert(false && "MaterialEntity not found");
422 return;
423 }
424
425 auto* colorComponent = materialEntity->template get<ColorComponent<MaterialHandle>>();
426 if (colorComponent) {
427 materialUniformValueBag_.set<MaterialBaseColorUniform>(colorComponent->value());
428 const auto shaderEntity = engineWorld_.find(currentShaderHandle_);
429 assert(shaderEntity && "ShaderEntity expected, but not found");
430 writeUniformValues<UniformScope::Material>(*shaderEntity, materialUniformValueBag_);
431 }
432
433 }

beginMeshBatch()

void helios::opengl::OpenGLBackend::beginMeshBatch (MeshHandle meshHandle)
inline noexcept

Begins processing for one mesh batch.

Resolves and binds the mesh VAO used for all draw contexts in the batch.

Parameters
meshHandle

Mesh handle for this batch.

Definition at line 451 of file OpenGLBackend.ixx.

451 void beginMeshBatch(MeshHandle meshHandle) noexcept {
452
453 auto meshEntity = engineWorld_.find(meshHandle);
454 if (!meshEntity) {
455 logger_.error("MeshEntity expected, but not found");
456 assert(false && "MeshEntity not found");
457 return;
458 }
459
460 auto* openglMesh = meshEntity->template get<OpenGLMeshComponent<MeshHandle>>();
461 if (!openglMesh) {
462 logger_.error("OpenGLMesh expected, but not found");
463 assert(false && "OpenGLMesh not found");
464 return;
465 } else {
466 currentOpenGLMesh_ = openglMesh;
467 glBindVertexArray(openglMesh->vao);
468 }
469 }

beginRenderTargetBatch()

void helios::opengl::OpenGLBackend::beginRenderTargetBatch (const RenderTargetHandle renderTargetHandle)
inline noexcept

Begins processing for one render-target batch.

Binds the framebuffer, validates it in debug builds, and initializes pass-independent GL state such as blending and clear color.

Parameters
renderTargetHandle

Render-target handle for this batch.

Definition at line 259 of file OpenGLBackend.ixx.

259 void beginRenderTargetBatch(const RenderTargetHandle renderTargetHandle) noexcept {
260
261 auto renderTargetEntity = engineWorld_.find<RenderTargetHandle>(renderTargetHandle);
262
263 #ifdef HELIOS_DEBUG
264 if (!renderTargetEntity) {
265 logger_.error("Missing RenderTargetEntity for handle {0}.", renderTargetHandle.entityId);
266 assert(renderTargetEntity && "Missing RenderTargetEntity for handle.");
267 }
268 #endif
269
270 currentRenderTargetHandle_ = renderTargetHandle;
271
272 const auto renderTargetId = renderTargetEntity->get<OpenGLRenderTargetIdComponent<RenderTargetHandle>>()->value();
273
274 glBindFramebuffer(GL_FRAMEBUFFER, renderTargetId);
275
276 #ifdef HELIOS_DEBUG
277 const auto isValidRenderTarget = renderTargetId == 0 ||
278 (glIsFramebuffer(renderTargetId) == GL_TRUE && glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
279 if (!isValidRenderTarget) {
280 logger_.error("RenderTargetEntity with EntityId {0} undefined.", renderTargetId);
281 assert(isValidRenderTarget && "RenderTargetEntity EntityId does not seem to be a valid id.");
282 }
283 #endif
284
285 auto renderTargetSize = renderTargetEntity->get<Size2DComponent<RenderTargetHandle>>()->value();
286
287 glViewport(0, 0,
288 static_cast<int>(renderTargetSize[0]),
289 static_cast<int>(renderTargetSize[1])
290 );
291
292 clearColor<RenderTargetHandle>(renderTargetEntity);
293
294 // this is equally important for the GlpyhTextRenderer
295 // enable blending since the font's fragment shader uses the alpha channel
296 glEnable(GL_BLEND);
297 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
298 }

beginShaderBatch()

void helios::opengl::OpenGLBackend::beginShaderBatch (ShaderHandle shaderHandle)
inline noexcept

Begins processing for one shader batch.

Binds the shader program and uploads pass-scope uniforms.

Parameters
shaderHandle

Shader handle for this batch.

Definition at line 379 of file OpenGLBackend.ixx.

379 void beginShaderBatch(ShaderHandle shaderHandle) noexcept {
380
381 auto shaderEntity = engineWorld_.find(shaderHandle);
382 if (!shaderEntity) {
383 logger_.error("ShaderEntity expected, but not found");
384 assert(false && "ShaderEntity not found");
385 return;
386 }
387
388 currentShaderHandle_ = shaderHandle;
389
390 auto* openglShader = shaderEntity->template get<OpenGLShaderComponent<ShaderHandle>>();
391 if (!openglShader) {
392 logger_.error("OpenGLShader expected, but not found");
393 assert(false && "OpenGLShader not found");
394 return;
395 }
396
397 glUseProgram(openglShader->programId);
398 writeUniformValues<UniformScope::Pass>(*shaderEntity, passUniformValueBag_);
399 }

beginViewportBatch()

void helios::opengl::OpenGLBackend::beginViewportBatch (const ViewportHandle viewportHandle)
inline noexcept

Begins processing for one viewport batch.

Resolves camera matrices, configures viewport/scissor rectangles, and performs optional clears according to the active render target clear flags.

Parameters
viewportHandle

Viewport handle for this batch.

Definition at line 321 of file OpenGLBackend.ixx.

321 void beginViewportBatch(const ViewportHandle viewportHandle) noexcept {
322
323 auto viewport = engineWorld_.find<ViewportHandle>(viewportHandle);
324 auto renderTargetEntity = engineWorld_.find<RenderTargetHandle>(currentRenderTargetHandle_);
325
326 #ifdef HELIOS_DEBUG
327 if (!renderTargetEntity) {
328 logger_.error("Missing RenderTargetEntity for handle {0}.", renderTargetEntity->handle().entityId);
329 assert(renderTargetEntity && "Missing RenderTargetEntity for handle.");
330 }
331 if (!viewport) {
332 logger_.error("Missing Viewport for handle {0}.", viewportHandle.entityId);
333 assert(viewport && "Missing Viewport for handle.");
334 }
335 #endif
336
337 auto vp = viewProjection(*viewport);
338 if (!vp) {
339 logger_.warn("Could not determine View/Projection-matrices for RenderPass");
340 passUniformValueBag_.set<ProjectionMatrixUniform>(helios::math::mat4f{1.0f});
341 passUniformValueBag_.set<ViewMatrixUniform>(helios::math::mat4f{1.0f});
342 } else {
343 passUniformValueBag_.set<ProjectionMatrixUniform>(vp->projectionMatrix);
344 passUniformValueBag_.set<ViewMatrixUniform>(vp->viewMatrix);
345 }
346
347 auto viewportBounds = viewport->get<RectComponent<ViewportHandle>>()->value();
348 auto renderTargetSize = renderTargetEntity->get<Size2DComponent<RenderTargetHandle>>()->value();
349
350 const auto x = static_cast<int>(renderTargetSize[0] * viewportBounds[0]);
351 const auto y = static_cast<int>(renderTargetSize[1] * viewportBounds[1]);
352 const auto width = static_cast<int>(renderTargetSize[0] * viewportBounds[2]);
353 const auto height = static_cast<int>(renderTargetSize[1] * viewportBounds[3]);
354
355
356 glViewport(x, y, width, height);
357 glScissor(x, y, width, height);
358 glEnable(GL_SCISSOR_TEST);
359
360 clearColor<ViewportHandle>(viewport);
361 }

endMaterialBatch()

void helios::opengl::OpenGLBackend::endMaterialBatch (MaterialHandle handle)
inline noexcept

Ends processing for one material batch.

Parameters
handle

Material handle for this batch.

Definition at line 440 of file OpenGLBackend.ixx.

440 void endMaterialBatch(MaterialHandle handle) noexcept {
441 materialUniformValueBag_.clearValues();
442 }

endMeshBatch()

void helios::opengl::OpenGLBackend::endMeshBatch (MeshHandle handle)
inline noexcept

Ends processing for one mesh batch.

Parameters
handle

Mesh handle for this batch.

Definition at line 476 of file OpenGLBackend.ixx.

476 void endMeshBatch(MeshHandle handle) noexcept {
477 currentOpenGLMesh_ = nullptr;
478 glBindVertexArray(0);
479 }

endRenderTargetBatch()

void helios::opengl::OpenGLBackend::endRenderTargetBatch (const RenderTargetHandle renderTargetHandle)
inline noexcept

Ends processing for one render-target batch.

Clears current render-target state and resets cached pass/draw uniform values.

Parameters
renderTargetHandle

Render-target handle for this batch.

Definition at line 307 of file OpenGLBackend.ixx.

307 void endRenderTargetBatch(const RenderTargetHandle renderTargetHandle) noexcept {
308
309 currentRenderTargetHandle_ = RenderTargetHandle{};
310 passUniformValueBag_.clearValues();
311 }

endShaderBatch()

void helios::opengl::OpenGLBackend::endShaderBatch (ShaderHandle handle)
inline noexcept

Ends processing for one shader batch.

Parameters
handle

Shader handle for this batch.

Definition at line 406 of file OpenGLBackend.ixx.

406 void endShaderBatch(ShaderHandle handle) noexcept {
407 currentShaderHandle_ = ShaderHandle{};
408 }

endViewportBatch()

void helios::opengl::OpenGLBackend::endViewportBatch (const ViewportHandle viewportHandle)
inline noexcept

Ends processing for one viewport batch.

Parameters
viewportHandle

Viewport handle for this batch.

Definition at line 368 of file OpenGLBackend.ixx.

368 void endViewportBatch(const ViewportHandle viewportHandle) noexcept {
369 glDisable(GL_SCISSOR_TEST);
370 }

init()

bool helios::opengl::OpenGLBackend::init ()
inline noexcept

Initializes OpenGL function pointers through GLFW.

Precondition

A valid, current OpenGL context exists on the calling thread.

Postcondition

isInitialized() returns true on success.

Returns

true if loading succeeded, otherwise false.

Definition at line 592 of file OpenGLBackend.ixx.

592 [[nodiscard]] bool init() noexcept {
593
594 assert(!isInitialized_ && "Backend already initialized");
595
596 const GLADloadfunc procAddressLoader = glfwGetProcAddress;
597 const int gl_ver = gladLoadGL(procAddressLoader);
598
599 if (gl_ver == 0) {
600 logger_.error("Failed to load OpenGL");
601 assert(false && "Failed to load OpenGL");
602 return false;
603 }
604
605 logger_.info("OpenGL {0}.{1} loaded", GLAD_VERSION_MAJOR(gl_ver), GLAD_VERSION_MINOR(gl_ver));
606
607 isInitialized_ = true;
608 return true;
609
610 }

isInitialized()

bool helios::opengl::OpenGLBackend::isInitialized ()
inline noexcept

Reports whether OpenGL function loading completed successfully.

Definition at line 615 of file OpenGLBackend.ixx.

615 [[nodiscard]] bool isInitialized() const noexcept {
616 return isInitialized_;
617 }

provideWindowHints()

void helios::opengl::OpenGLBackend::provideWindowHints ()
inline noexcept

Applies window hints for an OpenGL core-profile context.

The backend currently requests OpenGL 4.1 core profile for macOS compatibility.

Definition at line 577 of file OpenGLBackend.ixx.

577 void provideWindowHints() noexcept {
578
579 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
580 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
581 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
582
583 }

renderBatch()

template <typename THandle>
void helios::opengl::OpenGLBackend::renderBatch (std::span< const SceneMemberRenderContext< THandle > > sceneMemberRenderContexts)
inline noexcept

Renders non-instanced draw contexts.

Iterates sceneMemberRenderContexts, updates draw-scope uniforms per context, and issues one indexed draw call per member.

Template Parameters
THandle

Scene member handle type contained in render contexts.

Parameters
sceneMemberRenderContexts

Non-instanced draw contexts.

Definition at line 492 of file OpenGLBackend.ixx.

492 void renderBatch(std::span<const SceneMemberRenderContext<THandle>> sceneMemberRenderContexts) noexcept {
493
494 if (!currentOpenGLMesh_) {
495 logger_.error("OpenGLMesh expected, but not available");
496 return;
497 }
498 if (!currentShaderHandle_.isValid()) {
499 logger_.error("Expected valid currentShaderHandle_, but found {0}.", currentShaderHandle_.entityId);
500 return;
501 }
502
503 const auto shaderEntity = engineWorld_.find(currentShaderHandle_);
504
505 assert(shaderEntity && "ShaderEntity expected, but not found");
506 assert(currentOpenGLMesh_ && "Current OpenGL mesh expected, but not found");
507
508 for (auto& renderContext : sceneMemberRenderContexts) {
509
510 drawUniformValueBag_.set<ModelMatrixUniform>(renderContext.worldMatrix);
511 writeUniformValues<UniformScope::Draw>(*shaderEntity, drawUniformValueBag_);
512 glDrawElements(
513 currentOpenGLMesh_->primitiveType,
514 currentOpenGLMesh_->indexCount,
515 GL_UNSIGNED_INT,
516 nullptr
517 );
518 }
519
520 drawUniformValueBag_.clearValues();
521 }

References helios::opengl::components::OpenGLMeshComponent< TOwnerHandle >::indexCount and helios::opengl::components::OpenGLMeshComponent< TOwnerHandle >::primitiveType.

renderBatch()

template <typename THandle>
void helios::opengl::OpenGLBackend::renderBatch (std::span< const InstanceData< THandle > > instanceData)
inline noexcept

Renders one instanced draw call for the provided instance payload.

Uploads instanceData to the active instance VBO and submits one glDrawElementsInstanced call. Returns early when the input span is empty.

Template Parameters
THandle

Scene member handle type used by InstanceData.

Parameters
instanceData

Per-instance payload for instanced rendering.

Definition at line 533 of file OpenGLBackend.ixx.

533 void renderBatch(std::span<const InstanceData<THandle>> instanceData) noexcept {
534
535 if (!currentOpenGLMesh_) {
536 logger_.error("OpenGLMesh expected, but not available");
537 return;
538 }
539
540 assert(currentOpenGLMesh_ && "Current OpenGL mesh expected, but not found");
541
542 const auto instanceSize = instanceData.size();
543
544 assert(instanceSize <= 1000000 && "Instance data size seems unreasonably large.");
545
546 if (instanceSize <= 0) {
547 return;
548 }
549
550 assert(currentOpenGLMesh_->instanceVbo && "Using instancing without configured instanceVbo");
551 glBindBuffer(GL_ARRAY_BUFFER, currentOpenGLMesh_->instanceVbo);
552
553 glBufferData(
554 GL_ARRAY_BUFFER,
555 instanceSize * sizeof(InstanceData<THandle>),
556 instanceData.data(),
557 GL_DYNAMIC_DRAW);
558
559
560 glDrawElementsInstanced(
561 currentOpenGLMesh_->primitiveType,
562 currentOpenGLMesh_->indexCount,
563 GL_UNSIGNED_INT,
564 nullptr,
565 instanceSize
566 );
567
568 glBindBuffer(GL_ARRAY_BUFFER, 0);
569 }

References helios::opengl::components::OpenGLMeshComponent< TOwnerHandle >::indexCount, helios::opengl::components::OpenGLMeshComponent< TOwnerHandle >::instanceVbo and helios::opengl::components::OpenGLMeshComponent< TOwnerHandle >::primitiveType.

Private Member Functions

clearColor()

template <typename THandle, typename TEntity>
void helios::opengl::OpenGLBackend::clearColor (TEntity & entity)
inline noexcept

Applies clear color and clear mask based on optional components.

Template Parameters
THandle

Handle type used for component lookup.

TEntity

Entity wrapper type exposing get<...>().

Parameters
entity

Entity to query for ColorComponent and ClearComponent.

Definition at line 216 of file OpenGLBackend.ixx.

216 void clearColor(TEntity& entity) noexcept {
217
218 auto* colorComp = entity->template get<ColorComponent<THandle>>();
219 auto* clearComp = entity->template get<ClearComponent<THandle>>();
220
221 if (colorComp) {
222 const auto clearColor = colorComp->value();
223 glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
224 }
225
226 if (clearComp) {
227 const auto clearFlags = std::to_underlying(clearComp->flags);
228 const auto clearMask = ((clearFlags & std::to_underlying(ClearFlags::Color)) ? GL_COLOR_BUFFER_BIT : 0) |
229 ((clearFlags & std::to_underlying(ClearFlags::Depth)) ? GL_DEPTH_BUFFER_BIT : 0) |
230 ((clearFlags & std::to_underlying(ClearFlags::Stencil)) ? GL_STENCIL_BUFFER_BIT : 0);
231
232 if (clearMask != 0) {
233 glClear(clearMask);
234 }
235 }
236 }

viewProjection()

std::optional< ViewProjection > helios::opengl::OpenGLBackend::viewProjection (const ViewportEntity & viewportEntity)
inline noexcept

Resolves view and projection matrices for a viewport's bound camera.

Parameters
viewportEntity

Viewport entity used to resolve camera bindings.

Returns

View/projection pair on success, otherwise std::nullopt.

Definition at line 150 of file OpenGLBackend.ixx.

150 [[nodiscard]] std::optional<ViewProjection> viewProjection(const ViewportEntity& viewportEntity) const noexcept {
151
152 auto* cbc = viewportEntity.get<CameraBindingComponent<ViewportHandle>>();
153 if (!cbc) {
154 logger_.error("Expected CameraBindingComponent on ViewportEntity, but couldn't find any.");
155 return std::nullopt;
156 }
157 auto camera = engineWorld_.find(cbc->targetHandle());
158 if (!camera) {
159 logger_.error("Expected CameraEntity, but couldn't find any.");
160 return std::nullopt;
161 }
162 using CameraHandleType = std::remove_cvref_t<decltype(cbc->targetHandle())>;
163 auto* vm = camera->get<ViewMatrixComponent<CameraHandleType>>();
164 if (!vm) {
165 logger_.error("Expected ViewMatrixComponent, but couldn't find any.");
166 return std::nullopt;
167 }
168
169 auto* pm = camera->get<ProjectionMatrixComponent<CameraHandleType>>();
170 if (!pm) {
171 logger_.error("Expected ProjectionMatrixComponent, but couldn't find any.");
172 return std::nullopt;
173 }
174
175 return ViewProjection{
176 vm->value(), pm->value()
177 };
178
179 }

writeUniformValues()

template <typename TUniformScope>
void helios::opengl::OpenGLBackend::writeUniformValues (ShaderEntity shaderEntity, UniformValueBag< TUniformScope > & uniformValueBag)
inline noexcept

Uploads cached uniform values for a specific uniform scope.

Resolves OpenGLUniformWriteOperationsComponent<ShaderHandle, TUniformScope> on the shader entity and forwards its operation list plus values from UniformValueBag to OpenGLUniformWriter. If no write-plan component exists, the method logs an error and asserts in debug builds.

Template Parameters
TUniformScope

Uniform lifetime scope (for example pass or draw).

Parameters
shaderEntity

Shader entity holding location cache and shader data.

uniformValueBag

Source values to upload for this scope.

Definition at line 194 of file OpenGLBackend.ixx.

194 void writeUniformValues(ShaderEntity shaderEntity, UniformValueBag<TUniformScope>& uniformValueBag) noexcept {
195
197
198 if (!ulc) {
199 logger_.error("OpenGLUniformWriteOperationsComponent<{0}> expected, but not found", typeid(TUniformScope).name());
200 assert(false && "OpenGLUniformWriteOperationsComponent not found");
201 return;
202 }
203
204 OpenGLUniformWriter::write(ulc->operations, uniformValueBag);
205 }

Private Member Attributes

currentOpenGLMesh_

OpenGLMeshComponent<MeshHandle>* helios::opengl::OpenGLBackend::currentOpenGLMesh_ = nullptr

Cached pointer to the currently bound OpenGL mesh component.

Definition at line 103 of file OpenGLBackend.ixx.

103 OpenGLMeshComponent<MeshHandle>* currentOpenGLMesh_ = nullptr;

currentRenderTargetHandle_

RenderTargetHandle helios::opengl::OpenGLBackend::currentRenderTargetHandle_ {}

Currently active render target for nested viewport processing.

Definition at line 123 of file OpenGLBackend.ixx.

123 RenderTargetHandle currentRenderTargetHandle_{};

currentShaderHandle_

ShaderHandle helios::opengl::OpenGLBackend::currentShaderHandle_ {}

Currently bound shader to avoid redundant glUseProgram calls.

Definition at line 128 of file OpenGLBackend.ixx.

128 ShaderHandle currentShaderHandle_{};

drawUniformValueBag_

UniformValueBag<UniformScope::Draw> helios::opengl::OpenGLBackend::drawUniformValueBag_ {}

Cached draw-scope uniforms (for example model matrix).

Definition at line 113 of file OpenGLBackend.ixx.

113 UniformValueBag<UniformScope::Draw> drawUniformValueBag_{};

engineWorld_

EngineWorld& helios::opengl::OpenGLBackend::engineWorld_

Engine world used to resolve render entities and components.

Definition at line 134 of file OpenGLBackend.ixx.

134 EngineWorld& engineWorld_;

isInitialized_

bool helios::opengl::OpenGLBackend::isInitialized_ = false

Tracks whether GL function pointers were initialized.

Definition at line 91 of file OpenGLBackend.ixx.

91 bool isInitialized_ = false;

materialUniformValueBag_

UniformValueBag<UniformScope::Material> helios::opengl::OpenGLBackend::materialUniformValueBag_ {}

Cached material-scope uniforms (for example material color).

Definition at line 118 of file OpenGLBackend.ixx.

118 UniformValueBag<UniformScope::Material> materialUniformValueBag_{};

passUniformValueBag_

UniformValueBag<UniformScope::Pass> helios::opengl::OpenGLBackend::passUniformValueBag_ {}

Cached pass-scope uniforms (typically view/projection).

Definition at line 108 of file OpenGLBackend.ixx.

108 UniformValueBag<UniformScope::Pass> passUniformValueBag_{};

Private Static Attributes

logger_

const helios::engine::util::log::Logger& helios::opengl::OpenGLBackend::logger_
static

Scoped logger used for backend diagnostics.

Initialiser
= helios::engine::util::log::LogManager::loggerForScope( HELIOS_LOG_SCOPE )

Definition at line 96 of file OpenGLBackend.ixx.

96 inline static const helios::engine::util::log::Logger& logger_ = helios::engine::util::log::LogManager::loggerForScope(

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.