Hi again,
I've been working with a number of OpenGL 2.0 concepts such as shader programs, and I've come across a bit of a snag with ATI's OpenGL 2.0support.
The shader programs work fine with the libGL.so as supplied by nvidia (on my home machine), but when using libGL.so from ATI on my work machine, functions such as create-shader fail, as there is no such symbol in the library. Using glXGetProcAddress to get the function pointer for glCreateShader, however, is the required work around for the ATI library.
I was tempted to create a cl-glew library binding, however this won't really work that well, as _that_ library also doesn't include all the symbols, and relies on C preprocessor macros heavily to do the right thing.
Anyways, I was thinking instead of modifying cl-opengl instead to (perhaps dependant on some switch?) use glXGetProcAddress for those functions that aren't directly callable, memoized of course.
Does this sort of thing make sense in this context? It's been a while since I've done a lot of lisp, and I'm also not super familiar with FFIs, so I want to make sure I do this the lispyiest way possible.
-greg
Hi Greg,
I don't know if you've checked out Bart Botta's cl-opengl modifications, but it is further along with generated OpenGL bindings. His changes have been out there for a while but I've seen no word, yay or nay, about merging them into the main tree so it should still be treated as experimental. But all of the examples do work on my ati mobility 9600. If you don't like the changes, it still could be used for ideas of one way to address the get-process-address issue.
However there is no glx-get-process-address function. Bart's approach uses the glut library to get the equivalent (at least on linux). I think it might be nice to have a glx-get-process-address implemented if just to avoid loading cl-glut for those who don't want to load it.
This is all from a fellow user, not a main dev so take it with a scrutinous eye. Here are links to the relevant posts by Bart: http://article.gmane.org/gmane.lisp.cl-opengl.devel/68/ http://article.gmane.org/gmane.lisp.cl-opengl.devel/63/
charlie mac
On 2/13/07, Charlie McMackin charliemac+cl-opengl@gmail.com wrote:
However there is no glx-get-process-address function. Bart's approach uses the glut library to get the equivalent (at least on linux). I think it might be nice to have a glx-get-process-address implemented if just to avoid loading cl-glut for those who don't want to load it.
My code is configurable to use any function that can translate from a string to a function pointer, it just uses GLUT in the examples since that's what the examples use. I've used it with lispbuilder-sdl, and it should work directly with the glx,wgl, etc. functions as well if you add a defcfun for them. To use another function, just do (setf cl-opengl-bindings::*gl-get-proc-address* #'foo-get-proc-address) at some point after loading cl-opengl and before you try to use any functions from an extension or from GL version>1.1.
-- Bart
cl-opengl-devel@common-lisp.net