Mercurial > hg > forks > gldragon
changeset 16:c134a186912f
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 05 Nov 2019 09:06:12 +0200 |
parents | 2d2aadfa3df3 |
children | 0fa9302e324d |
files | glxdragon.cpp |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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 <vector> #include <cstdio> + /* 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<float> vertices; std::vector<unsigned> 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]); } }