On Saturday, 25 January 2020 at 20:21:31 UTC, lithium iodate
wrote:
In line 146
glBufferData(GL_ARRAY_BUFFER, vertices.sizeof, vertices.ptr,
GL_STATIC_DRAW);
you are calculating the size of `vertices` incorrectly. As
`vertices` is a dynamic array, .sizeof will only give you the
size of the array reference (size_t.sizeof * 2, note that
.sizeof will always give you a compile-time constant in D).
Change it to
glBufferData(GL_ARRAY_BUFFER, vertices.length * GLfloat.sizeof,
vertices.ptr, GL_STATIC_DRAW);
and the data will be correctly copied into the buffer.
Many thanks !