So I was just wondering how to install opengl for SBCL? I'm on a 64-bit Windows 8 notebook. I did use quicklisp and quickload but when I actually use it in a program I get an error like this:
; compilation unit finished
; Undefined functions:
; DRAW-FRAME INIT-GL
; caught 2 STYLE-WARNING conditions
and this is my code:
(require 'cl-opengl)
(require 'cl-glu)
(require 'lispbuilder-sdl)
(defun main-loop ()
(sdl:with-init ()
(sdl:window 800 800
:title-caption "OpenGL Test"
:opengl t
:opengl-attributes '((:sdl-gl-doublebuffer 1)
(:sdl-gl-depth-size 16)))
(setf (sdl:frame-rate) 20)
(init-gl)
(draw-frame)
(sdl:update-display)
(sdl:with-events ()
(:quit-event () t)
(:video-expose-event ()
(sdl:update-display))
(:idle ()
(draw-frame)
(sdl:update-display)))))
I took a quick look at the page that your code seems to have come from.
It appears that the compiler is not lying, and that (init-gl)
and (draw-frame)
are not defined.
From what I can tell, the author of the above page later included a definition of (draw-frame)
that looks like this:
(defun draw-frame (rotx roty rotz) (gl:matrix-mode :modelview) (gl:push-matrix) (gl:translate 0.5 0.5 0.5) (gl:rotate rotx 1 0 0) (gl:rotate roty 0 1 0) (gl:rotate rotz 0 0 1) (gl:translate -0.5 -0.5 -0.5) (draw-figure +cube-vertices+ +cube-faces+) (gl:pop-matrix))
However, it looks like (init-gl)
was later renamed to (start)
, which begins like this:
(defun start () (let ((rotx 0) (roty 0) (rotz 0))
The author describes (init-gl)
as setting up "the viewing parameters, lighting, culling, modelview matrix etc", which looks to be exactly what his function (start)
accomplishes.
Incidentally, cybevnm was asking all the right questions, and answering those questions probably would have led you to a similar conclusion.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With