tag:blogger.com,1999:blog-10460112.post-47709899059435159912007-02-16T10:51:00.000+01:002007-02-16T11:35:26.284+01:00OpenGL in a WorkspaceOn some modern Linux systems, Croquet does not work anymore because OpenGL failes to initialize. Now, I originally wrote that code, and it worked fine for years. So it can't possibly be buggy, right? Jens Lincke of <a href="http://impara.de/">impara</a> tracked it down to the "Composite" extension that is enabled by default nowadays. With Composite disabled, it works, enable it, and it does not.<br /><br />So I turned to NVIDIA for help, thinking their driver might be buggy. Had to give them an easy way to reproduce the problem, this is the snippet I came up with:<br /><blockquote><pre style="font-family: arial;line-height:1.1em">| ogl green |<br />ogl := OpenGL newIn: (0@0 extent: 100@100).<br />green := 1.<br />[[<br /> ogl glClearColor(0, green, 0, 1).<br /> ogl glClear(16r4000).<br /> ogl swapBuffers.<br /> Sensor waitClickButton.<br /> green := 1 - green.<br />] repeat] ensure: [ogl destroy]</pre></blockquote>Beauty, eh? ;-) I guess nobody has done this in a workspace for a long time. Stop it with Alt-.<br /><br />Anyway, NVIDIA could reproduce the problem, and found our bug:<br /><blockquote>[...] the app is trying to create a depth 24 child window of a depth 32 parent and the app specifies neither a border pixel nor a border pixmap.</blockquote>Doh! I forgot to specify the <a href="http://www.tronche.com/gui/x/xlib/window/attributes/border.html">border</a>! We were just lucky that this did not happen before. Jens and y.t. made a patch, should be in the next VM. And big thanks to <a href="http://developer.nvidia.com/">NVIDIA developer support</a>!CroqueTweakerhttp://www.blogger.com/profile/05353637548899091553noreply@blogger.com5