m_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f), 1.0f, 0 );
That code works fine in full screen mode, but it turns the screen green in windowed mode. What code can I use to clear the screen in both full screen AND windowed mode?
Clear the buffer
Im trying to clear the screen to black, and the following is the code Im using.
m_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(R,G,B), 1.0f, 0);
Just change R,G,B with UCHAR values
---------------------------------------------
If God with me, Who against me?
Sitio de desarrollo de videojuegos en español
Digital Moon Studio...
Just change R,G,B with UCHAR values
---------------------------------------------
If God with me, Who against me?
Sitio de desarrollo de videojuegos en español
Digital Moon Studio...
I gave that a try, but it still only turns the background green in windowed mode. Maybe the problem isnt with my call to clear?
This is how I init d3d in windowed mode:
[edited by - lwinkenb on November 17, 2003 1:41:47 PM]
This is how I init d3d in windowed mode:
m_pD3D = Direct3DCreate9( D3D_SDK_VERSION );D3DDISPLAYMODE d3ddm; if( m_pD3D == NULL ) { return FALSE; }ZeroMemory(&d3ddm, sizeof(d3ddm));if(FAILED(m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm))){ return FALSE;}d3dpp.Windowed = TRUE;d3dpp.BackBufferFormat = d3ddm.Format;d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;if( FAILED( m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &m_pd3dDevice ) ) ){return FALSE;}
[edited by - lwinkenb on November 17, 2003 1:41:47 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement