-------- Original Message -------- Subject: Re: [Fwd: I'm stuck ... pse help!] Date: Sat, 23 Oct 2004 18:27:15 -0400 From: Kenny Tilton ktilton@nyc.rr.com To: frank_goenninger@t-online.de References: 1098563096.1653.66.camel@stargate.de.goenninger.com
Frank Goenninger wrote:
Where I'm stuck:
Getting glut-functions.lisp to use function 'glut-set-option which apparently is not in Apple's GLUT.
Not a problem! We need to put a #+FREEGLUT feature on any glut-set-option call, or anything else corresponding to the FG way of fixing the Glut problem with closing windows. Apple's fix was to specify a new callback, glutWMCloseFunc. We have to supply that callback to avoid the standard Glut behavior of calling exit() when a window closes, cuz that would also close the Lisp IDE after each test run.
I have to do some research to find out what we should do inside our glutWMCloseFunc -- maybe nothing, maybe call glutDestroyWindow, maybe just do our Lisp housekeeping for window closes.
Of course I had to make some changes to various sources:
Notably I found that OpenMCL does not need to use a CLOS package because this is already built-in and accessable in the CL-USER package.
Ah, yes, sounds familiar.
Hell, why is there no CLOS entry in the OpenMCL docs ?!
Ehem, Kenny, I found a
/* stencils */
in the gl-functions.lisp file. Where did that come from? I changed this to use #| and |# as comment delimiters. Well, now it's fixed ;-)
yeah, that was the right thing to do. I do not know why ACL and LW have not complained about that.
ImageMagick and FTGL also work now on Mac OS X for me. I also modified the Imakefile in the ftgl-int directory to build a dynamic library on OS X. So that's working also with the test program being available.
Back to what's not working
The error I get is:
Can't resolve foreign symbol "_glutSetOption"
For detailed info pls see the attached PDF file - a screen dump showing Emacs with a backtrace.
Also, I attached the files I changed in a tar file so you can follow my adaptions.
I used "nm" and "otool" on OS X to track down the glutSetOption thingy but with no luck.
So, my question is:
How did you do it ????
?? Is it possible I have misled you into thinking I have anything working on OS X? If so, sorry. No, all I have done is use Freeglut on win32 (and you got it working on Linux!) so fair warning: as I feared (and hoped!) you got to these Apple Glut differences before I did and are bearing the brunt. I will try to stop playing with my new G5 and help. :) More on glutWMCloseFunc ASAP...ok, here goes:
Apple Glut doc says they copied Rob Fletcher's Glut fixes. Here is Rob:
http://www-users.york.ac.uk/~rpf1/glut.html
In there he offers WMTest.c, which I see works as I suspected: provide a callback that does nothing. So I think all we have to do is duplicate this line of code in glut-callbacks-set:
(glut-callback-set 'glut-close-func close) #-FREEGLUT (glut-callback-set 'glut-wm-close-func close)
I guess a danger is that both might get called under Apple's, in which case just put a #-FREEGLUT on the glut-close-func call.
#+FREEGLUT (glut-callback-set 'glut-close-func close) #-FREEGLUT (glut-callback-set 'glut-wm-close-func close)
btw, the (ogl::lesson-14) test requires only gl, glu and glut to run, not FTGL or ImageMagick -- it uses the limited built-in glut fonts.
congrats again on the (usual <g>) rapid progress. now back to my G5! :)
kt
I just want to clarify a small mis-impression I created:
Apple Glut doc says they copied Rob Fletcher's Glut fixes. Here is Rob:
http://www-users.york.ac.uk/~rpf1/glut.html
In there he offers WMTest.c, which I see works as I suspected: provide a callback that does nothing. So I think all we have to do is duplicate this line of code in glut-callbacks-set:
(glut-callback-set 'glut-close-func close) #-FREEGLUT (glut-callback-set 'glut-wm-close-func close)
this is fine, but just in case I might have caused some confusion: Fletcher responded to wm-close by doing nothing. We respond to wm-close by losing the CLOS window instance corresponding to the Glut window, /not/ by doing nothing.
What I meant was that simply providing a wm-close callback defeats the Glut default of calling exit(), which would nail the Lisp IDE as well.
kt
Hi Kenny,
thx for the inputs on the window close issue.
Unfortunately, I'm not getting this far. It seems it was unclear from my previous emails that I do not get any window even appearing!
Any call to the glut-create-window function makes OpenMCL die, yes, really die! The process is interrupted without any signs or hints on the cause.
So, I think I might also ask the OpenMCL developers list on that one. I think it's not entirely clear if that's an OpenGL or GLUT or OpenMCL problem.
Question is how to make OpenMCL more verbose on when calling FFI land... Any suggestions?
Thx!
Cheers!
Frank
On Oct 24, 2004, at 11:35 AM, Frank Goenninger wrote:
Hi Kenny,
thx for the inputs on the window close issue.
Unfortunately, I'm not getting this far.
I understand, but you had asked about glutSetOption, and that is a Freeglut extension designed to address the window close issue. So I was telling you (a) you could just *feature* it out and (b) how to survive a window close /if/ we ever get that far.
It seems it was unclear from my previous emails that I do not get any window even appearing!
Any call to the glut-create-window function makes OpenMCL die, yes, really die! The process is interrupted without any signs or hints on the cause.
Boy, that sounds like Glut calling exit(), though of course that should not happen on glutCreateWindow. There is an Apple list for OpenGL. I wonder if they would have any insight. Or some of the gmane lists, which seem more numerous than comp.mac.* lists.
Would it be interesting to download the Lispworks freebee and see if you get the same thing there?
But first I would put in the code I suggested about setting up the glut-wm-close-func by duplicating the glut-close-func setup. And you might want to put a (break) in the callabcks to see if maybe we are getting further than we think. You can add the break to the macro you see wrapping the code in each callback so you just have to put it one place.
kenny
ps. I download Lisp In a Box for Max OS X and it seems to work right out of the box, as they say. I would have a lot of Emacs to learn, but I think I want to do that anyway. So maybe I will be using OpenMCL shortly.... say, you included a tar last time. I just focused on the glutSetOption problem. If I look at your code will I see how you loaded the Apple Glut? k
Kenny,
thx for quickly coming back. Seems as if we're back in chat mode ;-)
On Sun, 2004-10-24 at 20:18, Kenneth Tilton wrote:
On Oct 24, 2004, at 11:35 AM, Frank Goenninger wrote:
Hi Kenny,
thx for the inputs on the window close issue.
Unfortunately, I'm not getting this far.
I understand, but you had asked about glutSetOption, and that is a Freeglut extension designed to address the window close issue. So I was telling you (a) you could just *feature* it out and (b) how to survive a window close /if/ we ever get that far.
Ah, now I got it. Well, sometimes I am bit slow ;-) Ok. Now, not using glut-set-option doesn't hurt for what I'm trying to accomplish...
It seems it was unclear from my previous emails that I do not get any window even appearing!
Any call to the glut-create-window function makes OpenMCL die, yes, really die! The process is interrupted without any signs or hints on the cause.
Boy, that sounds like Glut calling exit(), though of course that should not happen on glutCreateWindow. There is an Apple list for OpenGL. I wonder if they would have any insight. Or some of the gmane lists, which seem more numerous than comp.mac.* lists.
Would it be interesting to download the Lispworks freebee and see if you get the same thing there?
This is my fallback, yes. But I'm not yet that frustrated to do so ;-)
But first I would put in the code I suggested about setting up the glut-wm-close-func by duplicating the glut-close-func setup.
Sir. Yes, Sir. :-)
And you might want to put a (break) in the callabcks to see if maybe we are getting further than we think. You can add the break to the macro you see wrapping the code in each callback so you just have to put it one place.
Sir. Yes, Sir. :-)
kenny
ps. I download Lisp In a Box for Max OS X and it seems to work right out of the box, as they say. I would have a lot of Emacs to learn, but I think I want to do that anyway. So maybe I will be using OpenMCL shortly.... say, you included a tar last time. I just focused on the glutSetOption problem. If I look at your code will I see how you loaded the Apple Glut? k
You will. It's in the build.lisp file. I simply do:
CL-USER > (load "config.lisp")
and then
CL-USER > (load "build.sys")
Apple GLUT loading definitions is distributed across the cl-opengl config files (which are included also) and the glut-functions.lisp file.
As always, I have marked my changes with the string "frgo" in them. You can search for that to find the places.
I will now be off for our weekly dancing course doing Cha-Cha and the like. Will be back in 2 hours.
Frank