Hi,
Something in my code is making my draw function run tons of times, which is causing a memory leak, here is the draw code for the menu:
public void draw() {
Color.white.bind();
loadText();
System.out.println("this shouldnt be running more than once"); // what i am using to test
backg();
handleInput();
font.drawString(Display.getWidth() / 2 - 150, Display.getHeight() - 100, "Play", colorSelected);
font.drawString(Display.getWidth() / 2 - 50, Display.getHeight() - 50, "Quit", colorSelected2);
if(currentChoice == 0) {
colorSelected = MenuButton.COLOR_SELECTED;
colorSelected1 = MenuButton.COLOR_UNSELECTED;
colorSelected2 = MenuButton.COLOR_UNSELECTED;
}
if(currentChoice == 1) {
colorSelected = MenuButton.COLOR_UNSELECTED;
colorSelected1 = MenuButton.COLOR_UNSELECTED;
colorSelected2 = MenuButton.COLOR_SELECTED;
}
font.drawString(20, Display.getHeight() - 30, Game.VERSION, Color.black);
cleanUp();
}
Thanks,
- Dan