Re: Unable to set pixel format 4 for device context
Posted by
Wade Walker on
Apr 28, 2011; 1:21pm
URL: https://forum.jogamp.org/Unable-to-set-pixel-format-4-for-device-context-tp2852819p2874676.html
Hi Rob,
The problem may just be multithreading bugs in your code

I noticed that the errors occur when display events cause asynchronous accesses to your static variables when they're in the midst of changing (due to the thread that's setting up and tearing down). When I add some synchronization calls to make it impossible to interrupt a setup or teardown operation with a display, it seems to work fine.
Try this new version (
SimpleScene.java) and let me know if it works for you. I wouldn't recommend that you do what I've done, however -- it's probably wiser to get rid of static variables in a multithreaded program instead of trying to synchronize the problems away.