I try to split up my DirectX stuff and GUI stuff into two classes. It has come to the part where it compiles, but this snippet return false:
if(FAILED(pd3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pd3dDevice)))
{
MessageBox(NULL, "CD failed!", "Fatal error!", MB_OK);
return false;
}
It is part of the class DxManager, I think it's the hwnd that fails. hwnd is part of the Gui class
Here is the Gui class
class Gui
{
public:
Gui();
virtual ~Gui();
bool InitWindow(HINSTANCE hInstance);
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
protected:
HINSTANCE hInstance;
HWND hwnd;
private:
int width, height;
};
and here is the DxManager class
class DxManager : public Gui
{
public:
DxManager();
virtual ~DxManager();
bool InitDirect3D();
void StartRender();
void StopRender();
void CleanUp();
void BlitToSurface();
private:
bool fullscreen;
};
Anyone that can help me understand what is wrong?