Hi, I'm currently working on a sprite engine in C++. I have an abstract class IEngine with a virtual function init_api. This takes in a void*.
// Initialise the engines' API
// api_params - void* to api parameters for initalisation
// hWnd - window handle
virtual bool init_api( void* api_params, HWND hWnd ) = 0;
I then have a DirectX implemented engine class CEngineDX. Which then casts api_params to a D3DPRESENT_PARAMETERS*, so it can be used for initialising DirectX.
// Cast api_params to a D3DPRESENT_PARAMETERS
D3DPRESENT_PARAMETERS* presentParams = NULL;
presentParams = reinterpret_cast< D3DPRESENT_PARAMETERS* >( api_params );
I'm quite happy with this setup but wanted to get some other programmers view on this "solution" if you like.
Cheers for the replies!
Carl