minor changes and added namespace to avoid conflicts when integrating with PanoPainter

This commit is contained in:
2017-03-15 08:17:22 +00:00
parent ee6d352fc6
commit c34d1a1f44
16 changed files with 112 additions and 39 deletions

View File

@@ -1,6 +1,8 @@
#include "pch.h"
#include "shape.h"
using namespace ui;
bool Shape::create_buffers(GLvoid* idx, GLvoid* vertices, int isize, int vsize)
{
glGenBuffers(2, buffers);
@@ -46,6 +48,8 @@ void Shape::draw_fill() const
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (GLvoid*)0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (GLvoid*)offsetof(vertex_t, uvs));
glDrawElements(GL_TRIANGLES, count[0], GL_UNSIGNED_SHORT, ioff[0]);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
#endif // USE_VBO
@@ -64,6 +68,10 @@ void Shape::draw_stroke() const
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (GLvoid*)0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (GLvoid*)offsetof(vertex_t, uvs));
glDrawElements(GL_LINES, count[1], GL_UNSIGNED_SHORT, ioff[1]);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
#endif // USE_VBO
}