Hi,
How can I create different structs with only one function according to one parameter??
I have the next example
#define POSCOL 1
#define POSTEX 2
typedef struct PosCol
{
XMLFLOAT3 pos;
XMLFLOAT4 col;
}PosCol;
typedef struct PosTex
{
XMLFLOAT3 pos;
XMLFLOAT2 tex;
}PosTex;
void CreateShape(void** ppVerts, int type)
{
if(type == POSCOL)
{
*ppVerts = new PosCol[8];
(*ppVerts)[0] = //object type PosCol. ERROR! "expression must be a pointer to a complete object type"
(*ppVerts)[1] = //object type PosCol. ERROR! "expression must be a pointer to a complete object type"
}
if(type == POSTEX)
{
*ppVerts = new PosTex[8];
(*ppVerts)[0] = //object type PosTex. ERROR! "expression must be a pointer to a complete object type"
(*ppVerts)[1] = //object type PosTex. ERROR! "expression must be a pointer to a complete object type"
}
}
That is the idea.
Someone can help me??
Thanks
Cesar