Sign in to follow this  
5h466y

Direct3D9: (ERROR) :GetClientRect Failed ?

Recommended Posts

forgive me for being so inquisitive today and for being so implicit to express my current problem, i have this basic code as follows:
#include "Game.h"

XGMGraphics &xgmg = XGMGraphics::GetInstance () ;

HRESULT GameInit (CONST HWND &hWnd)
{
	if (xgmg.Init (hWnd, XGMG_SCREEN_WINDOWED))
		return E_FAIL ;
	xgmg.SetClearColor (0, 0, 255) ;
        return S_OK ;
}
VOID GameMain (VOID)
{
	xgmg.RenderBegin () ;
	xgmg.RenderEnd () ;
}

VOID GameEnd (VOID)
{ xgmg.ShutDown () ; }
..and i have this output:
Direct3D9: :====> ENTER: DLLMAIN(00d4d6e0): Process Attach: 00000ba4, tid=00000ba8
Direct3D9: :====> EXIT: DLLMAIN(00d4d6e0): Process Attach: 00000ba4
Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
Direct3D9: (INFO) :======================= Hal HWVP device selected

Direct3D9: (INFO) :HalDevice Driver style 9

Direct3D9: :DoneExclusiveMode
D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.58456e+029f.  This is ok.
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :GetClientRect Failed ?
Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present
D3D9 Helper: IDirect3DDevice9::Present failed: E_FAIL
Direct3D9: :====> ENTER: DLLMAIN(00d4d6e0): Process Detach 00000ba4, tid=00000ba8
Direct3D9: (INFO) :MemFini!
Direct3D9: :====> EXIT: DLLMAIN(00d4d6e0): Process Detach 00000ba4
The program '[2980] TestGame.exe: Native' has exited with code 0 (0x0).
somehow i think those errors had something to do with RenderBegin() and RenderEnd(), here's the code of both methods:
//Function: RenderBegin
//Contents: Beginning of rendering
//Note: This function must be called before any rendering
inline VOID XGM_API XGMGraphics::RenderBegin (VOID) 
{
	// Clear the back buffer to a blue color
	m_pD3DDevice->Clear (0, NULL, D3DCLEAR_TARGET, 
			     m_dwClearColor, 1.0f, 0) ;
	// Begin the scene
	m_pD3DDevice->BeginScene () ; 
}

//Function: RenderEnd
//Contents: End of rendering
//Note: This function must be called after any rendering
inline VOID XGM_API XGMGraphics::RenderEnd (VOID) 
{
	//End the scene
	m_pD3DDevice->EndScene () ;
	//Copy contents to back buffer
	m_pD3DDevice->Present (NULL, NULL, NULL, NULL) ;
}
i don't see nothing wrong with them, but maybe is something beyond those functions that consequently ends in a error in IDirect3DDevice::Present(). again, forgive me for being so implicit, but i just want to know what are the posible reasons of the problem thx, i did post this thread because no documentation was found on this forum. any help will be preciated thx :):) and peace ...

Share this post


Link to post
Share on other sites
Almost all DirectX calls return HRESULT. You need to check it after each call to determine where the error is. I suspect your device or back buffer is not being created correctly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this