# HG changeset patch # User Matti Hamalainen # Date 1572937572 -7200 # Node ID c134a186912fe214cc32d96c3e8418556f470fe0 # Parent 2d2aadfa3df35f18e6bb2a926edf7020c3442d6b Cosmetics. diff -r 2d2aadfa3df3 -r c134a186912f glxdragon.cpp --- a/glxdragon.cpp Tue Oct 29 12:51:25 2019 +0200 +++ b/glxdragon.cpp Tue Nov 05 09:06:12 2019 +0200 @@ -39,11 +39,12 @@ #include #include + /* Default settings etc. constants */ -#define SET_DEF_WIDTH 1280 -#define SET_DEF_HEIGHT 960 -#define SET_FRAMES (180) +#define SET_DEF_WIDTH 1280 +#define SET_DEF_HEIGHT 960 +#define SET_FRAMES (180) /* Structures @@ -51,6 +52,7 @@ struct Mesh { int nvertices, nfaces; + std::vector vertices; std::vector faces; @@ -199,12 +201,12 @@ glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &maxIndices); - glVertexPointer(3, GL_FLOAT, 24, &mesh.vertices[0]); - glNormalPointer(GL_FLOAT, 24, &mesh.vertices[3]); + glVertexPointer(3, GL_FLOAT, 3 * 4 * 2, &mesh.vertices[0]); + glNormalPointer( GL_FLOAT, 3 * 4 * 2, &mesh.vertices[3]); for (int n = 0; n < mesh.nfaces; n += maxIndices) { - const int count = std::min(maxIndices, int(mesh.nfaces - n)); + const int count = std::min(maxIndices, mesh.nfaces - n); glDrawElements(GL_TRIANGLES, count * 3, GL_UNSIGNED_INT, &mesh.faces[n * 3]); } }