On 05/04/2015 08:36 AM, WhatMeWorry wrote:
> But just for arguments sake, wouldn't it have
> been better to define in dynamic array properties a .sizeofref and a
> .sizeof (which behaves like the static array.sizeof)?
It would not work because
1) .sizeof means the size of the variable that a pi
Many thanks. Just to recap, I got the code working with:
glBufferData(GL_ARRAY_BUFFER, (verts.sizeof * verts.length),
verts.ptr, GL_STATIC_DRAW);
sizeof on a slice doesn't do what you think it does, it returns
the size of the actual slice object I believe.
I have to admit that I didn't und
On Monday, 4 May 2015 at 02:47:24 UTC, WhatMeWorry wrote:
This following code works fine. A triangle is displayed.
GLfloat[6] verts = [ 0.0, 1.0,
-1.0, -1.0,
1.0, -1.0 ];
glGenBuffers(1, &vbo);
glBindBuffer(GL_
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
This following code works fine. A triangle is displayed.
GLfloat[6] verts = [ 0.0, 1.0,
-1.0, -1.0,
1.0, -1.0 ];
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo); // Some of the
types are: