caramia-0.7.2.0: High-level OpenGL bindings

Safe HaskellSafe-Inferred
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.

Instances

OpenGLResource GLsync Fence 
OpenGLResource GLuint Buffer 
OpenGLResource GLuint Texture

If you use finalize, be careful of any resource that might refer to the texture.

OpenGLResource GLuint Framebuffer 
OpenGLResource GLuint Pipeline

Despite the Haskell name, Pipeline, the object is a shader program object.

OpenGLResource GLuint Shader 
OpenGLResource GLuint VAO 
OpenGLResource a (WrappedOpenGLResource a) 
OpenGLResource GLuint (Query a)