[cl-opengl-devel] gl:clear and depth-buffer

Sumant Oemrawsingh soemraws at xs4all.nl
Wed Jun 3 00:10:27 UTC 2009


On Wed, Jun 03, 2009 at 12:39:31AM +0100, Luís Oliveira wrote:
> On Tue, Jun 2, 2009 at 11:41 PM, Sumant Oemrawsingh <soemraws at xs4all.nl> wrote:
> > It is highly probable that you won't be able to reproduce this problem, or
> > else, you would have noticed immediately, since it is the examples already
> > that don't work, right? :) If you need more information or there are things
> > you want me to try to debug what's going on, then I'm willing to help. At the
> > moment, though, since the examples don't work, I'm not using cl-opengl, while
> > I really want to.
> 
> Indeed, I can't reproduce your problem. What version of FreeGLUT are
> you using? Also, perhaps you can try to call (%gl:clear #x100) and see
> if that helps.

Hi Luís,

It's solved now. Basically, I was using an old version, not the darcs
version... Will you release stable versions again, or is darcs the only place
to get it? Anyway, read on if you're interested in what I tried and what I
found out.

I'm using freeglut 2.4.0. In both the teapot and gears demo, I replaced

  (gl:clear :color-buffer :depth-buffer)

into

  (format t "~a~%" (gl:get-error))
  (gl:clear :color-buffer)
  (format t "~a~%" (gl:get-error))
  (gl:clear :depth-buffer)
  (format t "~a~%" (gl:get-error))

which gives

  ZERO
  ZERO
  INVALID-VALUE

and terrible visual output, the same as with the original call. So I replace
the last gl:clear call with

  (%gl:clear #x100)

as you suggested. The result is

  ZERO
  ZERO
  ZERO

and gives me a nice teapot, and nice, fast rotating gears! This appears to
work fine!

So I looked again at the source file constants.lisp which seemed fine.
However, I suddenly noticed that asdf wasn't using the darcs version I
downloaded a few days ago, but an older version 0.1_p20080926 that was
installed through my dists package manager! D'oh!

In the old version, :depth-buffer-bit is defined as #x100, but :depth-buffer
is defined as #x8223. I removed the old one, and pointed asdf to the new one.
Everything works as advertised now!

Sorry for wasting your time.

Sumant




More information about the cl-opengl-devel mailing list