#include "config.h"
#endif
-#define G_LOG_DOMAIN "freeglut-geometry"
-
#include "../include/GL/freeglut.h"
#include "freeglut_internal.h"
/*
* Allocate the vertices array
*/
- vertex = calloc( sizeof(double), 3 * slices * (stacks - 1) );
+ vertex = (double *)calloc( sizeof(double), 3 * slices * (stacks - 1) );
glPushMatrix();
glScaled( radius, radius, radius );
glPushMatrix();
/* glScalef( radius, radius, radius ); */
- row = calloc( sizeof(double), slices * 3 );
- next = calloc( sizeof(double), slices * 3 );
+ row = (double *)calloc( sizeof(double), slices * 3 );
+ next = (double *)calloc( sizeof(double), slices * 3 );
dpsi = M_PI / (stacks + 1);
dphi = 2 * M_PI / slices;
glVertex3d(
radius * *(row + 3 * i + 0),
radius * *(row + 3 * i + 1),
- radius * *(row + 3 * i + 2)
- );
-
+ radius * *(row + 3 * i + 2)
+ );
+
phi += dphi;
}
glVertex3d(
radius * *(row + 3 * i + 0),
radius * *(row + 3 * i + 1),
- radius * *(row + 3 * i + 2)
- );
+ radius * *(row + 3 * i + 2)
+ );
glNormal3dv( next + i * 3 );
glVertex3d(
glVertex3d(
radius * *(row + 3 * i + 0),
radius * *(row + 3 * i + 1),
- radius * *(row + 3 * i + 2)
- );
+ radius * *(row + 3 * i + 2)
+ );
}
glEnd();
/*
* We need 'slices' points on a circle
*/
- vertices = calloc( sizeof(double), 2 * (slices + 1) );
+ vertices = (double *)calloc( sizeof(double), 2 * (slices + 1) );
for( j=0; j<slices+1; j++ )
{
/*
* We need 'slices' points on a circle
*/
- vertices = calloc( sizeof(double), 2 * (slices + 1) );
+ vertices = (double *)calloc( sizeof(double), 2 * (slices + 1) );
for( j=0; j<slices+1; j++ )
{
/*
* Allocate the vertices array
*/
- vertex = calloc( sizeof(double), 3 * nSides * nRings );
- normal = calloc( sizeof(double), 3 * nSides * nRings );
+ vertex = (double *)calloc( sizeof(double), 3 * nSides * nRings );
+ normal = (double *)calloc( sizeof(double), 3 * nSides * nRings );
glPushMatrix();
/*
* Allocate the vertices array
*/
- vertex = calloc( sizeof(double), 3 * nSides * nRings );
- normal = calloc( sizeof(double), 3 * nSides * nRings );
+ vertex = (double *)calloc( sizeof(double), 3 * nSides * nRings );
+ normal = (double *)calloc( sizeof(double), 3 * nSides * nRings );
glPushMatrix();