<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 8, 2014 at 9:20 AM, Elise Huard <span dir="ltr"><<a href="mailto:haskell@elisehuard.be" target="_blank">haskell@elisehuard.be</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I wanted to thank you, because pointing to unsafeCoerce was a nice bit<br>

of serendipity.  I'll admit I thought it was nitpicking initially, but<br>
I did a quick pass at cleaning things up last week after your mail<br>
(not perfect, but this was a prototype so I'm not looking for pretty):<br>
<br>
<a href="https://github.com/elisehuard/game-prototype/commit/5cf85fa60f325dbe610b5e1f017c9427e304daf6" target="_blank">https://github.com/elisehuard/game-prototype/commit/5cf85fa60f325dbe610b5e1f017c9427e304daf6</a><br>
<br>
and that fixed the texture mapping!<br>
Consider me informed on that issue :)<br></blockquote><div><br></div><div>Cool! By the way, the 'proper way' to convert between Double and CDouble is to use realToFrac:</div><div><br></div><div><div>Prelude Foreign.C.Types λ> realToFrac (1 :: Double) :: CDouble</div>
<div>1.0</div></div><div><br></div><div>In specific case like this (Double <-> CDouble) it should be equivalent (but as a user of the library you shouldn't depend on know that). In some cases it can be a performance hit, but that's what RULEs pragmas are for. Moreover, some versions of the Haskell OpenGL bindings made it so that GLdouble was not the same type as CDouble. So the safest way is to use realToFrac and depend on the library writer to provide RULEs that make it efficient.</div>
<div><br></div><div>I hope that helps,</div><div>Jason</div><div><br></div><div><br></div></div></div></div>