charcoal/OpenGLEngine/BasicBatch.h

44 lines
1005 B
C
Raw Normal View History

#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;
};
}
}