Clean opengl rendering.
This commit is contained in:
parent
4849d83fcf
commit
798cb365d7
19 changed files with 483 additions and 274 deletions
27
src/graphics/opengl/OpenGlMeshPainter.h
Normal file
27
src/graphics/opengl/OpenGlMeshPainter.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class DrawingContext;
|
||||
class OpenGlShaderProgram;
|
||||
class TriMesh;
|
||||
|
||||
class OpenGlMeshPainter
|
||||
{
|
||||
public:
|
||||
OpenGlMeshPainter();
|
||||
|
||||
void paint(TriMesh* mesh, DrawingContext* context);
|
||||
|
||||
private:
|
||||
void initializeShader();
|
||||
void initializeBuffers();
|
||||
|
||||
void paint(const std::vector<float>& verts, const std::vector<unsigned>& elements, const std::vector<float>& color);
|
||||
|
||||
unsigned mVertexBuffer{0};
|
||||
unsigned mElementBuffer{0};
|
||||
unsigned mVertexArray{0};
|
||||
std::unique_ptr<OpenGlShaderProgram> mShaderProgram;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue