40 lines
675 B
C++
40 lines
675 B
C++
#include "MyTriangle.h"
|
|
|
|
MyTriangle::MyTriangle()
|
|
{
|
|
}
|
|
|
|
MyTriangle::~MyTriangle()
|
|
{
|
|
}
|
|
|
|
const MyTriangle::VertexType* MyTriangle::get_vertices() const
|
|
{
|
|
return m_vertices;
|
|
}
|
|
|
|
const unsigned int MyTriangle::get_vertex_count() const
|
|
{
|
|
return m_vertex_count;
|
|
}
|
|
|
|
const MyTriangle::IndexType* MyTriangle::get_indices() const
|
|
{
|
|
return m_indices;
|
|
}
|
|
|
|
const unsigned int MyTriangle::get_index_count() const
|
|
{
|
|
return m_index_count;
|
|
}
|
|
|
|
GLuint MyTriangle::gen_vbo() const
|
|
{
|
|
GLuint vbo;
|
|
glGenBuffers(1, &vbo);
|
|
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
|
glBufferData(GL_ARRAY_BUFFER, m_vertex_count * sizeof(VertexType), m_vertices, GL_STATIC_DRAW); // TODO: Optimise Usage
|
|
return vbo;
|
|
}
|
|
|