summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-03-22 08:40:35 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-03-22 08:40:35 +0000
commita47745e9fd2043eb140a0721bf83221a89cb684f (patch)
treee510da1d162641a8669bc51d338a53b2ab436af3 /progs
parent69ce6b7db0ef8a6539979c53452a5929238945e3 (diff)
Link GLU explicitly.
Subsetize some more demos.
Diffstat (limited to 'progs')
-rw-r--r--progs/demos/Makefile4
-rw-r--r--progs/demos/bounce.c12
-rw-r--r--progs/demos/isosurf.c12
-rw-r--r--progs/demos/terrain.c11
-rw-r--r--progs/demos/texobj.c18
5 files changed, 26 insertions, 31 deletions
diff --git a/progs/demos/Makefile b/progs/demos/Makefile
index db985b69024..7e5c73e5b9c 100644
--- a/progs/demos/Makefile
+++ b/progs/demos/Makefile
@@ -14,12 +14,12 @@ PROGS = gears \
# make executable from .c file:
.c: $(LIB_DEP)
- gcc -I../include -I../util -g $< -L../lib -lglut -lGL -lm -o $@
+ gcc -I../include -I../util -g $< -L../lib -lglut -lGL -lGLU -lm -o $@
default: $(PROGS)
clean:
- -rm *.o *~
+ -rm -f *.o *~ $(PROGS)
diff --git a/progs/demos/bounce.c b/progs/demos/bounce.c
index 34134901fb9..5ac4062ce87 100644
--- a/progs/demos/bounce.c
+++ b/progs/demos/bounce.c
@@ -1,4 +1,4 @@
-/* $Id: bounce.c,v 1.3.8.1 2003/02/23 19:25:07 keithw Exp $ */
+/* $Id: bounce.c,v 1.3.8.2 2003/03/22 08:40:35 keithw Exp $ */
/*
* Bouncing ball demo.
@@ -115,15 +115,15 @@ draw(void)
glColor3f(0, 1, 1);
glBegin(GL_LINES);
for (i = -5; i <= 5; i++) {
- glVertex2i(i, -5);
- glVertex2i(i, 5);
+ glVertex2f(i, -5);
+ glVertex2f(i, 5);
}
for (i = -5; i <= 5; i++) {
- glVertex2i(-5, i);
- glVertex2i(5, i);
+ glVertex2f(-5, i);
+ glVertex2f(5, i);
}
for (i = -5; i <= 5; i++) {
- glVertex2i(i, -5);
+ glVertex2f(i, -5);
glVertex2f(i * 1.15, -5.9);
}
glVertex2f(-5.3, -5.35);
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index 950622ef53a..c0c298df366 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -1,4 +1,4 @@
-/* $Id: isosurf.c,v 1.15.4.1 2003/02/23 21:04:25 keithw Exp $ */
+/* $Id: isosurf.c,v 1.15.4.2 2003/03/22 08:40:35 keithw Exp $ */
/*
* Display an isosurface of 3-D wind speed volume.
@@ -37,7 +37,7 @@
#define GL_GLEXT_LEGACY
#include "GL/glut.h"
-#include "readtex.c" /* I know, this is a hack. KW: me too. */
+#include "readtex.c"
#define TEXTURE_FILE "../images/reflect.rgb"
#define LIT 0x00000001
@@ -805,10 +805,10 @@ static void Init(int argc, char *argv[])
expand_arrays();
make_tri_indices();
- if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
- printf("Error: couldn't load texture image\n");
- exit(1);
- }
+/* if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { */
+/* printf("Error: couldn't load texture image\n"); */
+/* exit(1); */
+/* } */
}
}
diff --git a/progs/demos/terrain.c b/progs/demos/terrain.c
index f389f54cd68..98a4385c075 100644
--- a/progs/demos/terrain.c
+++ b/progs/demos/terrain.c
@@ -680,18 +680,13 @@ loadpic(void)
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if ((gluerr = gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, 256, 256, GL_RGBA,
- GL_UNSIGNED_BYTE,
- (GLvoid *) (&terrainpic[0][0])))) {
- fprintf(stderr, "GLULib%s\n", (char *) gluErrorString(gluerr));
- exit(-1);
- }
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, GL_RGBA, 256, 256, GL_RGBA,
+ GL_UNSIGNED_BYTE, (GLvoid *) terrainpic);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
diff --git a/progs/demos/texobj.c b/progs/demos/texobj.c
index dc297317919..b16a5c864da 100644
--- a/progs/demos/texobj.c
+++ b/progs/demos/texobj.c
@@ -1,4 +1,4 @@
-/* $Id: texobj.c,v 1.6.6.1 2003/02/23 19:25:07 keithw Exp $ */
+/* $Id: texobj.c,v 1.6.6.2 2003/03/22 08:40:35 keithw Exp $ */
/*
* Example of using the 1.1 texture object functions.
@@ -50,7 +50,7 @@ static void draw( void )
#endif
}
else {
- glCallList( TexObj[0] );
+/* glCallList( TexObj[0] ); */
}
glBegin( GL_POLYGON );
glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
@@ -70,7 +70,7 @@ static void draw( void )
#endif
}
else {
- glCallList( TexObj[1] );
+/* glCallList( TexObj[1] ); */
}
glBegin( GL_POLYGON );
glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
@@ -166,8 +166,8 @@ static void init( void )
#endif
}
else {
- TexObj[0] = glGenLists(2);
- TexObj[1] = TexObj[0]+1;
+/* TexObj[0] = glGenLists(2); */
+/* TexObj[1] = TexObj[0]+1; */
}
/* setup first texture object */
@@ -178,7 +178,7 @@ static void init( void )
#endif
}
else {
- glNewList( TexObj[0], GL_COMPILE );
+/* glNewList( TexObj[0], GL_COMPILE ); */
}
/* red on white */
for (i=0;i<height;i++) {
@@ -201,7 +201,7 @@ static void init( void )
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
if (!UseObj) {
- glEndList();
+/* glEndList(); */
}
/* end of texture object */
@@ -214,7 +214,7 @@ static void init( void )
/* assert(!glIsTexture(TexObj[1] + 999)); */
}
else {
- glNewList( TexObj[1], GL_COMPILE );
+/* glNewList( TexObj[1], GL_COMPILE ); */
}
/* green on blue */
for (i=0;i<height;i++) {
@@ -235,7 +235,7 @@ static void init( void )
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
if (!UseObj) {
- glEndList();
+/* glEndList(); */
}
/* end texture object */