I've been working on a game with LWJGL and came to a weird problem. Every time I decide to hide the text my textures seem to unbind. Here's all the code that is invlolved
Below is the code inside my Text class.
public void draw() {
for (TextData textData : textList) {
drawString(textData.getX(), textData.getY(), textData.getText());
}
}
void drawString(int x, int y, String text) {
for (String line : text.split("\n"))
ttf.drawString( x, y += ttf.getHeight(), line);
}
Now the code in the main class
if (Keyboard.isKeyDown(Keyboard.KEY_H)) {
hideText = !hideText;
}
if (!hideText) {
text.draw();
}
This is the result