Hi. I'm making a test OpenGL game and I want to draw some GUIs to the screen that are separate from the 3D world. The 3D works fine, but the GUIs don't show up on the screen at all.
This is my basic code:
private void render() { // Called once per frame
make3D();
camera.useView(); // Translates the world based on the camera
render3D(); // Draws some cubes
make2D();
render2D(); // Draws some quads onscreen
Display.update();
}
public void make2D() {
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
GL11.glLoadIdentity();
GL11.glOrtho(0, WIDTH, 0, HEIGHT, -1, 1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glLoadIdentity();
}
public void make3D() {
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glLoadIdentity();
}
Keep in mind that I am using immediate mode for all my rendering.
(Also, if it helps at all, I am using display lists for my 3D rendering.)
Please help! I don't know why it's not working.