charcoal/OpenGLEngine/BasicBatch.h
elipzer d63f341d89 More builtin abstraction
Got the builtin basicscene to render. For some reason, it seems
like the model matrices are not working correctly. The two shapes
that are supposed to be rendering on screen are not moving around
as they should be.
2018-09-13 19:21:34 -04:00

44 lines
1005 B
C++

#pragma once
#include <vector>
#include "MeshTypes.h"
#include "BuiltinBatch.h"
#include "Poseable.h"
namespace charcoal
{
namespace builtin
{
// TODO: Consider namespacing basic
class BasicBatch : public Batch<BasicVertex, Index, 1>
{
public:
BasicBatch(
BasicRenderable* renderable,
const SizeType& element_count
) : BasicBatch(renderable, element_count, element_count) {}
BasicBatch(
BasicRenderable* renderable,
const SizeType& element_count,
const SizeType& element_render_count
) : Batch(renderable, element_render_count), m_pose_elements(element_count) {}
virtual ~BasicBatch() {}
Poseable& get_pose(const SizeType& index) { return m_pose_elements[index]; }
const Poseable& get_pose(const SizeType& index) const { return m_pose_elements[index]; }
protected:
void setup_element_buffers() override;
void setup_vao() override;
void update_element_buffers() override;
private:
std::vector<Poseable> m_pose_elements;
};
}
}