It has something to do with the functions in interface.lisp, I believe. (I can't remember for sure, but I THINK, if you call glut:init twice using apple's cocoa glut it gives you that NSApplicationInit() error.)<br>
<br>All I had to do (I think, it's been a while) was to use that (:darwin (:framework "GLUT")) line in library.lisp.<br><br>My sample code is attached, Sean, although it won't run as it is, unless you install cl-arcball. Remove all of the cl-arcball code and it should run for you. (Or, since I'm also attaching my cl-arcball asdf-install library, you can just asdf-install cl-arcball
0.1).<br><br>Note all of the cffi foreign function and foreign type conversion and callback stuff. It's not hard once you read through the code, in my opinion.<br><br><div><span class="gmail_quote">On 3/17/07, <b class="gmail_sendername">
Sean Charles</b> <<a href="mailto:sean.charles@objitsu.com">sean.charles@objitsu.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">I am sure the thing that stopped me was not being able to call NSApplicationInit()... I did manage to get something going but it kept dropping out with an error, which, on looking it up said I had to call NSApplicationInit() but my CFFI experience is limited and I couldn't work out how to do it.
<div><br></div><div>I looked at Verrazano as well but in the end time pressures made me go for X11. It just worked, I had to make a small change to get it to work on an intel mac though if I remember I just modded the library.lisp
file a bit. My finally chaotic glut def looks like:</div><div><br></div><div>(define-foreign-library glut</div><div> ;;-- (sjc-03-jul-06) -- added this line to ensure my locally built</div><div> ;;-- OpenGLUT library is loaded as the "glut" library!
</div><div> ;;</div><div> ;; (1) /usr/local/lib/libopenglut.dylib => my build from OpenGLUT source package.</div><div> ;; (2) /sw/lib/libglut.dylib => FINK installation of 3.7-1025</div><div> ;;</div><div> ;; Q. Which one is 'better' to use, if any ?!
</div><div> ;; (1) because (2) doesn't have glutLeaveMainLoop etc !!!</div><div> ;;</div><div> ;((:and :darwin :x86) "/sw/lib/libglut.dylib")</div><div> ((:and :darwin :x86) "/usr/local/lib/libopenglut.dylib")
</div><div> ;((:and :darwin :x86) (:framework "GLUT"))</div><div> ;(:darwin (:or "libglut.dylib" "libglut.3.dylib" #-(and)(:framework "GLUT")))</div><div> (:windows "freeglut.dll
") ; XXX: is this right?</div><span class="q"><div> (:unix (:or "libglut.so" "libglut.so.3")))</div><div><br></div></span><div>which, removing the chaff leaves this, I added the :x86 to make it intel friendly!
</div><div><br></div><div>(define-foreign-library glut</div><div> ((:and :darwin :x86) "/usr/local/lib/libopenglut.dylib")</div><div> (:windows "freeglut.dll") ; XXX: is this right?</div><span class="q">
<div> (:unix (:or "libglut.so" "libglut.so.3")))</div><div><br></div><div><br></div></span><div><br><div><div><span class="e" id="q_1115f344b05905a0_5"><div>On 17 Mar 2007, at 00:11, sathya gnanasekaran wrote:
</div><br></span></div><blockquote type="cite"><div><span class="e" id="q_1115f344b05905a0_7">Yeah, it annoys me a lot. I'll check if anyone has any prior work done in that direction first, but if not, I'll look into it. The problem is I have little cocoa/carbon experience. Time to learn I guess.
<br><br><div> <span class="gmail_quote">On 3/16/07, <b class="gmail_sendername">Luís Oliveira</b> <<a href="mailto:luismbo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">luismbo@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> On 16/03/07, sathya gnanasekaran <<a href="mailto:thekingoftruth@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
thekingoftruth@gmail.com</a>> wrote:<br>> I use cl-opengl on OSX to play with opengl in lisp. I use it by<br>> changing the library from freeglut to apple's cocoa-based glut <br>> framework. (Although I'm sure I could use apple's X11 + freeglut, X
<br>> has given be trouble.)<br><br>That GLUT will call exit() (and kill your Lisp) very often, doesn't<br>that annoy you? Hey, you could port freeglut to Cocoa (or is it <br>Carbon?), that'd be nice. :-)<br><br>
--<br>Luís Oliveira<br><a href="http://student.dei.uc.pt/%7Elmoliv/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://student.dei.uc.pt/~lmoliv/</a><br></blockquote></div><br></span></div><span class="q">
<div style="margin: 0px;">_______________________________________________</div><div style="margin: 0px;">cl-opengl-devel mailing list</div><div style="margin: 0px;"><a href="mailto:cl-opengl-devel@common-lisp.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
cl-opengl-devel@common-lisp.net</a></div><div style="margin: 0px;"><a href="http://common-lisp.net/cgi-bin/mailman/listinfo/cl-opengl-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://common-lisp.net/cgi-bin/mailman/listinfo/cl-opengl-devel
</a></div> </span></blockquote></div><br></div></div></blockquote></div><br>