[cells-devel] PortaGlut 1.0

Kenny Tilton ktilton at nyc.rr.com
Tue Feb 24 13:27:39 UTC 2004


Raistlin,

Sorry, I tried BCCing cells-devel when I posted the errata below to 
comp.lang.lisp, but did not notice that they never appeared.

Raistlin Magere wrote:

> Ok I have played with portaglut only a few minutes so nothing too 
> insightfull:
> I load the program by running first "glbind.lpr" [no errors here] and 
> then "opengl-ffi.lpr" which returns the following error
>
> Error: (SETF NIL) does not have a function definition
> [condition type: SIMPLE-ERROR] 

I have no idea what is going on with that. See errata for my 
fulminations againt the project manager, which is dandy but can be a 
total PITA sometimes.

>
>
> the options are to skip loading uffi.lpr (which was already loaded by 
> glbind) or to skip loading opengl-ffi, aborting the loading of 
> uffi.lpr seems to solve the problem. 

Sh*t, I kept telling myself to delete glbind.lpr. That was an old name 
for it. Just use opengl-ffi.lpr. I am totally sorry for wasting your 
time by neglecting to delete that file.

>
> In fact deleting from opengl-ffi  the line
> :projects (list (make-instance 'project-module :name
>                                 "\\dvx\\uffi\\uffi"))
> allows the loading of the two projects in succession without any 
> problem, by the way I need to run the two project as opengl-ffi 
> although requiring glbind doesn't automatically load it.
>
> I then run (ogb::lesson-14) and get the following error
>
> Error: Attempt to call #("glClearDepth" 1669795401 0 2 1669795401) for 
> which the definition has not yet been (or is no longer) loaded.
> [condition type: SIMPLE-ERROR] 

That was in the errata. I need to add a wrapper for uffi::load-library 
which checks that the library exists. uffi does not. Find the hard-coded 
loads of opengl32 and glu32 and change to match your configuration.

>
> The program does manage to create a new window titled "NeHe's OpenGL 
> Framework" however I only see the outline of it and nothing else.
>
> By the way I got an error similar to the one above when I tried to 
> load a dll I had made for test purpose to learn to use uffi or 
> acl-ffi, the loading of the dll went fine and lisp said library loaded 
> however when trying to call the function I would get the same error (I 
> think even the same numbers) but with the name of the function I had 
> tried to call. I then gave up on ffi and uffi - though I still need to 
> use some c code. Maybe this will help me out also with my work. 

Well, it might be different, but I can help with that, too. The first 
thing to do is what I will do to fix my stuff:

 (let ((dll-path "whatever"))
     (assert (probe-file dll-path))
     (uffi:load-library dll-path))

If that works, well, what C compiler are you using? Using VC++, I have 
to do two things: wrap the C functions in extern "C" {} declarations 
/and/ list each function name in a .DEF file included in the source for 
the VC++ project. I /think/ naming the C file is an alternative to 
wrapping the function in the extern form.

The FTGLFromC.cpp and the def file I sent illustrate the above.

Sorry again I botched sending the errata (below).

kenny



Kenny Tilton wrote:

> OK, 3D-lovers, the (model) matrix is now your oyster (if UFFI loves you):
>
>    http://www.tilton-technology.com/cellophane.html
>

Just installed from ZIP. Errata:

1. In dvx/lib there is a freeglut.zip from which freeglut.dll should be 
extracted. Won't happen again.

2. Look for load of freeglut.dll from hard-coded "D:/dvx/lib".

3. Also look for hard-coded loads of opengl32 and glu32 from "/winnt". 
That's "/windows" on other wins, lord knows what on other oses. The bad 
news here is that uffi:load-library seems not to mind at all if it is 
asked to load a non-existent library, so the first sign of trouble is a 
runtime erorr something like "glClearColor? what the hell is that?"

4. ACL users: because the handling of the project files is such a 
phenomenal PITA, I get "opengl-bindings" package not found because after 
I change the defpackage inside the LPR (it's just source) to:

  (defpackage :opengl-bindings...)

ACL changes it back to common-graphics whenever it feels like it. :) I 
would tell you the fix if I knew one, but in the past I just turn a few 
hundred monkeys trying things at random until it works, and then I never 
know which monkey fixed it nor certainly what they did to fix it.

kenny





-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film 

Your Project Here! http://alu.cliki.net/Industry%20Application






More information about the cells-devel mailing list