37 lines
689 B
C++
37 lines
689 B
C++
#pragma once
|
|
|
|
#include "Renderable.h"
|
|
|
|
#include "MyShaderProgram.h"
|
|
|
|
class MyTriangle : public Renderable<MyShaderProgram::Vertex>
|
|
{
|
|
public:
|
|
MyTriangle();
|
|
~MyTriangle();
|
|
|
|
const VertexType* get_vertices() const override;
|
|
const unsigned int get_vertex_count() const override;
|
|
const IndexType* get_indices() const override;
|
|
const unsigned int get_index_count() const override;
|
|
|
|
protected:
|
|
GLuint gen_vbo() const override;
|
|
|
|
private:
|
|
const unsigned int m_vertex_count = 3;
|
|
const VertexType m_vertices[3] =
|
|
{
|
|
{ 0.0f, 0.5f, 0.0f },
|
|
{ 0.5f, -0.5f, 0.0f },
|
|
{ -0.5f, -0.5f, 0.0f },
|
|
};
|
|
|
|
const unsigned int m_index_count = 3;
|
|
const IndexType m_indices[3] =
|
|
{
|
|
0, 1, 2,
|
|
};
|
|
};
|
|
|