diff --git a/progs/samples/fog.c b/progs/samples/fog.c index 96534dddcb6..3f3ffdbcc7a 100644 --- a/progs/samples/fog.c +++ b/progs/samples/fog.c @@ -41,55 +41,55 @@ GLint cubeList = 1; float scp[18][3] = { { 1.000000, 0.000000, 0.000000 - }, + }, { 1.000000, 0.000000, 5.000000 }, { 0.707107, 0.707107, 0.000000 - }, + }, { 0.707107, 0.707107, 5.000000 }, { 0.000000, 1.000000, 0.000000 - }, + }, { 0.000000, 1.000000, 5.000000 }, { -0.707107, 0.707107, 0.000000 - }, + }, { -0.707107, 0.707107, 5.000000 }, { -1.000000, 0.000000, 0.000000 - }, + }, { -1.000000, 0.000000, 5.000000 }, { -0.707107, -0.707107, 0.000000 - }, + }, { -0.707107, -0.707107, 5.000000 }, { 0.000000, -1.000000, 0.000000 - }, + }, { 0.000000, -1.000000, 5.000000 }, { 0.707107, -0.707107, 0.000000 - }, + }, { 0.707107, -0.707107, 5.000000 }, { 1.000000, 0.000000, 0.000000 - }, + }, { 1.000000, 0.000000, 5.000000 }, @@ -136,7 +136,7 @@ static void Init(void) static float back_mat_diffuse[] = {1.0, 0.0, 0.0, 1.0}; static float lmodel_ambient[] = {0.0, 0.0, 0.0, 1.0}; static float fog_color[] = {0.8, 0.8, 0.8, 1.0}; - + glFrontFace(GL_CW); glEnable(GL_DEPTH_TEST); @@ -148,7 +148,7 @@ static void Init(void) glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); - + glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess); glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular); glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse); @@ -258,7 +258,7 @@ static GLenum Args(int argc, char **argv) GLint i; rgb = GL_TRUE; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-ci") == 0) { diff --git a/progs/samples/line.c b/progs/samples/line.c index 59e1d62192c..83f70cb3ac4 100644 --- a/progs/samples/line.c +++ b/progs/samples/line.c @@ -123,7 +123,7 @@ static void Draw(void) } else { glDisable(GL_LINE_STIPPLE); } - + if (mode2) { ci = CI_OFFSET; glEnable(GL_LINE_SMOOTH); @@ -170,7 +170,7 @@ static GLenum Args(int argc, char **argv) GLint i; rgb = GL_TRUE; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-ci") == 0) { diff --git a/progs/samples/olympic.c b/progs/samples/olympic.c index db72002c01a..d1cfa7250f5 100644 --- a/progs/samples/olympic.c +++ b/progs/samples/olympic.c @@ -26,7 +26,7 @@ * Nov 20, 1995 use stdlib's rand()/srand() instead of random()/srand48(), etc. */ -/* +/* * Modified by Li Wei(liwei@aiar.xjtu.edu.cn) to be able to run in Windows * 6/13 * @@ -83,7 +83,7 @@ void FillTorus(float rc, int numc, float rt, int numt) pi = 3.14159265358979323846; twopi = 2 * pi; - + for (i = 0; i < numc; i++) { glBegin(GL_QUAD_STRIP); for (j = 0; j <= numt; j++) { @@ -136,7 +136,7 @@ void DrawScene(void) } glPushMatrix(); - + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); gluLookAt(0,0,10, 0,0,0, 0,1,0); @@ -252,7 +252,7 @@ void Init(void) dests[GREENRING][1] = bottom_y; dests[GREENRING][2] = bottom_z; - base = 2.0; + base = 2.0; height = 2.0; theTorus = glGenLists(1); glNewList(theTorus, GL_COMPILE); @@ -321,7 +321,7 @@ GLenum Args(int argc, char **argv) GLint i; rgb = GL_TRUE; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-ci") == 0) { diff --git a/progs/samples/overlay.c b/progs/samples/overlay.c index 4542b49a0a7..23b5a4793ba 100644 --- a/progs/samples/overlay.c +++ b/progs/samples/overlay.c @@ -326,7 +326,7 @@ static GLenum Args(int argc, char **argv) { GLint i; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-sb") == 0) { 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++) { diff --git a/progs/samples/star.c b/progs/samples/star.c index 180585e1218..62d7d854852 100644 --- a/progs/samples/star.c +++ b/progs/samples/star.c @@ -281,7 +281,7 @@ static GLenum Args(int argc, char **argv) { GLint i; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-sb") == 0) { diff --git a/progs/samples/stretch.c b/progs/samples/stretch.c index 3f610e77de0..9efa8e187e3 100644 --- a/progs/samples/stretch.c +++ b/progs/samples/stretch.c @@ -285,7 +285,7 @@ static GLenum Args(int argc, char **argv) { GLint i; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-sb") == 0) { diff --git a/progs/samples/wave.c b/progs/samples/wave.c index 187c590000d..288bea4eb72 100644 --- a/progs/samples/wave.c +++ b/progs/samples/wave.c @@ -128,7 +128,7 @@ static void Animate(void) glColor3fv(facet->color); } else { thisColor = facet->color; - glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES, + glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES, facet->color); } } else { @@ -182,7 +182,7 @@ static void Animate(void) } } -static void SetColorMap(void) +static void SetColorMap(void) { static float green[3] = {0.2, 1.0, 0.2}; static float red[3] = {1.0, 0.2, 0.2}; @@ -360,7 +360,7 @@ static void InitMaterials(void) glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); - + glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess); glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular); glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse); @@ -394,7 +394,7 @@ static void Init(void) glClearColor(0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT); - + glFrontFace(GL_CW); glEnable(GL_DEPTH_TEST); @@ -515,7 +515,7 @@ static GLenum Args(int argc, char **argv) GLint i; rgb = GL_TRUE; - doubleBuffer = GL_FALSE; + doubleBuffer = GL_TRUE; frames = 10; widthX = 10; widthY = 10;