charcoal/OpenGLEngine/Renderable.h

30 lines
613 B
C
Raw Normal View History

2018-09-05 06:49:02 +00:00
#pragma once
#include "stdafx.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
template <typename VertexType, typename IndexType>
class Renderable final
2018-09-05 06:49:02 +00:00
{
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) {}
2018-09-05 06:49:02 +00:00
const MeshType* get_mesh() const { return m_p_mesh; }
2018-09-05 06:49:02 +00:00
const DrawMode& get_draw_mode() const { return m_draw_mode; }
2018-09-05 06:49:02 +00:00
private:
const MeshType* m_p_mesh = nullptr;
DrawMode m_draw_mode;
};