I just updated <a href="http://trac.haskell.org/FieldTrip/ticket/8">http://trac.haskell.org/FieldTrip/ticket/8</a> .<br><br><div class="gmail_quote">On Thu, Dec 4, 2008 at 10:19 AM, Conal Elliott <span dir="ltr">&lt;<a href="mailto:conal@conal.net">conal@conal.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks very much Claus.&nbsp; Sound fixable indeed, with an exception handler.<br><br>Would someone with convenient access to a non-freeglut system be up for trying out Claus&#39;s suggestion???<br>
<font color="#888888"><br>&nbsp;&nbsp; - Conal</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">
On Thu, Dec 4, 2008 at 9:52 AM, Claus Reinke <span dir="ltr">&lt;<a href="mailto:claus.reinke@talk21.com" target="_blank">claus.reinke@talk21.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Is this still an open issue in FieldTrip? If you look at the online versions of the files Sven mentioned<br>
<br>
 &nbsp; <a href="http://darcs.haskell.org/packages/GLUT/include/HsGLUTExt.h" target="_blank">http://darcs.haskell.org/packages/GLUT/include/HsGLUTExt.h</a><br>
 &nbsp; <a href="http://darcs.haskell.org/packages/GLUT/Graphics/UI/GLUT/Extensions.hs" target="_blank">http://darcs.haskell.org/packages/GLUT/Graphics/UI/GLUT/Extensions.hs</a><br>
<br>
you can see how the dynamic lookup of functions that are only available in some extensions is handled. Looking at<br>
<br>
 &nbsp; <a href="http://darcs.haskell.org/packages/GLUT/Graphics/UI/GLUT/Begin.hs" target="_blank">http://darcs.haskell.org/packages/GLUT/Graphics/UI/GLUT/Begin.hs</a><br>
<br>
it does seem as if constants and StateVars are not directly protected like this, but &#39;actionOnWindowClose&#39; calls &#39;glutSetOption&#39;, which you can see in <br>
 &nbsp; <a href="http://darcs.haskell.org/packages/GLUT/Graphics/UI/GLUT/QueryUtils.hs" target="_blank">http://darcs.haskell.org/packages/GLUT/Graphics/UI/GLUT/QueryUtils.hs</a><br>
<br>
as just such a dynamic lookup. In case this isn&#39;t clear: your code can<br>
simply catch the exception thrown when that dynamic lookup fails,<br>
letting the exception handler pursue an alternative path (since your ticket<br>
recommends commenting out that line, the handler could perhaps just do nothing in your case, or issue a warning about missing freeglut?).<br>
<br>
No change to the GLUT package should be needed, I think.<br>
Claus<div><div></div><div><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the pointers.<br>
<br>
I&#39;m looking for some way to program my library so that a graceful exit is<br>
made where possible and still runs, though exits less gracefully with<br>
non-free glut. &nbsp;I&#39;d be happy with either a new API entry for that case or a<br>
change to the meaning of MainLoopReturns.<br>
<br>
&nbsp;- Conal<br>
<br>
On Thu, Nov 20, 2008 at 5:33 AM, Sven Panne &lt;<a href="mailto:sven.panne@aedion.de" target="_blank">sven.panne@aedion.de</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thursday 13 November 2008 03:24:29 Conal Elliott wrote:<br>
&gt; I&#39;m looking for a way to use MainLoopReturns when freeglut is present and<br>
&gt; not when it isn&#39;t. &nbsp;I could use some help. &nbsp;I figure that the<br>
&gt; implementation has some way to generate that error message, and maybe we<br>
&gt; could similarly just do a standard ungraceful exit if freeglut is<br>
missing.<br>
&gt;<br>
&gt; The great thing about MainLoopReturns is that it plays nicely with ghci.<br>
&gt; Closing a window returns to ghci for more fun.<br>
&gt;<br>
&gt; Some more info at <a href="http://trac.haskell.org/FieldTrip/ticket/8" target="_blank">http://trac.haskell.org/FieldTrip/ticket/8</a> .<br>
&gt;<br>
&gt; Any ideas?<br>
<br>
Currently the GLUT binding uses dynamic lookup to get freeglut-only API<br>
entries (see /GLUT/Graphics/UI/GLUT/Extensions.hs, cbits/HsGLUT.c,<br>
include/HsGLUTExt.h) and uses throwIfNull to test for non-existent API<br>
entries. Therefore, e.g. actionOnWindowClose should throw an exception when<br>
&quot;classic&quot; GLUT is used. I am not sure if I understand your request: Do you<br>
want a new API entry for the GLUT binding or a different behavior of the<br>
current entries?<br>
<br>
Cheers,<br>
 &nbsp; S.<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br></div></div>
--------------------------------------------------------------------------------<br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
_______________________________________________<br>
HOpenGL mailing list<br>
<a href="mailto:HOpenGL@haskell.org" target="_blank">HOpenGL@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/hopengl" target="_blank">http://www.haskell.org/mailman/listinfo/hopengl</a><br>
<br>
</blockquote>
</blockquote></div><br>
</div></div></blockquote></div><br>