[cl-opengl-devel] Some issues porting an example from nehe.gamedev.net

Bart Botta 00003b at gmail.com
Mon Oct 5 19:36:23 UTC 2009


On Mon, Oct 5, 2009 at 1:43 PM, Malcolm Reynolds
<malcolm.reynolds at gmail.com> wrote:
> Working version (objective C): http://img260.imageshack.us/i/picture3g.png/
> Non working version: http://img209.imageshack.us/i/picture4k.png/
>
> In case it's not clear, in the non-working version above the corner
> you see in the pyramid is actually the back corner. It shouldn't be
> visible. When the pyramid rotates so that you should be looking down
> on the point at it, you see only the base instead of only the four top
> faces. I have similar issues with the cube faces, some of them only
> being visible from the 'inside'.
>
> means presumably something in my setup is off, something to do with
> the depth buffer maybe? I guess the issue might be in the keyword args
> in function calls in #'glut:display-window method but it's hard to
> figure out exactly what the arguments to these functions will be
> except a guess at translating them into lisp-ish hyphenated lowercase.
>

Right, you probably need to enable a depth buffer, and you probably
also want double buffering on modern platforms, both are controlled by
the :mode parameter to glut:window instance creation, easiest way to
fix that is changing the ":mode '(:single :rgb)" in the (defclass
test-window ...) form to ":mode '(:double :rgb :depth)".

If you switch to double buffering (using :double instead of :single
there), you will also need to do (glut:swap-buffers) after drawing
each frame, probably in place of the (gl:flush) in the glut:display
method.

You may also want to get rid of the (glut:post-redisplay) in the
keyboard method, since that kills my lisp when i try to exit the
window (yay for C libraries that think exit() is a good response to
unexpected situations)

Seems to work with those changes though.

--
3b




More information about the cl-opengl-devel mailing list