Problem with DirectX3D initiation

Reply

Join Date: Oct 2009
Posts: 7
Reputation: FrozenSnake is an unknown quantity at this point 
Solved Threads: 0
FrozenSnake FrozenSnake is offline Offline
Newbie Poster

Problem with DirectX3D initiation

 
0
  #1
22 Days Ago
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?
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Game Development Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC