Safe Haskell | Safe-Infered |
---|
Graphics.GLUtil.BufferObjects
Description
Utilities for filling BufferObject
s.
- makeBuffer :: Storable a => BufferTarget -> [a] -> IO BufferObject
- makeBufferLen :: Storable a => BufferTarget -> Int -> [a] -> IO BufferObject
- fromPtr :: BufferTarget -> Int -> Ptr a -> IO BufferObject
- fromByteString :: BufferTarget -> ByteString -> IO BufferObject
- fromForeignPtr :: forall a. Storable a => BufferTarget -> Int -> ForeignPtr a -> IO BufferObject
- fromVector :: forall a. Storable a => BufferTarget -> Vector a -> IO BufferObject
- offsetPtr :: Int -> Ptr a
- offset0 :: Ptr a
Documentation
makeBuffer :: Storable a => BufferTarget -> [a] -> IO BufferObjectSource
Allocate and fill a BufferObject
from a list of Storable
s.
makeBufferLen :: Storable a => BufferTarget -> Int -> [a] -> IO BufferObjectSource
Allocate and fill a BufferObject
from a list of Storable
s
whose length is explicitly given. This is useful when the list is
of known length, as it avoids a traversal to find the length.
fromPtr :: BufferTarget -> Int -> Ptr a -> IO BufferObjectSource
Allocate and fill a BufferObject
with the given number of bytes
from the supplied pointer.
fromByteString :: BufferTarget -> ByteString -> IO BufferObjectSource
Fill a buffer with a ByteString
.
fromForeignPtr :: forall a. Storable a => BufferTarget -> Int -> ForeignPtr a -> IO BufferObjectSource
Fill a buffer with data from a ForeignPtr
. The application
fromForeignPtr target len fptr
fills a target
BufferTarget
with len
elements starting from fptr
.
fromVector :: forall a. Storable a => BufferTarget -> Vector a -> IO BufferObjectSource
Fill a buffer with data from a Vector
.