Hello Guest

Issue with while

  • 2 Replies
  • 8654 Views
Issue with while
« on: September 10, 2013, 22:22:45 »
Code: [Select]
public static void ListenMenuAction(){
    if(Mouse.getX() >= 47 && Mouse.getX() <= 147){
if(Mouse.getY() >= 50 && Mouse.getY() <= 350){
Render.menu1Selected = true;
}
}
}
}

If I change the ifs to whiles, the quad that worked with the if won't show, and the it gets labeled not responding

Re: Issue with while
« Reply #1 on: September 11, 2013, 12:43:56 »
1) Why do you even want to make them while loops?
2) The mouse data does not update without calling Mouse.poll() or Display.update().
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
Re: Issue with while
« Reply #2 on: September 11, 2013, 16:54:33 »
It is shown as not responding because you've put it into an infinite while loop. You haven't understood the game loop concept. Read how it is done here: http://www.lwjgl.org/wiki/index.php?title=LWJGL_Basics_2_(Input). While you're there, read the rest of the basic tutorials before you ask more stupid questions.