It has something to do with the functions in interface.lisp, I believe. (I can&#39;t remember for sure, but I THINK, if you call glut:init twice using apple&#39;s cocoa glut it gives you that NSApplicationInit() error.)<br>
<br>All I had to do (I think, it&#39;s been a while) was to use that (:darwin (:framework &quot;GLUT&quot;)) line in library.lisp.<br><br>My sample code is attached, Sean, although it won&#39;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&#39;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&#39;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> &lt;<a href="mailto:sean.charles@objitsu.com">sean.charles@objitsu.com</a>&gt; 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&#39;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>&nbsp; ;;-- (sjc-03-jul-06) -- added this line to ensure my locally built</div><div>&nbsp; ;;-- OpenGLUT library is loaded as the &quot;glut&quot; library!
</div><div>&nbsp; ;;</div><div>&nbsp; ;; (1) /usr/local/lib/libopenglut.dylib&nbsp; =&gt; my build from OpenGLUT source package.</div><div>&nbsp; ;; (2) /sw/lib/libglut.dylib =&gt; FINK installation of 3.7-1025</div><div>&nbsp; ;;</div><div>&nbsp; ;; Q. Which one is &#39;better&#39; to use, if any ?!
</div><div>&nbsp; ;;&nbsp; &nbsp; (1) because (2) doesn&#39;t have glutLeaveMainLoop etc !!!</div><div>&nbsp; ;;</div><div>&nbsp; ;((:and :darwin :x86) &quot;/sw/lib/libglut.dylib&quot;)</div><div>&nbsp; ((:and :darwin :x86) &quot;/usr/local/lib/libopenglut.dylib&quot;)
</div><div>&nbsp; ;((:and :darwin :x86) (:framework &quot;GLUT&quot;))</div><div>&nbsp; ;(:darwin (:or &quot;libglut.dylib&quot; &quot;libglut.3.dylib&quot; #-(and)(:framework &quot;GLUT&quot;)))</div><div>&nbsp; (:windows &quot;freeglut.dll
&quot;) ; XXX: is this right?</div><span class="q"><div>&nbsp; (:unix (:or &quot;libglut.so&quot; &quot;libglut.so.3&quot;)))</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>&nbsp; ((:and :darwin :x86) &quot;/usr/local/lib/libopenglut.dylib&quot;)</div><div>&nbsp; (:windows &quot;freeglut.dll&quot;) ; XXX: is this right?</div><span class="q">
<div>&nbsp; (:unix (:or &quot;libglut.so&quot; &quot;libglut.so.3&quot;)))</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&#39;ll check if anyone has any prior work done in that direction first, but if not, I&#39;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> &lt;<a href="mailto:luismbo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">luismbo@gmail.com
</a>&gt; 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 &lt;<a href="mailto:thekingoftruth@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
thekingoftruth@gmail.com</a>&gt; wrote:<br>&gt; I use cl-opengl on OSX to play with opengl in lisp. I use it by<br>&gt; changing the library from freeglut to apple&#39;s cocoa-based glut <br>&gt; framework. (Although I&#39;m sure I could use apple&#39;s X11 + freeglut, X
<br>&gt; has given be trouble.)<br><br>That GLUT will call exit() (and kill your Lisp) very often, doesn&#39;t<br>that annoy you? Hey, you could port freeglut to Cocoa (or is it <br>Carbon?), that&#39;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>