I'm learning to use OpenGL and refresh my knowledge of C++. I want to make simple way to render objects with one call, I've created Mesh class (that inherits from Component but that doesn't matter) and it should have 2 public variables (for now) which is float array for vertices and unsigned int array for indices, however when I try to create them in .h like this:
#pragma once
#include "../Component.h"
class Mesh : public Component {
public:
float vertices[]; //error is on this line of code
unsigned int indices[];
Mesh(float vertices[], unsigned int indices[]);
};
it gives me a error which says "Incomplete type is not allowed
", however this only happens if there are 2 arrays, if I remove the unsigned int array it works, then if unsigned int array would be declared one line higher like this:
public:
unsigned int indices[]; //now the error is here
float vertices[];
Mesh(float vertices[], unsigned int indices[]);
and I remove the float array, then there is no error, I tried everything, and it can't be problem with that there is no size specified because if I remove the other array it magically works. Also sorry if this is like simple mistake I haven't worked with C++ in long time.
Cheers.