13 const std::vector<IndexedRectangle>& rect,
14 const std::vector<IndexedRectangle>& tri) {
15 for (
auto& t : rect) {
17 verticesBuff.push_back(glm::vec3(vert.at(t.v1).x, vert.at(t.v1).y, vert.at(t.v1).z));
18 verticesBuff.push_back(glm::vec3(vert.at(t.v2).x, vert.at(t.v2).y, vert.at(t.v2).z));
19 verticesBuff.push_back(glm::vec3(vert.at(t.v3).x, vert.at(t.v3).y, vert.at(t.v3).z));
20 verticesBuff.push_back(glm::vec3(vert.at(t.v4).x, vert.at(t.v4).y, vert.at(t.v4).z));
26 verticesBuff.push_back(glm::vec3(vert.at(t.v1).x, vert.at(t.v1).y, vert.at(t.v1).z));
27 verticesBuff.push_back(glm::vec3(vert.at(t.v2).x, vert.at(t.v2).y, vert.at(t.v2).z));
28 verticesBuff.push_back(glm::vec3(vert.at(t.v3).x, vert.at(t.v3).y, vert.at(t.v3).z));
34 std::vector<unsigned short> ind;
35 std::vector<glm::vec3> vert;
36 std::vector<glm::vec2> uvBuff;
37 std::vector<unsigned int> tex;
42 for (
int x = 0; x < ((
indicesBuff.at(i) == 0) ? 4 : 3); x++) {
48 ind.push_back(vert.size());
51 tex.push_back(texture);
55 ind.push_back(ind.at(ind.size() - 4));
56 ind.push_back(ind.at(ind.size() - 3));
74 unsigned int indexStart = 0;
75 unsigned int indexPos = 1;
78 while ((indexStart != indexPos) && (indexPos <
indicesBuff.size())) {
84 std::vector<unsigned short> ind(
indicesBuff.begin() + indexStart,
90 indexStart = indexPos;
void bufferData(int elem, int size, void *data)
static TextureTile & getTile(int index)
std::vector< unsigned short > indicesBuff
static void drawGL(ShaderBuffer &vertices, ShaderBuffer &uvs, glm::vec4 color, unsigned int texture, TextureStorage store=TextureStorage::SYSTEM, unsigned int mode=GL_TRIANGLES, ShaderTexture *target=nullptr, Shader &shader=textShader)
#define assertEqual(x, y)
RoomMesh(const std::vector< RoomVertexTR2 > &vertices, const std::vector< IndexedRectangle > &rectangles, const std::vector< IndexedRectangle > &triangles)
void display(glm::mat4 MVP)
std::vector< glm::vec3 > verticesBuff
std::vector< unsigned int > texturesBuff