charcoal/OpenGLEngine/Renderable.h

33 lines
646 B
C
Raw Permalink Normal View History

2018-09-05 06:49:02 +00:00
#pragma once
2018-10-10 21:44:15 +00:00
#include "deps.h"
2018-09-05 06:49:02 +00:00
#include <type_traits>
2018-09-05 06:49:02 +00:00
#include "Mesh.h"
#include "DrawMode.h"
#include "Batch.h"
2018-09-05 06:49:02 +00:00
2018-09-12 21:03:46 +00:00
namespace charcoal
2018-09-05 06:49:02 +00:00
{
2018-09-12 21:03:46 +00:00
template <typename VertexType, typename IndexType>
2018-09-19 07:52:42 +00:00
class RenderableT
2018-09-12 21:03:46 +00:00
{
public:
typedef VertexType VertexType;
typedef IndexType IndexType;
typedef Mesh<VertexType, IndexType> MeshType;
2018-09-19 07:52:42 +00:00
RenderableT(const MeshType* mesh, const DrawMode& draw_mode)
2018-09-12 21:03:46 +00:00
: 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;
};
}