[Haskell-cafe] Loading a texture in OpenGL

Clark Gaebel cgaebel at csclub.uwaterloo.ca
Tue Feb 7 04:40:47 CET 2012


Awesome. Thanks!

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)?

On Mon, Feb 6, 2012 at 10:14 PM, Ben Lippmeier <benl at ouroborus.net> wrote:

>
> On 07/02/2012, at 7:00 AM, Clark Gaebel wrote:
>
> Using the OpenGL package on Hackage, how do I load a texture from an array?
>
> In the red book[1], I see their code using glGenTextures and
> glBindTexture, but I can't find these in the documentation. Are there
> different functions I should be calling?
>
>
> The Gloss graphics library has texture support, and the code for drawing
> them is confined to this module:
>
>
> http://code.ouroborus.net/gloss/gloss-head/gloss/Graphics/Gloss/Internals/Render/Picture.hs
>
> Feel free to steal the code from there.
>
> Ben.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120206/76eb1354/attachment.htm>


More information about the Haskell-Cafe mailing list