I’m using the SOIL library to load images.
I don’t get any compiling errors, and i have texture mapped images fine in the past with this process.
Problem: Texture not showing up in quad (plane).
Variables:
GLuint _SignId;
Draw call:
void drawSign(){
glDisable(GL_COLOR_MATERIAL);
glPushMatrix();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, _SignId);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glBegin(GL_QUADS);
glNormal3f(0.0, 0.0, 1.0);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(signX + 0.0f, signY + 0.0f, signZ + 0.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(signX + 128.0f, signY + 0.0f, signZ + 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(signX + 128.0f, signY + 128.0f, signZ + 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(signX + 0.0f, signY + 128.0f, signZ + 0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
glEnable(GL_COLOR_MATERIAL);
}
Display function (if it helps solved the problem):
void display (void) {
//clear screen
clearScreen();
//set modelview
setModelView();
//load identity
glLoadIdentity();
//update
camera();
drawFloor();
drawSign();
glutSwapBuffers(); //swap the buffers
}