Copyright | (c) Sven Panne 2002-2019 |
---|---|
License | BSD3 |
Maintainer | Sven Panne <svenpanne@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module corresponds to section 2.9 (Buffer Objects) of the OpenGL 2.1 specs.
Synopsis
- data BufferObject
- data BufferTarget
- bindBuffer :: BufferTarget -> StateVar (Maybe BufferObject)
- arrayBufferBinding :: ClientArrayType -> GettableStateVar (Maybe BufferObject)
- vertexAttribArrayBufferBinding :: AttribLocation -> GettableStateVar (Maybe BufferObject)
- data BufferUsage
- bufferData :: BufferTarget -> StateVar (GLsizeiptr, Ptr a, BufferUsage)
- data TransferDirection
- bufferSubData :: BufferTarget -> TransferDirection -> GLintptr -> GLsizeiptr -> Ptr a -> IO ()
- data BufferAccess
- data MappingFailure
- withMappedBuffer :: BufferTarget -> BufferAccess -> (Ptr a -> IO b) -> (MappingFailure -> IO b) -> IO b
- mapBuffer :: BufferTarget -> BufferAccess -> IO (Maybe (Ptr a))
- unmapBuffer :: BufferTarget -> IO Bool
- bufferAccess :: BufferTarget -> GettableStateVar BufferAccess
- bufferMapped :: BufferTarget -> GettableStateVar Bool
- data MapBufferUsage
- type Offset = GLintptr
- type Length = GLsizeiptr
- mapBufferRange :: BufferTarget -> Offset -> Length -> [MapBufferUsage] -> IO (Maybe (Ptr a))
- flushMappedBufferRange :: BufferTarget -> Offset -> Length -> IO ()
- type BufferIndex = GLuint
- type RangeStartIndex = GLintptr
- type RangeSize = GLsizeiptr
- type BufferRange = (BufferObject, RangeStartIndex, RangeSize)
- data IndexedBufferTarget
- bindBufferBase :: IndexedBufferTarget -> BufferIndex -> StateVar (Maybe BufferObject)
- bindBufferRange :: IndexedBufferTarget -> BufferIndex -> StateVar (Maybe BufferRange)
- indexedBufferStart :: IndexedBufferTarget -> BufferIndex -> GettableStateVar RangeStartIndex
- indexedBufferSize :: IndexedBufferTarget -> BufferIndex -> GettableStateVar RangeSize
Buffer Objects
data BufferObject Source #
Instances
Binding Buffer Objects
data BufferTarget Source #
Instances
Eq BufferTarget Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: BufferTarget -> BufferTarget -> Bool # (/=) :: BufferTarget -> BufferTarget -> Bool # | |
Ord BufferTarget Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: BufferTarget -> BufferTarget -> Ordering # (<) :: BufferTarget -> BufferTarget -> Bool # (<=) :: BufferTarget -> BufferTarget -> Bool # (>) :: BufferTarget -> BufferTarget -> Bool # (>=) :: BufferTarget -> BufferTarget -> Bool # max :: BufferTarget -> BufferTarget -> BufferTarget # min :: BufferTarget -> BufferTarget -> BufferTarget # | |
Show BufferTarget Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> BufferTarget -> ShowS # show :: BufferTarget -> String # showList :: [BufferTarget] -> ShowS # |
bindBuffer :: BufferTarget -> StateVar (Maybe BufferObject) Source #
Handling Buffer Data
data BufferUsage Source #
StreamDraw | |
StreamRead | |
StreamCopy | |
StaticDraw | |
StaticRead | |
StaticCopy | |
DynamicDraw | |
DynamicRead | |
DynamicCopy |
Instances
Eq BufferUsage Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: BufferUsage -> BufferUsage -> Bool # (/=) :: BufferUsage -> BufferUsage -> Bool # | |
Ord BufferUsage Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: BufferUsage -> BufferUsage -> Ordering # (<) :: BufferUsage -> BufferUsage -> Bool # (<=) :: BufferUsage -> BufferUsage -> Bool # (>) :: BufferUsage -> BufferUsage -> Bool # (>=) :: BufferUsage -> BufferUsage -> Bool # max :: BufferUsage -> BufferUsage -> BufferUsage # min :: BufferUsage -> BufferUsage -> BufferUsage # | |
Show BufferUsage Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> BufferUsage -> ShowS # show :: BufferUsage -> String # showList :: [BufferUsage] -> ShowS # |
bufferData :: BufferTarget -> StateVar (GLsizeiptr, Ptr a, BufferUsage) Source #
data TransferDirection Source #
Instances
Eq TransferDirection Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: TransferDirection -> TransferDirection -> Bool # (/=) :: TransferDirection -> TransferDirection -> Bool # | |
Ord TransferDirection Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: TransferDirection -> TransferDirection -> Ordering # (<) :: TransferDirection -> TransferDirection -> Bool # (<=) :: TransferDirection -> TransferDirection -> Bool # (>) :: TransferDirection -> TransferDirection -> Bool # (>=) :: TransferDirection -> TransferDirection -> Bool # max :: TransferDirection -> TransferDirection -> TransferDirection # min :: TransferDirection -> TransferDirection -> TransferDirection # | |
Show TransferDirection Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> TransferDirection -> ShowS # show :: TransferDirection -> String # showList :: [TransferDirection] -> ShowS # |
bufferSubData :: BufferTarget -> TransferDirection -> GLintptr -> GLsizeiptr -> Ptr a -> IO () Source #
Mapping Buffer Objects
data BufferAccess Source #
Instances
Eq BufferAccess Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: BufferAccess -> BufferAccess -> Bool # (/=) :: BufferAccess -> BufferAccess -> Bool # | |
Ord BufferAccess Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: BufferAccess -> BufferAccess -> Ordering # (<) :: BufferAccess -> BufferAccess -> Bool # (<=) :: BufferAccess -> BufferAccess -> Bool # (>) :: BufferAccess -> BufferAccess -> Bool # (>=) :: BufferAccess -> BufferAccess -> Bool # max :: BufferAccess -> BufferAccess -> BufferAccess # min :: BufferAccess -> BufferAccess -> BufferAccess # | |
Show BufferAccess Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> BufferAccess -> ShowS # show :: BufferAccess -> String # showList :: [BufferAccess] -> ShowS # |
data MappingFailure Source #
Instances
Eq MappingFailure Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: MappingFailure -> MappingFailure -> Bool # (/=) :: MappingFailure -> MappingFailure -> Bool # | |
Ord MappingFailure Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: MappingFailure -> MappingFailure -> Ordering # (<) :: MappingFailure -> MappingFailure -> Bool # (<=) :: MappingFailure -> MappingFailure -> Bool # (>) :: MappingFailure -> MappingFailure -> Bool # (>=) :: MappingFailure -> MappingFailure -> Bool # max :: MappingFailure -> MappingFailure -> MappingFailure # min :: MappingFailure -> MappingFailure -> MappingFailure # | |
Show MappingFailure Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> MappingFailure -> ShowS # show :: MappingFailure -> String # showList :: [MappingFailure] -> ShowS # |
withMappedBuffer :: BufferTarget -> BufferAccess -> (Ptr a -> IO b) -> (MappingFailure -> IO b) -> IO b Source #
Convenience function for an exception-safe combination of mapBuffer
and
unmapBuffer
.
mapBuffer :: BufferTarget -> BufferAccess -> IO (Maybe (Ptr a)) Source #
unmapBuffer :: BufferTarget -> IO Bool Source #
data MapBufferUsage Source #
Instances
Eq MapBufferUsage Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: MapBufferUsage -> MapBufferUsage -> Bool # (/=) :: MapBufferUsage -> MapBufferUsage -> Bool # | |
Ord MapBufferUsage Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: MapBufferUsage -> MapBufferUsage -> Ordering # (<) :: MapBufferUsage -> MapBufferUsage -> Bool # (<=) :: MapBufferUsage -> MapBufferUsage -> Bool # (>) :: MapBufferUsage -> MapBufferUsage -> Bool # (>=) :: MapBufferUsage -> MapBufferUsage -> Bool # max :: MapBufferUsage -> MapBufferUsage -> MapBufferUsage # min :: MapBufferUsage -> MapBufferUsage -> MapBufferUsage # | |
Show MapBufferUsage Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> MapBufferUsage -> ShowS # show :: MapBufferUsage -> String # showList :: [MapBufferUsage] -> ShowS # |
type Length = GLsizeiptr Source #
mapBufferRange :: BufferTarget -> Offset -> Length -> [MapBufferUsage] -> IO (Maybe (Ptr a)) Source #
flushMappedBufferRange :: BufferTarget -> Offset -> Length -> IO () Source #
Indexed Buffer manipulation
type BufferIndex = GLuint Source #
type RangeStartIndex = GLintptr Source #
type RangeSize = GLsizeiptr Source #
type BufferRange = (BufferObject, RangeStartIndex, RangeSize) Source #
data IndexedBufferTarget Source #
IndexedAtomicCounterBuffer | |
IndexedShaderStorageBuffer | |
IndexedTransformFeedbackBuffer | |
IndexedUniformBuffer |
Instances
Eq IndexedBufferTarget Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects (==) :: IndexedBufferTarget -> IndexedBufferTarget -> Bool # (/=) :: IndexedBufferTarget -> IndexedBufferTarget -> Bool # | |
Ord IndexedBufferTarget Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects compare :: IndexedBufferTarget -> IndexedBufferTarget -> Ordering # (<) :: IndexedBufferTarget -> IndexedBufferTarget -> Bool # (<=) :: IndexedBufferTarget -> IndexedBufferTarget -> Bool # (>) :: IndexedBufferTarget -> IndexedBufferTarget -> Bool # (>=) :: IndexedBufferTarget -> IndexedBufferTarget -> Bool # max :: IndexedBufferTarget -> IndexedBufferTarget -> IndexedBufferTarget # min :: IndexedBufferTarget -> IndexedBufferTarget -> IndexedBufferTarget # | |
Show IndexedBufferTarget Source # | |
Defined in Graphics.Rendering.OpenGL.GL.BufferObjects showsPrec :: Int -> IndexedBufferTarget -> ShowS # show :: IndexedBufferTarget -> String # showList :: [IndexedBufferTarget] -> ShowS # |