Hello,
i’ve been trying to solve the problem am facing with rendering Font using SlickUtile in Lwjgl, and it appears that the issue is due because of the OpenGL initialization (the low FPS was because i initialize variable inside the game loop )
anyway,
i tried to render a text in a simple pong game, and the result was this (the white rectangle is the text) :
http://s20.postimg.org/ti3pflj5p/image.png
that result happens when i use this openGl initialization :
private void initGL() {
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, 800, 0, 600, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
}
and if i use this initialization (from the FontExample of the lwjgl wiki )
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.glViewport(0,0,width,height);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, width, height, 0, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
i get this result :
http://s20.postimg.org/4q438d1z1/image.png
PS :
sorry if you are reading this post and there isn’t enough information in it, i hit the post button by mistake
thank you