Original Post
Hi all, I have a couple of questions pertaining to the methods I have created for a ShapeFactory I have in my Game Engine. My game engine resides in it's own DLL and was built in VC7.1 as a Multithreaded DLL. My applications which link to it are also built with the same option. My shapefactory class has functions like this: My apps all derive from a base Application Class which holds a pointer to the engine class in the DLL. Say for example My app class has the following two members. Is there a better or preferred method to do what I am trying to accomplish here? Everything works fine, I just don't know how hapy I am about the void pointer and such. Thanks in advance for any and all help or comments. Seth [Edited by - DeafManNoEars on January 23, 2007 4:09:10 PM]
SVertex_XYZ_N_T1* m_pVertices;
uint32* m_puiIndices;
uint32 m_uiNumVerts;
uint32 m_uiNumIndices;
and I want to fill them with data obtained from the shapefactory. Currently I am using the function below to do so.
//Resides in DLL
CreateCuboid( void** ppVerts, uint32** ppIndices, uint32 &numVerts,
uint32 &numIndices, VERTEXTYPE vtp, uint16 iTess, bool bInvert )
{
numVerts = 6*iTess*iTess;
numIndices = 6*6*(iTess-1)(iTess-1);
//create dynamic arrays of data
SVertex_XYZ_N_T1* pVertices = new SVertex_XYZ_N_T1[numVerts];
uint32* pIndices = new uint32[numIndices];
// creation data here
*ppVerts = pVertices;
*ppIndices = pIndices;
}
//this is called from the application. Not the DLL
CreateCuboid( &m_pVertices, &n_puiIndices, m_uiNumVerts, m_uiNumIndices,
VERTTYPE_XYZ_N_T1, 20, false );