I am writing a new class using OpenGL, i have two possibilities for my constructor :
VertexObject();
VertexObject(GLuint* vertices,GLuint* elements);
What i would like to do is that VertexObject() calls the other one with an already inisialised array such as
VertexObject::VertexObject() :
VertexObject(
(GLuint[]) {
0, 1, 2,
2, 3, 0
},
(GLuint[]) {
0, 1, 2,
2, 3, 0
}) {}
But it seems C++ won't let me do it, error being 'taking address of temporary array'. I am not even sure what i am asking for is doable but any help will be greatly appreciated.
verticesandelementsbe pointers-to-const?