diff options
author | Gareth Hughes <[email protected]> | 2000-10-27 02:49:17 +0000 |
---|---|---|
committer | Gareth Hughes <[email protected]> | 2000-10-27 02:49:17 +0000 |
commit | ba58a6665f21319a636ec4c09f7f592fbc8e36b5 (patch) | |
tree | bd30cc32f1a96d40b930cc2807763820c535d783 /progs/samples/sphere.c | |
parent | b4df56fcd9e8e7ac8d9f585daf90ac2f246fa508 (diff) |
Change animated apps to double-buffered visuals by default.
Diffstat (limited to 'progs/samples/sphere.c')
-rw-r--r-- | progs/samples/sphere.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/progs/samples/sphere.c b/progs/samples/sphere.c index 154e85cbecc..a2d3e43ee28 100644 --- a/progs/samples/sphere.c +++ b/progs/samples/sphere.c @@ -85,7 +85,7 @@ float c[6][4][4][3] = { { { 1.0, 1.0, -1.0 - }, + }, { 0.0, 1.0, -1.0 }, @@ -102,10 +102,10 @@ float c[6][4][4][3] = { }, { -1.0, 1.0, -1.0 - }, + }, { -1.0, 0.0, -1.0 - }, + }, { 0.0, 0.0, -1.0 }, @@ -269,7 +269,7 @@ float c[6][4][4][3] = { { -1.0, 0.0, -1.0 }, - }, + }, { { -1.0, 1.0, 0.0 @@ -283,7 +283,7 @@ float c[6][4][4][3] = { { -1.0, 0.0, 0.0 }, - }, + }, { { -1.0, 0.0, 1.0 @@ -297,7 +297,7 @@ float c[6][4][4][3] = { { -1.0, 0.0, 0.0 }, - }, + }, { { -1.0, -1.0, 0.0 @@ -311,7 +311,7 @@ float c[6][4][4][3] = { { -1.0, 0.0, 0.0 }, - }, + }, }, { { @@ -463,8 +463,8 @@ GLfloat identity[16] = { void BuildCylinder(int numEdges) { int i, top = 1.0, bottom = -1.0; - float x[100], y[100], angle; - + float x[100], y[100], angle; + for (i = 0; i <= numEdges; i++) { angle = i * 2.0 * PI / numEdges; x[i] = cos(angle); /* was cosf() */ @@ -505,7 +505,7 @@ void BuildTorus(float rc, int numc, float rt, int numt) pi = 3.14159265358979323846; twopi = 2.0 * pi; - + glNewList(torus, GL_COMPILE); for (i = 0; i < numc; i++) { glBegin(GL_QUAD_STRIP); @@ -542,7 +542,7 @@ void BuildCage(void) left = -4.0; bottom = -4.0; right = 4.0; - top = 4.0; + top = 4.0; inc = 2.0 * 4.0 * 0.1; @@ -631,7 +631,7 @@ void BuildCube(void) glNewList(cube, GL_COMPILE); for (i = 0; i < 6; i++) { for (j = 0; j < 4; j++) { - glNormal3fv(n[i]); + glNormal3fv(n[i]); glBegin(GL_POLYGON); glVertex3fv(c[i][j][0]); glVertex3fv(c[i][j][1]); @@ -670,7 +670,7 @@ void SetDeepestColor(void) glGetIntegerv(GL_BLUE_BITS, &blueBits); deepestColor = (redBits >= greenBits) ? COLOR_RED : COLOR_GREEN; - deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE; + deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE; } void SetDefaultSettings(void) @@ -726,17 +726,17 @@ void Init(void) image->data = AlphaPadImage(image->sizeX*image->sizeY, image->data, 128); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents, - image->sizeX, image->sizeY, + gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents, + image->sizeX, image->sizeY, GL_RGBA, GL_UNSIGNED_BYTE, image->data); } else { image = LoadPPM(imageFileName); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents, - image->sizeX, image->sizeY, + gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents, + image->sizeX, image->sizeY, GL_RGB, GL_UNSIGNED_BYTE, image->data); } - + glFogf(GL_FOG_DENSITY, 0.125); glFogi(GL_FOG_MODE, GL_LINEAR); glFogf(GL_FOG_START, 4.0); @@ -747,7 +747,7 @@ void Init(void) glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, specular); glLightfv(GL_LIGHT0, GL_POSITION, position); - + glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); @@ -845,7 +845,7 @@ void Draw(void) if (autoRotate) { xRotation += .75; yRotation += .375; - } + } glutSwapBuffers(); } @@ -964,7 +964,7 @@ GLenum Args(int argc, char **argv) { GLint i; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; numComponents = 4; for (i = 1; i < argc; i++) { |