<font face="verdana,sans-serif">Awesome. Thanks!<br><br>As a follow up question, how do I add a finalizer to a normal variable? OpenGL returns an integer handle to your texture in graphics memory, and you have to call deleteObjectNames on it. Is there any way to have this automatically run once we lose all references to this variable (and all copies)?<br>

</font><br><div class="gmail_quote">On Mon, Feb 6, 2012 at 10:14 PM, Ben Lippmeier <span dir="ltr">&lt;<a href="mailto:benl@ouroborus.net">benl@ouroborus.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div class="im"><br><div><div>On 07/02/2012, at 7:00 AM, Clark Gaebel wrote:</div><br><blockquote type="cite"><font face="verdana,sans-serif">Using the OpenGL package on Hackage, how do I load a texture from an array?<br>

<br>In the red book[1], I see their code using glGenTextures and glBindTexture, but I can&#39;t find these in the documentation. Are there different functions I should be calling?<br></font></blockquote></div><br></div><div>

The Gloss graphics library has texture support, and the code for drawing them is confined to this module:</div><div><br></div><div><a href="http://code.ouroborus.net/gloss/gloss-head/gloss/Graphics/Gloss/Internals/Render/Picture.hs" target="_blank">http://code.ouroborus.net/gloss/gloss-head/gloss/Graphics/Gloss/Internals/Render/Picture.hs</a></div>

<div><br></div><div>Feel free to steal the code from there.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Ben.</div><div><br></div><div><br></div></font></span></div></blockquote></div><br>