summaryrefslogtreecommitdiff
path: root/progs/trivial
diff options
context:
space:
mode:
Diffstat (limited to 'progs/trivial')
-rw-r--r--progs/trivial/.gitignore8
-rw-r--r--progs/trivial/Makefile8
-rw-r--r--progs/trivial/SConscript9
-rw-r--r--progs/trivial/clear-random.c2
-rw-r--r--progs/trivial/clear-repeat.c22
-rw-r--r--progs/trivial/clear.c2
-rw-r--r--progs/trivial/createwin.c2
-rw-r--r--progs/trivial/dlist-dangling.c2
-rw-r--r--progs/trivial/dlist-edgeflag-dangling.c2
-rw-r--r--progs/trivial/dlist-edgeflag.c2
-rw-r--r--progs/trivial/draw2arrays.c117
-rw-r--r--progs/trivial/line-clip.c2
-rw-r--r--progs/trivial/line-cull.c2
-rw-r--r--progs/trivial/line-stipple-wide.c2
-rw-r--r--progs/trivial/line-userclip-clip.c2
-rw-r--r--progs/trivial/line-userclip-nop-clip.c2
-rw-r--r--progs/trivial/line-userclip-nop.c2
-rw-r--r--progs/trivial/line-userclip.c2
-rw-r--r--progs/trivial/line-wide.c2
-rw-r--r--progs/trivial/line.c2
-rw-r--r--progs/trivial/lineloop-clip.c2
-rw-r--r--progs/trivial/lineloop.c2
-rw-r--r--progs/trivial/linestrip-clip.c2
-rw-r--r--progs/trivial/linestrip-flat-stipple.c2
-rw-r--r--progs/trivial/linestrip-stipple-wide.c2
-rw-r--r--progs/trivial/linestrip-stipple.c2
-rw-r--r--progs/trivial/linestrip.c2
-rw-r--r--progs/trivial/long-fixed-func.c2
-rw-r--r--progs/trivial/point-clip.c2
-rw-r--r--progs/trivial/point-sprite.c2
-rw-r--r--progs/trivial/point-wide-smooth.c2
-rw-r--r--progs/trivial/point-wide.c2
-rw-r--r--progs/trivial/point.c2
-rw-r--r--progs/trivial/poly-flat-clip.c2
-rw-r--r--progs/trivial/poly-flat-unfilled-clip.c2
-rw-r--r--progs/trivial/poly-flat.c2
-rw-r--r--progs/trivial/poly-unfilled.c2
-rw-r--r--progs/trivial/poly.c2
-rw-r--r--progs/trivial/quad-clip-all-vertices.c2
-rw-r--r--progs/trivial/quad-clip-nearplane.c2
-rw-r--r--progs/trivial/quad-clip.c2
-rw-r--r--progs/trivial/quad-degenerate.c2
-rw-r--r--progs/trivial/quad-flat.c2
-rw-r--r--progs/trivial/quad-offset-factor.c2
-rw-r--r--progs/trivial/quad-offset-unfilled.c2
-rw-r--r--progs/trivial/quad-offset-units.c2
-rw-r--r--progs/trivial/quad-tex-2d.c2
-rw-r--r--progs/trivial/quad-tex-3d.c2
-rw-r--r--progs/trivial/quad-tex-alpha.c2
-rw-r--r--progs/trivial/quad-tex-pbo.c2
-rw-r--r--progs/trivial/quad-tex-sub.c203
-rw-r--r--progs/trivial/quad-unfilled-clip.c2
-rw-r--r--progs/trivial/quad-unfilled-stipple.c2
-rw-r--r--progs/trivial/quad-unfilled.c2
-rw-r--r--progs/trivial/quad.c2
-rw-r--r--progs/trivial/quads.c2
-rw-r--r--progs/trivial/quadstrip-clip.c137
-rw-r--r--progs/trivial/quadstrip-cont.c2
-rw-r--r--progs/trivial/quadstrip-flat.c2
-rw-r--r--progs/trivial/quadstrip.c2
-rw-r--r--progs/trivial/tri-alpha-tex.c2
-rw-r--r--progs/trivial/tri-alpha.c2
-rw-r--r--progs/trivial/tri-blend-color.c2
-rw-r--r--progs/trivial/tri-clear.c2
-rw-r--r--progs/trivial/tri-clip.c2
-rw-r--r--progs/trivial/tri-cull-both.c2
-rw-r--r--progs/trivial/tri-cull.c2
-rw-r--r--progs/trivial/tri-dlist.c2
-rw-r--r--progs/trivial/tri-edgeflag.c2
-rw-r--r--progs/trivial/tri-fbo-tex-mip.c261
-rw-r--r--progs/trivial/tri-fbo-tex.c10
-rw-r--r--progs/trivial/tri-flat-clip.c2
-rw-r--r--progs/trivial/tri-flat.c2
-rw-r--r--progs/trivial/tri-fog.c27
-rw-r--r--progs/trivial/tri-fp-const-imm.c2
-rw-r--r--progs/trivial/tri-fp.c2
-rw-r--r--progs/trivial/tri-lit.c2
-rw-r--r--progs/trivial/tri-logicop-none.c178
-rw-r--r--progs/trivial/tri-logicop-xor.c186
-rw-r--r--progs/trivial/tri-mask-tri.c2
-rw-r--r--progs/trivial/tri-orig.c2
-rw-r--r--progs/trivial/tri-query.c2
-rw-r--r--progs/trivial/tri-repeat.c2
-rw-r--r--progs/trivial/tri-scissor-tri.c2
-rw-r--r--progs/trivial/tri-square.c2
-rw-r--r--progs/trivial/tri-stencil.c2
-rw-r--r--progs/trivial/tri-stipple.c2
-rw-r--r--progs/trivial/tri-tex-3d.c2
-rw-r--r--progs/trivial/tri-tex.c2
-rw-r--r--progs/trivial/tri-tri.c2
-rw-r--r--progs/trivial/tri-unfilled-clip.c2
-rw-r--r--progs/trivial/tri-unfilled-edgeflag.c2
-rw-r--r--progs/trivial/tri-unfilled-fog.c152
-rw-r--r--progs/trivial/tri-unfilled-point.c2
-rw-r--r--progs/trivial/tri-unfilled-smooth.c2
-rw-r--r--progs/trivial/tri-unfilled-tri-lit.c2
-rw-r--r--progs/trivial/tri-unfilled-tri.c2
-rw-r--r--progs/trivial/tri-unfilled-userclip-stip.c2
-rw-r--r--progs/trivial/tri-unfilled-userclip.c2
-rw-r--r--progs/trivial/tri-unfilled.c2
-rw-r--r--progs/trivial/tri-userclip.c2
-rw-r--r--progs/trivial/tri-viewport.c129
-rw-r--r--progs/trivial/tri-z-9.c2
-rw-r--r--progs/trivial/tri-z-eq.c2
-rw-r--r--progs/trivial/tri.c86
-rw-r--r--progs/trivial/trifan-flat-clip.c2
-rw-r--r--progs/trivial/trifan-flat-unfilled-clip.c2
-rw-r--r--progs/trivial/trifan-flat.c2
-rw-r--r--progs/trivial/trifan-unfilled.c2
-rw-r--r--progs/trivial/trifan.c2
-rw-r--r--progs/trivial/tristrip-clip.c2
-rw-r--r--progs/trivial/tristrip-flat.c2
-rw-r--r--progs/trivial/tristrip.c2
-rw-r--r--progs/trivial/vp-tri-cb-pos.c2
-rw-r--r--progs/trivial/vp-tri-cb-tex.c2
115 files changed, 1570 insertions, 163 deletions
diff --git a/progs/trivial/.gitignore b/progs/trivial/.gitignore
index d77f120b96b..aec4c94527d 100644
--- a/progs/trivial/.gitignore
+++ b/progs/trivial/.gitignore
@@ -9,6 +9,7 @@ dlist-dangling
dlist-degenerate
dlist-edgeflag
dlist-edgeflag-dangling
+draw2arrays
drawarrays
drawelements
drawrange
@@ -58,11 +59,13 @@ quad-tex-2d
quad-tex-3d
quad-tex-alpha
quad-tex-pbo
+quad-tex-sub
quad-unfilled
quad-unfilled-clip
quad-unfilled-stipple
quads
quadstrip
+quadstrip-clip
quadstrip-cont
quadstrip-flat
readtex.c
@@ -83,12 +86,15 @@ tri-dlist
tri-edgeflag
tri-fbo
tri-fbo-tex
+tri-fbo-tex-mip
tri-flat
tri-flat-clip
tri-fog
tri-fp
tri-fp-const-imm
tri-lit
+tri-logicop-none
+tri-logicop-xor
tri-mask-tri
tri-orig
tri-query
@@ -102,12 +108,14 @@ tri-tri
tri-unfilled
tri-unfilled-clip
tri-unfilled-edgeflag
+tri-unfilled-fog
tri-unfilled-smooth
tri-unfilled-tri
tri-unfilled-tri-lit
tri-unfilled-userclip
tri-unfilled-userclip-stip
tri-userclip
+tri-viewport
tri-z
tri-z-eq
trifan
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
index dce96f6bc8c..082387d86ea 100644
--- a/progs/trivial/Makefile
+++ b/progs/trivial/Makefile
@@ -23,6 +23,7 @@ SOURCES = \
dlist-edgeflag.c \
dlist-degenerate.c \
drawarrays.c \
+ draw2arrays.c \
drawelements.c \
drawrange.c \
flat-clip.c \
@@ -69,11 +70,13 @@ SOURCES = \
quad-tex-3d.c \
quad-tex-alpha.c \
quad-tex-pbo.c \
+ quad-tex-sub.c \
quad-unfilled-clip.c \
quad-unfilled-stipple.c \
quad-unfilled.c \
quad.c \
quads.c \
+ quadstrip-clip.c \
quadstrip-cont.c \
quadstrip-flat.c \
quadstrip.c \
@@ -88,8 +91,11 @@ SOURCES = \
tri-clip.c \
tri-cull-both.c \
tri-cull.c \
+ tri-logicop-none.c \
+ tri-logicop-xor.c \
tri-dlist.c \
tri-edgeflag.c \
+ tri-fbo-tex-mip.c \
tri-fbo-tex.c \
tri-fbo.c \
tri-flat-clip.c \
@@ -108,6 +114,7 @@ SOURCES = \
tri-tex.c \
tri-tex-3d.c \
tri-tri.c \
+ tri-unfilled-fog.c \
tri-unfilled-edgeflag.c \
tri-unfilled-clip.c \
tri-unfilled-smooth.c \
@@ -117,6 +124,7 @@ SOURCES = \
tri-unfilled-userclip.c \
tri-unfilled.c \
tri-userclip.c \
+ tri-viewport.c \
tri-z-eq.c \
tri-z.c \
tri.c \
diff --git a/progs/trivial/SConscript b/progs/trivial/SConscript
index 76826d9be08..6a9ffafe509 100644
--- a/progs/trivial/SConscript
+++ b/progs/trivial/SConscript
@@ -19,6 +19,7 @@ progs = [
'dlist-edgeflag',
'dlist-degenerate',
'drawarrays',
+ 'draw2arrays',
'drawelements',
'drawrange',
'flat-clip',
@@ -65,11 +66,13 @@ progs = [
'quad-tex-3d',
'quad-tex-alpha',
'quad-tex-pbo',
+ 'quad-tex-sub',
'quad-unfilled-clip',
'quad-unfilled-stipple',
'quad-unfilled',
'quad',
'quads',
+ 'quadstrip-clip',
'quadstrip-cont',
'quadstrip-flat',
'quadstrip',
@@ -86,6 +89,7 @@ progs = [
'tri-cull',
'tri-dlist',
'tri-edgeflag',
+ 'tri-fbo-tex-mip',
'tri-fbo-tex',
'tri-fbo',
'tri-flat-clip',
@@ -94,15 +98,19 @@ progs = [
'tri-fp',
'tri-fp-const-imm',
'tri-lit',
+ 'tri-logicop-none',
+ 'tri-logicop-xor',
'tri-mask-tri',
'tri-orig',
'tri-query',
'tri-repeat',
'tri-scissor-tri',
'tri-stencil',
+ 'tri-stipple',
'tri-tex',
'tri-tex-3d',
'tri-tri',
+ 'tri-unfilled-fog',
'tri-unfilled-edgeflag',
'tri-unfilled-clip',
'tri-unfilled-smooth',
@@ -112,6 +120,7 @@ progs = [
'tri-unfilled-userclip',
'tri-unfilled',
'tri-userclip',
+ 'tri-viewport',
'tri-z-eq',
'tri-z',
'tri',
diff --git a/progs/trivial/clear-random.c b/progs/trivial/clear-random.c
index 16bd83339b8..f3a67dbe8a8 100644
--- a/progs/trivial/clear-random.c
+++ b/progs/trivial/clear-random.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/clear-repeat.c b/progs/trivial/clear-repeat.c
index 9f9490c6c87..9c618d492f3 100644
--- a/progs/trivial/clear-repeat.c
+++ b/progs/trivial/clear-repeat.c
@@ -72,6 +72,24 @@ static void Draw(void)
glClearColor((sin(f)+1)/2.0,(cos(f)+1)/2.0,0.5,1);
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
+
+ {
+ static GLint T0 = 0;
+ static GLint Frames = 0;
+ GLint t = glutGet(GLUT_ELAPSED_TIME);
+
+ Frames++;
+
+ if (t - T0 >= 5000) {
+ GLfloat seconds = (t - T0) / 1000.0;
+ GLfloat fps = Frames / seconds;
+ printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
+ fflush(stdout);
+ T0 = t;
+ Frames = 0;
+ }
+ }
+
}
glutPostRedisplay();
}
@@ -91,13 +109,13 @@ int main(int argc, char **argv)
exit(1);
}
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
type = GLUT_RGB | GLUT_ALPHA;
type |= GLUT_DOUBLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/clear.c b/progs/trivial/clear.c
index da4fff04590..37cfd54fbe2 100644
--- a/progs/trivial/clear.c
+++ b/progs/trivial/clear.c
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/createwin.c b/progs/trivial/createwin.c
index 901048555a9..44d5b1b2c5f 100644
--- a/progs/trivial/createwin.c
+++ b/progs/trivial/createwin.c
@@ -106,7 +106,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/dlist-dangling.c b/progs/trivial/dlist-dangling.c
index 00a75078444..64054ec96c1 100644
--- a/progs/trivial/dlist-dangling.c
+++ b/progs/trivial/dlist-dangling.c
@@ -135,7 +135,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/dlist-edgeflag-dangling.c b/progs/trivial/dlist-edgeflag-dangling.c
index 08fae549c31..1b66244cabf 100644
--- a/progs/trivial/dlist-edgeflag-dangling.c
+++ b/progs/trivial/dlist-edgeflag-dangling.c
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/dlist-edgeflag.c b/progs/trivial/dlist-edgeflag.c
index ae799dc3557..350100681e5 100644
--- a/progs/trivial/dlist-edgeflag.c
+++ b/progs/trivial/dlist-edgeflag.c
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/draw2arrays.c b/progs/trivial/draw2arrays.c
new file mode 100644
index 00000000000..95a89981d3a
--- /dev/null
+++ b/progs/trivial/draw2arrays.c
@@ -0,0 +1,117 @@
+/* Basic VBO */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+GLfloat pos[][3] =
+ { { 0.9, -0.9, 0.0 },
+ { 0.9, 0.9, 0.0 },
+ { -0.9, 0.9, 0.0 },
+ { -0.9, -0.9, 0.0 } };
+
+GLubyte color[][4] =
+{ { 0x00, 0x00, 0xff, 0x00 },
+ { 0x00, 0xff, 0x00, 0x00 },
+ { 0xff, 0x00, 0x00, 0x00 },
+ { 0xff, 0xff, 0xff, 0x00 } };
+
+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(pos[0]), pos );
+ glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof(color[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_ARB);
+
+// glDrawArrays( GL_TRIANGLES, 0, 3 );
+ glDrawArrays( GL_TRIANGLES, 1, 3 );
+
+ 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]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/line-clip.c b/progs/trivial/line-clip.c
index fd79d049c4f..bcee32e25fc 100644
--- a/progs/trivial/line-clip.c
+++ b/progs/trivial/line-clip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-cull.c b/progs/trivial/line-cull.c
index 038004b4c4a..98218731304 100644
--- a/progs/trivial/line-cull.c
+++ b/progs/trivial/line-cull.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-stipple-wide.c b/progs/trivial/line-stipple-wide.c
index 09e5e1fe089..28d96c797b0 100644
--- a/progs/trivial/line-stipple-wide.c
+++ b/progs/trivial/line-stipple-wide.c
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip-clip.c b/progs/trivial/line-userclip-clip.c
index 5c9c1b3b291..1b9f059729c 100644
--- a/progs/trivial/line-userclip-clip.c
+++ b/progs/trivial/line-userclip-clip.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip-nop-clip.c b/progs/trivial/line-userclip-nop-clip.c
index a6ee44fbd0f..9f144a6e9a3 100644
--- a/progs/trivial/line-userclip-nop-clip.c
+++ b/progs/trivial/line-userclip-nop-clip.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip-nop.c b/progs/trivial/line-userclip-nop.c
index cebea5f4812..7588faeb98f 100644
--- a/progs/trivial/line-userclip-nop.c
+++ b/progs/trivial/line-userclip-nop.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip.c b/progs/trivial/line-userclip.c
index ecfd28cac71..77d8228188c 100644
--- a/progs/trivial/line-userclip.c
+++ b/progs/trivial/line-userclip.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-wide.c b/progs/trivial/line-wide.c
index 543b1f67f34..f20505378cb 100644
--- a/progs/trivial/line-wide.c
+++ b/progs/trivial/line-wide.c
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line.c b/progs/trivial/line.c
index de5f9274e41..7ccbce3750a 100644
--- a/progs/trivial/line.c
+++ b/progs/trivial/line.c
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/lineloop-clip.c b/progs/trivial/lineloop-clip.c
index 211056720fe..fbeca985b90 100644
--- a/progs/trivial/lineloop-clip.c
+++ b/progs/trivial/lineloop-clip.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/lineloop.c b/progs/trivial/lineloop.c
index fab7d1ea022..5863df654b8 100644
--- a/progs/trivial/lineloop.c
+++ b/progs/trivial/lineloop.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-clip.c b/progs/trivial/linestrip-clip.c
index acab0f4e1cf..dae27c31d44 100644
--- a/progs/trivial/linestrip-clip.c
+++ b/progs/trivial/linestrip-clip.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-flat-stipple.c b/progs/trivial/linestrip-flat-stipple.c
index b691437346a..ee79f150194 100644
--- a/progs/trivial/linestrip-flat-stipple.c
+++ b/progs/trivial/linestrip-flat-stipple.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-stipple-wide.c b/progs/trivial/linestrip-stipple-wide.c
index 53dfa554e98..c6307d59941 100644
--- a/progs/trivial/linestrip-stipple-wide.c
+++ b/progs/trivial/linestrip-stipple-wide.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-stipple.c b/progs/trivial/linestrip-stipple.c
index 5933d1a136f..2b40b5f1b8e 100644
--- a/progs/trivial/linestrip-stipple.c
+++ b/progs/trivial/linestrip-stipple.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip.c b/progs/trivial/linestrip.c
index 06dd1c10872..865a752796c 100644
--- a/progs/trivial/linestrip.c
+++ b/progs/trivial/linestrip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/long-fixed-func.c b/progs/trivial/long-fixed-func.c
index 41ad25c1b3d..f2a29a9d376 100644
--- a/progs/trivial/long-fixed-func.c
+++ b/progs/trivial/long-fixed-func.c
@@ -139,7 +139,7 @@ main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize( 250, 250);
glutInitDisplayMode(type);
- if (glutCreateWindow("tri-long-fixedfunc") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
glewInit();
diff --git a/progs/trivial/point-clip.c b/progs/trivial/point-clip.c
index 7fec54e1db9..6aaee0d1a5f 100644
--- a/progs/trivial/point-clip.c
+++ b/progs/trivial/point-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point-sprite.c b/progs/trivial/point-sprite.c
index 583bdca1b71..2f8226ee273 100644
--- a/progs/trivial/point-sprite.c
+++ b/progs/trivial/point-sprite.c
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point-wide-smooth.c b/progs/trivial/point-wide-smooth.c
index 55cbcaec70b..63f83badf8c 100644
--- a/progs/trivial/point-wide-smooth.c
+++ b/progs/trivial/point-wide-smooth.c
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c
index 265b20097b1..725edae49ec 100644
--- a/progs/trivial/point-wide.c
+++ b/progs/trivial/point-wide.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point.c b/progs/trivial/point.c
index 8dabfb6ca64..3c472c1b91e 100644
--- a/progs/trivial/point.c
+++ b/progs/trivial/point.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-flat-clip.c b/progs/trivial/poly-flat-clip.c
index 72c2a29a0d2..d58a3a358f8 100644
--- a/progs/trivial/poly-flat-clip.c
+++ b/progs/trivial/poly-flat-clip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-flat-unfilled-clip.c b/progs/trivial/poly-flat-unfilled-clip.c
index d3a14a516a4..74249eb4999 100644
--- a/progs/trivial/poly-flat-unfilled-clip.c
+++ b/progs/trivial/poly-flat-unfilled-clip.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-flat.c b/progs/trivial/poly-flat.c
index a847d6828a7..82098bc1bbc 100644
--- a/progs/trivial/poly-flat.c
+++ b/progs/trivial/poly-flat.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-unfilled.c b/progs/trivial/poly-unfilled.c
index ae092a830ab..5cc8523f815 100644
--- a/progs/trivial/poly-unfilled.c
+++ b/progs/trivial/poly-unfilled.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly.c b/progs/trivial/poly.c
index 2f254de4815..8944f148d09 100644
--- a/progs/trivial/poly.c
+++ b/progs/trivial/poly.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-clip-all-vertices.c b/progs/trivial/quad-clip-all-vertices.c
index 3e0f3d94948..6559adf4af8 100644
--- a/progs/trivial/quad-clip-all-vertices.c
+++ b/progs/trivial/quad-clip-all-vertices.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-clip-nearplane.c b/progs/trivial/quad-clip-nearplane.c
index 1e8056c474b..0e4f4c947c3 100644
--- a/progs/trivial/quad-clip-nearplane.c
+++ b/progs/trivial/quad-clip-nearplane.c
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-clip.c b/progs/trivial/quad-clip.c
index 504fef3dc59..fd3522a89a2 100644
--- a/progs/trivial/quad-clip.c
+++ b/progs/trivial/quad-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-degenerate.c b/progs/trivial/quad-degenerate.c
index 83047408573..29fb2774deb 100644
--- a/progs/trivial/quad-degenerate.c
+++ b/progs/trivial/quad-degenerate.c
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-flat.c b/progs/trivial/quad-flat.c
index bd8be7c43e3..570eb6bc715 100644
--- a/progs/trivial/quad-flat.c
+++ b/progs/trivial/quad-flat.c
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-offset-factor.c b/progs/trivial/quad-offset-factor.c
index 90943d908ff..2c4946a13a6 100644
--- a/progs/trivial/quad-offset-factor.c
+++ b/progs/trivial/quad-offset-factor.c
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-offset-unfilled.c b/progs/trivial/quad-offset-unfilled.c
index 1ad44cdcaec..40762825bd1 100644
--- a/progs/trivial/quad-offset-unfilled.c
+++ b/progs/trivial/quad-offset-unfilled.c
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-offset-units.c b/progs/trivial/quad-offset-units.c
index d5db21469e6..b4b138b4b44 100644
--- a/progs/trivial/quad-offset-units.c
+++ b/progs/trivial/quad-offset-units.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-2d.c b/progs/trivial/quad-tex-2d.c
index 97c9fc54d86..ed6f4a07330 100644
--- a/progs/trivial/quad-tex-2d.c
+++ b/progs/trivial/quad-tex-2d.c
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- win = glutCreateWindow("First Tri");
+ win = glutCreateWindow(*argv);
if (!win) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-3d.c b/progs/trivial/quad-tex-3d.c
index ca7ea91d2f3..84acb35fd82 100644
--- a/progs/trivial/quad-tex-3d.c
+++ b/progs/trivial/quad-tex-3d.c
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-alpha.c b/progs/trivial/quad-tex-alpha.c
index cd73f013eb0..be24255a3e2 100644
--- a/progs/trivial/quad-tex-alpha.c
+++ b/progs/trivial/quad-tex-alpha.c
@@ -156,7 +156,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-pbo.c b/progs/trivial/quad-tex-pbo.c
index c6f60f51fa6..dcb4ae0e7f8 100644
--- a/progs/trivial/quad-tex-pbo.c
+++ b/progs/trivial/quad-tex-pbo.c
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-sub.c b/progs/trivial/quad-tex-sub.c
new file mode 100644
index 00000000000..aabbb9edce9
--- /dev/null
+++ b/progs/trivial/quad-tex-sub.c
@@ -0,0 +1,203 @@
+/*
+ * 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+#define SIZE 16
+GLenum doubleBuffer;
+GLint line = 0;
+
+static void MakeImage()
+{
+ GLubyte tex2d[SIZE][SIZE][3];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+ tex2d[t][s][0] = s*255/(SIZE-1);
+ tex2d[t][s][1] = t*255/(SIZE-1);
+ tex2d[t][s][2] = 0*255/(SIZE-1);
+ }
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+ SIZE, SIZE,
+ 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ glEnable(GL_TEXTURE_2D);
+}
+
+static void UpdateLine()
+{
+ GLubyte tex[SIZE][3];
+ GLubyte b = 0;
+ GLint s, t;
+
+ t = line % SIZE;
+ if (line % (SIZE * 2) < SIZE)
+ b = 255;
+ else
+ b = 0;
+
+ for (s = 0; s < SIZE; s++) {
+ tex[s][0] = s*255/(SIZE-1);
+ tex[s][1] = t*255/(SIZE-1);
+ tex[s][2] = b;
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexSubImage2D(GL_TEXTURE_2D, 0,
+ 0, t,
+ SIZE, 1,
+ GL_RGB, GL_UNSIGNED_BYTE, tex);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+}
+
+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);
+
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ MakeImage();
+ UpdateLine();
+ line++;
+}
+
+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:
+ UpdateLine();
+ line++;
+ break;
+ }
+
+ 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 | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(*argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quad-unfilled-clip.c b/progs/trivial/quad-unfilled-clip.c
index e298bd455bf..e25a34bda85 100644
--- a/progs/trivial/quad-unfilled-clip.c
+++ b/progs/trivial/quad-unfilled-clip.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-unfilled-stipple.c b/progs/trivial/quad-unfilled-stipple.c
index 2036aacbaab..d33e5918bce 100644
--- a/progs/trivial/quad-unfilled-stipple.c
+++ b/progs/trivial/quad-unfilled-stipple.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-unfilled.c b/progs/trivial/quad-unfilled.c
index 9d0087ce08d..b60af3e7f56 100644
--- a/progs/trivial/quad-unfilled.c
+++ b/progs/trivial/quad-unfilled.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad.c b/progs/trivial/quad.c
index 85424b7b388..c4773ec7dab 100644
--- a/progs/trivial/quad.c
+++ b/progs/trivial/quad.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quads.c b/progs/trivial/quads.c
index 307a9e07209..5bc622144ed 100644
--- a/progs/trivial/quads.c
+++ b/progs/trivial/quads.c
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quadstrip-clip.c b/progs/trivial/quadstrip-clip.c
new file mode 100644
index 00000000000..82a6d4e0769
--- /dev/null
+++ b/progs/trivial/quadstrip-clip.c
@@ -0,0 +1,137 @@
+/*
+ * 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+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);
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_QUAD_STRIP);
+ glColor3f(1,1,1);
+ glVertex3f( 1.9, -0.9, -30.0);
+ glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(1,0,0);
+ glVertex3f( 0.1, -0.8, -30.0);
+ glVertex3f( 0.1, 0.8, -30.0);
+
+ glColor3f(0,1,0);
+ glVertex3f(-0.1, -0.9, -30.0);
+ glVertex3f(-0.1, 0.9, -30.0);
+
+ glColor3f(0,0,0);
+ glVertex3f(-0.9, -0.8, -30.0);
+ 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 | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(*argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quadstrip-cont.c b/progs/trivial/quadstrip-cont.c
index c6c8f69f8ca..62208dfae75 100644
--- a/progs/trivial/quadstrip-cont.c
+++ b/progs/trivial/quadstrip-cont.c
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quadstrip-flat.c b/progs/trivial/quadstrip-flat.c
index d02135f702a..9011ee0873f 100644
--- a/progs/trivial/quadstrip-flat.c
+++ b/progs/trivial/quadstrip-flat.c
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quadstrip.c b/progs/trivial/quadstrip.c
index ff8644be09e..6923afc04b5 100644
--- a/progs/trivial/quadstrip.c
+++ b/progs/trivial/quadstrip.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-alpha-tex.c b/progs/trivial/tri-alpha-tex.c
index 776f39dcc35..382d7b21029 100644
--- a/progs/trivial/tri-alpha-tex.c
+++ b/progs/trivial/tri-alpha-tex.c
@@ -165,7 +165,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-alpha.c b/progs/trivial/tri-alpha.c
index 90cfdbe199d..1a653713bbf 100644
--- a/progs/trivial/tri-alpha.c
+++ b/progs/trivial/tri-alpha.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-blend-color.c b/progs/trivial/tri-blend-color.c
index d2d72d0b62f..db831e3d6e0 100644
--- a/progs/trivial/tri-blend-color.c
+++ b/progs/trivial/tri-blend-color.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-clear.c b/progs/trivial/tri-clear.c
index 25ea77cfa75..a3908e38e9d 100644
--- a/progs/trivial/tri-clear.c
+++ b/progs/trivial/tri-clear.c
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-clip.c b/progs/trivial/tri-clip.c
index f30445cdba1..0d31086c855 100644
--- a/progs/trivial/tri-clip.c
+++ b/progs/trivial/tri-clip.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-cull-both.c b/progs/trivial/tri-cull-both.c
index 51b5865ae5c..73c5583cfdd 100644
--- a/progs/trivial/tri-cull-both.c
+++ b/progs/trivial/tri-cull-both.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-cull.c b/progs/trivial/tri-cull.c
index 2eead841155..c6bcf444e42 100644
--- a/progs/trivial/tri-cull.c
+++ b/progs/trivial/tri-cull.c
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-dlist.c b/progs/trivial/tri-dlist.c
index c21c4714adf..1c0e320f61a 100644
--- a/progs/trivial/tri-dlist.c
+++ b/progs/trivial/tri-dlist.c
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-edgeflag.c b/progs/trivial/tri-edgeflag.c
index 41899c2eb4f..e1278dd6490 100644
--- a/progs/trivial/tri-edgeflag.c
+++ b/progs/trivial/tri-edgeflag.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-fbo-tex-mip.c b/progs/trivial/tri-fbo-tex-mip.c
new file mode 100644
index 00000000000..07443695011
--- /dev/null
+++ b/progs/trivial/tri-fbo-tex-mip.c
@@ -0,0 +1,261 @@
+/* Framebuffer object test */
+
+
+#include <GL/glew.h>
+#include <GL/glut.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+/* For debug */
+
+
+static int Win = 0;
+static int Width = 512, Height = 512;
+
+static GLenum TexTarget = GL_TEXTURE_2D;
+static int TexWidth = 512, TexHeight = 512;
+
+static GLuint MyFB;
+static GLuint TexObj;
+static GLboolean Anim = GL_FALSE;
+static GLfloat Rot = 0.0;
+static GLuint TextureLevel = 4; /* which texture level to render to */
+static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
+
+
+static void
+CheckError(int line)
+{
+ GLenum err = glGetError();
+ if (err) {
+ printf("GL Error 0x%x at line %d\n", (int) err, line);
+ }
+}
+
+
+static void
+Idle(void)
+{
+ Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
+ glutPostRedisplay();
+}
+
+
+static void
+RenderTexture(void)
+{
+ GLenum status;
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+
+ if (1) {
+ /* draw to texture image */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+
+ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ printf("Framebuffer incomplete!!!\n");
+ }
+
+ glViewport(0, 0,
+ TexWidth / (1 << TextureLevel),
+ TexHeight / (1 << TextureLevel));
+ glClearColor(0.5, 0.5, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ CheckError(__LINE__);
+
+ glBegin(GL_POLYGON);
+ glColor3f(1, 0, 0);
+ glVertex2f(-1, -1);
+ glColor3f(0, 1, 0);
+ glVertex2f(1, -1);
+ glColor3f(0, 0, 1);
+ glVertex2f(0, 1);
+ glEnd();
+
+ /* Bind normal framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+ else {
+ }
+
+ CheckError(__LINE__);
+}
+
+
+
+static void
+Display(void)
+{
+ float ar = (float) Width / (float) Height;
+
+ RenderTexture();
+
+ /* draw textured quad in the window */
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -7.0);
+
+ glViewport(0, 0, Width, Height);
+
+ glClearColor(0.25, 0.25, 0.25, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(Rot, 0, 1, 0);
+ glEnable(TexTarget);
+ glBindTexture(TexTarget, TexObj);
+
+ {
+ glBegin(GL_POLYGON);
+ glColor3f(0.25, 0.25, 0.25);
+ glTexCoord2f(0, 0);
+ glVertex2f(-1, -1);
+ glTexCoord2f(1, 0);
+ glVertex2f(1, -1);
+ glColor3f(1.0, 1.0, 1.0);
+ glTexCoord2f(1, 1);
+ glVertex2f(1, 1);
+ glTexCoord2f(0, 1);
+ glVertex2f(-1, 1);
+ glEnd();
+ }
+
+ glPopMatrix();
+ glDisable(TexTarget);
+
+ glutSwapBuffers();
+ CheckError(__LINE__);
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ Width = width;
+ Height = height;
+}
+
+
+static void
+CleanUp(void)
+{
+ glDeleteFramebuffersEXT(1, &MyFB);
+
+ glDeleteTextures(1, &TexObj);
+
+ glutDestroyWindow(Win);
+
+ exit(0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 's':
+ Rot += 2.0;
+ break;
+ case 27:
+ CleanUp();
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(int argc, char *argv[])
+{
+ if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+ printf("GL_EXT_framebuffer_object not found!\n");
+ exit(0);
+ }
+
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+
+
+ /* Make texture object/image */
+ glGenTextures(1, &TexObj);
+ glBindTexture(TexTarget, TexObj);
+ glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
+
+ glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexImage2D(TexTarget, TextureLevel, TexIntFormat,
+ TexWidth / (1 << TextureLevel), TexHeight / (1 << TextureLevel), 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+
+
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+
+
+
+ /* gen framebuffer id, delete it, do some assertions, just for testing */
+ glGenFramebuffersEXT(1, &MyFB);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+ assert(glIsFramebufferEXT(MyFB));
+
+
+ CheckError(__LINE__);
+
+ /* Render color to texture */
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ TexTarget, TexObj, TextureLevel);
+
+
+
+ CheckError(__LINE__);
+
+ /* bind regular framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+
+
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(Width, Height);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ Win = glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Display);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init(argc, argv);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-fbo-tex.c b/progs/trivial/tri-fbo-tex.c
index 253f9310db4..72b4cf3683d 100644
--- a/progs/trivial/tri-fbo-tex.c
+++ b/progs/trivial/tri-fbo-tex.c
@@ -1,12 +1,4 @@
-/*
- * Test GL_EXT_framebuffer_object render-to-texture
- *
- * Draw a teapot into a texture image with stenciling.
- * Then draw a textured quad using that texture.
- *
- * Brian Paul
- * 18 Apr 2005
- */
+/* Framebuffer object test */
#include <GL/glew.h>
diff --git a/progs/trivial/tri-flat-clip.c b/progs/trivial/tri-flat-clip.c
index 155b0c4f8d4..3235100385c 100644
--- a/progs/trivial/tri-flat-clip.c
+++ b/progs/trivial/tri-flat-clip.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-flat.c b/progs/trivial/tri-flat.c
index 0583a2a99a1..a7fdaa1f469 100644
--- a/progs/trivial/tri-flat.c
+++ b/progs/trivial/tri-flat.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-fog.c b/progs/trivial/tri-fog.c
index 75f3262ecf4..0099a90ad6c 100644
--- a/progs/trivial/tri-fog.c
+++ b/progs/trivial/tri-fog.c
@@ -42,6 +42,15 @@ static void Init(void)
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
glClearColor(0.0, 0.0, 1.0, 0.0);
+
+ glEnable(GL_FOG);
+ glFogi(GL_FOG_MODE, GL_LINEAR);
+ glFogf(GL_FOG_START, 25);
+ glFogf(GL_FOG_END, 35);
+#if 0
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable (GL_BLEND);
+#endif
}
static void Reshape(int width, int height)
@@ -70,26 +79,26 @@ static void Key(unsigned char key, int x, int y)
static void Draw(void)
{
- glClear(GL_COLOR_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_FOG);
glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
+ glColor3f(1,1,1);
glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
+ glColor3f(1,1,1);
glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(1,1,1);
+ glVertex3f(-0.9, 0.0, -40.0);
glEnd();
#if 0
glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
+ glColor3f(0,0,.7);
glVertex3f(-0.9, -0.9, -30.0);
- glColor3f(.8,0,0);
+ glColor3f(.8,0,0);
glVertex3f(-0.9, 0.9, -30.0);
- glColor3f(0,.9,0);
+ glColor3f(0,.9,0);
glVertex3f( 0.9, 0.0, -30.0);
glEnd();
#endif
@@ -138,7 +147,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-fp-const-imm.c b/progs/trivial/tri-fp-const-imm.c
index 9e2c63a22af..2b1499903c1 100644
--- a/progs/trivial/tri-fp-const-imm.c
+++ b/progs/trivial/tri-fp-const-imm.c
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-fp.c b/progs/trivial/tri-fp.c
index fcf57f5a85f..b30f9b73e0f 100644
--- a/progs/trivial/tri-fp.c
+++ b/progs/trivial/tri-fp.c
@@ -153,7 +153,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-lit.c b/progs/trivial/tri-lit.c
index 22f199c9828..91fac1a5981 100644
--- a/progs/trivial/tri-lit.c
+++ b/progs/trivial/tri-lit.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-logicop-none.c b/progs/trivial/tri-logicop-none.c
new file mode 100644
index 00000000000..aba3614bf68
--- /dev/null
+++ b/progs/trivial/tri-logicop-none.c
@@ -0,0 +1,178 @@
+/*
+ * 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer = 1;
+int win;
+
+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.3, 0.1, 0.3, 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(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
+ glEnd();
+
+
+ glLineWidth(4.0);
+
+ glBegin(GL_LINES);
+ glColor3f(.1,.7,.1);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glVertex3f( 0.5, 0.5, -30.0);
+
+ glColor3f(.1,.1,.8);
+ glVertex3f( 0.5, 0.5, -30.0);
+ glVertex3f(-0.5, 0.5, -30.0);
+
+ glColor3f(.5,.1,.1);
+ glVertex3f(-0.5, 0.5, -30.0);
+ glVertex3f(-0.5, -0.5, -30.0);
+
+ glColor3f(.8,.8,.8);
+ glVertex3f(-0.5, -0.5, -30.0);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glEnd();
+
+// glLineWidth(12.0);
+
+ /* Redraw parts of the lines:
+ */
+ glBegin(GL_LINES);
+ glColor3f(.1,.7,.1);
+ glVertex3f( 0.5, -0.2, -30.0);
+ glVertex3f( 0.5, 0.2, -30.0);
+
+ glColor3f(.1,.1,.8);
+ glVertex3f( 0.2, 0.5, -30.0);
+ glVertex3f(-0.2, 0.5, -30.0);
+
+ glColor3f(.5,.1,.1);
+ glVertex3f(-0.5, 0.2, -30.0);
+ glVertex3f(-0.5, -0.2, -30.0);
+
+ glColor3f(.8,.8,.8);
+ glVertex3f(-0.2, -0.5, -30.0);
+ glVertex3f( 0.2, -0.5, -30.0);
+ glEnd();
+
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ 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_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ win = glutCreateWindow(*argv);
+ if (!win) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-logicop-xor.c b/progs/trivial/tri-logicop-xor.c
new file mode 100644
index 00000000000..e2c94f9bee7
--- /dev/null
+++ b/progs/trivial/tri-logicop-xor.c
@@ -0,0 +1,186 @@
+/*
+ * 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer = 1;
+int win;
+
+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.3, 0.1, 0.3, 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(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
+ glEnd();
+
+
+ glLineWidth(4.0);
+
+ glEnable(GL_BLEND);
+ glEnable(GL_COLOR_LOGIC_OP);
+ glLogicOp(GL_XOR);
+
+ glBegin(GL_LINES);
+ glColor3f(.1,.7,.1);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glVertex3f( 0.5, 0.5, -30.0);
+
+ glColor3f(.1,.1,.8);
+ glVertex3f( 0.5, 0.5, -30.0);
+ glVertex3f(-0.5, 0.5, -30.0);
+
+ glColor3f(.5,.1,.1);
+ glVertex3f(-0.5, 0.5, -30.0);
+ glVertex3f(-0.5, -0.5, -30.0);
+
+ glColor3f(.8,.8,.8);
+ glVertex3f(-0.5, -0.5, -30.0);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glEnd();
+
+// glLineWidth(12.0);
+
+ /* Redraw parts of the lines to remove them:
+ */
+ glBegin(GL_LINES);
+ glColor3f(.1,.7,.1);
+ glVertex3f( 0.5, -0.2, -30.0);
+ glVertex3f( 0.5, 0.2, -30.0);
+
+ glColor3f(.1,.1,.8);
+ glVertex3f( 0.2, 0.5, -30.0);
+ glVertex3f(-0.2, 0.5, -30.0);
+
+ glColor3f(.5,.1,.1);
+ glVertex3f(-0.5, 0.2, -30.0);
+ glVertex3f(-0.5, -0.2, -30.0);
+
+ glColor3f(.8,.8,.8);
+ glVertex3f(-0.2, -0.5, -30.0);
+ glVertex3f( 0.2, -0.5, -30.0);
+ glEnd();
+
+
+
+ glDisable(GL_COLOR_LOGIC_OP);
+ glDisable(GL_BLEND);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ 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_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ win = glutCreateWindow(*argv);
+ if (!win) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-mask-tri.c b/progs/trivial/tri-mask-tri.c
index 8333f7ed8ab..449125a4db7 100644
--- a/progs/trivial/tri-mask-tri.c
+++ b/progs/trivial/tri-mask-tri.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(100, 0); glutInitWindowSize(Width, Height);
glutInitDisplayMode(type);
- Win = glutCreateWindow("First Tri");
+ Win = glutCreateWindow(*argv);
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/progs/trivial/tri-orig.c b/progs/trivial/tri-orig.c
index d5e6742ce1a..6861ff6e492 100644
--- a/progs/trivial/tri-orig.c
+++ b/progs/trivial/tri-orig.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-query.c b/progs/trivial/tri-query.c
index 25cfcb8e148..9b319ba2a7d 100644
--- a/progs/trivial/tri-query.c
+++ b/progs/trivial/tri-query.c
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-repeat.c b/progs/trivial/tri-repeat.c
index e894269e84b..a271fab54cc 100644
--- a/progs/trivial/tri-repeat.c
+++ b/progs/trivial/tri-repeat.c
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
type |= GLUT_DOUBLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-scissor-tri.c b/progs/trivial/tri-scissor-tri.c
index dcc6d282dc2..2b5536ecd65 100644
--- a/progs/trivial/tri-scissor-tri.c
+++ b/progs/trivial/tri-scissor-tri.c
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-square.c b/progs/trivial/tri-square.c
index ef9ea63048f..9102888abd0 100644
--- a/progs/trivial/tri-square.c
+++ b/progs/trivial/tri-square.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-stencil.c b/progs/trivial/tri-stencil.c
index 7686e16aef1..9f68bca9149 100644
--- a/progs/trivial/tri-stencil.c
+++ b/progs/trivial/tri-stencil.c
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
type = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH | GLUT_STENCIL;
glutInitDisplayMode(type);
- if (glutCreateWindow("Stencil Test") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-stipple.c b/progs/trivial/tri-stipple.c
index 887de550e2c..33e6dd16a7e 100644
--- a/progs/trivial/tri-stipple.c
+++ b/progs/trivial/tri-stipple.c
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-tex-3d.c b/progs/trivial/tri-tex-3d.c
index 50f6a754189..4f276af653f 100644
--- a/progs/trivial/tri-tex-3d.c
+++ b/progs/trivial/tri-tex-3d.c
@@ -157,7 +157,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-tex.c b/progs/trivial/tri-tex.c
index a0d75b4a331..1dbbe6aa586 100644
--- a/progs/trivial/tri-tex.c
+++ b/progs/trivial/tri-tex.c
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-tri.c b/progs/trivial/tri-tri.c
index 06a0528eb87..8b0c2dafefe 100644
--- a/progs/trivial/tri-tri.c
+++ b/progs/trivial/tri-tri.c
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-clip.c b/progs/trivial/tri-unfilled-clip.c
index df161df3fb8..438899dc1a0 100644
--- a/progs/trivial/tri-unfilled-clip.c
+++ b/progs/trivial/tri-unfilled-clip.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-edgeflag.c b/progs/trivial/tri-unfilled-edgeflag.c
index 31f41f6220b..78c5ae8e9cd 100644
--- a/progs/trivial/tri-unfilled-edgeflag.c
+++ b/progs/trivial/tri-unfilled-edgeflag.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-fog.c b/progs/trivial/tri-unfilled-fog.c
new file mode 100644
index 00000000000..113b8d051df
--- /dev/null
+++ b/progs/trivial/tri-unfilled-fog.c
@@ -0,0 +1,152 @@
+/*
+ * 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+GLint Width = 250, Height = 250;
+
+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);
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_FOG);
+
+ glPolygonMode(GL_FRONT, GL_FILL);
+ glPolygonMode(GL_BACK, GL_FILL);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.7, -0.7, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.7, 0.7, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.7, 0.0, -30.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_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(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glDisable(GL_FOG);
+
+ 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(100, 0); glutInitWindowSize(Width, Height);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(*argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-point.c b/progs/trivial/tri-unfilled-point.c
index 71ac453d603..b0502801552 100644
--- a/progs/trivial/tri-unfilled-point.c
+++ b/progs/trivial/tri-unfilled-point.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-smooth.c b/progs/trivial/tri-unfilled-smooth.c
index f70c1cd9d4d..9306af849a4 100644
--- a/progs/trivial/tri-unfilled-smooth.c
+++ b/progs/trivial/tri-unfilled-smooth.c
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-tri-lit.c b/progs/trivial/tri-unfilled-tri-lit.c
index f9e1d009884..775c3530b7e 100644
--- a/progs/trivial/tri-unfilled-tri-lit.c
+++ b/progs/trivial/tri-unfilled-tri-lit.c
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-tri.c b/progs/trivial/tri-unfilled-tri.c
index d9a9faeb9f5..ce789255fd9 100644
--- a/progs/trivial/tri-unfilled-tri.c
+++ b/progs/trivial/tri-unfilled-tri.c
@@ -161,7 +161,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-userclip-stip.c b/progs/trivial/tri-unfilled-userclip-stip.c
index 4aefa85032f..6835b53c0f5 100644
--- a/progs/trivial/tri-unfilled-userclip-stip.c
+++ b/progs/trivial/tri-unfilled-userclip-stip.c
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled-userclip.c b/progs/trivial/tri-unfilled-userclip.c
index 9201f9d433c..aab5abc2303 100644
--- a/progs/trivial/tri-unfilled-userclip.c
+++ b/progs/trivial/tri-unfilled-userclip.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-unfilled.c b/progs/trivial/tri-unfilled.c
index 1e44823db5a..4f50d083c2d 100644
--- a/progs/trivial/tri-unfilled.c
+++ b/progs/trivial/tri-unfilled.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-userclip.c b/progs/trivial/tri-userclip.c
index ccf631dff80..43d19cebab5 100644
--- a/progs/trivial/tri-userclip.c
+++ b/progs/trivial/tri-userclip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-viewport.c b/progs/trivial/tri-viewport.c
new file mode 100644
index 00000000000..3205b9ee9c3
--- /dev/null
+++ b/progs/trivial/tri-viewport.c
@@ -0,0 +1,129 @@
+/*
+ * 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 <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+GLenum doubleBuffer = 1;
+int win;
+
+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.3, 0.1, 0.3, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+ glViewport(width / -2.0, height / -2.0, width, height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ 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_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ win = glutCreateWindow(*argv);
+ if (!win) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-z-9.c b/progs/trivial/tri-z-9.c
index 4bd99861660..e7d4184bdb0 100644
--- a/progs/trivial/tri-z-9.c
+++ b/progs/trivial/tri-z-9.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-z-eq.c b/progs/trivial/tri-z-eq.c
index ad5f31a5588..4ec55ac080a 100644
--- a/progs/trivial/tri-z-eq.c
+++ b/progs/trivial/tri-z-eq.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c
index d3c6b59ea5d..d99d5872a90 100644
--- a/progs/trivial/tri.c
+++ b/progs/trivial/tri.c
@@ -41,28 +41,28 @@ static void Init(void)
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- glClearColor(0.3, 0.1, 0.3, 0.0);
+ glClearColor(0.3, 0.1, 0.3, 0.0);
}
static void Reshape(int width, int height)
{
- glViewport(0, 0, (GLint)width, (GLint)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);
+ 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(0);
- default:
- glutPostRedisplay();
- return;
+ case 27:
+ exit(0);
+ default:
+ glutPostRedisplay();
+ return;
}
}
@@ -88,47 +88,47 @@ static void Draw(void)
static GLenum Args(int argc, char **argv)
{
- GLint i;
-
- 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;
+ GLint i;
+
+ 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;
+ GLenum type;
- glutInit(&argc, argv);
+ glutInit(&argc, argv);
- if (Args(argc, argv) == GL_FALSE) {
- exit(1);
- }
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB | GLUT_ALPHA;
- type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
- glutInitDisplayMode(type);
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
- win = glutCreateWindow("First Tri");
- if (!win) {
- exit(1);
- }
+ win = glutCreateWindow(*argv);
+ if (!win) {
+ exit(1);
+ }
- Init();
+ Init();
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
}
diff --git a/progs/trivial/trifan-flat-clip.c b/progs/trivial/trifan-flat-clip.c
index 04042fac704..ec7a50a75e0 100644
--- a/progs/trivial/trifan-flat-clip.c
+++ b/progs/trivial/trifan-flat-clip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/trifan-flat-unfilled-clip.c b/progs/trivial/trifan-flat-unfilled-clip.c
index 25224412cc9..4887b5a30c5 100644
--- a/progs/trivial/trifan-flat-unfilled-clip.c
+++ b/progs/trivial/trifan-flat-unfilled-clip.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/trifan-flat.c b/progs/trivial/trifan-flat.c
index 737eccdcae7..cf75d4cf08f 100644
--- a/progs/trivial/trifan-flat.c
+++ b/progs/trivial/trifan-flat.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/trifan-unfilled.c b/progs/trivial/trifan-unfilled.c
index 8e7454108c0..491fe5b3df2 100644
--- a/progs/trivial/trifan-unfilled.c
+++ b/progs/trivial/trifan-unfilled.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/trifan.c b/progs/trivial/trifan.c
index ecb0424393e..ee9854dc94a 100644
--- a/progs/trivial/trifan.c
+++ b/progs/trivial/trifan.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tristrip-clip.c b/progs/trivial/tristrip-clip.c
index f95c66a62aa..eeab676ea90 100644
--- a/progs/trivial/tristrip-clip.c
+++ b/progs/trivial/tristrip-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tristrip-flat.c b/progs/trivial/tristrip-flat.c
index e048233e67c..49bb432b9df 100644
--- a/progs/trivial/tristrip-flat.c
+++ b/progs/trivial/tristrip-flat.c
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tristrip.c b/progs/trivial/tristrip.c
index 51ea4f23251..023e6475c0d 100644
--- a/progs/trivial/tristrip.c
+++ b/progs/trivial/tristrip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/vp-tri-cb-pos.c b/progs/trivial/vp-tri-cb-pos.c
index 430a4d3964c..42bf9806b19 100644
--- a/progs/trivial/vp-tri-cb-pos.c
+++ b/progs/trivial/vp-tri-cb-pos.c
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/vp-tri-cb-tex.c b/progs/trivial/vp-tri-cb-tex.c
index 57fd2cdbbd1..8290226675e 100644
--- a/progs/trivial/vp-tri-cb-tex.c
+++ b/progs/trivial/vp-tri-cb-tex.c
@@ -175,7 +175,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}