encode icon texture coordinate in buffer so we can render all pois with 1 draw call
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user