encode icon texture coordinate in buffer so we can render all pois with 1 draw call

This commit is contained in:
Konstantin Käfer
2014-05-15 17:19:14 +02:00
parent 264bcd34d9
commit 27f8ed29e4
22 changed files with 120 additions and 253 deletions

View File

@@ -5,8 +5,14 @@
using namespace llmr;
void IconVertexBuffer::add(vertex_type x, vertex_type y) {
vertex_type *vertices = static_cast<vertex_type *>(addElement());
void IconVertexBuffer::add(vertex_type x, vertex_type y, uint16_t tx, uint16_t ty) {
void *data = addElement();
vertex_type *vertices = static_cast<vertex_type *>(data);
vertices[0] = x;
vertices[1] = y;
uint16_t *texture = static_cast<uint16_t *>(data);
texture[2] = tx;
texture[3] = ty;
}