Not sure if this can be done the way I would like, but I'll put the question out there.
I have an array that contains three floats in each location, which I am using as vertex data.
I have a public variable verticies[] inside a class. Is there a way I can assign variable length data to this variable without the compiler throwing an error?
This is the class (pretty basic)
class Object
{
public:
Object(){}
~Object(){}
VertexPos verticies[];
private:
};
And I'd like to fill the verticies[] like this;
mObject->verticies[] =
{
DirectX::XMFLOAT3((float)-0.5, (float)-0.5, (float)0), DirectX::XMFLOAT3((float)-0.5, (float)0.5, (float)0), DirectX::XMFLOAT3((float)0.5, (float)-0.5, (float)0),
DirectX::XMFLOAT3((float)-0.5, (float)0.5, (float)0), DirectX::XMFLOAT3((float)0.5, (float)0.5, (float)0), DirectX::XMFLOAT3((float)0.5, (float)-0.5, (float)0),
};
Can this be done? Or is this going to be a problem as there is no static size defined in the class?Thanks in advance