[cl-opengl-devel] Trouble using gl:color-mask.

raito at raito.com raito at raito.com
Thu Sep 25 21:29:44 UTC 2008


(Yes, 2 messages in one day). 

I'm doing some code that relies fairly heavily on the stencil buffer, and
naturally, I'm committing the sin of saying something doesn't work when I
probably don't have the latest stuff (either Lisp or cl-opengl), but here goes
anyway. 

To test this, I gutted one the smooth redbook example, and changed the display
function to the following:

(defmethod glut:display ((w smooth-window))
  (gl:clear :color-buffer)
  (gl:color 0 1 0)
  (gl:with-primitives :quads
    (gl:vertex 5 5)
    (gl:vertex 25 5)
    (gl:vertex 25 25)
    (gl:vertex 5 25))
  (gl:color 1 0 0)
  (gl:color-mask :false :false :false :false)
  (gl:with-primitives :quads
    (gl:vertex 5 5)
    (gl:vertex 25 5)
    (gl:vertex 25 25)
    (gl:vertex 5 25))
  (gl:flush))

The result ought to be that you see a green square, and not a red square. To
make sure that this was not a driver or video card issue, I wrote the same
program in C, and that worked correctly. 

It did not work using sbcl 1.0.13 on XP, nor using 1.0.11 on OS X. The C code
was written using Xcode on the Mac, and did work correctly. 

Any pointers would be most helpful (I'd love to fix it myself). I'm not doing
the usual reflection stuff with the stencil buffer, where the fact that the
color buffer is being overwritten doesn't matter, because it gets written again
anyway. I'm creating a stencil, drawing some stuff, then changing the stencil
and drawing again, then re-creating the original stencil. The current behavior
means that the color buffer has stuff I want to keep overwritten. 

Neil Gilmore
raito at raito.com



More information about the cl-opengl-devel mailing list