Function mallumo_gls::raw::named_buffer_storage
[−]
[src]
pub unsafe fn named_buffer_storage<T, M>(
id: BufferId,
data: BufferData<T>,
mutability: BufferMutability,
map: M
) -> Result<(), Error> where
M: Into<Option<BufferMap>>,
Initializes buffer
Arguments
id
- id of the bufferdata
- enumeration, Empty(size) will allocate the size for the buffer, Data(&[T]) will initialize size of &[T] and copy data from slice to GPU memorymutability
- sets the mutability for the buffer. Beware, in OpenGL terminology immutable buffer means not resizable but all buffers created withglNamedBufferStorage
are non-resizable. This simply says whether you can modify data in the buffermap
- whether to map the buffer for reading, writing, both or none
Example
let vertices: Vec<f32> = vec![-1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 0.0, 1.0, 0.0]; let vertices_buffer = create_buffer(); named_buffer_storage( buffer, BufferData::Data(&vertices), BufferMutability:Immutable, None );