charcoal/OpenGLEngine/Renderable.h
elipzer 3485bcb2a0 Improved Batch Functionality
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.
2018-09-06 23:22:40 -04:00

30 lines
613 B
C++

#pragma once
#include "stdafx.h"
#include <type_traits>
#include "Mesh.h"
#include "DrawMode.h"
#include "Batch.h"
template <typename VertexType, typename IndexType>
class Renderable final
{
public:
typedef VertexType VertexType;
typedef IndexType IndexType;
typedef Mesh<VertexType, IndexType> MeshType;
Renderable(const MeshType* mesh, const DrawMode& draw_mode)
: m_p_mesh(mesh), m_draw_mode(draw_mode) {}
const MeshType* get_mesh() const { return m_p_mesh; }
const DrawMode& get_draw_mode() const { return m_draw_mode; }
private:
const MeshType* m_p_mesh = nullptr;
DrawMode m_draw_mode;
};