I'm planning to send in an entry for the LOTR contest and I finally got to the eye candy part of my program yesterday. Turns out the TGA loading code from tutorial 25 doesn't want to work in the framework of my app. Let me explain.
I've got a header file called
gl_texture.h that includes the following :
#ifndef _GL_TEXTURE_H_
#define _GL_TEXTURE_H_
typedef struct
{
GLubyte *imageData;
GLuint bpp;
GLuint width;
GLuint height;
GLuint texID;
} TextureImage;
extern TextureImage textures[1];
bool LoadTGA(TextureImage *texture, char *filename);
#endif
|
The code that is supposed to load the textures is in
gl_texture.cpp :
TextureImage textures[1];
bool LoadTGA(TextureImage *texture, char *filename)
{
... all the code from tutorial 25 ...
return true;
}
|
Problem is, I try to bring up a quad and texture it, and all I get is a white textureless quad. Now, you have to understand I'm not a total newbie at this. I'm including the right header files, I've enabled texture mapping and everything, so it's not a trivial C++ problem. In fact, the exact same code I'm using works just fine if I keep everything in one file (like tutorial 25 does). Yet when put this code over multiple files like this, it stops working. Doesn't give me any errors, it just doesn't work.
I'm probably just defining "TextureImage textures[1];" wrong or something... Do any of you people have any idea what I'm doing wrong ?
_________
"Maybe this world is another planet''s hell." -- Aldous Huxley
Edited by - Lord FlatHead on March 6, 2002 11:08:06 AM
_________"Maybe this world is another planet''s hell." -- Aldous Huxley