#define NFACE 6
#define NVERT 8
-void drawCube(GLdouble x0, GLdouble x1, GLdouble y0, GLdouble y1,
+static void drawCube(GLdouble x0, GLdouble x1, GLdouble y0, GLdouble y1,
GLdouble z0, GLdouble z1)
{
static GLfloat v[8][3];
/* Note: polygons must be drawn from front to back
* for proper blending.
*/
-void display(void)
+static void display(void)
{
if (polySmooth) {
glClear (GL_COLOR_BUFFER_BIT);
glFlush ();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 't':
* blending, hint, and line width. Print out implementation
* specific info on line width granularity and width.
*/
-void init(void)
+static void init(void)
{
GLfloat values[2];
glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values);
/* Draw 2 diagonal lines to form an X
*/
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'r':
/* Initialize lighting and other values.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
glClearAccum(0.0, 0.0, 0.0, 0.0);
}
-void displayObjects(void)
+static void displayObjects(void)
{
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
#define ACSIZE 8
-void display(void)
+static void display(void)
{
GLint viewport[4];
int jitter;
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
* probably want to insure that your ModelView matrix has been
* initialized to identity before calling accFrustum().
*/
-void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
+static void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
{
*
* Note that accPerspective() calls accFrustum().
*/
-void accPerspective(GLdouble fovy, GLdouble aspect,
+static void accPerspective(GLdouble fovy, GLdouble aspect,
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
{
/* Initialize lighting and other values.
*/
-void init(void)
+static void init(void)
{
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
glClearAccum(0.0, 0.0, 0.0, 0.0);
}
-void displayObjects(void)
+static void displayObjects(void)
{
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
#define ACSIZE 8
-void display(void)
+static void display(void)
{
GLint viewport[4];
int jitter;
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
glEnd();
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 't':
glEndList();
}
-void display(void)
+static void display(void)
{
GLfloat mat_solid[] = { 0.75, 0.75, 0.0, 1.0 };
GLfloat mat_zero[] = { 0.0, 0.0, 0.0, 1.0 };
glutSwapBuffers();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLint) w, (GLint) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
}
-void animate(void)
+static void animate(void)
{
static double t0 = -1.;
if (solidZ <= MINZ || transparentZ >= MAXZ)
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'a':
* blending, hint, and line width. Print out implementation
* specific info on line width granularity and width.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat values[2];
glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values);
/* display() draws an icosahedron with a large alpha value, 1.0.
*/
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor4f (1.0, 1.0, 1.0, 1.0);
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
{ -4.0, -4.0, 0.0}, { -2.0, 4.0, 0.0},
{2.0, -4.0, 0.0}, {4.0, 4.0, 0.0}};
-void init(void)
+static void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glEnable(GL_MAP1_VERTEX_3);
}
-void display(void)
+static void display(void)
{
int i;
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
{1.5, 1.5, -1.0}}
};
-void
+static void
initlights(void)
{
GLfloat ambient[] =
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
}
-void
+static void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void
+static void
myinit(void)
{
glClearColor(0.0, 0.0, 0.0, 1.0);
initlights(); /* for lighted version only */
}
-void
+static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
#define checkImageHeight 64
GLubyte checkImage[checkImageWidth][checkImageHeight][3];
-void makeCheckImage(void)
+static void makeCheckImage(void)
{
int i, j, c;
}
}
-void myinit(void)
+static void myinit(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_FLAT);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS);
glutSwapBuffers();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
#include <GL/glut.h>
#include <stdlib.h>
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void display(void)
+static void display(void)
{
GLdouble eqn[4] = {0.0, 1.0, 0.0, 0.0};
GLdouble eqn2[4] = {1.0, 0.0, 0.0, 0.0};
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize material property, light source, lighting model,
* and depth buffer.
*/
-void init(void)
+static void init(void)
{
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
glEnable(GL_COLOR_MATERIAL);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSolidSphere(1.0, 20, 16);
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED2 */
-void mouse(int button, int state, int x, int y)
+static void mouse(int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
#include <GL/glut.h>
#include <stdlib.h>
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize linear fog for depth cueing.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat fogColor[4] = {0.0, 0.0, 0.0, 1.0};
/* display() draws an icosahedron.
*/
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
* probably want to insure that your ModelView matrix has been
* initialized to identity before calling accFrustum().
*/
-void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
+static void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
{
*
* Note that accPerspective() calls accFrustum().
*/
-void accPerspective(GLdouble fovy, GLdouble aspect,
+static void accPerspective(GLdouble fovy, GLdouble aspect,
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
{
pixdx, pixdy, eyedx, eyedy, focus);
}
-void myinit(void)
+static void myinit(void)
{
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
glClearAccum(0.0, 0.0, 0.0, 0.0);
}
-void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
+static void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
GLfloat ambr, GLfloat ambg, GLfloat ambb,
GLfloat difr, GLfloat difg, GLfloat difb,
GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine)
* magnitude of the accPerspective() jitter; in this example, 0.33.
* In this example, the teapots are drawn 8 times. See jitter.h
*/
-void display(void)
+static void display(void)
{
int jitter;
GLint viewport[4];
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
}
static GLfloat spin = 0.0;
static GLdouble t0 = 0.;
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glutSwapBuffers();
}
-GLdouble gettime(void)
+static GLdouble gettime(void)
{
return (GLdouble)(glutGet(GLUT_ELAPSED_TIME)) / 1000.;
}
-void spinDisplay(void)
+static void spinDisplay(void)
{
GLdouble t, dt;
t = gettime();
glutPostRedisplay();
}
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED2 */
-void mouse(int button, int state, int x, int y)
+static void mouse(int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
0xff, 0x00, 0xff, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00,
0xff, 0xc0, 0xff, 0xc0};
-void init(void)
+static void init(void)
{
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glClearColor (0.0, 0.0, 0.0, 0.0);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize lighting.
*/
-void init(void)
+static void init(void)
{
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
* be clipped. If in feedback mode, a passthrough token
* is issued between the each primitive.
*/
-void drawGeometry (GLenum mode)
+static void drawGeometry (GLenum mode)
{
glBegin (GL_LINE_STRIP);
glNormal3f (0.0, 0.0, 1.0);
}
/* Write contents of one vertex to stdout. */
-void print3DcolorVertex (GLint size, GLint *count,
- GLfloat *buffer)
+static void print3DcolorVertex (GLint size, GLint *count,
+ GLfloat *buffer)
{
int i;
}
/* Write contents of entire buffer. (Parse tokens!) */
-void printBuffer(GLint size, GLfloat *buffer)
+static void printBuffer(GLint size, GLfloat *buffer)
{
GLint count;
GLfloat token;
}
}
-void display(void)
+static void display(void)
{
GLfloat feedBuffer[1024];
GLint size;
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
GLint fogMode;
-void
+static void
selectFog(int mode)
{
switch(mode) {
/* Initialize z-buffer, projection matrix, light source,
* and lighting model. Do not specify a material property here.
*/
-void
+static void
myinit(void)
{
GLfloat position[] =
}
}
-void
+static void
renderRedTeapot(GLfloat x, GLfloat y, GLfloat z)
{
float mat[4];
/* display() draws 5 teapots at different z positions.
*/
-void
+static void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void
+static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
#define NUM_COLORS 32
#define RAMPSTART 16
-void
+static void
myinit(void)
{
int i;
/* display() renders 3 cones at different z positions.
*/
-void
+static void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void
+static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
GLuint fontOffset;
-void makeRasterFont(void)
+static void makeRasterFont(void)
{
GLuint i, j;
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glEndList();
}
-void init(void)
+static void init(void)
{
glShadeModel (GL_FLAT);
makeRasterFont();
}
-void printString(char *s)
+static void printString(char *s)
{
glPushAttrib (GL_LIST_BIT);
glListBase(fontOffset);
* to call makeRasterFont() before you start making
* calls to printString().
*/
-void display(void)
+static void display(void)
{
GLfloat white[3] = { 1.0, 1.0, 1.0 };
glFlush ();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
#include <stdlib.h>
#include <GL/glut.h>
-void display(void)
+static void display(void)
{
/* clear all pixels */
glClear (GL_COLOR_BUFFER_BIT);
glFlush ();
}
-void init (void)
+static void init (void)
{
/* select clearing color */
glClearColor (0.0, 0.0, 0.0, 0.0);
static GLdouble zoomFactor = 1.0;
static GLint height;
-void makeCheckImage(void)
+static void makeCheckImage(void)
{
int i, j, c;
}
}
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glRasterPos2i(0, 0);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
height = (GLint) h;
glLoadIdentity();
}
-void motion(int x, int y)
+static void motion(int x, int y)
{
static GLint screeny;
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'r':
/* Initialize material property, light source, lighting model,
* and depth buffer.
*/
-void init(void)
+static void init(void)
{
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_shininess[] = { 50.0 };
glEnable(GL_DEPTH_TEST);
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSolidSphere (1.0, 20, 16);
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void display(void)
+static void display(void)
{
int i;
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
glEnd ();
}
-void display(void)
+static void display(void)
{
GLuint i;
glFlush ();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize z-buffer, projection matrix, light source,
* and lighting model. Do not specify a material property here.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
* glTranslatef() is used to move spheres to their appropriate locations.
*/
-void display(void)
+static void display(void)
{
GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat mat_ambient[] = { 0.7, 0.7, 0.7, 1.0 };
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
GLubyte mipmapImage2[2][2][3];
GLubyte mipmapImage1[1][1][3];
-void makeImages(void)
+static void makeImages(void)
{
int i, j;
mipmapImage1[0][0][2] = 255;
}
-void myinit(void)
+static void myinit(void)
{
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_TEXTURE_2D);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS);
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
#include <GL/glut.h>
#include <stdlib.h>
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void draw_triangle(void)
+static void draw_triangle(void)
{
glBegin (GL_LINE_LOOP);
glVertex2f(0.0, 25.0);
glEnd();
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize material property, light source, lighting model,
* and depth buffer.
*/
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_SMOOTH);
* light at a new position in world coordinates. The cube
* represents the position of the light.
*/
-void display(void)
+static void display(void)
{
GLfloat position[] = { 0.0, 0.0, 1.5, 1.0 };
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED2 */
-void mouse(int button, int state, int x, int y)
+static void mouse(int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize material property, light source, lighting model,
* and depth buffer.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_diffuse[] = { 1.0, 0.2, 1.0, 1.0 };
gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
#include <stdio.h>
#include <GL/glut.h>
-void
+static void
myinit(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
* each rectangle is given the same name. Note that
* each rectangle is drawn with a different z value.
*/
-void
+static void
drawRects(GLenum mode)
{
if (mode == GL_SELECT)
/* processHits() prints out the contents of the
* selection array.
*/
-void
+static void
processHits(GLint hits, GLuint buffer[])
{
GLint i;
*/
#define BUFSIZE 512
-void
+static void
pickRects(int button, int state, int x, int y)
{
GLuint selectBuf[BUFSIZE];
processHits(hits, selectBuf);
}
-void
+static void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSwapBuffers();
}
-void
+static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
int board[3][3]; /* amount of color for each square */
/* Clear color value for every square on the board */
-void init(void)
+static void init(void)
{
int i, j;
for (i = 0; i < 3; i++)
* square is determined by its position on the grid, and
* the value in the board[][] array.
*/
-void drawSquares(GLenum mode)
+static void drawSquares(GLenum mode)
{
GLuint i, j;
for (i = 0; i < 3; i++) {
/* processHits prints out the contents of the
* selection array.
*/
-void processHits (GLint hits, GLuint buffer[])
+static void processHits (GLint hits, GLuint buffer[])
{
GLint i;
GLuint j, ii = 0, jj = 0, names, *ptr;
*/
#define BUFSIZE 512
-void pickSquares(int button, int state, int x, int y)
+static void pickSquares(int button, int state, int x, int y)
{
GLuint selectBuf[BUFSIZE];
GLint hits;
glutPostRedisplay();
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
drawSquares (GL_RENDER);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Initialize material property, light source, and lighting model.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat mat_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
/* mat_specular and mat_shininess are NOT default values */
glEnable(GL_DEPTH_TEST);
}
-void drawPlane(void)
+static void drawPlane(void)
{
glBegin (GL_QUADS);
glNormal3f (0.0, 0.0, 1.0);
glEnd();
}
-void display (void)
+static void display (void)
{
GLfloat infinite_light[] = { 1.0, 1.0, 1.0, 0.0 };
GLfloat local_light[] = { 1.0, 1.0, 1.0, 1.0 };
glFlush ();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport (0, 0, w, h);
glMatrixMode (GL_PROJECTION);
static int year = 0, day = 0;
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glutSwapBuffers();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard (unsigned char key, int x, int y)
+static void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case 'd':
/* display() draws two spheres, one with a gray, diffuse material,
* the other sphere with a magenta material with a specular highlight.
*/
-void display (void)
+static void display (void)
{
GLfloat gray[] = { 0.8, 0.8, 0.8, 1.0 };
GLfloat black[] = { 0.0, 0.0, 0.0, 1.0 };
* create display list with sphere
* initialize lighting and depth buffer
*/
-void gfxinit (void)
+static void gfxinit (void)
{
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
}
/* call when window is resized */
-void reshape(int width, int height)
+static void reshape(int width, int height)
{
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
/* call when mouse button is pressed */
/* ARGSUSED2 */
-void mouse(int button, int state, int x, int y) {
+static void mouse(int button, int state, int x, int y) {
switch (button) {
case GLUT_LEFT_BUTTON:
switch (state) {
}
/* ARGSUSED1 */
-void keyboard (unsigned char key, int x, int y)
+static void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case 't':
fflush(stdout);
}
-static void
-key(unsigned char k, int x, int y)
-{
- switch (k) {
- case 27: /* Escape */
- exit(0);
- break;
- default:
- return;
- }
- glutPostRedisplay();
-}
-
-GLenum Args(int argc, char **argv)
+static GLenum Args(int argc, char **argv)
{
GLint i;
#include <stdlib.h>
#include <GL/glut.h>
-void display(void)
+static void display(void)
{
GLubyte fly[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x80, 0x01, 0xC0, 0x06, 0xC0, 0x03, 0x60, 0x04, 0x60, 0x06, 0x20,
glFlush ();
}
-void myinit (void)
+static void myinit (void)
{
/* clear background to black */
glClearColor (0.0, 0.0, 0.0, 0.0);
GLuint startList;
-void CALLBACK errorCallback(GLenum errorCode)
+static void CALLBACK errorCallback(GLenum errorCode)
{
const GLubyte *estring;
exit(0);
}
-void init(void)
+static void init(void)
{
GLUquadricObj *qobj;
GLfloat mat_ambient[] = { 0.5, 0.5, 0.5, 1.0 };
gluDeleteQuadric(qobj);
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glFlush();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
static int shoulder = 0, elbow = 0;
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glPushMatrix();
glutSwapBuffers();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard (unsigned char key, int x, int y)
+static void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case 's':
/* Initialize material property and light source.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 0.0, 1.0, 1.0 };
glEnable(GL_DEPTH_TEST);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix ();
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
/* Initialize material property and light source.
*/
-void myinit (void)
+static void myinit (void)
{
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
glEnable(GL_DEPTH_TEST);
}
-void display (void)
+static void display (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush ();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport (0, 0, w, h);
glMatrixMode (GL_PROJECTION);
/* Initialize light source and lighting.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat light_ambient[] = { 0.0, 0.0, 1.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
glEnable(GL_DEPTH_TEST);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
/* Initialize light source and shading model (GL_FLAT).
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
glShadeModel (GL_FLAT);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
/* draw a triangle with vertices at (x1, y1), (x2, y2)
* and (x3, y3) at z units away from the origin.
*/
-void drawTriangle (GLfloat x1, GLfloat y1, GLfloat x2,
+static void drawTriangle (GLfloat x1, GLfloat y1, GLfloat x2,
GLfloat y2, GLfloat x3, GLfloat y3, GLfloat z)
{
glBegin (GL_TRIANGLES);
}
/* draw a rectangular box with these outer x, y, and z values */
-void drawViewVolume (GLfloat x1, GLfloat x2, GLfloat y1,
- GLfloat y2, GLfloat z1, GLfloat z2)
+static void drawViewVolume (GLfloat x1, GLfloat x2, GLfloat y1,
+ GLfloat y2, GLfloat z1, GLfloat z2)
{
glColor3f (1.0, 1.0, 1.0);
glBegin (GL_LINE_LOOP);
/* drawScene draws 4 triangles and a wire frame
* which represents the viewing volume.
*/
-void drawScene (void)
+static void drawScene (void)
{
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
/* processHits prints out the contents of the selection array
*/
-void processHits (GLint hits, GLuint buffer[])
+static void processHits (GLint hits, GLuint buffer[])
{
GLint i;
GLuint j, names, *ptr;
*/
#define BUFSIZE 512
-void selectObjects(void)
+static void selectObjects(void)
{
GLuint selectBuf[BUFSIZE];
GLint hits;
processHits (hits, selectBuf);
}
-void init (void)
+static void init (void)
{
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_FLAT);
}
-void display(void)
+static void display(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
#include <GL/glut.h>
#include <stdlib.h>
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_SMOOTH);
}
-void triangle(void)
+static void triangle(void)
{
glBegin (GL_TRIANGLES);
glColor3f (1.0, 0.0, 0.0);
glEnd();
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
triangle ();
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
#define YELLOWMAT 1
#define BLUEMAT 2
-void myinit (void)
+static void myinit (void)
{
GLfloat yellow_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
GLfloat yellow_specular[] = { 1.0, 1.0, 1.0, 1.0 };
/* Draw a sphere in a diamond-shaped section in the
* middle of a window with 2 tori.
*/
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* Whenever the window is reshaped, redefine the
* coordinate system and redraw the stencil area.
*/
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
/* drawLetter() interprets the instructions from the array
* for that letter and renders the letter with line segments.
*/
-void drawLetter(CP *l)
+static void drawLetter(CP *l)
{
glBegin(GL_LINE_STRIP);
for (;;) {
}
/* Create a display list for each of 6 characters */
-void myinit (void)
+static void myinit (void)
{
GLuint base;
char *test1 = "A SPARE SERAPE APPEARS AS";
char *test2 = "APES PREPARE RARE PEPPERS";
-void printStrokedString(char *s)
+static void printStrokedString(char *s)
{
GLsizei len = (GLsizei) strlen(s);
glCallLists(len, GL_BYTE, (GLbyte *)s);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
* Initializes the control points of the surface to a small hill.
* The control points range from -3 to +3 in x, y, and z
*/
-void init_surface(void)
+static void init_surface(void)
{
int u, v;
for (u = 0; u < 4; u++) {
/* Initialize material property and depth buffer.
*/
-void myinit(void)
+static void myinit(void)
{
GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 };
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
glTranslatef (0.0, 0.0, -5.0);
}
-void display(void)
+static void display(void)
{
GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
int i, j;
glutSwapBuffers();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glMatrixMode(GL_MODELVIEW);
}
-void
+static void
menu(int value)
{
switch (value) {
int down = 0, lastx;
/* ARGSUSED1 */
-void
+static void
motion(int x, int y)
{
if (down) {
}
/* ARGSUSED3 */
-void
+static void
mouse(int button, int state, int x, int y)
{
if (button == GLUT_LEFT_BUTTON) {
/* Initialize light source and lighting model.
*/
-void
+static void
myinit(void)
{
GLfloat light_ambient[] =
glEnable(GL_DEPTH_TEST);
}
-void
+static void
display(void)
{
GLfloat low_ambient[] =
glFlush();
}
-void
+static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
* Initialize depth buffer, projection matrix, light source, and lighting
* model. Do not specify a material property here.
*/
-void
+static void
myinit(void)
{
GLfloat ambient[] =
* Move object into position. Use 3rd through 12th parameters to specify the
* material property. Draw a teapot.
*/
-void
+static void
renderTeapot(GLfloat x, GLfloat y,
GLfloat ambr, GLfloat ambg, GLfloat ambb,
GLfloat difr, GLfloat difg, GLfloat difb,
* 3rd column: black, cyan, green, red, white, yellow plastic
* 4th column: black, cyan, green, red, white, yellow rubber
*/
-void
+static void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void
+static void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
GLuint startList;
-void display (void) {
+static void display (void) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glCallList(startList);
glFlush();
}
-void CALLBACK beginCallback(GLenum which)
+static void CALLBACK beginCallback(GLenum which)
{
glBegin(which);
}
-void CALLBACK errorCallback(GLenum errorCode)
+static void CALLBACK errorCallback(GLenum errorCode)
{
const GLubyte *estring;
exit(0);
}
-void CALLBACK endCallback(void)
+static void CALLBACK endCallback(void)
{
glEnd();
}
-void CALLBACK vertexCallback(GLvoid *vertex)
+static void CALLBACK vertexCallback(GLvoid *vertex)
{
const GLdouble *pointer;
* but weight[4] may be used to average color, normal, or texture
* coordinate data. In this program, color is weighted.
*/
-void CALLBACK combineCallback(GLdouble coords[3],
+static void CALLBACK combineCallback(GLdouble coords[3],
GLdouble *vertex_data[4],
GLfloat weight[4], GLdouble **dataOut )
{
*dataOut = vertex;
}
-void init (void)
+static void init (void)
{
GLUtesselator *tobj;
GLdouble rect[4][3] = {{50.0, 50.0, 0.0},
gluDeleteTess(tobj);
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
/* Make four display lists,
* each with a different tessellated object.
*/
-void makeNewLists (void) {
+static void makeNewLists (void) {
int i;
static GLdouble rects[12][3] =
{{ 50.0, 50.0, 0.0}, {300.0, 50.0, 0.0},
glEndList();
}
-void display (void) {
+static void display (void) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glPushMatrix();
glFlush();
}
-void CALLBACK beginCallback(GLenum which)
+static void CALLBACK beginCallback(GLenum which)
{
glBegin(which);
}
-void CALLBACK errorCallback(GLenum errorCode)
+static void CALLBACK errorCallback(GLenum errorCode)
{
const GLubyte *estring;
exit(0);
}
-void CALLBACK endCallback(void)
+static void CALLBACK endCallback(void)
{
glEnd();
}
* coordinate data.
*/
/* ARGSUSED */
-void CALLBACK combineCallback(GLdouble coords[3], GLdouble *data[4],
+static void CALLBACK combineCallback(GLdouble coords[3], GLdouble *data[4],
GLfloat weight[4], GLdouble **dataOut )
{
GLdouble *vertex;
*dataOut = vertex;
}
-void init(void)
+static void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
makeNewLists();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'w':
static GLuint texName[2];
-void makeCheckImages(void)
+static void makeCheckImages(void)
{
int i, j, c;
}
}
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glEnable(GL_TEXTURE_2D);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, texName[0]);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
static GLuint texName;
#endif
-void makeStripeImage(void)
+static void makeStripeImage(void)
{
int j;
static GLenum currentPlane;
static GLint currentGenMode;
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glEnable(GL_DEPTH_TEST);
glMaterialf (GL_FRONT, GL_SHININESS, 64.0);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard (unsigned char key, int x, int y)
+static void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case 'e':
#define GL_TEXTURE_INTERNAL_FORMAT GL_TEXTURE_COMPONENTS
#endif
-void init(void)
+static void init(void)
{
GLint proxyComponents;
putchar('\n');
}
-void display(void)
+static void display(void)
{
exit(0);
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
static GLuint texName;
-void makeCheckImages(void)
+static void makeCheckImages(void)
{
int i, j, c;
}
}
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_2D);
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard (unsigned char key, int x, int y)
+static void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case 's':
GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}},
{{1.0, 0.0}, {1.0, 1.0}}};
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
#define imageHeight 64
GLubyte image[3*imageWidth*imageHeight];
-void makeImage(void)
+static void makeImage(void)
{
int i, j;
float ti, tj;
}
}
-void myinit(void)
+static void myinit(void)
{
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4,
0, 1, 12, 4, &ctrlpoints[0][0][0]);
glShadeModel (GL_FLAT);
}
-void myReshape(int w, int h)
+static void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
}
/* Clear window and draw torus */
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
}
/* Handle window resize */
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
/* Rotate about x-axis when "x" typed; rotate about y-axis
when "y" typed; "i" returns torus to original view */
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 'x':
* Initializes the control points of the surface to a small hill.
* The control points range from -3 to +3 in x, y, and z
*/
-void init_surface(void)
+static void init_surface(void)
{
int u, v;
for (u = 0; u < 4; u++) {
}
}
-void nurbsError(GLenum errorCode)
+static void nurbsError(GLenum errorCode)
{
const GLubyte *estring;
/* Initialize material property and depth buffer.
*/
-void init(void)
+static void init(void)
{
GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 };
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
(GLvoid (CALLBACK*) ()) nurbsError);
}
-void display(void)
+static void display(void)
{
GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
GLfloat edgePt[5][2] = /* counter clockwise */
glFlush();
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
#include <stdlib.h>
#include <stdio.h>
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
/* Change these values for a different transformation */
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
}
-void mouse(int button, int state, int x, int y)
+static void mouse(int button, int state, int x, int y)
{
GLint viewport[4];
GLdouble mvmatrix[16], projmatrix[16];
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
int setupMethod = POINTER;
int derefMethod = DRAWARRAY;
-void setupPointers(void)
+static void setupPointers(void)
{
static GLint vertices[] = {25, 25,
100, 325,
glColorPointer (3, GL_FLOAT, 0, colors);
}
-void setupInterleave(void)
+static void setupInterleave(void)
{
static GLfloat intertwined[] =
{1.0, 0.2, 1.0, 100.0, 100.0, 0.0,
glInterleavedArrays (GL_C3F_V3F, 0, intertwined);
}
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_SMOOTH);
setupPointers ();
}
-void display(void)
+static void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glFlush ();
}
-void reshape (int w, int h)
+static void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
}
/* ARGSUSED2 */
-void mouse (int button, int state, int x, int y)
+static void mouse (int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
}
/* ARGSUSED1 */
-void keyboard(unsigned char key, int x, int y)
+static void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
static GLuint texName;
#endif
-void makeCheckImage(void)
+static void makeCheckImage(void)
{
int i, j, c;
}
}
-void init(void)
+static void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
#endif
}
-void display(void)
+static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_2D);
}
-void reshape(int w, int h)
+static void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
}
/* ARGSUSED1 */
-void keyboard (unsigned char key, int x, int y)
+static void keyboard (unsigned char key, int x, int y)
{
switch (key) {
case 's':