Hello,
it’s the first time i try to draw font using SlickUtile, i followed the example in the main lwjgl page and then when i tried to apply it in my game the result is quite strange, i can see the text but the frame rate is between 7 and 9 and it also remove all the other graphics after they do a little “eye flash” (i saw the level then it disappear )
i call the font from another method :
// the update method
private void update(int delta) {
painting();
draw.text();
loop.updateFPS();
}
the draw text method :
public void text() {
TrueTypeFont font;
Font awtFont = new Font("Times New Roman", Font.BOLD, 24);
font = new TrueTypeFont(awtFont, true);
font.drawString(100, 50, "test ", Color.white);
}
the openGL initialization :
public void initGL() {
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL11.glClearDepth(1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, 800, 600, 0, 1, -1);
}
thank you