98c6d3868c
Still need to allow for adding lights!
36 lines
907 B
C++
36 lines
907 B
C++
#pragma once
|
|
|
|
#include "LitTypes.h"
|
|
#include "PoseableBatch.h"
|
|
|
|
namespace charcoal
|
|
{
|
|
namespace builtin
|
|
{
|
|
namespace lit
|
|
{
|
|
class Batch : public PoseableBatch<Vertex, Index, 3>
|
|
{
|
|
public:
|
|
using PoseableBatch<Vertex, Index, 3>::PoseableBatch;
|
|
protected:
|
|
void setup_vao_vertex() override
|
|
{
|
|
glBindBuffer(GL_ARRAY_BUFFER, m_vertex_vbo);
|
|
|
|
glEnableVertexAttribArray(0);
|
|
glEnableVertexAttribArray(1);
|
|
glEnableVertexAttribArray(2);
|
|
|
|
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex, position));
|
|
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex, normal));
|
|
glVertexAttribPointer(2, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offsetof(Vertex, material));
|
|
|
|
glVertexAttribDivisor(0, 0);
|
|
glVertexAttribDivisor(1, 0);
|
|
glVertexAttribDivisor(2, 0);
|
|
}
|
|
};
|
|
}
|
|
}
|
|
} |