I’m not sure if this is a JOGL issue or something I’m doing wrong –
I basically have a JFrame that has a few JPanels on it. One of the JPanels contains a hardware accelerated GLCanvas. I have a loop running that looks something like this:
while(true){
canvas.display();
Thread.yield();
}
The canvas display() method does nothing – it clears the screen black. When I do nothing, I get around 2000 FPS. However, as soon as I even move the mouse cursor into the JFrame, performance drops drastically. I get continual 2-3 second spikes where there is no response at all, and FPS drops to less than 500 when it is responding. What is happening here?
If I do a Thread.sleep(10) instead, there is no spike when the mouse enters the JFrame and the FPS remains at a steady 90ish (this wont work however – 90 FPS when all I’m doing is clearing the screen).
In both cases, the program freezes up for a a solid 2-6 seconds whenever I try and move the window around, resize it, or exit the program.
Am I doing something wrong, or does JOGL always act like this?