caramia-0.7.2.2: High-level OpenGL bindings

Safe HaskellSafe
LanguageHaskell2010

Graphics.Caramia.OpenGLResource

Synopsis

Documentation

class OpenGLResource innertype a | a -> innertype where Source

All OpenGL resources implement this typeclass.

The resources have an inner type, usually a GLuint but not always.

If you work with raw OpenGL resources, you may need to use touch to make sure the resource is not garbage collected prematurely.

Methods

getRaw :: MonadIO m => a -> m innertype Source

Returns the raw OpenGL type.

touch :: MonadIO m => a -> m () Source

Guarantees that the resource has not been garbage collected at the point this function is invoked.

finalize :: MonadIO m => a -> m () Source

Promptly finalizes the resource.

This can be unsafe; see finalizeNow.