glGenTextures(1, &treeid);
glBindTexture(GL_TEXTURE_2D, treeid);
+ if (1)
{
int w, h;
GLenum format;
int x, y;
- GLubyte *image = LoadRGBImage("../images/tree2.rgb", &w, &h, &format);
+ GLubyte *image = LoadRGBImage("../images/tree3.rgb", &w, &h, &format);
if (!image) {
fprintf(stderr, "Error reading a texture.\n");
exit(-1);
}
}
-
+ else {
+ if (!LoadRGBMipmaps("../images/tree2.rgba", GL_RGBA)) {
+ fprintf(stderr, "Error reading a texture.\n");
+ exit(-1);
+ }
+ }
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-/* $Id: paltex.c,v 1.3 2000/06/27 17:04:43 brianp Exp $ */
+/* $Id: paltex.c,v 1.4 2000/06/27 17:12:10 brianp Exp $ */
/*
* Paletted texture demo. Written by Brian Paul.
" "
};
GLubyte table[256][4];
- int i;
if (!glutExtensionSupported("GL_EXT_paletted_texture")) {
printf("Sorry, GL_EXT_paletted_texture not supported\n");