[cl-opengl-devel] gl:clear and depth-buffer
Sumant Oemrawsingh
soemraws at xs4all.nl
Tue Jun 2 22:41:18 UTC 2009
Hi,
To answer Edward Tate: I'm not using LispBuilderSDL. In fact, I'm not "using"
cl-opengl at all at the moment. What I was talking about was, right after
installation of cl-opengl running some examples in the source tree to see if
it works. So I guess to answer the question properly, I'm using GLUT then.
So I tried two examples: glut-teapot and gears. Both of these suffer from the
same problem with gl:clear (i.e. gl:get-errror returns invalid-value when
depth-buffer is set). So, here are some details.
For the teapot, what happens is that the window shows the (in)famous teapot,
but the background is a copy of the place on my desktop where the window was
instantiated, i.e. not black.
For gears, I can't see the gears rotating, because the "teeth" of the gears
smear out and cause the gears to have a more wheel-like appearance.
I also had a quick look at render-to-texture, which is... well, weird...
On #lisp, it was suggested that this means that gl:clear doesn't do it's job
properly, and that I should see what cl:get-error returns. So I altered the
code for the teapot and put a cl:get-error before and after the (cl:clear
:color-buffer :depth-buffer), and the error is printed on screen. Result is
that before the call to clear, get-error returns zero, but after, it returns
invalid-value. So I proceeded to find out which of the two flags is bogus.
Removing :color-buffer and keeping :depth-buffer from the call to cl:clear
still returned invalid-value, while removing :depth-buffer and keeping
:color-buffer returned zero. So both the original and former calls to cl:clear
failed, while the latter succeeded.
Of course, the result is still wrong, because the depth buffer isn't cleared.
But at least I know that using (cl:clear :depth-buffer) fails.
I've verified in my GL.h file that the constant for the depth buffer bit
matches the one in constants.lisp, so there's no problem there. Also, using
lsof, I've verified that when I (require 'cl-opengl) in SBCL, that SBCL indeed
uses the correct libGL.so.
Now, when I compile and run glxgears, the C program, it works fine.
I'm not sure where else I can look for more info. I don't think my X logs say
anything, and I don't see any error messages when running the (gears) example,
nor when running the (glut-teapot) example.
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.
Thanks,
Sumant
On Tue, Jun 02, 2009 at 02:07:27PM +0100, Luís Oliveira wrote:
> On Tue, Jun 2, 2009 at 5:24 AM, Sumant Oemrawsingh <soemraws at xs4all.nl> wrote:
> > After successfully installing cl-opengl, I ran into the following problem when
> > trying to run the examples. I found that the demo's ran without explicit
> > errors, but the output didn't look right. Basically, gl:clear wasn't doing its
> > job.
>
> Can you give us a specific example so that we can try and reproduce the problem?
>
> --
> Luís Oliveira
> http://student.dei.uc.pt/~lmoliv/
>
More information about the cl-opengl-devel
mailing list