LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: jonalu on December 26, 2011, 13:49:44

Title: Slick-Util Library Load Fonts in 3d
Post by: jonalu on December 26, 2011, 13:49:44
Im trying to import a ttf font into a 3D lwjgl game. When i render it, it does not show any text. if i use the example program in 2d, it works. I may be a noob, but I try to learn.
Title: Re: Slick-Util Library Load Fonts in 3d
Post by: CodeBunny on December 28, 2011, 03:05:09
Not sure, but I'm guessing you're running into a depth buffer / frustum culling error.

Slick fonts are designed explicitly to work in a 2D, orthogonal setup. Because of the finicky nature of OpenGL, the same code executed with different matrix settings will result in completely separate results.

Try pushing both the modelview and projection matrix, calling glLoadIdentity in each, and call glOrtho for the projection matrix. Then, render the font and pop both matrices. That may work.