hi im using VC++.net and writing a 3d game engine with directx 8.1, however i have run into a problem which i cant find a solution to. (this is a simple problem and has nothing to do with directx or 3d graphics theory)
this is my problem, i have a void pointer which is initalized to be an array of 4 structs, however depending on the flow of the program it is not always intialized into the same type.
this is an example:
//the vertex pointer whos type is set by eather having lighting or not
void * vertices;
//if there is lighting
//define vertex type for light
reinterpret_cast <VertexLitTex *> ( vertices) = new VertexLitTex[ 4 ];
//if there is no lighting
//no normals are needed
reinterpret_cast <VertexTex *> ( vertices ) = new VertexTex[ 4 ];
then later on in the constructor i go on to set the values of the structs, it must be done this way. this is where i get the problem
the error is: "error C2106: '=' : left operand must be l-value".
i know what the problem is and what is wrong, i just dont know the solution.
what i want to say is basicly this:
vertices[ 0 ].x = -half_height;
vertices[ 0 ].y = half_height;
i have tried this and other varients but they all yield the same error:
reinterpret_cast <VertexLitTex *> ( vertices[ 0 ].x   = half_height;
thank you for your time,
your help is greatly appreciated!