struct Gloop::Buffer::BindTarget
- Gloop::Buffer::BindTarget
- Struct
- Value
- Object
Overview
Reference to a target that a buffer can be bound to. Provides operations for working with buffers bound to the target.
Included Modules
- Gloop::Contextual
- Gloop::Parameters
Defined in:
gloop/buffer/bind_target.crClass Method Summary
-
.copy(from read_target : Target | self, to write_target : Target | self, read_offset : Size, write_offset : Size, size : Size) : Nil
Copies a subset of data from a buffer bound to one target into one bound by another target.
Instance Method Summary
-
#[](start : Size, count : Size) : Bytes
Retrieves a subset of data from the buffer currently bound to this target.
-
#[](range : Range) : Bytes
Retrieves a range of data from the buffer currently bound to this target.
-
#[]=(start : Size, count : Size, data)
Updates a subset of the currently bound buffer's data store.
-
#[]=(range : Range, data)
Updates a subset of the currently bound buffer's data store.
-
#allocate_data(size : Size, usage : Usage = :static_draw) : Nil
Initializes the currently bound buffer to a given size with undefined contents.
-
#allocate_storage(size : Size, flags : Storage) : Nil
Initializes the currently bound buffer to a given size with undefined contents.
-
#bind(buffer : Buffer) : Nil
Binds a buffer to this target.
-
#bind(buffer : Buffer, &)
Binds a buffer to this target.
-
#buffer : Buffer
Retrieves the buffer currently bound to this target.
-
#buffer? : Buffer | Nil
Retrieves the buffer currently bound to this target.
-
#clear : Nil
Sets the contents of the buffer to zero.
-
#context : Context
Context for this target.
-
#copy_from(target : Target | self, read_offset : Size, write_offset : Size, size : Size) : Nil
Copies a subset of another buffer into the buffer bound to this target.
-
#copy_to(target : Target | self, read_offset : Size, write_offset : Size, size : Size) : Nil
Copies a subset of the buffer bound to this target into another.
-
#data : Bytes
Retrieves all data in the buffer currently bound to this target.
-
#data=(data)
Stores data in the buffer currently bound to this target.
-
#fill(value : Int8) : Nil
Fills the contents of the buffer to a single value.
-
#fill(value : UInt8) : Nil
Fills the contents of the buffer to a single value.
-
#fill(value : Int16) : Nil
Fills the contents of the buffer to a single value.
-
#fill(value : UInt16) : Nil
Fills the contents of the buffer to a single value.
-
#fill(value : Int32) : Nil
Fills the contents of the buffer to a single value.
-
#fill(value : UInt32) : Nil
Fills the contents of the buffer to a single value.
-
#fill(value : Float32) : Nil
Fills the contents of the buffer to a single value.
-
#flush(start : Size, count : Size) : Nil
Flushes a subset of the mapped buffer to indicate changes have been made.
-
#flush(range : Range) : Nil
Flushes a subset of the mapped buffer to indicate changes have been made.
-
#flush : Nil
Flushes the entire mapped buffer range to indicate changes have been made.
-
#immutable? : Bool
Indicates whether the buffer is immutable.
-
#initialize_data(data, usage : Usage = :static_draw) : Nil
Stores data in the buffer currently bound to this target.
-
#initialize_storage(data, flags : Storage) : Nil
Stores data in the buffer currently bound to this target.
-
#map(access : AccessMask, start : Size, count : Size) : Bytes
Maps a subset of the buffer's memory into client space.
-
#map(access : AccessMask, range : Range) : Bytes
Maps a subset of the buffer's memory into client space.
-
#map(access : Access) : Bytes
Maps the buffer's memory into client space.
-
#map(access : AccessMask, start : Size, count : Size, & : Bytes -> _) : Bool
Maps a subset of the buffer's memory into client space.
-
#map(access : AccessMask, range : Range, & : Bytes -> _) : Bool
Maps a subset of the buffer's memory into client space.
-
#map(access : Access, & : Bytes -> _) : Bool
Maps the buffer's memory into the client space.
-
#mapped? : Bool
Indicates whether the buffer is currently mapped.
-
#mapping : TargetMap
Retrieves information about the bound buffer's current map.
-
#mapping? : TargetMap | Nil
Retrieves information about the bound buffer's current map.
-
#size
Size of the buffer's contents in bytes.
-
#storage_flags : Gloop::Buffer::Storage
Retrieves the flags previously set for the buffer's immutable storage.
-
#target : Target
Target this binding refers to.
-
#to_unsafe
Returns an OpenGL enum representing this buffer binding target.
-
#unbind : Nil
Unbinds any previously bound buffer from this target.
-
#unmap : Bool
Unmaps the buffer's memory from client space.
-
#update(offset : Size, data) : self
Updates a subset of the currently bound buffer's data store.
-
#usage : Gloop::Buffer::Usage
Retrieves the usage hints previously provided for the buffer's data.
Class Method Detail
Copies a subset of data from a buffer bound to one target into one bound by another target.
The read_offset indicates the byte offset to start copying from read_target. The write_offset indicates the byte offset to start copying into write_target. The size is the number of bytes to copy.
See: Buffer.copy
- OpenGL function:
glCopyBufferSubData
- OpenGL version: 3.1
Instance Method Detail
Retrieves a subset of data from the buffer currently bound to this target.
NOTE Modifying the data returned by this method will not update the contents of the buffer.
See: Buffer#[]
- OpenGL function:
glGetBufferSubData
- OpenGL version: 2.0
Retrieves a range of data from the buffer currently bound to this target.
NOTE Modifying the data returned by this method will not update the contents of the buffer.
See: Buffer#[]
- OpenGL function:
glGetBufferSubData
- OpenGL version: 2.0
Updates a subset of the currently bound buffer's data store.
The data must have a #to_unsafe
method or be a Pointer
.
Bytes
, Slice
, and StaticArray
types are ideal for this.
NOTE Any length data might have is ignored. Be sure that count is less than or equal to the byte size of data.
See: Buffer#[]=
- OpenGL function:
glBufferSubData
- OpenGL version: 2.0
Updates a subset of the currently bound buffer's data store.
The data must have a #to_unsafe
method or be a Pointer
.
Bytes
, Slice
, and StaticArray
types are ideal for this.
NOTE Any length data might have is ignored. Be sure that the size of range is less than or equal to the byte size of data.
See: Buffer#[]=
- OpenGL function:
glBufferSubData
- OpenGL version: 2.0
Initializes the currently bound buffer to a given size with undefined contents.
See: Buffer#allocate_data
- OpenGL function:
glBufferData
- OpenGL version: 2.0
Initializes the currently bound buffer to a given size with undefined contents. This makes the buffer have a fixed size (immutable).
- OpenGL function:
glBufferStorage
- OpenGL version: 4.4
Binds a buffer to this target.
The previously bound buffer (if any) is restored after the block completes.
See: Buffer#bind
- OpenGL function:
glBindBuffer
- OpenGL version: 2.0
Retrieves the buffer currently bound to this target.
Returns .none
if no buffer is bound.
- OpenGL function:
glGetIntegerv
- OpenGL version: 2.0
Retrieves the buffer currently bound to this target.
Returns nil if no buffer is bound.
- OpenGL function:
glGetIntegerv
- OpenGL version: 2.0
Sets the contents of the buffer to zero.
- OpenGL function:
glClearBufferData
- OpenGL version: 4.3
Copies a subset of another buffer into the buffer bound to this target.
The read_offset indicates the byte offset to start copying from target. The write_offset indicates the byte offset to start copying into the buffer bound to this target.. The size is the number of bytes to copy.
See: Buffer#copy_from
- OpenGL function:
glCopyBufferSubData
- OpenGL version: 3.1
Copies a subset of the buffer bound to this target into another.
The read_offset indicates the byte offset to start copying from the buffer bound to this target. The write_offset indicates the byte offset to start copying into target. The size is the number of bytes to copy.
See: Buffer#copy_to
- OpenGL function:
glCopyBufferSubData
- OpenGL version: 3.1
Retrieves all data in the buffer currently bound to this target.
NOTE Modifying the data returned by this method will not update the contents of the buffer.
See: Buffer#data
- OpenGL function:
glGetBufferSubData
- OpenGL version: 2.0
Stores data in the buffer currently bound to this target.
The data must have a #to_slice
method.
Bytes
, Slice
, and StaticArray
types are ideal for this.
Previously set #usage
hint is reapplied for this data.
See: Buffer#data=
- OpenGL function:
glBufferData
- OpenGL version: 2.0
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Fills the contents of the buffer to a single value.
The value is repeated throughout the buffer. Ensure the correct numerical type is used.
- OpenGL function:
glClearNamedBufferData
- OpenGL version: 4.5
Flushes a subset of the mapped buffer to indicate changes have been made.
See: Buffer#flush
- OpenGL function:
glFlushMappedBufferRange
- OpenGL version: 3.0
Flushes a subset of the mapped buffer to indicate changes have been made.
See: Buffer#flush
- OpenGL function:
glFlushMappedBufferRange
- OpenGL version: 3.0
Flushes the entire mapped buffer range to indicate changes have been made.
See: Buffer#flush
- OpenGL function:
glFlushMappedBufferRange
- OpenGL version: 3.0
Indicates whether the buffer is immutable.
See: Buffer#immutable?
- OpenGL function:
glGetBufferParameteriv
- OpenGL enum:
GL_BUFFER_IMMUTABLE_STORAGE
- OpenGL version: 4.4
Stores data in the buffer currently bound to this target.
The data must have a #to_slice
method.
Bytes
, Slice
, and StaticArray
types are ideal for this.
- OpenGL function:
glBufferData
- OpenGL version: 2.0
Stores data in the buffer currently bound to this target. This makes the buffer have a fixed size (immutable).
The data must have a #to_slice
method.
Bytes
, Slice
, and StaticArray
types are ideal for this.
See: Buffer#initialize_storage
- OpenGL function:
glBufferStorage
- OpenGL version: 4.4
Maps a subset of the buffer's memory into client space.
See: Buffer#map
- OpenGL function:
glMapBufferRange
- OpenGL version: 3.0
Maps a subset of the buffer's memory into client space.
See: Buffer#map
- OpenGL function:
glMapBufferRange
- OpenGL version: 3.0
Maps the buffer's memory into client space.
See: Buffer#map
- OpenGL function:
glMapBuffer
- OpenGL version: 2.0
Maps a subset of the buffer's memory into client space.
The buffer is automatically unmapped when the block completes. Returns false if the buffer memory was corrupted while it was mapped.
See: Buffer#map
Maps a subset of the buffer's memory into client space.
The buffer is automatically unmapped when the block completes. Returns false if the buffer memory was corrupted while it was mapped.
See: Buffer#map
Maps the buffer's memory into the client space.
The buffer is automatically unmapped when the block completes. Returns false if the buffer memory was corrupted while it was mapped.
See: Buffer#map
Indicates whether the buffer is currently mapped.
See: Buffer#mapped?
- OpenGL function:
glGetBufferParameteriv
- OpenGL enum:
GL_BUFFER_MAPPED
- OpenGL version: 2.0
Retrieves information about the bound buffer's current map.
Raises if the buffer isn't mapped.
See: Buffer#mapping
Retrieves information about the bound buffer's current map.
Returns nil if the buffer isn't mapped.
See: Buffer#mapping?
Size of the buffer's contents in bytes.
See: Buffer#size
- OpenGL function:
glGetBufferParameteri64v
- OpenGL enum:
GL_BUFFER_SIZE
- OpenGL version: 3.2
Retrieves the flags previously set for the buffer's immutable storage.
See: #storage
See: Buffer#storage_flags
- OpenGL function:
glGetBufferParameteriv
- OpenGL enum:
GL_BUFFER_STORAGE_FLAGS
- OpenGL version: 4.4
Unbinds any previously bound buffer from this target.
- OpenGL function:
glBindBuffer
- OpenGL version: 2.0
Unmaps the buffer's memory from client space.
Returns false if the buffer memory was corrupted while it was mapped.
See: Buffer#unmap
- OpenGL function:
glUnmapBuffer
- OpenGL version: 2.0
Updates a subset of the currently bound buffer's data store.
The number of bytes updated in the buffer is equal to the byte size of data.
The data must have a #to_slice
.
Bytes
, Slice
, and StaticArray
types are ideal for this.
See: Buffer#update
- OpenGL function:
glBufferSubData
- OpenGL version: 2.0
Retrieves the usage hints previously provided for the buffer's data.
See: #data
See: Buffer#usage
- OpenGL function:
glGetBufferParameteriv
- OpenGL enum:
GL_BUFFER_USAGE
- OpenGL version: 2.0