remove ui namespace which is not really used, move CameraData in camera_modes.h to avoid the inclusion of canva.h

This commit is contained in:
2018-11-27 14:24:01 +01:00
parent f34ffa825d
commit 0c6b409606
57 changed files with 538 additions and 597 deletions

View File

@@ -2,16 +2,14 @@
#include "log.h"
#include "shape.h"
using namespace ui;
bool ui::Shape::create_buffers(GLushort * idx, GLvoid * vertices, int isize, int vsize)
bool Shape::create_buffers(GLushort * idx, GLvoid * vertices, int isize, int vsize)
{
index_type = GL_UNSIGNED_SHORT;
create_buffers_imp(idx, vertices, isize, vsize);
return false;
}
bool ui::Shape::create_buffers(GLuint* idx, GLvoid * vertices, int isize, int vsize)
bool Shape::create_buffers(GLuint* idx, GLvoid * vertices, int isize, int vsize)
{
index_type = GL_UNSIGNED_INT;
create_buffers_imp(idx, vertices, isize, vsize);
@@ -239,7 +237,7 @@ void Plane::create_impl(float w, float h, int div, GLushort *idx, vertex_t *vert
}
}
bool ui::HeightmapPlane::create(float w, float h, const Image& img, float scale)
bool HeightmapPlane::create(float w, float h, const Image& img, float scale)
{
int div = img.width - 1; // TODO: handle height also
int idx_size = (div * div * 6) + (div * (div + 1) * 4);
@@ -313,7 +311,7 @@ bool ui::HeightmapPlane::create(float w, float h, const Image& img, float scale)
return create_buffers(idx.get(), vertices.get(), sizeof(GLuint) * idx_size, sizeof(vertex_t) * vertices_size);
}
void ui::Plane::update_vertices(const glm::vec4* data, const glm::vec2* uvs, const glm::vec2* uvs2)
void Plane::update_vertices(const glm::vec4* data, const glm::vec2* uvs, const glm::vec2* uvs2)
{
static vertex_t vertices[4];
@@ -605,7 +603,7 @@ void Sphere::create_impl(int rings, int sectors, float radius,
*i++ = (r+1) * sectors + s;
}
}
void ui::LineSegment::update_vertices(const glm::vec4 data[2])
void LineSegment::update_vertices(const glm::vec4 data[2])
{
static vertex_t vertices[2];
vertices[0] = { data[0], { 0, 0 } }; // A
@@ -614,7 +612,7 @@ void ui::LineSegment::update_vertices(const glm::vec4 data[2])
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void ui::DynamicShape::update_vertices(vertex_t* vertices, int vcount)
void DynamicShape::update_vertices(vertex_t* vertices, int vcount)
{
count[0] = vcount;
count[1] = vcount;