Hello everybody. I've been lurking here for a bit and this seems like a great resource for me, since I've just started to get back into game programming. I'm still fairly new though, so if this isn't the right place for this question feel free to move it.
Anyway, here's my problem. I'll just present a very simple test case I'm working on, if any more info is needed I'll be happy to provide it.
I made 2 functions for drawing text, depending on if I'm using a font with a size in its filename or not:
Code:
public void drawString(String font, int x, int y, String str) {
glEnable(GL_TEXTURE_2D);
try { new AngelCodeFont("fonts/" + font + ".fnt", "fonts/" + font + "_0.png").drawString(x, y, str, Color.black); } catch (SlickException ex) { ex.printStackTrace(); }
glDisable(GL_TEXTURE_2D);
}
public void drawString(String font, int size, int x, int y, String str) {
glEnable(GL_TEXTURE_2D);
try { new AngelCodeFont("fonts/" + font + "_" + size + ".fnt", "fonts/" + font + "_" + size + "_0.png").drawString(x, y, str, Color.black); } catch (SlickException ex) { ex.printStackTrace(); }
glDisable(GL_TEXTURE_2D);
}
Now if I draw two strings like so
Code:
textDrawer.drawString("test1", 50, 50, "test 1!");
textDrawer.drawString("arial", 32, 50, 150, "test 2!");
it works as expected. However if I comment out "test1" and just leave the arial drawing command, the text doesn't come out right (blocky/unreadable or sometimes not at all). I can't even begin to imagine how this is even possible. Anyone have any insights?
Thanks so much in advance.