0a9fde252a
The trapezoid now throbs between black and white. This was made to test out the element buffers using MyBatch. Next up for the batches should probably be to figure out the recommended way of specifying more than one element buffer. Currently it is done by specifying the number of elements to be stored and the number of element vbos needed but maybe there is some way to get it to work using variadic templates. There is a comment about this in the Batch.h file.
38 lines
684 B
C++
38 lines
684 B
C++
#pragma once
|
|
|
|
#include "ShaderProgram.h"
|
|
#include "Shader.h"
|
|
#include "Mesh.h"
|
|
#include "Renderable.h"
|
|
|
|
class MyBatchTestShaderProgram : 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;
|
|
|
|
MyBatchTestShaderProgram();
|
|
|
|
private:
|
|
Shader m_vertex_shader;
|
|
Shader m_fragment_shader;
|
|
};
|