caramia-0.7.2.2: High-level OpenGL bindings

Safe HaskellNone
LanguageHaskell2010

Graphics.Caramia.Buffer.Internal

Synopsis

Documentation

data Buffer Source

Buffer data type.

Constructors

Buffer 

Fields

resource :: !(Resource Buffer_)
 
status :: !(IORef BufferStatus)
 
viewAllowedMappings :: !AccessFlags

Returns the allowed mappings.

viewSize :: !Int

Returns the size of the buffer, in bytes.

ordIndex :: !Unique
 

data BufferStatus Source

Constructors

BufferStatus 

Fields

mapped :: !(Maybe (Set MapFlag))
 

newtype Buffer_ Source

Constructors

Buffer_ GLuint 

data AccessFlags Source

Describes a style of mapping.

Constructors

ReadAccess

The mapping can be read from.

WriteAccess

The mapping can be written to.

ReadWriteAccess

Both reading and writing can be done.

NoAccess

No access; you cannot map the buffer at all after creation.

data MapFlag Source

Additional mapping flags.

Constructors

UnSynchronized

Map the buffer without synchronization. You will have to use synchronization primitives to make sure you and OpenGL won't be using the buffer at the same time.

ExplicitFlush

If set, you need to explicitly flush ranges of the mapping after you have modified them, with explicitFlush. The mapping must allow writes. Requires OpenGL 3.0 or greater or "GL_ARB_map_buffer_range", but if neither of these are available, then this flag is no-op and so is explicitFlush.

Explicit flushing can be useful when you map a large buffer but don't know beforehand how much of that buffer you are going to modify.