Hello again,
what would be the easiest way to print 2D-text to screen? I have tried code from NeHe's tutorial but it doesn't print anything to screen (possibly because I fail to init the font, but I don't know how to do it).
1 2 3 4 5 6
| private void printText(String text) { byte[] textBytes = text.getBytes(); gl.glPushAttrib(GL.GL_LIST_BIT); gl.glListBase(base - 32); gl.glCallLists(text.length(), GL.GL_UNSIGNED_BYTE, textBytes); gl.glPopAttrib(); |
I have created the base by using "base=gl.glGenList(256). Should I init somehow the font?
Thank you.