Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
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
.
OpenGLResource GLsync Fence | |
OpenGLResource GLuint Buffer | |
OpenGLResource GLuint Texture | If you use |
OpenGLResource GLuint Framebuffer | |
OpenGLResource GLuint Pipeline | Despite the Haskell name, |
OpenGLResource GLuint Shader | |
OpenGLResource GLuint VAO | |
OpenGLResource a (WrappedOpenGLResource a) | |
OpenGLResource GLuint (Query a) |