From 4f9c00faa753d09f004fd76fa4774ce80cecebda Mon Sep 17 00:00:00 2001 From: dcnieho Date: Fri, 16 Mar 2012 07:24:34 +0000 Subject: [PATCH] octahedron also done another pass at making all variable types consistent added some direct mode drawing code for debugging git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1153 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/fg_geometry.c | 183 ++++++++++++++++++---------- 1 file changed, 117 insertions(+), 66 deletions(-) diff --git a/freeglut/freeglut/src/fg_geometry.c b/freeglut/freeglut/src/fg_geometry.c index 66659a4..f52e13f 100644 --- a/freeglut/freeglut/src/fg_geometry.c +++ b/freeglut/freeglut/src/fg_geometry.c @@ -67,7 +67,7 @@ * useWireMode controls the drawing of solids (false) or wire frame * versions (TRUE) of the geometry you pass */ -static void fghDrawGeometry(GLenum vertexMode, double* vertices, double* normals, GLsizei numVertices, GLboolean useWireMode) +static void fghDrawGeometry(GLenum vertexMode, GLdouble* vertices, GLdouble* normals, GLsizei numVertices, GLboolean useWireMode) { if (useWireMode) { @@ -75,15 +75,31 @@ static void fghDrawGeometry(GLenum vertexMode, double* vertices, double* normals glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); } - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); + if (1) + { + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); - glVertexPointer(3, GL_DOUBLE, 0, vertices); - glNormalPointer(GL_DOUBLE, 0, normals); - glDrawArrays(vertexMode,0,numVertices); + glVertexPointer(3, GL_DOUBLE, 0, vertices); + glNormalPointer(GL_DOUBLE, 0, normals); + glDrawArrays(vertexMode, 0, numVertices); - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + } + else + { + int i; + glBegin(vertexMode); + for(i=0; i