Artifacts from Other Programs

Okay. This is driving me nuts. I’m writing a program for a graphics class I’m taking, and this has me completely and utterly stumped. It seems that artifacts from other programs/processes are appearing in my program.

What I’m actually usually seeing is a huge jumble of colored blocks or parallelograms. The colors that appear aren’t even in my code anywhere. However, for a brief time, one portion of the component appeared recognizable enough for me to place as part of the graphics in another program I was running. (That program doesn’t even use jogl; it’s written in a native language.) Then, later, I ran an example program (that does use jogl) that our professor provided. It worked just fine. Then when I went back and ran my program, the colors from his example program appeared.

…I know this sounds entirely nuts. It makes no sense that one single jogl program is using data from other programs while other programs don’t do anything of the sort. Is it possible I’m not clearing out some kind of buffer I need to?

This is happening on both the Swing components and the AWT components provided in jogl. (I also don’t mix Swing and AWT frames.) I should also mention I tried rebooting my computer, and it still happened.

During context creation and framebuffer allocation, the (back)framebuffer is not cleared. You have to clear it yourself with glClear(COLOR_BUFFER_BIT) IIRC - it has been a while…

I have had your problem too: in my program the first frame took very long too render (like 10s). During that time the last frame of the previous context would show, or some random garbage.

The paralellograms are simply skewed rectangled, indicating that the framebuffer of the other processes had a different dimension than your current context. If the previous framebuffer was wider, the skewing would be /_/

Hooray! Thank you. That fixed it. (Well, it fixed that part of my problems anyway. Now that I can actually see my own drawing, I can work on the rest.) This is all pretty new to me. I have pretty much no experience in OpenGL or any sort of real graphics. I’m very appreciative.