I trying to use policy classes , like that described in "moden c++ design" of Alexandrescu.
I wish create a simple project:
template <class CCreatorVboGl>
class VboManager: public CCreatorVboGl
{
Create(class CData vertexes){
. . .glvbo = CCreatorVboGl.Create(vertexes) ecc....
}
void Draw();
}
else
template <class CCreatorVboDx>
class VboManager: public CCreatorVboDx
{
Create(class CData vertexes){
. . .dxvbo = CCreatorVboDx.Create(vertexes) ecc....
}
void Draw();
}
i create an host class for each graphics entity(texture,vbo ecc...)and i send a CCreator
to the host class in this mode if i wish change the api from opengl to directx i simply change the creator object template parameter.
The question is : if i wish serialize the graphics elements how i do?
I think that is sufficent save the CData param of each element, then launch a Save for each CData classes.
but i must take care of the linkage ecc...
There is an example of serialization for non reinvent the wheel?
thanks