(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@raito.com
(oops, forgot to send to the list, sorry for duplicates)
On Thu, Sep 25, 2008 at 4:29 PM, raito@raito.com wrote:
(gl:color-mask :false :false :false :false)
cl-opengl uses common lisp "generalized booleans" (where anything except NIL means true) instead of :true or :false most places, so the following should do what you want :
(gl:color-mask nil nil nil nil)
Took me a bit to notice the problem though, so possibly we should support :false as meaning GL_FALSE as well?
--- -b-
Bart,
Thanks. That works. It'll probaly save me frustration for other calls, too.
Quoting Bart Botta 00003b@gmail.com:
(oops, forgot to send to the list, sorry for duplicates)
I can hardly complain for getting help, can I?
On Thu, Sep 25, 2008 at 4:29 PM, raito@raito.com wrote:
(gl:color-mask :false :false :false :false)
cl-opengl uses common lisp "generalized booleans" (where anything except NIL means true) instead of :true or :false most places, so the following should do what you want :
(gl:color-mask nil nil nil nil)
Took me a bit to notice the problem though, so possibly we should support :false as meaning GL_FALSE as well?
Possibly. A cursory check of the net for example code for gl-color-mask seems to show about half the examples using GL_FALSE, and the other half using 0 (geez...). Another cursory check of the docs subdirectory shows... very little. (I was a bit worried that I hadn't RTFA, but FA doesn't seem to have much.)
Neil Gilmore raito@raito.com
cl-opengl-devel@common-lisp.net