开发者

Netbeans and JOGL, problem with the GLCanvas

When I'm running开发者_如何学C the JOGL Application(Form Designer, GLCanvas) in the Netbeans 6.7.1 the GLCanvas disappear after less than one second (then I can see only jframe without GLCanvas component). Next when I'm maximizing the window, the GLCanvas reappear for a moment and disappear too. The JOGL Application(Form Designer, GLPanel) works properly after running. Where is the problem ?


I'm using a newer version of Netbeans so I cant use the JOGL plugin.. But, Ive encountered the problem you are describing.. For me it seemed like it was only drawing the first frame and then it stopped. I'm not sure but i think GLCanvas need a FPSAnimator.. And as far as I know the JOGL template in the plugin didn't create one..(or?) It did the trick for me

example:

    Frame frame = new Frame("test");
    GLCanvas canvas;
    FPSAnimator animator;
    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);
    canvas = new GLCanvas(caps);
    animator = new FPSAnimator(canvas, 60);
    canvas.addGLEventListener(new Renderer());
    frame.add(canvas);
    frame.setSize(600, 600);
    animator.start();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜