56 const std::string &fragmentSource);
121 std::shared_ptr<ShaderProgram> m_defaultShaderProgram;
std::shared_ptr< Material > material
std::shared_ptr< Mesh > mesh
OpenGL 3.3 Core Profile abstraction layer.
const std::shared_ptr< ShaderProgram > & GetDefaultShaderProgram()
Returns the built-in default shader (Blinn-Phong + diffuse texture).
void BindShaderProgram(ShaderProgram *shaderProgram)
Bind a compiled shader program to the current GL state.
void ClearBuffers()
Clear the colour and depth buffers ready for the next frame.
void BindMaterial(Material *material)
Upload all material parameters as uniforms to the active shader.
void UnbindMesh(Mesh *mesh)
void DrawMesh(Mesh *mesh)
Issue a draw call for the bound mesh.
void SetClearColor(float r, float g, float b, float a)
Set the colour that glClear() fills the framebuffer with.
std::shared_ptr< ShaderProgram > CreateShaderProgram(const std::string &vertexSource, const std::string &fragmentSource)
Compile vertex + fragment GLSL source and link into a program.
GLuint CreateIndexBuffer(const std::vector< uint32_t > &indices)
Upload a flat array of u32 indices to a new GPU index buffer.
bool Init()
Set up initial OpenGL state (depth test, face culling, etc.).
GLuint CreateVertexBuffer(const std::vector< float > &vertices)
Upload a flat array of floats to a new GPU vertex buffer.
void BindMesh(Mesh *mesh)
Bind the mesh's VAO so the next draw call uses its geometry.
Shader + uniform storage that defines how a surface is rendered.
Immutable GPU mesh (VAO + VBO + optional EBO).
Linked GLSL program with cached uniform locations.