OpenGLMeshRenderer.ixx File
OpenGL implementation of the MeshRenderer interface for rendering mesh geometry. More...
Included Headers
#include <cassert>
#include <glad/gl.h>
#include <ostream>
#include <ranges>
#include <helios.ext.opengl.rendering.model>
#include <helios.ext.opengl.rendering.shader>
#include <helios.ext.opengl.rendering.OpenGLEnumMapper>
#include <helios.rendering>
Namespaces Index
| namespace | helios |
| namespace | ext |
|
Platform-specific extensions and backend implementations. More... | |
| namespace | opengl |
|
OpenGL-specific implementations. More... | |
| namespace | rendering |
|
OpenGL rendering implementations. More... | |
Classes Index
| class | OpenGLMeshRenderer |
|
OpenGL implementation of the MeshRenderer interface. More... | |
Description
OpenGL implementation of the MeshRenderer interface for rendering mesh geometry.
File Listing
The file content with the documentation metadata removed is:
22export namespace helios::ext::opengl::rendering {
60 class OpenGLMeshRenderer : public helios::rendering::mesh::MeshRenderer {
64 friend class OpenGLDevice;
72 mutable const helios::ext::opengl::rendering::shader::OpenGLShader* lastShader_ = nullptr;
100 void beginRenderPass(helios::rendering::RenderPass& renderPass) const noexcept {
116 ~OpenGLMeshRenderer() override {
144 const helios::rendering::mesh::MeshRenderCommand& command,
145 const helios::rendering::shader::UniformValueMap& frameUniformValues) noexcept {
151 const auto* shader = static_cast<const helios::ext::opengl::rendering::shader::OpenGLShader*>(&baseShader);
152 assert(shader && "Unexpected failure when casting to OpenGLShader.");
154 if (shader != lastShader_) {
155 shader->use();
156 lastShader_ = shader;
159 shader->applyUniformValues(frameUniformValues);
160 shader->applyUniformValues(command.objectUniformValues());
161 shader->applyUniformValues(command.materialUniformValues());
163 const auto* mesh = static_cast<const helios::ext::opengl::rendering::model::OpenGLMesh*>(&baseMesh);
173 glDrawElements(helios::ext::opengl::rendering::OpenGLEnumMapper::toOpenGL(primitiveType), mesh->indexCount(), GL_UNSIGNED_INT, nullptr);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.