LWJGL Forum

Programming => LWJGL Documentation => Topic started by: FusionTech on September 10, 2013, 22:22:45

Title: Issue with while
Post by: FusionTech 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
Title: Re: Issue with while
Post by: Fool Running 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().
Title: Re: Issue with while
Post by: quew8 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) (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.