I want to use gluUnProject in order to do things on-screen when the user clicks with the mouse. I'm using Ubuntu, and it seems that the opengl libraries that come with it do not come with the glu(Un)Project methods defined. However, after poking around a bit in the source, it looks pretty straight-forward to create the lisp methods from the c methods, so I added the following to my glu.lisp file:
(def-foreign-routine ("gluProject" project) void (obj-x gl:double) (obj-y gl:double) (obj-z gl:double) (modelview (* gl:double) (projection (* gl:double) (viewport (* gl:int)) (win-x (* gl:double) (win-y (* gl:double) (win-z (* gl:double)))))))
(def-foreign-routine ("gluUnProject" unproject) void (win-x gl:double) (win-y gl:double) (win-z gl:double) (modelview (* gl:double) (projection (* gl:double) (viewport (* gl:int)) (obj-x (* gl:double) (obj-y (* gl:double) (obj-z (* gl:double)))))))
These are purely based off of looking around at how the other glu methods were defined.
Are these definitions correct? I'm unable to really try them out because I don't understand how to pass double pointers to these methods. I'm just getting started with CL, and loving it so far, but the application I'm currently working on has definitely hit a roadblock.
Can somone point me in the right direction as far as whether how I'm defining these methods is correct, and if so, how I pass pointer-style vars to the method calls to get the results?
Thanks!
On Thu, Apr 8, 2010 at 12:18 AM, David Davis dabukun@gmail.com wrote:
I want to use gluUnProject in order to do things on-screen when the user clicks with the mouse. I'm using Ubuntu, and it seems that the opengl libraries that come with it do not come with the glu(Un)Project methods defined.
They're defined in the CL-GLU system, which you need to load.
HTH,
Luís Oliveira wrote:
On Thu, Apr 8, 2010 at 12:18 AM, David Davis dabukun@gmail.com wrote:
I want to use gluUnProject in order to do things on-screen when the user clicks with the mouse. I'm using Ubuntu, and it seems that the opengl libraries that come with it do not come with the glu(Un)Project methods defined.
They're defined in the CL-GLU system, which you need to load.
HTH,
Hi Luís,
A 'egrep "[pP]roject" /usr/share/common-lisp/source/opengl/opengl/glu.lisp' returns nothing for me. Maybe the CL opengl code in Ubuntu 9.10 is way out of date?
-Dave
A 'egrep "[pP]roject" /usr/share/common-lisp/source/opengl/opengl/glu.lisp' returns nothing for me. Maybe the CL opengl code in Ubuntu 9.10 is way out of date?
Most likely. I'd recommend grabbing this code: http://github.com/3b/cl-opengl - it's much more up to date.
Malcolm
cl-opengl-devel@common-lisp.net