From: Diederick Niehorster Date: Fri, 16 Mar 2012 04:49:17 +0000 (+0000) Subject: now using one function to generate geometry from the lists of vertices, X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=5de2f0e3013d4906bf05343dee518929ef979bcc;p=freeglut now using one function to generate geometry from the lists of vertices, normals and vertex indices Geometry lists now stored in 1D arrays git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1149 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/fg_geometry.c b/src/fg_geometry.c index a1d683d..743909d 100644 --- a/src/fg_geometry.c +++ b/src/fg_geometry.c @@ -91,6 +91,35 @@ static void fghDrawGeometry(GLenum vertexMode, double* vertices, double* normals } } +static void fghGenerateGeometry(int numFaces, int numVertPerFace, GLdouble *vertices, GLubyte* vertIndices, GLdouble *normals, GLdouble *vertOut, GLdouble *normOut) +{ + int i,j; + /* + * Build array with vertices from vertex coordinates and vertex indices + * Do same for normals. + * Need to do this because of different normals at shared vertices + * (and because normals' coordinates need to be negated). + */ + for (i=0; i