14#include <unordered_map>
43 [[nodiscard]] std::string
getName()
const override {
return "OpenGL"; }
51 gl.ClearColor(color.
r, color.
g, color.
b, color.
a);
60 void createMesh(
const std::vector<float> &vertices)
override;
This file contains the Renderer abstract class.
This file contains the IContext interface.
Abstract class for renderer.
Class for the OpenGL plugin.
utl::PluginType getType() const override
Get the type of the plugin.
std::unordered_map< ShaderID, GLuint > m_programs
void initialize(const NativeWindowHandle &nativeWindowHandle, const Color &clearColor) override
Initialize the renderer with a native window handle and clear color.
std::string getName() const override
Get the name of the plugin.
OPGL & operator=(const OPGL &)=delete
utl::PluginPlatform getPlatform() const override
Get the handled platform of the plugin.
static GLuint createGLShader(GLenum type, const ShaderIRModule &data, const GladGLContext &gl)
void draw(const WindowSize &windowSize, const ShaderID &shaderId, glm::mat4 mvp) override
Draw the scene using the specified shader and window size.
void setVSyncEnabled(const bool enabled) override
Enable or disable VSync.
OPGL & operator=(OPGL &&)=delete
OPGL(const OPGL &)=delete
bool isVSyncEnabled() const override
Check if VSync is enabled.
void createMesh(const std::vector< float > &vertices) override
Create a mesh with the given vertex data.
std::unique_ptr< IContext > m_context
void setClearColor(const Color &color) override
Set the clear color.
void createPipeline(const ShaderID &id, const ShaderIRModule &vertex, const ShaderIRModule &fragment) override
Create a rendering pipeline with vertex and fragment shaders.
Struct for native window handle.
Struct for shader intermediate representation module.