Render results are only seen very briefly

Hi all,

I am having issues with rendered content disappearing after a split second. Let me explain more fully: when I run a JOGL windowed app, I briefly see rendered content (e.g. a triangle) in the jframe, but then it is replaced by a completely gray background. If I resize the frame, I see the content flicker by again, but as soon as the resize is complete, bam, average gray background again.

I am running the 64 bit JRE on Vista. I tried to use the 32 bit JRE and JOGL library with the same results. The application I used to test is the first test application in the ‘Getting Started’ topic, with all the imports fixed for the latest version of JOGL, gldrawable replaced by glautodrawable, and no animator.

Any pointers? I am really scratching my head over this.

Update: So I added an animator to the code. The graphics are now rendered correctly from the looks of it.

Why do I need this animator?

The animator drives the display()-method, but is usually not needed, if you want to drive your rendering yourself. Calling display() on the GLCanvas od GLJPanel should be sufficient. I suspect you run into conflicts either with DirectDraw or with AWT background clearing. Specify


-Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true

on the commandline when running your app. This should solve your problem.

That fixed it. Thanks!