From 02048984b7962154956e9669d84ca062a576e4d9 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 4 Feb 2007 15:15:43 +0100 Subject: Delete directories not included in the mesa tarballs. --- progs/trivial/Makefile | 136 ------------------------- progs/trivial/clear.c | 126 ----------------------- progs/trivial/line-clip.c | 140 ------------------------- progs/trivial/line-cull.c | 136 ------------------------- progs/trivial/line-userclip-clip.c | 142 -------------------------- progs/trivial/line-userclip-nop-clip.c | 142 -------------------------- progs/trivial/line-userclip-nop.c | 142 -------------------------- progs/trivial/line-userclip.c | 142 -------------------------- progs/trivial/line.c | 140 ------------------------- progs/trivial/lineloop-clip.c | 136 ------------------------- progs/trivial/lineloop.c | 136 ------------------------- progs/trivial/point-clip.c | 138 ------------------------- progs/trivial/point-param.c | 145 -------------------------- progs/trivial/point-wide.c | 140 ------------------------- progs/trivial/point.c | 138 ------------------------- progs/trivial/poly-flat.c | 140 ------------------------- progs/trivial/poly-unfilled.c | 139 ------------------------- progs/trivial/poly.c | 138 ------------------------- progs/trivial/quad-clip-all-vertices.c | 138 ------------------------- progs/trivial/quad-clip-nearplane.c | 138 ------------------------- progs/trivial/quad-clip.c | 138 ------------------------- progs/trivial/quad-degenerate.c | 143 -------------------------- progs/trivial/quad-flat.c | 148 --------------------------- progs/trivial/quad-offset-factor.c | 167 ------------------------------ progs/trivial/quad-offset-unfilled.c | 167 ------------------------------ progs/trivial/quad-offset-units.c | 166 ------------------------------ progs/trivial/quad-tex-2d.c | 169 ------------------------------ progs/trivial/quad-tex-3d.c | 177 -------------------------------- progs/trivial/quad-tex-pbo.c | 181 --------------------------------- progs/trivial/quad-unfilled.c | 139 ------------------------- progs/trivial/quad.c | 138 ------------------------- progs/trivial/quads.c | 156 ---------------------------- progs/trivial/quadstrip-flat.c | 150 --------------------------- progs/trivial/quadstrip.c | 144 -------------------------- progs/trivial/tri-blend.c | 144 -------------------------- progs/trivial/tri-clip.c | 137 ------------------------- progs/trivial/tri-cull.c | 136 ------------------------- progs/trivial/tri-dlist.c | 150 --------------------------- progs/trivial/tri-edgeflag.c | 141 ------------------------- progs/trivial/tri-flat-clip.c | 137 ------------------------- progs/trivial/tri-flat.c | 137 ------------------------- progs/trivial/tri-tex-3d.c | 170 ------------------------------- progs/trivial/tri-unfilled-clip.c | 137 ------------------------- progs/trivial/tri-unfilled-smooth.c | 150 --------------------------- progs/trivial/tri-unfilled-userclip.c | 141 ------------------------- progs/trivial/tri-unfilled.c | 138 ------------------------- progs/trivial/tri-userclip.c | 140 ------------------------- progs/trivial/tri.c | 136 ------------------------- progs/trivial/tristrip-clip.c | 138 ------------------------- progs/trivial/tristrip.c | 138 ------------------------- progs/trivial/vp-array.c | 117 --------------------- progs/trivial/vp-clip.c | 102 ------------------- progs/trivial/vp-line-clip.c | 116 --------------------- progs/trivial/vp-tri.c | 104 ------------------- progs/trivial/vp-unfilled.c | 104 ------------------- 55 files changed, 7768 deletions(-) delete mode 100644 progs/trivial/Makefile delete mode 100644 progs/trivial/clear.c delete mode 100644 progs/trivial/line-clip.c delete mode 100644 progs/trivial/line-cull.c delete mode 100644 progs/trivial/line-userclip-clip.c delete mode 100644 progs/trivial/line-userclip-nop-clip.c delete mode 100644 progs/trivial/line-userclip-nop.c delete mode 100644 progs/trivial/line-userclip.c delete mode 100644 progs/trivial/line.c delete mode 100644 progs/trivial/lineloop-clip.c delete mode 100644 progs/trivial/lineloop.c delete mode 100644 progs/trivial/point-clip.c delete mode 100644 progs/trivial/point-param.c delete mode 100644 progs/trivial/point-wide.c delete mode 100644 progs/trivial/point.c delete mode 100644 progs/trivial/poly-flat.c delete mode 100644 progs/trivial/poly-unfilled.c delete mode 100644 progs/trivial/poly.c delete mode 100644 progs/trivial/quad-clip-all-vertices.c delete mode 100644 progs/trivial/quad-clip-nearplane.c delete mode 100644 progs/trivial/quad-clip.c delete mode 100644 progs/trivial/quad-degenerate.c delete mode 100644 progs/trivial/quad-flat.c delete mode 100644 progs/trivial/quad-offset-factor.c delete mode 100644 progs/trivial/quad-offset-unfilled.c delete mode 100644 progs/trivial/quad-offset-units.c delete mode 100644 progs/trivial/quad-tex-2d.c delete mode 100644 progs/trivial/quad-tex-3d.c delete mode 100644 progs/trivial/quad-tex-pbo.c delete mode 100644 progs/trivial/quad-unfilled.c delete mode 100644 progs/trivial/quad.c delete mode 100644 progs/trivial/quads.c delete mode 100644 progs/trivial/quadstrip-flat.c delete mode 100644 progs/trivial/quadstrip.c delete mode 100644 progs/trivial/tri-blend.c delete mode 100644 progs/trivial/tri-clip.c delete mode 100644 progs/trivial/tri-cull.c delete mode 100644 progs/trivial/tri-dlist.c delete mode 100644 progs/trivial/tri-edgeflag.c delete mode 100644 progs/trivial/tri-flat-clip.c delete mode 100644 progs/trivial/tri-flat.c delete mode 100644 progs/trivial/tri-tex-3d.c delete mode 100644 progs/trivial/tri-unfilled-clip.c delete mode 100644 progs/trivial/tri-unfilled-smooth.c delete mode 100644 progs/trivial/tri-unfilled-userclip.c delete mode 100644 progs/trivial/tri-unfilled.c delete mode 100644 progs/trivial/tri-userclip.c delete mode 100644 progs/trivial/tri.c delete mode 100644 progs/trivial/tristrip-clip.c delete mode 100644 progs/trivial/tristrip.c delete mode 100644 progs/trivial/vp-array.c delete mode 100644 progs/trivial/vp-clip.c delete mode 100644 progs/trivial/vp-line-clip.c delete mode 100644 progs/trivial/vp-tri.c delete mode 100644 progs/trivial/vp-unfilled.c (limited to 'progs/trivial') diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile deleted file mode 100644 index b9ed5c70dc5..00000000000 --- a/progs/trivial/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# progs/tests/Makefile - - -# These programs aren't intended to be included with the normal distro. -# They're not too interesting but they're good for testing. - -TOP = ../.. -include $(TOP)/configs/current - - -LIBS = $(APP_LIB_DEPS) - -SOURCES = \ - clear.c \ - line-clip.c \ - line-cull.c \ - line-userclip-clip.c \ - line-userclip-nop-clip.c \ - line-userclip-nop.c \ - line-userclip.c \ - line.c \ - lineloop-clip.c \ - lineloop.c \ - point.c \ - point-clip.c \ - point-param.c \ - point-wide.c \ - poly-flat.c \ - poly-unfilled.c \ - poly.c \ - quad-clip.c \ - quad-clip-all-vertices.c \ - quad-clip-nearplane.c \ - quad-degenerate.c \ - quad-flat.c \ - quad-offset-factor.c \ - quad-offset-units.c \ - quad-offset-unfilled.c \ - quad-unfilled.c \ - quad-tex-2d.c \ - quad-tex-pbo.c \ - quad-tex-3d.c \ - quad-tex-dep.c \ - quad.c \ - quads.c \ - quadstrip.c \ - quadstrip-flat.c \ - tri-blend.c \ - tri-tex-3d.c \ - tri-clip.c \ - tri-cull.c \ - tri-edgeflag.c \ - tri-flat-clip.c \ - tri-flat.c \ - tri-unfilled-clip.c \ - tri-unfilled-smooth.c \ - tri-unfilled-userclip.c \ - tri-unfilled.c \ - tri-userclip.c \ - tri-dlist.c \ - tri.c \ - tristrip-clip.c \ - tristrip.c \ - vp-clip.c \ - vp-tri.c \ - vp-line-clip.c \ - vp-unfilled.c \ - vp-array.c - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = -I. -I$(TOP)/include -I../samples - -UTIL_FILES = readtex.h readtex.c - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: $(UTIL_FILES) $(PROGS) - -clean: - rm -f $(PROGS) - rm -f *.o - rm -f getproclist.h - - -# auto code generation -getprocaddress: getprocaddress.c getproclist.h - -getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py - python getprocaddress.py > getproclist.h - - -texrect: texrect.o readtex.o - $(CC) texrect.o readtex.o $(LIBS) -o $@ - -texrect.o: texrect.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -invert: invert.o readtex.o - $(CC) invert.o readtex.o $(LIBS) -o $@ - -invert.o: invert.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -readtex.o: readtex.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -readtex.h: $(TOP)/progs/util/readtex.h - ln -s $(TOP)/progs/util/readtex.h . - -readtex.c: $(TOP)/progs/util/readtex.c - ln -s $(TOP)/progs/util/readtex.c . - - - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` diff --git a/progs/trivial/clear.c b/progs/trivial/clear.c deleted file mode 100644 index 7e7ca588c31..00000000000 --- a/progs/trivial/clear.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line-clip.c b/progs/trivial/line-clip.c deleted file mode 100644 index 9acd12acc7b..00000000000 --- a/progs/trivial/line-clip.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-1.9, 0.0, -30.0); - /* Repeat - no loop support yet: - */ - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line-cull.c b/progs/trivial/line-cull.c deleted file mode 100644 index 8999a8f0b1c..00000000000 --- a/progs/trivial/line-cull.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,1); - glVertex3f( -1.5, 0.5, -30.0); - glColor3f(1,0,0); - glVertex3f( 0, 2.0, -30.0); - glColor3f(0,1,0); - glVertex3f(-1.5, 2.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line-userclip-clip.c b/progs/trivial/line-userclip-clip.c deleted file mode 100644 index b24d8452bcd..00000000000 --- a/progs/trivial/line-userclip-clip.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - static GLdouble plane[4] = { -.5, 0, 1, 0 }; - - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - glClipPlane(GL_CLIP_PLANE0, plane); - glEnable(GL_CLIP_PLANE0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(0,.9,0); - glVertex3f(-1.9, 0.0, 0.0); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line-userclip-nop-clip.c b/progs/trivial/line-userclip-nop-clip.c deleted file mode 100644 index e2e0b85a522..00000000000 --- a/progs/trivial/line-userclip-nop-clip.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - static GLdouble plane[4] = { 0, 0, 1, 0 }; - - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - glClipPlane(GL_CLIP_PLANE0, plane); - glEnable(GL_CLIP_PLANE0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(0,.9,0); - glVertex3f(-1.9, 0.0, 0.0); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line-userclip-nop.c b/progs/trivial/line-userclip-nop.c deleted file mode 100644 index eacee069789..00000000000 --- a/progs/trivial/line-userclip-nop.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - static GLdouble plane[4] = { 0, 0, 1, 0 }; - - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - glClipPlane(GL_CLIP_PLANE0, plane); - glEnable(GL_CLIP_PLANE0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, 0.0); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line-userclip.c b/progs/trivial/line-userclip.c deleted file mode 100644 index 6af91431d08..00000000000 --- a/progs/trivial/line-userclip.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - static GLdouble plane[4] = { -.5, 0, 1, 0 }; - - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - glClipPlane(GL_CLIP_PLANE0, plane); - glEnable(GL_CLIP_PLANE0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, 0.0); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/line.c b/progs/trivial/line.c deleted file mode 100644 index 58bad91b05a..00000000000 --- a/progs/trivial/line.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_STRIP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, -30.0); - /* Repeat the first vertex - don't have lineloop support in GS yet - */ - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/lineloop-clip.c b/progs/trivial/lineloop-clip.c deleted file mode 100644 index d8645ee3477..00000000000 --- a/progs/trivial/lineloop-clip.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_LOOP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-1.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/lineloop.c b/progs/trivial/lineloop.c deleted file mode 100644 index 7500c54fc26..00000000000 --- a/progs/trivial/lineloop.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINE_LOOP); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/point-clip.c b/progs/trivial/point-clip.c deleted file mode 100644 index 32792047c64..00000000000 --- a/progs/trivial/point-clip.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_POINTS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-1.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/point-param.c b/progs/trivial/point-param.c deleted file mode 100644 index c5424682b85..00000000000 --- a/progs/trivial/point-param.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - static GLfloat theQuad[3] = { 0.25, 0.0, 1/60.0 }; - - glClear(GL_COLOR_BUFFER_BIT); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glPointSize(8.0); - glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, theQuad); - - - glBegin(GL_POINTS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c deleted file mode 100644 index 473ca043f1d..00000000000 --- a/progs/trivial/point-wide.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glPointSize(8.0); - - glBegin(GL_POINTS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/point.c b/progs/trivial/point.c deleted file mode 100644 index 87465bfb2c1..00000000000 --- a/progs/trivial/point.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_POINTS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/poly-flat.c b/progs/trivial/poly-flat.c deleted file mode 100644 index 747b24dc0ce..00000000000 --- a/progs/trivial/poly-flat.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glShadeModel(GL_FLAT); - - - glBegin(GL_POLYGON); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/poly-unfilled.c b/progs/trivial/poly-unfilled.c deleted file mode 100644 index e0ae463b083..00000000000 --- a/progs/trivial/poly-unfilled.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glBegin(GL_POLYGON); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/poly.c b/progs/trivial/poly.c deleted file mode 100644 index bdb9e27aa91..00000000000 --- a/progs/trivial/poly.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_POLYGON); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-clip-all-vertices.c b/progs/trivial/quad-clip-all-vertices.c deleted file mode 100644 index 019ef0c479a..00000000000 --- a/progs/trivial/quad-clip-all-vertices.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 1.9, -1.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 1.9, 1.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-1.9, 1.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-1.9, -1.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-clip-nearplane.c b/progs/trivial/quad-clip-nearplane.c deleted file mode 100644 index 7e12e58a196..00000000000 --- a/progs/trivial/quad-clip-nearplane.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, 30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, 30.0); - glColor3f(1,0,1); - glVertex3f(-1.9, 0.9, 30.0); - glColor3f(0,1,1); - glVertex3f(-1.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-clip.c b/progs/trivial/quad-clip.c deleted file mode 100644 index 9f3a45caec3..00000000000 --- a/progs/trivial/quad-clip.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-1.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-degenerate.c b/progs/trivial/quad-degenerate.c deleted file mode 100644 index b14b0f1d879..00000000000 --- a/progs/trivial/quad-degenerate.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-flat.c b/progs/trivial/quad-flat.c deleted file mode 100644 index d6e9f021206..00000000000 --- a/progs/trivial/quad-flat.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glShadeModel(GL_FLAT); - - if (1) { - glBegin(GL_LINES); - glColor3f(1,0,0); - glVertex3f( 0.95, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.95, 0.9, -30.0); - glEnd(); - } - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-offset-factor.c b/progs/trivial/quad-offset-factor.c deleted file mode 100644 index 861d3461c04..00000000000 --- a/progs/trivial/quad-offset-factor.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(1.0, 1.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void quad( float half ) -{ - glBegin(GL_QUADS); - glVertex3f( half/9.0, -half/9.0, -25.0 + half); - glVertex3f( half/9.0, half/9.0, -25.0 + half); - glVertex3f(-half/9.0, half/9.0, -25.0 - half); - glVertex3f(-half/9.0, -half/9.0, -25.0 - half); - glEnd(); - -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(1, 0); - - glColor3f(1,0,0); - quad(9); - - glDisable(GL_POLYGON_OFFSET_FILL); - glColor3f(0,1,0); - quad(6); - - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(0, 0); - - /* Black - should not be visible - */ - glColor3f(0,0,0); - quad(6); - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(-1, 0); - glColor3f(0,0,1); - quad(3); - - glDisable(GL_POLYGON_OFFSET_FILL); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB | GLUT_DEPTH; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-offset-unfilled.c b/progs/trivial/quad-offset-unfilled.c deleted file mode 100644 index 1cecf3c1cef..00000000000 --- a/progs/trivial/quad-offset-unfilled.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(1.0, 1.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(1, 0); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -10.0); - glVertex3f( 0.9, 0.9, -10.0); - glVertex3f(-0.9, 0.9, -40.0); - glVertex3f(-0.9, -0.9, -40.0); - glEnd(); - - glDisable(GL_POLYGON_OFFSET_FILL); - - glBegin(GL_QUADS); - glColor3f(0,1,0); - glVertex3f( 0.6, -0.6, -15.0); - glVertex3f( 0.6, 0.6, -15.0); - glVertex3f(-0.6, 0.6, -35.0); - glVertex3f(-0.6, -0.6, -35.0); - glEnd(); - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(-1, 0); - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glBegin(GL_QUADS); - glColor3f(0,0,1); - glVertex3f( 0.3, -0.3, -20.0); - glVertex3f( 0.3, 0.3, -20.0); - glVertex3f(-0.3, 0.3, -30.0); - glVertex3f(-0.3, -0.3, -30.0); - glEnd(); - - - glDisable(GL_POLYGON_OFFSET_FILL); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB | GLUT_DEPTH; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-offset-units.c b/progs/trivial/quad-offset-units.c deleted file mode 100644 index 5c41be308ee..00000000000 --- a/progs/trivial/quad-offset-units.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(1.0, 1.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.2, 1.2, -1.2, 1.2, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void quad( float half ) -{ - glBegin(GL_QUADS); - glVertex3f( half/9.0, -half/9.0, -25.0 + half); - glVertex3f( half/9.0, half/9.0, -25.0 + half); - glVertex3f(-half/9.0, half/9.0, -25.0 - half); - glVertex3f(-half/9.0, -half/9.0, -25.0 - half); - glEnd(); - -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(0, 4); - - glColor3f(1,0,0); - quad(9); - - glDisable(GL_POLYGON_OFFSET_FILL); - glColor3f(0,0,0); - quad(6); - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(0, 0); - - glDepthFunc( GL_EQUAL ); - glColor3f(0,1,0); - quad(6); - glDepthFunc( GL_LESS ); - - - glPolygonOffset(0, -4); - glColor3f(0,0,1); - quad(3); - - glDisable(GL_POLYGON_OFFSET_FILL); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB | GLUT_DEPTH; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-tex-2d.c b/progs/trivial/quad-tex-2d.c deleted file mode 100644 index 70b9fbf8c61..00000000000 --- a/progs/trivial/quad-tex-2d.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - -#define SIZE 16 - { - GLubyte tex2d[SIZE][SIZE][3]; - GLint s, t; - - for (s = 0; s < SIZE; s++) { - for (t = 0; t < SIZE; t++) { -#if 0 - tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255; - tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255; - tex2d[t][s][2] = 0; -#else - tex2d[t][s][0] = s*255/(SIZE-1); - tex2d[t][s][1] = t*255/(SIZE-1); - tex2d[t][s][2] = 0; -#endif - } - } - - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0, - GL_RGB, GL_UNSIGNED_BYTE, tex2d); - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glEnable(GL_TEXTURE_2D); - } - -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glTexCoord2f(1,0); - glVertex3f( 0.9, -0.9, -30.0); - glTexCoord2f(1,1); - glVertex3f( 0.9, 0.9, -30.0); - glTexCoord2f(0,1); - glVertex3f(-0.9, 0.9, -30.0); - glTexCoord2f(0,0); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-tex-3d.c b/progs/trivial/quad-tex-3d.c deleted file mode 100644 index 0b2dcc08a5f..00000000000 --- a/progs/trivial/quad-tex-3d.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - -GLfloat z= 0; -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - -#define SIZE 16 - { - GLubyte tex3d[SIZE][SIZE][SIZE][3]; - GLint r, s, t; - - for (s = 0; s < SIZE; s++) { - for (t = 0; t < SIZE; t++) { - for (r = 0; r < SIZE; r++) { -#if 0 - tex3d[r][t][s][0] = (s < SIZE/2) ? 0 : 255; - tex3d[r][t][s][1] = (t < SIZE/2) ? 0 : 255; - tex3d[r][t][s][2] = (r < SIZE/2) ? 0 : 255; -#else - tex3d[r][t][s][0] = s*255/(SIZE-1); - tex3d[r][t][s][1] = t*255/(SIZE-1); - tex3d[r][t][s][2] = r*255/(SIZE-1); -#endif - } - } - } - - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage3D(GL_TEXTURE_3D, 0, 3, SIZE, SIZE, SIZE, 0, - GL_RGB, GL_UNSIGNED_BYTE, tex3d); - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glEnable(GL_TEXTURE_3D); - } - -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case ' ': - z += 1.0/SIZE; - break; - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - fprintf(stderr, "z: %f\n", z); - - glBegin(GL_QUADS); - glTexCoord3f(1,0,z); - glVertex3f( 0.9, -0.9, -30.0); - glTexCoord3f(1,1,z); - glVertex3f( 0.9, 0.9, -30.0); - glTexCoord3f(0,1,z); - glVertex3f(-0.9, 0.9, -30.0); - glTexCoord3f(0,0,z); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-tex-pbo.c b/progs/trivial/quad-tex-pbo.c deleted file mode 100644 index 5b63c698a7e..00000000000 --- a/progs/trivial/quad-tex-pbo.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#define GL_GLEXT_PROTOTYPES - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - -GLenum doubleBuffer; - -static GLuint DrawPBO; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - -#define SIZE 16 - { - GLubyte tex2d[SIZE][SIZE][4]; - GLint s, t; - - for (s = 0; s < SIZE; s++) { - for (t = 0; t < SIZE; t++) { - /* bgra: - */ - tex2d[t][s][0] = 0x30; - tex2d[t][s][1] = t*255/(SIZE-1); - tex2d[t][s][2] = s*255/(SIZE-1); - tex2d[t][s][3] = 0xff; - } - } - - - /* put image into DrawPBO */ - glGenBuffersARB(1, &DrawPBO); - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, DrawPBO); - glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT, - SIZE * SIZE * 4, tex2d, GL_STATIC_DRAW); - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, 0); - - - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE, SIZE, 0, - GL_BGRA, GL_UNSIGNED_BYTE, NULL); - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glEnable(GL_TEXTURE_2D); - } - -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glTexCoord2f(1,0); - glVertex3f( 0.9, -0.9, -30.0); - glTexCoord2f(1,1); - glVertex3f( 0.9, 0.9, -30.0); - glTexCoord2f(0,1); - glVertex3f(-0.9, 0.9, -30.0); - glTexCoord2f(0,0); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad-unfilled.c b/progs/trivial/quad-unfilled.c deleted file mode 100644 index 9d63d2dfb95..00000000000 --- a/progs/trivial/quad-unfilled.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quad.c b/progs/trivial/quad.c deleted file mode 100644 index 85424b7b388..00000000000 --- a/progs/trivial/quad.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quads.c b/progs/trivial/quads.c deleted file mode 100644 index 1ca82cd9f8b..00000000000 --- a/progs/trivial/quads.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUADS); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - - glColor3f(1,1,1); - glVertex3f( 0.1, 0.9, -30.0); - glColor3f(1,0,1); - glVertex3f( 0.1, -0.9, -30.0); - - if (0) { - glEnd(); - glFlush(); - glBegin(GL_QUADS); - } - - glColor3f(0,1,0); - glVertex3f(-0.1, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f(-0.1, 0.9, -30.0); - - - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quadstrip-flat.c b/progs/trivial/quadstrip-flat.c deleted file mode 100644 index 061a0e409e4..00000000000 --- a/progs/trivial/quadstrip-flat.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glShadeModel(GL_FLAT); - - glBegin(GL_QUAD_STRIP); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - - glColor3f(1,0,0); - glVertex3f( 0.1, -0.8, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.1, 0.8, -30.0); - - glColor3f(0,1,1); - glVertex3f(-0.1, -0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.1, 0.9, -30.0); - - glColor3f(0,1,1); - glVertex3f(-0.9, -0.8, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.8, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/quadstrip.c b/progs/trivial/quadstrip.c deleted file mode 100644 index 342463f1a24..00000000000 --- a/progs/trivial/quadstrip.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_QUAD_STRIP); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - - glColor3f(1,0,0); - glVertex3f( 0.1, -0.8, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.1, 0.8, -30.0); - - glColor3f(0,1,1); - glVertex3f(-0.1, -0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.1, 0.9, -30.0); - - glColor3f(0,1,1); - glVertex3f(-0.9, -0.8, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.8, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-blend.c b/progs/trivial/tri-blend.c deleted file mode 100644 index 284d15fd3c9..00000000000 --- a/progs/trivial/tri-blend.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 1993-1997, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(R) is a registered trademark of Silicon Graphics, Inc. - */ - -/* - * alpha.c - * This program draws several overlapping filled polygons - * to demonstrate the effect order has on alpha blending results. - * Use the 't' key to toggle the order of drawing polygons. - */ -#include -#include - -static int leftFirst = GL_TRUE; - -/* Initialize alpha blending function. - */ -static void init(void) -{ - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glShadeModel (GL_FLAT); - glClearColor (1.0, 0.0, 0.0, 0.0); -} - -static void drawLeftTriangle(void) -{ - /* draw yellow triangle on LHS of screen */ - - glBegin (GL_TRIANGLES); - glColor4f(1.0, 1.0, 0.0, 0.75); - glVertex3f(0.1, 0.9, 0.0); - glVertex3f(0.1, 0.1, 0.0); - glVertex3f(0.7, 0.5, 0.0); - glEnd(); -} - -static void drawRightTriangle(void) -{ - /* draw cyan triangle on RHS of screen */ - - glEnable (GL_BLEND); - glBegin (GL_TRIANGLES); - glColor4f(0.0, 1.0, 1.0, 0.75); - glVertex3f(0.9, 0.9, 0.0); - glVertex3f(0.3, 0.5, 0.0); - glVertex3f(0.9, 0.1, 0.0); - glEnd(); - glDisable (GL_BLEND); -} - -void display(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - if (leftFirst) { - drawLeftTriangle(); - drawRightTriangle(); - } - else { - drawRightTriangle(); - drawLeftTriangle(); - } - - glFlush(); -} - -void reshape(int w, int h) -{ - glViewport(0, 0, (GLsizei) w, (GLsizei) h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - if (w <= h) - gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w); - else - gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0); -} - -/* ARGSUSED1 */ -void keyboard(unsigned char key, int x, int y) -{ - switch (key) { - case 't': - case 'T': - leftFirst = !leftFirst; - glutPostRedisplay(); - break; - case 27: /* Escape key */ - exit(0); - break; - default: - break; - } -} - -/* Main Loop - * Open window with initial window size, title bar, - * RGBA display mode, and handle input events. - */ -int main(int argc, char** argv) -{ - glutInit(&argc, argv); - glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); - glutInitWindowSize (200, 200); - glutCreateWindow (argv[0]); - init(); - glutReshapeFunc (reshape); - glutKeyboardFunc (keyboard); - glutDisplayFunc (display); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-clip.c b/progs/trivial/tri-clip.c deleted file mode 100644 index bf48533adcc..00000000000 --- a/progs/trivial/tri-clip.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-1.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } - -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-cull.c b/progs/trivial/tri-cull.c deleted file mode 100644 index 20aeaf1d7cd..00000000000 --- a/progs/trivial/tri-cull.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( -1.5, 0.5, -30.0); - glColor3f(1,0,0); - glVertex3f( 0, 2.0, -30.0); - glColor3f(0,1,0); - glVertex3f(-1.5, 2.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-dlist.c b/progs/trivial/tri-dlist.c deleted file mode 100644 index e0ab285eff4..00000000000 --- a/progs/trivial/tri-dlist.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; -GLint list; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - - list = glGenLists(1); - glNewList(list, GL_COMPILE); - glBegin(GL_TRIANGLES); -/* glColor3f(0,0,.7); */ - glVertex3f( 0.9, -0.9, -30.0); -/* glColor3f(.8,0,0); */ - glVertex3f( 0.9, 0.9, -30.0); -/* glColor3f(0,.9,0); */ - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - glEndList(); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - - - - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glColor3f(0,.9,0); - glCallList(list); - - glRotatef(45,0,0,1); - glColor3f(1,0,1); - glCallList(list); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-edgeflag.c b/progs/trivial/tri-edgeflag.c deleted file mode 100644 index bdc0eaa253a..00000000000 --- a/progs/trivial/tri-edgeflag.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glPolygonMode(GL_FRONT, GL_LINE); - glPolygonMode(GL_BACK, GL_POINT); - - glBegin(GL_TRIANGLES); - glEdgeFlag(1); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -0.0); - glEdgeFlag(0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -0.0); - glEdgeFlag(1); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, -0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-flat-clip.c b/progs/trivial/tri-flat-clip.c deleted file mode 100644 index fafa64914d4..00000000000 --- a/progs/trivial/tri-flat-clip.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.5, 0.5, 0.5, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glShadeModel(GL_FLAT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-1.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-flat.c b/progs/trivial/tri-flat.c deleted file mode 100644 index fb2cdbd7bba..00000000000 --- a/progs/trivial/tri-flat.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.5, 0.5, 0.5, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glShadeModel(GL_FLAT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-tex-3d.c b/progs/trivial/tri-tex-3d.c deleted file mode 100644 index 6a9d1d1bf6d..00000000000 --- a/progs/trivial/tri-tex-3d.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - -#define SIZE 16 - { - GLubyte tex3d[SIZE][SIZE][SIZE][3]; - GLint r, s, t; - - for (s = 0; s < SIZE; s++) { - for (t = 0; t < SIZE; t++) { - for (r = 0; r < SIZE; r++) { -#if 0 - tex3d[r][t][s][0] = (s < SIZE/2) ? 0 : 255; - tex3d[r][t][s][1] = (t < SIZE/2) ? 0 : 255; - tex3d[r][t][s][2] = (r < SIZE/2) ? 0 : 255; -#else - tex3d[r][t][s][0] = s*255/(SIZE-1); - tex3d[r][t][s][1] = t*255/(SIZE-1); - tex3d[r][t][s][2] = r*255/(SIZE-1); -#endif - } - } - } - - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage3D(GL_TEXTURE_3D, 0, 3, SIZE, SIZE, SIZE, 0, - GL_RGB, GL_UNSIGNED_BYTE, tex3d); - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glEnable(GL_TEXTURE_3D); - } - -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glTexCoord3f( 0,0,.9); - glVertex3f( 0.9, -0.9, -30.0); - glTexCoord3f(.9,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glTexCoord3f(0,.9,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-unfilled-clip.c b/progs/trivial/tri-unfilled-clip.c deleted file mode 100644 index d486af23655..00000000000 --- a/progs/trivial/tri-unfilled-clip.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-1.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-unfilled-smooth.c b/progs/trivial/tri-unfilled-smooth.c deleted file mode 100644 index e41903a3d50..00000000000 --- a/progs/trivial/tri-unfilled-smooth.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glEnable(GL_LINE_SMOOTH); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.6, -0.6, -0.0); - glColor3f(.8,0,0); - glVertex3f( 0.6, 0.6, -0.0); - glColor3f(0,.9,0); - glVertex3f(-0.6, 0.0, -0.0); - glEnd(); - - glPolygonMode(GL_FRONT, GL_LINE); -/* glPolygonMode(GL_BACK, GL_LINE); */ - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -0.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, -0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-unfilled-userclip.c b/progs/trivial/tri-unfilled-userclip.c deleted file mode 100644 index dc93a8f1abf..00000000000 --- a/progs/trivial/tri-unfilled-userclip.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - static GLdouble plane[4] = { -.5, 0, 1, 0 }; - - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - glClipPlane(GL_CLIP_PLANE0, plane); - glEnable(GL_CLIP_PLANE0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, 0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-unfilled.c b/progs/trivial/tri-unfilled.c deleted file mode 100644 index 73961bc93a6..00000000000 --- a/progs/trivial/tri-unfilled.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glPolygonMode(GL_FRONT, GL_LINE); - glPolygonMode(GL_BACK, GL_LINE); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -0.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, -0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri-userclip.c b/progs/trivial/tri-userclip.c deleted file mode 100644 index cde9662ace9..00000000000 --- a/progs/trivial/tri-userclip.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - static GLdouble plane[4] = { -.5, 0, 1, 0 }; - - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); - glClipPlane(GL_CLIP_PLANE0, plane); - glEnable(GL_CLIP_PLANE0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); -/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */ - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, 0.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c deleted file mode 100644 index 58a650b559f..00000000000 --- a/progs/trivial/tri.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,.7); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(.8,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,.9,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tristrip-clip.c b/progs/trivial/tristrip-clip.c deleted file mode 100644 index f95c66a62aa..00000000000 --- a/progs/trivial/tristrip-clip.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLE_STRIP); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-1.9, 0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/tristrip.c b/progs/trivial/tristrip.c deleted file mode 100644 index fa82a737112..00000000000 --- a/progs/trivial/tristrip.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - - -#define CI_OFFSET_1 16 -#define CI_OFFSET_2 32 - - -GLenum doubleBuffer; - -static void Init(void) -{ - fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - glClearColor(0.0, 0.0, 1.0, 0.0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLE_STRIP); - glColor3f(1,0,0); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,1,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,1); - glVertex3f(-0.9, -0.9, -30.0); - glColor3f(1,0,1); - glVertex3f(-0.9, 0.9, -30.0); - glEnd(); - - glFlush(); - - if (doubleBuffer) { - glutSwapBuffers(); - } -} - -static GLenum Args(int argc, char **argv) -{ - GLint i; - - doubleBuffer = GL_FALSE; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-sb") == 0) { - doubleBuffer = GL_FALSE; - } else if (strcmp(argv[i], "-db") == 0) { - doubleBuffer = GL_TRUE; - } else { - fprintf(stderr, "%s (Bad option).\n", argv[i]); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - if (Args(argc, argv) == GL_FALSE) { - exit(1); - } - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/vp-array.c b/progs/trivial/vp-array.c deleted file mode 100644 index abe8f62bec3..00000000000 --- a/progs/trivial/vp-array.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include -#include -#include -#include -#include -#define GL_GLEXT_PROTOTYPES -#include - -GLfloat verts[][4] = { - { 0.9, -0.9, 0.0, 1.0 }, - { 0.9, 0.9, 0.0, 1.0 }, - { -0.9, 0.9, 0.0, 1.0 }, - { -0.9, -0.9, 0.0, 1.0 }, -}; - -GLubyte color[][4] = { - { 0x00, 0x00, 0xff, 0x00 }, - { 0x00, 0xff, 0x00, 0x00 }, - { 0xff, 0x00, 0x00, 0x00 }, - { 0xff, 0xff, 0xff, 0x00 }, -}; - -GLuint indices[] = { 0, 1, 2, 3 }; - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - - static const char *prog1 = - "!!ARBvp1.0\n" - "MOV result.color, vertex.color;\n" - "MOV result.position, vertex.position;\n" - "END\n"; - - glGenProgramsARB(1, &prognum); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog1), (const GLubyte *) prog1); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } - - - glEnableClientState( GL_VERTEX_ARRAY ); - glEnableClientState( GL_COLOR_ARRAY ); - glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts ); - glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color ); - -} - - - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_NV); - glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices ); - - glFlush(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/vp-clip.c b/progs/trivial/vp-clip.c deleted file mode 100644 index 206ba0b8cb8..00000000000 --- a/progs/trivial/vp-clip.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include -#include -#include -#include -#include -#define GL_GLEXT_PROTOTYPES -#include - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - - static const char *prog1 = - "!!ARBvp1.0\n" - "MOV result.color, vertex.color;\n" - "MOV result.position, vertex.position;\n" - "END\n"; - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog1), (const GLubyte *) prog1); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } -} - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_NV); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 2.0, -2.0, 0.0); - glColor3f(0,1,0); - glVertex3f( 2.0, 2.0, 0.0); - glColor3f(1,0,0); - glVertex3f(-2.0, 0.0, 0.0); - glEnd(); - - - glFlush(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/vp-line-clip.c b/progs/trivial/vp-line-clip.c deleted file mode 100644 index b2aaf17ca4f..00000000000 --- a/progs/trivial/vp-line-clip.c +++ /dev/null @@ -1,116 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include -#include -#include -#include -#include -#define GL_GLEXT_PROTOTYPES -#include - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - - static const char *prog1 = - "!!ARBvp1.0\n" - "MOV result.color, vertex.color;\n" - "MOV result.position, vertex.position;\n" - "END\n"; - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog1), (const GLubyte *) prog1); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } -} - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_NV); - -#if 0 - glBegin(GL_LINES); - glColor3f(0,0,1); - glVertex3f( 0.75, -0.75, 0.0); - glColor3f(0,1,0); - glVertex3f( 0.75, 0.75, 0.0); - - glColor3f(0,1,0); - glVertex3f( 0.75, 0.75, 0.0); - glColor3f(1,0,0); - glVertex3f(-1.75, 0.0, 0.0); - glEnd(); -#else - glBegin(GL_LINE_STRIP); - glColor3f(0,0,1); - glVertex3f( 0.75, -0.75, 0.0); - glColor3f(0,1,0); - glVertex3f( 0.75, 0.75, 0.0); - glColor3f(1,0,0); - glVertex3f(-1.75, 0.0, 0.0); - glEnd(); -#endif - - - glFlush(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/vp-tri.c b/progs/trivial/vp-tri.c deleted file mode 100644 index f8e18654c60..00000000000 --- a/progs/trivial/vp-tri.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include -#include -#include -#include -#include -#define GL_GLEXT_PROTOTYPES -#include - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - - static const char *prog1 = - "!!ARBvp1.0\n" - "MOV result.color, vertex.color;\n" -/* "MOV result.color, {0,0,0,1};\n" */ - "MOV result.position, vertex.position;\n" - "END\n"; - - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog1), (const GLubyte *) prog1); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } -} - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_NV); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(0,1,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(1,0,0); - glVertex3f(-0.9, 0.0, 0.0); - glEnd(); - - - glFlush(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/trivial/vp-unfilled.c b/progs/trivial/vp-unfilled.c deleted file mode 100644 index ac23181fff7..00000000000 --- a/progs/trivial/vp-unfilled.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include -#include -#include -#include -#include -#define GL_GLEXT_PROTOTYPES -#include - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - - static const char *prog1 = - "!!ARBvp1.0\n" - "MOV result.color, vertex.color;\n" - "MOV result.position, vertex.position;\n" - "END\n"; - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog1), (const GLubyte *) prog1); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } -} - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - glPolygonMode(GL_FRONT, GL_LINE); - glPolygonMode(GL_BACK, GL_POINT); - - glEnable(GL_VERTEX_PROGRAM_NV); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, 0.0); - glColor3f(0,1,0); - glVertex3f( 0.9, 0.9, 0.0); - glColor3f(1,0,0); - glVertex3f(-0.9, 0.0, 0.0); - glEnd(); - - - glFlush(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} -- cgit v1.2.3