Original Post
I''m having a problem texturing in my engine. The model just gets white. I was wondering if anyone knows what the error could be caused by? It''s a MD2 file, i know the bitmap loadin works (i loaded a model by another system, without pointers, and it worked) GL_TEXTURE_2D is enabled.
Here is some code:
The header
The functions..
And finally, the creation of an instance.
class mesh : public actor
{
public:
// MD2 *thisModel;
TEXTURE *thisTexture;
GLfloat x,y,z;
GLfloat position[3];
mesh(char* filename, char* skinFile, GLfloat scaleX, GLfloat scaleY, GLfloat scaleZ);
GLvoid draw();
};
mesh::mesh(char* filename, char* skinFile, GLfloat scaleX, GLfloat scaleY, GLfloat scaleZ)
{
thisTexture = new TEXTURE;
thisTexture->LoadBMP(skinFile, GL_LINEAR, GL_LINEAR);
thisModel = new MD2;
thisModel->Load(filename);
thisModel->SetState(IDLE1);
}
GLvoid mesh::draw()
{
glLoadIdentity();
glTranslatef(x, y, z);
glBindTexture(GL_TEXTURE_2D, thisTexture->ID);
glScalef(0.05f, 0.05f, 0.05f);
thisModel->Animate(thisModel->stateStart, thisModel->stateEnd, 1.00f);
glLoadIdentity();
}
mesh* pyramid = new mesh("models/Invader/tris.md2", "models/Invader/Alien.bmp", 0.5f, 0.5f, 0.5f);