From 164ce1220232e03660633e16681737782c73059e Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Wed, 16 Jan 2002 00:48:43 +0000 Subject: Demo updates for Windows (Robert Bergkvist) --- progs/demos/rain.cxx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'progs/demos/rain.cxx') 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 #include #include +#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 #include +#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); } -- cgit v1.2.3