summaryrefslogtreecommitdiff
path: root/progs/demos
diff options
context:
space:
mode:
authorKarl Schultz <kschultz@freedesktop.org>2002-01-16 00:48:43 +0000
committerKarl Schultz <kschultz@freedesktop.org>2002-01-16 00:48:43 +0000
commit164ce1220232e03660633e16681737782c73059e (patch)
tree31ff2ee201ee8063f60e7adb5fabdf35683d5efc /progs/demos
parent83356781e104cea412da9bd6d1127b56e0d7a6c4 (diff)
Demo updates for Windows (Robert Bergkvist)
Diffstat (limited to 'progs/demos')
-rw-r--r--progs/demos/Makefile.win42
-rw-r--r--progs/demos/ipers.c2
-rw-r--r--progs/demos/paltex.c5
-rw-r--r--progs/demos/pointblast.c6
-rw-r--r--progs/demos/rain.cxx24
-rw-r--r--progs/demos/winpos.c8
6 files changed, 70 insertions, 17 deletions
diff --git a/progs/demos/Makefile.win b/progs/demos/Makefile.win
index 829d2eaf6a..18372b05db 100644
--- a/progs/demos/Makefile.win
+++ b/progs/demos/Makefile.win
@@ -1,4 +1,4 @@
-# $Id: Makefile.win,v 1.6 2001/10/26 21:01:45 kschultz Exp $
+# $Id: Makefile.win,v 1.7 2002/01/16 00:48:43 kschultz Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -67,12 +67,41 @@ SRCS = \
geartrain.c \
glinfo.c \
gloss.c \
+ gltestperf.c \
+ glutfx.c \
isosurf.c \
+ lodbias.c \
morph3d.c \
- teapot.c
+ multiarb.c \
+ occlude.c \
+ paltex.c \
+ pixeltex.c \
+ pointblast.c \
+ ray.c \
+ readpix.c \
+ reflect.c \
+ renormal.c \
+ shadowtex.c \
+ spectex.c \
+ stex3d.c \
+ teapot.c \
+ terrain.c \
+ tessdemo.c \
+ texcyl.c \
+ texdown.c \
+ texenv.c \
+ texobj.c \
+ trispd.c \
+ tunnel.c \
+ tunnel2.c \
+ winpos.c
+
+CXXSRCS = \
+ rain.cxx
OSMESASRCS = osdemo.c
-
+IPERSSRCS = ipers.c
+IPERSEXES = $(IPERSSRCS:.c=.exe)
!include "../mesawin32.mak"
##### TARGETS #####
@@ -90,9 +119,12 @@ $(OSMESAEXES) : $*.obj
@echo $@
$(link) $(lcommon) -out:$@ $* /LIBPATH:$(LIBDIR) $(LIBS) $(EXTRALIBS)
+$(IPERSEXES) : $*.obj
+ @echo $@
+ $(link) -out:$@ $* /LIBPATH:$(LIBDIR) $(LIBS) winmm.lib
+
readtex.c:
-copy ..\util\readtex.c .
readtex.h:
- -copy ..\util\readtex.h .
-
+ -copy ..\util\readtex.h . \ No newline at end of file
diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c
index 029de00089..87d70ef8bc 100644
--- a/progs/demos/ipers.c
+++ b/progs/demos/ipers.c
@@ -11,7 +11,7 @@
#include <math.h>
#include <time.h>
-#ifdef WIN32
+#if defined (WIN32)|| defined(_WIN32)
#include <windows.h>
#include <mmsystem.h>
#endif
diff --git a/progs/demos/paltex.c b/progs/demos/paltex.c
index aabb47bbc0..d37538bcf4 100644
--- a/progs/demos/paltex.c
+++ b/progs/demos/paltex.c
@@ -1,4 +1,4 @@
-/* $Id: paltex.c,v 1.6 2000/10/05 07:17:43 joukj Exp $ */
+/* $Id: paltex.c,v 1.7 2002/01/16 00:48:43 kschultz Exp $ */
/*
* Paletted texture demo. Written by Brian Paul.
@@ -9,6 +9,9 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#ifdef _WIN32
+#include <windows.h>
+#endif
#define GL_GLEXT_LEGACY
#include <GL/glut.h>
diff --git a/progs/demos/pointblast.c b/progs/demos/pointblast.c
index f6486fe55a..8786e36e3a 100644
--- a/progs/demos/pointblast.c
+++ b/progs/demos/pointblast.c
@@ -13,6 +13,9 @@
/*
* $Log: pointblast.c,v $
+ * Revision 1.3 2002/01/16 00:48:43 kschultz
+ * Demo updates for Windows (Robert Bergkvist)
+ *
* Revision 1.2 2000/06/27 17:04:43 brianp
* fixed compiler warnings
*
@@ -38,6 +41,9 @@
#include <stdlib.h>
#include <string.h>
#include <math.h> /* for cos(), sin(), and sqrt() */
+#ifdef _WIN32
+#include <windows.h>
+#endif
#define GL_GLEXT_LEGACY
#include <GL/glut.h>
diff --git a/progs/demos/rain.cxx b/progs/demos/rain.cxx
index 4a7ecde3c8..e18397862f 100644
--- a/progs/demos/rain.cxx
+++ b/progs/demos/rain.cxx
@@ -11,15 +11,20 @@
#include <math.h>
#include <time.h>
#include <GL/glut.h>
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
#include "particles.h"
extern "C" {
-#include "image.h"
+#include "readtex.h"
}
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include <mmsystem.h>
+#include "particles.cxx"
+#include "readtex.c"
#endif
#ifdef XMESA
@@ -297,20 +302,21 @@ static void key(unsigned char key, int x, int y)
static void inittextures(void)
{
- IMAGE *img;
+ GLubyte *img;
+ GLint width,height;
+ GLenum format;
GLenum gluerr;
glGenTextures(1,&groundid);
glBindTexture(GL_TEXTURE_2D,groundid);
- if(!(img=ImageLoad("s128.rgb"))) {
- fprintf(stderr,"Error reading a texture.\n");
- exit(-1);
+ if(!(img=LoadRGBImage("../images/s128.rgb",&width,&height,&format))){
+ fprintf(stderr,"Error reading a texture.\n");
+ exit(-1);
}
-
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
- if((gluerr=(GLenum)gluBuild2DMipmaps(GL_TEXTURE_2D, 3, img->sizeX, img->sizeY, GL_RGB,
- GL_UNSIGNED_BYTE, (GLvoid *)(img->data)))) {
+ if((gluerr=(GLenum)gluBuild2DMipmaps(GL_TEXTURE_2D, 3, width, height,GL_RGB,
+ GL_UNSIGNED_BYTE, (GLvoid *)(img)))) {
fprintf(stderr,"GLULib%s\n",gluErrorString(gluerr));
exit(-1);
}
diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c
index b799657b8e..d2bd3494cc 100644
--- a/progs/demos/winpos.c
+++ b/progs/demos/winpos.c
@@ -1,4 +1,4 @@
-/* $Id: winpos.c,v 1.3 2000/12/24 22:53:54 pesco Exp $ */
+/* $Id: winpos.c,v 1.4 2002/01/16 00:48:43 kschultz Exp $ */
/*
* Example of how to use the GL_MESA_window_pos extension.
@@ -8,6 +8,9 @@
/*
* $Log: winpos.c,v $
+ * Revision 1.4 2002/01/16 00:48:43 kschultz
+ * Demo updates for Windows (Robert Bergkvist)
+ *
* Revision 1.3 2000/12/24 22:53:54 pesco
* * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util.
* * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus:
@@ -59,6 +62,9 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#ifdef _WIN32
+#include <windows.h>
+#endif
#define GL_GLEXT_LEGACY
#include "GL/glut.h"