SpecificVbo.mapReadOnly

Map the contents of the Vbo in our own memory, temporarily. (Calls glMapBuffer.)

  1. auto mapReadOnly()
    struct SpecificVbo(T)
    mapReadOnly
    ()
  2. auto mapWriteOnly()
  3. auto mapReadWrite()

Return Value

Type: auto

An object that behaves like a T[] (or const(T)[], for the read-only version), and reflects the contents of the Vbo. After this object is destructed, slices in that piece of memory are no longer valid (because glUnmapBuffer is then called).

Examples

auto v = Vbo!int(3);
{
	auto m = v.mapWriteOnly();
	m[] = 5;
	m[1] = 2;
}
assert(v.mapReadOnly()[] == [5, 2, 5]);

Meta