PDA

View Full Version : error: cannot convert 'QVector<QVector3D>' to 'const GLvoid* {aka const void*}' in a



saman_artorious
22nd June 2013, 10:02
I have defined vertices as

QVector<QVector3D> vertices

I get the above error when calling:

glBufferData(GL_ARRAY_BUFFER,
sizeof(vertices)+sizeof(colors),
vertices, GL_STATIC_DRAW );

I cannot cast vertices to GLvoid*. is there anyway to do that?

Besides, in

glVertexPointer(2, QVector3D, 0, 0);
QVector3D is also not recognized, having prototype:

GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr );

any ideas?

Added after 1 4 minutes:

OOoooooooppppssss, I totally forgot about

.constData:o