/*
* Geometry functions, see freeglut_geometry.c
*/
-#ifndef GL_ES_VERSION_2_0
FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void );
FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void );
-#endif
-
FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, double offset[3], double scale );
FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, double offset[3], double scale );
-#ifndef GL_ES_VERSION_2_0
FGAPI void FGAPIENTRY glutWireCylinder( double radius, double height, GLint slices, GLint stacks);
FGAPI void FGAPIENTRY glutSolidCylinder( double radius, double height, GLint slices, GLint stacks);
-#endif
/*
* Extension functions, see freeglut_ext.c
FGAPI void FGAPIENTRY glutWireCube( double size );
FGAPI void FGAPIENTRY glutSolidCube( double size );
-#ifndef GL_ES_VERSION_2_0
FGAPI void FGAPIENTRY glutWireSphere( double radius, GLint slices, GLint stacks );
FGAPI void FGAPIENTRY glutSolidSphere( double radius, GLint slices, GLint stacks );
-#endif
-#ifndef EGL_VERSION_1_0
FGAPI void FGAPIENTRY glutWireCone( double base, double height, GLint slices, GLint stacks );
FGAPI void FGAPIENTRY glutSolidCone( double base, double height, GLint slices, GLint stacks );
-#endif
-
FGAPI void FGAPIENTRY glutWireTorus( double innerRadius, double outerRadius, GLint sides, GLint rings );
FGAPI void FGAPIENTRY glutSolidTorus( double innerRadius, double outerRadius, GLint sides, GLint rings );
FGAPI void FGAPIENTRY glutWireDodecahedron( void );
static GLboolean show_info = GL_TRUE;
static float ar;
static GLboolean persProject = GL_TRUE;
+static GLboolean animateXRot = GL_FALSE;
/*
* These one-liners draw particular objects, fetching appropriate
static void drawWireIcosahedron(void) { glutWireIcosahedron (); }
static void drawSolidSierpinskiSponge(void) { glutSolidSierpinskiSponge (depth, offset, orad);} /* orad doubles as size input */
static void drawWireSierpinskiSponge(void) { glutWireSierpinskiSponge (depth, offset, orad); } /* orad doubles as size input */
-static void drawSolidSphere(void) { glutSolidSphere(orad,slices,stacks); } /* orad doubles as size input */
-static void drawWireSphere(void) { glutWireSphere(orad,slices,stacks); } /* orad doubles as size input */
-#ifndef EGL_VERSION_1_0
static void drawSolidTorus(void) { glutSolidTorus(irad,orad,slices,stacks); }
static void drawWireTorus(void) { glutWireTorus (irad,orad,slices,stacks); }
+static void drawSolidSphere(void) { glutSolidSphere(orad,slices,stacks); } /* orad doubles as size input */
+static void drawWireSphere(void) { glutWireSphere(orad,slices,stacks); } /* orad doubles as size input */
static void drawSolidCone(void) { glutSolidCone(orad,orad,slices,stacks); } /* orad doubles as size input */
static void drawWireCone(void) { glutWireCone(orad,orad,slices,stacks); } /* orad doubles as size input */
static void drawSolidCylinder(void) { glutSolidCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */
static void drawWireCylinder(void) { glutWireCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */
-#endif
/*
* This structure defines an entry in our function-table.
#define ENTRY(e) {#e, drawSolid##e, drawWire##e}
static const entry table [] =
{
- ENTRY (Cube),
ENTRY (Tetrahedron),
+ ENTRY (Cube),
ENTRY (Octahedron),
ENTRY (Dodecahedron),
ENTRY (RhombicDodecahedron),
ENTRY (Icosahedron),
ENTRY (SierpinskiSponge),
+ /* ENTRY (Teapot), */
+ ENTRY (Torus),
ENTRY (Sphere),
+ ENTRY (Cone),
+ ENTRY (Cylinder),
+ /* ENTRY (Cuboctahedron) */
};
#undef ENTRY
{
const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
const double a = t*90.0;
+ const double b = (animateXRot?t:1)*60.0;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glPushMatrix();
glTranslated(0,1.2,-6);
- glRotated(60,1,0,0);
+ glRotated(b,1,0,0);
glRotated(a,0,0,1);
table [function_index].solid ();
glPopMatrix();
glPushMatrix();
glTranslated(0,-1.2,-6);
- glRotated(60,1,0,0);
+ glRotated(b,1,0,0);
glRotated(a,0,0,1);
table [function_index].wire ();
glPopMatrix();
case 'P':
case 'p': persProject=!persProject; break;
+ case 'R':
+ case 'r': animateXRot=!animateXRot; break;
+
default:
break;
}
static void
onMouseClick(int button, int state, int x, int y) {
if (state == GLUT_DOWN)
- special(GLUT_KEY_PAGE_DOWN, 0, 0);
+ special(GLUT_KEY_PAGE_UP, 0, 0);
}
const GLfloat light_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
CHECK_NAME(glutStrokeWidth);
CHECK_NAME(glutBitmapLength);
CHECK_NAME(glutStrokeLength);
-#ifndef GL_ES_VERSION_2_0
CHECK_NAME(glutWireSphere);
CHECK_NAME(glutSolidSphere);
-#endif
-#ifndef EGL_VERSION_1_0
CHECK_NAME(glutWireCone);
CHECK_NAME(glutSolidCone);
CHECK_NAME(glutWireTorus);
CHECK_NAME(glutSolidTorus);
CHECK_NAME(glutWireCylinder);
CHECK_NAME(glutSolidCylinder);
+#ifndef EGL_VERSION_1_0
CHECK_NAME(glutWireTeapot);
CHECK_NAME(glutSolidTeapot);
#endif
CHECK_NAME(glutSolidTetrahedron);
CHECK_NAME(glutWireIcosahedron);
CHECK_NAME(glutSolidIcosahedron);
-#ifndef EGL_VERSION_1_0
CHECK_NAME(glutWireRhombicDodecahedron);
CHECK_NAME(glutSolidRhombicDodecahedron);
-#endif
CHECK_NAME(glutWireSierpinskiSponge);
CHECK_NAME(glutSolidSierpinskiSponge);
CHECK_NAME(glutVideoResizeGet);
}
}
-#ifndef GL_ES_VERSION_2_0
/* -- Now the various shapes involving circles -- */
/*
* Compute lookup table of cos and sin values forming a circle
free(sphi);
free(cphi);
}
-#endif
/* -- INTERNAL DRAWING functions --------------------------------------- */
#define _DECLARE_INTERNAL_DRAW_DO_DECLARE(name,nameICaps,nameCaps,vertIdxs)\
}
-#ifndef GL_ES_VERSION_2_0
static void fghSphere( double radius, GLint slices, GLint stacks, GLboolean useWireMode )
{
int i,j,idx, nVert;
fghSphere( radius, slices, stacks, TRUE );
}
-#endif /* GL_ES_VERSION_2_0 */
-#ifndef EGL_VERSION_1_0
/*
* Draws a solid cone
*/
fghTorus(dInnerRadius, dOuterRadius, nSides, nRings, FALSE);
}
-#endif /* EGL_VERSION_1_0 */