On Monday, 4 May 2015 at 02:47:24 UTC, WhatMeWorry wrote:
glBufferData(GL_ARRAY_BUFFER, verts.sizeof, &verts, GL_STATIC_DRAW);

Try

(GL_ARRAY_BUFFER, verts.length, verts.ptr, GL_STATIC_DRAW)

or maybe:

(GL_ARRAY_BUFFER, verts.length * verts[0].sizeof, verts.ptr, GL_STATIC_DRAW)

I'm not sure exactly what the function needs, but using the .length and .ptr properties on a dynamic array will probably work better than casting, and definitely work better than casting the address of it. (A dynamic array is actually a struct { size_t length; T* ptr; } object instead of raw memory like a static array, so taking the address of it actually gives the address of that length variable, not the data. the ptr attribute gets the pointer to the data. BTW static arrays also have .length and .ptr properties you can use the same way.)

Reply via email to