Hi,
i’m currently trying to create a render loop with JOGL.
The basic device creation looks like this:
public class ExampleScene extends Frame {
private GLCanvas canvas;
public ExampleScene() {
GLCapabilities glcaps = new GLCapabilities();
canvas = new GLCanvas(glcaps);
ExampleSceneView view = new ExampleSceneView();
canvas.addGLEventListener(view);
setSize(500,500);
setTitle("JOGL test");
add(canvas, BorderLayout.CENTER);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
public static void main(String[] args) {
final ExampleScene app=new ExampleScene();
app.setVisible(true);
}
This implementation works fine. But when i add a render loop like this …
public static void main(String[] args) {
final ExampleScene app=new ExampleScene();
app.setVisible(true);
while (true) {
app.canvas.display();
}
}
… the garbage collector gets active every second
In the render loop I am NOT creating garbage.
So there has to be a problem with JOGL …
Is there a workaround for this? Or is it even normal?