OpenGL-2.9.2.0: A binding for the OpenGL graphics system

Copyright | (c) Sven Panne 2013
License | BSD3
Maintainer | Sven Panne <svenpanne@gmail.com>
Stability | stable
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell98

Graphics.Rendering.OpenGL.GL.ObjectName

Description

This module corresponds to section 2.5 (Objects and the Object Model) of the OpenGL 4.4 specs.

Object names are explicitly handled identifiers for API objects, e.g. a texture object name in OpenGL or a buffer object name in OpenAL.

Synopsis

- class ObjectName a where
  - isObjectName :: a -> IO Bool
  - deleteObjectName :: a -> IO ()
  - deleteObjectNames :: [a] -> IO ()
- class ObjectName a => GeneratableObjectName a where
  - genObjectName :: IO a
  - genObjectNames :: Int -> IO [a]

# Documentation

class ObjectName a where

An `ObjectName` is an explicitly handled identifier for API objects, e.g. a texture object name in OpenGL or a buffer object name in OpenAL.

Minimal complete definition: `isObjectName` plus one of `deleteObjectName` or `deleteObjectNames`.

Minimal complete definition

isObjectName

Methods

isObjectName :: a -> IO Bool

Test if the given object name is currently in use, i.e. test if it has been generated, but not been deleted so far.

deleteObjectName :: a -> IO ()

Make the given object name available again, declaring it as unused.

deleteObjectNames :: [a] -> IO ()

Bulk version of `deleteObjectName`.

Instances

ObjectName SyncObject |
ObjectName VertexArrayObject |
ObjectName BufferObject |
ObjectName DisplayList |
ObjectName QueryObject |
ObjectName RenderbufferObject |
ObjectName TextureObject |
ObjectName FramebufferObject |
ObjectName Program |
ObjectName Shader |

class ObjectName a => GeneratableObjectName a where

A `GeneratableObjectName` is an `ObjectName` which can be generated without creating an associated object at the same time, e.g. a buffer object name. Note that e.g. program object names do not fall into this category, because you can only create such a name together with a program object itself.

Minimal complete definition: One of `genObjectName` or `genObjectNames`.

Minimal complete definition

Nothing

Methods

genObjectName :: IO a

Generate a new unused object name. By generating the name, it becomes used.

genObjectNames :: Int -> IO [a]

Bulk version of `genObjectName`.

Instances

GeneratableObjectName VertexArrayObject |
GeneratableObjectName BufferObject |
GeneratableObjectName DisplayList |
GeneratableObjectName QueryObject |
GeneratableObjectName RenderbufferObject |
GeneratableObjectName TextureObject |
GeneratableObjectName FramebufferObject |