Login  Register

Re: A problem with a tutorial

Posted by Wade Walker on Oct 27, 2010; 2:13am
URL: https://forum.jogamp.org/A-problem-with-a-tutorial-tp1777294p1777848.html

I get the same result as you when I run this tutorial. The window is blank unless I put these lines at the bottom of the main method:

        FPSAnimator animator = new FPSAnimator(canvas, 60);
        animator.add(canvas);
        animator.start();

Without these lines, the render() method is never called, because the canvas doesn't recieve any events that it can pass on to the SimpleScene.

You can also do canvas.display() at the end of your main method, but that only shows you the triangle for a moment -- it seems to be auto-flipping. I'm not sure why it acts different on Justin's machine -- maybe he'll see this and comment. I usually use SWT instead of AWT so I'm not an expert in this area.