/**************************************************************** Texture Demo Program Designed to illustrate texture mapping and the derivation of textures from images. Based on the Red Book example program p. 368, second ed. Adapted by H. Masterman 22 November 1999 Revised by H. Masterman 27 November 2000 Revised by H. Masterman April 2005 to use LoadBimap instead of SGI Image Product Library *****************************************************************/ #include #include #include #include #include /* Create checkerboard texture */ #define checkImageWidth 64 #define checkImageHeight 64 static GLubyte checkImage[checkImageHeight][checkImageWidth][4]; static GLubyte otherImage[checkImageHeight][checkImageWidth][4]; static GLuint texName[2]; float theta=0.0; //rotation angle int rotate = 0; // boolean flag for rotation int LoadBitmap(char *filename, int num_texture) { unsigned char *l_texture; // a pointer to the memory zone where I will load // my texture. Each point on the texture is represented // by 4 values ( RGBA ) int i, j=0; FILE *l_file; BITMAPFILEHEADER fileheader; // stores type and size of texture image BITMAPINFOHEADER infoheader; // texture image information ( width and height ) RGBTRIPLE rgb; if( (l_file = fopen(filename, "rb"))==NULL) {cout<<"Unable to open file:"<