3485bcb2a0
Now batches are actually batches. Also added the MeshFactory class. Drawing modes are now specified with DrawMode instead of the GLenum. Renderables must be specified with a draw mode.
38 lines
668 B
C++
38 lines
668 B
C++
#pragma once
|
|
|
|
#include "ShaderProgram.h"
|
|
#include "Shader.h"
|
|
#include "Mesh.h"
|
|
#include "Renderable.h"
|
|
|
|
class MyShaderProgram : public ShaderProgram
|
|
{
|
|
public:
|
|
struct VertexType
|
|
{
|
|
VertexType() {}
|
|
VertexType(float x, float y, float z)
|
|
: x(x), y(y), z(z)
|
|
{
|
|
}
|
|
float x;
|
|
float y;
|
|
float z;
|
|
};
|
|
struct ColorType // Try changing to normalized unsigned chars (0-255) for the example
|
|
{
|
|
float r;
|
|
float g;
|
|
float b;
|
|
float a;
|
|
};
|
|
typedef unsigned int IndexType;
|
|
typedef Renderable<VertexType, IndexType> RenderableType;
|
|
typedef Mesh<VertexType, IndexType> MeshType;
|
|
|
|
MyShaderProgram();
|
|
|
|
private:
|
|
Shader m_vertex_shader;
|
|
Shader m_fragment_shader;
|
|
}; |