I'm trying to draw a HUD over my game in OpenGL; I have decided to make it using some textures and applying them on a 2D scene. I'm using Java and LWJGL. This is the code:
public void drawHUD1()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, 800, 0, 600, -1, 1);
glMatrixMode(GL_MODELVIEW);
glDisable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
glPushMatrix();
glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, arrows[0]);
glBegin(GL_QUADS);
glTexCoord2f(0.0f,0.0f);
glVertex2f(60f,60f);
glTexCoord2f(1.0f,0.0f);
glVertex2f(90f,60f);
glTexCoord2f(1.0f,1.0f);
glVertex2f(90f,90f);
glTexCoord2f(0.0f,1.0f);
glVertex2f(60f,90f);
glEnd();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
float aspect = (float) width / height;
GLU.gluPerspective(45.0f, aspect, 0.1f, 1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
}
When I run it, the 3D part is correctly rendered, but there are no signs of my texture. I remembered to call the method, so that is not a possible answer; also the texture is correctly loaded, I've checked it. Can anybody help me?