Class for the OpenGL plugin. More...
#include <OPGL.hpp>
Inheritance diagram for cae::OPGL:
Collaboration diagram for cae::OPGL:Public Member Functions | |
| OPGL ()=default | |
| ~OPGL () override=default | |
| OPGL (const OPGL &)=delete | |
| OPGL & | operator= (const OPGL &)=delete |
| OPGL (OPGL &&)=delete | |
| OPGL & | operator= (OPGL &&)=delete |
| std::string | getName () const override |
| Get the name of the plugin. | |
| utl::PluginType | getType () const override |
| Get the type of the plugin. | |
| utl::PluginPlatform | getPlatform () const override |
| Get the handled platform of the plugin. | |
| void | setVSyncEnabled (const bool enabled) override |
| Enable or disable VSync. | |
| void | setClearColor (const Color &color) override |
| Set the clear color. | |
| bool | isVSyncEnabled () const override |
| Check if VSync is enabled. | |
| void | initialize (const NativeWindowHandle &nativeWindowHandle, const Color &clearColor) override |
| Initialize the renderer with a native window handle and clear color. | |
| void | createPipeline (const ShaderID &id, const ShaderIRModule &vertex, const ShaderIRModule &fragment) override |
| Create a rendering pipeline with vertex and fragment shaders. | |
| void | draw (const WindowSize &windowSize, const ShaderID &shaderId, glm::mat4 mvp) override |
| Draw the scene using the specified shader and window size. | |
| void | createMesh (const std::vector< float > &vertices) override |
| Create a mesh with the given vertex data. | |
Public Member Functions inherited from cae::ARenderer | |
| ~ARenderer () override=default | |
Public Member Functions inherited from cae::IRenderer | |
| ~IRenderer () override=default | |
Public Member Functions inherited from utl::IPlugin | |
| virtual | ~IPlugin ()=default |
Static Private Member Functions | |
| static GLuint | createGLShader (GLenum type, const ShaderIRModule &data, const GladGLContext &gl) |
Private Attributes | |
| std::unique_ptr< IContext > | m_context |
| std::unordered_map< ShaderID, GLuint > | m_programs |
| Mesh | m_mesh |
| GLuint | m_ubo |
|
default |
|
overridedefault |
|
delete |
|
delete |
|
staticprivate |
Definition at line 108 of file opgl.cpp.
References cae::ShaderIRModule::entryPoint, and cae::ShaderIRModule::spirv.
|
overridevirtual |
Create a mesh with the given vertex data.
| vertices | Vertex data to create the mesh |
Implements cae::IRenderer.
Definition at line 83 of file opgl.cpp.
References cae::Mesh::vertexCount.
|
overridevirtual |
Create a rendering pipeline with vertex and fragment shaders.
| id | Shader ID |
| vertex | Vertex shader IR module |
| fragment | Fragment shader IR module |
Implements cae::IRenderer.
|
overridevirtual |
Draw the scene using the specified shader and window size.
| windowSize | Current window size |
| shaderId | Shader ID to use for drawing |
| mvp | Model-View-Projection matrix |
Implements cae::IRenderer.
Definition at line 38 of file opgl.cpp.
References cae::WindowSize::height, and cae::WindowSize::width.
|
inlinenodiscardoverridevirtual |
|
inlinenodiscardoverridevirtual |
Get the handled platform of the plugin.
Implements utl::IPlugin.
Definition at line 45 of file OPGL.hpp.
References utl::ALL.
|
inlinenodiscardoverridevirtual |
Get the type of the plugin.
Implements utl::IPlugin.
Definition at line 44 of file OPGL.hpp.
References utl::RENDERER.
|
overridevirtual |
Initialize the renderer with a native window handle and clear color.
| nativeWindowHandle | Native window handle |
| clearColor | Clear color (default: white) |
Implements cae::IRenderer.
Definition at line 15 of file opgl.cpp.
References cae::Color::a, cae::Color::b, cae::Color::g, m_context, m_ubo, and cae::Color::r.
|
inlinenodiscardoverridevirtual |
Check if VSync is enabled.
Implements cae::IRenderer.
Definition at line 54 of file OPGL.hpp.
References m_context.
|
inlineoverridevirtual |
Set the clear color.
| color | Clear color to set |
Implements cae::IRenderer.
Definition at line 48 of file OPGL.hpp.
References cae::Color::a, cae::Color::b, cae::Color::g, m_context, and cae::Color::r.
|
inlineoverridevirtual |
Enable or disable VSync.
| enabled | Whether VSync is enabled |
Implements cae::IRenderer.
Definition at line 47 of file OPGL.hpp.
References m_context.
|
private |
Definition at line 63 of file OPGL.hpp.
Referenced by initialize(), isVSyncEnabled(), setClearColor(), and setVSyncEnabled().
|
private |
|
private |
Definition at line 67 of file OPGL.hpp.
Referenced by initialize().