Flickering problem

Hi,

I’m currently trying to learn jogl, starting from small example programs. What I did is a program that draws a triangle and moves it to the right until it reaches the end of the canvas, and the starts again from the left.

Seems simple enough but I have problems with flickering. I enabled vsync using gl.setSwapInterval(1); and movements are time based, and in fact it moves smooth, but when I put the window near the center of the screen it starts flickering. If I move it again on the top or bottom it works fine. I can’t even imagine what this problem is, maybe someone can help me figure this out.

Thanks

P.S: english is not my native language if something is not clear please ask

Try adding -Dsun.java2d.noddraw=true when running the program. See Jogl Users Guide for more details under “Platform Notes”

Thanks for you reply. I already use -Dsun.java2d.noddraw=true, but doesn’t help. In fact I’m using OS X and maybe this is one of those issues mentioned in the jogl user guide, but I couldn’t find a list of known problems.

-Dsun.java2d.noddraw=true does not help anything on macos, because it just disables windows direct draw pipeline. Is this really flickering or some kind of tearing? maybe gl.setSwapInterval() does not work on macosx!?

gl.setSwapInterval() works, when it’s enabled my fps are constant. It’s flickering not tearing, as the whole image “lags”. What’s strange is that it gets worse depending on the window position. I really don’t know how to avoid this, since vsync and time based movements are working correctly. Maybe I’m missing something?

Are you using a buffering strategy at all? I remember awhile back on OS X and the java buffering strategy on the frame/canvas conflicted with the opengl buffering strategy and caused flickering (between an empty image and whatever I was rendering). I’ve had no trouble doing something like:

JFrame frame = new JFrame();
GLCanvas c = new GLCanvas();
frame.add(c);
...
Start an animator or other rendering mechanism to a GLEventListener

I’m not using a buffer strategy.

Should I set something in the JFrame buffer strategy?

Why don’t you try to use a GLCanvas instead of a GLJPanel at least to know if the problem comes from GLJPanel? I don’t use GLJPanel because there are too much problems with it on a few graphics cards.

Could you post a small test case that shows this flickering problem on your computer?
Thanks