From ee9edf0b34600e68936e677163238f2f47367fae Mon Sep 17 00:00:00 2001 From: Diederick Niehorster 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1153 7f0cb862-5218-0410-a997-914c9d46530a --- src/fg_geometry.c | 183 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 117 insertions(+), 66 deletions(-) diff --git a/src/fg_geometry.c b/src/fg_geometry.c index 66659a4..f52e13f 100644 --- a/src/fg_geometry.c +++ b/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