Hello, as the title says, when I render text it shows up as a red box instead of text. Here is my code:
public void render3D(){
/* For some reason, needs commenting for camera to work :p */
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
resourceManager.getTextureManager().loadTextureSheet("resources/textures/terrain.png", true);
BlockRenderer.renderBlock(Block.DIRT, 0f, 0f, 0f);
BlockRenderer.renderWireframeBlock(Block.DIRT, 0f, 1f, 1f);
setOrthoOn();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
Color.white.bind();
_font.drawString(100, 25, "Hello world!", Color.red);
setOrthoOff();
}
public static Player getPlayerObject(){
return p;
}
public static void setOrthoOn()
{
// prepare to render in 2D
GL11.glDisable(GL11.GL_DEPTH_TEST); // so 2D stuff stays on top of 3D scene
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix(); // preserve perspective view
GL11.glLoadIdentity(); // clear the perspective matrix
GL11.glOrtho(0, Binder.getDisplayMode().getWidth(), Binder.getDisplayMode().getHeight(), 0,-1,1); // turn on 2D
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix(); // Preserve the Modelview Matrix
GL11.glLoadIdentity(); // clear the Modelview Matrix
}
public static void setOrthoOff()
{
// restore the original positions and views
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_DEPTH_TEST); // turn Depth Testing back on
}
Thanks for any pointers!