🔒 Locked
Fullscreen Problems
Advertisement
Original Post
Define "doesn't work". Does it crash? If so, with what error? Does Reset() fail?Do you release all D3DPOOL_DEFAULT resources before the reset and recreate them after? Do you call OnLostDevice() for all D3DX classes you create and call OnReset() after? Do you reset all your render states, streams, textures, materials, lights, matrices, etc after? Are you using the debug runtimes? Do they spit out any useful debug information? Have you tried resetting the device to go to/from windowed mode? Does that work?
Quote:
Original post by Evil Steve Define "doesn't work". Does it crash? If so, with what error?Does Reset() fail?Do you release all D3DPOOL_DEFAULT resources before the reset and recreate them after? Do you call OnLostDevice() for all D3DX classes you create and call OnReset() after? Do you reset all your render states, streams, textures, materials, lights, matrices, etc after? Are you using the debug runtimes? Do they spit out any useful debug information? Have you tried resetting the device to go to/from windowed mode? Does that work?
Quote:What error does it return? If you have an ID3DXSprite, you need to call ID3DXSprite::OnLostDevice() before resetting the device, and then ID3DXSprite::OnResetDevice() after.
Original post by Jazonxyz
Reset Does Fail.
I made a D3DXSPRITE so that might be the problem.
and TestCooperativeLevel() prooved that the cause was D3DERR_DEVICE LOST
This is what I just did.
switch(D3DDevice->TestCooperativeLevel()) (D3DDevice is LPDIRECT3DDEVICE);
{
case D3DERR_DEVICENOTRESET:
SpriteHandler->OnLostDevice(); (SpriteHandler is D3DXSPRITE);
D3DDevice->Reset(&d3dpp);
SpriteHandler->OnResetDevice();
break;
case D3DERR_DEVICELOST:
SpriteHandler->OnLostDevice();
D3DDevice->Reset(&d3dpp);
SpriteHandler->OnResetDevice();
break;
and it did not work.
I am not getting any messages or error codes
switch(D3DDevice->TestCooperativeLevel()) (D3DDevice is LPDIRECT3DDEVICE);
{
case D3DERR_DEVICENOTRESET:
SpriteHandler->OnLostDevice(); (SpriteHandler is D3DXSPRITE);
D3DDevice->Reset(&d3dpp);
SpriteHandler->OnResetDevice();
break;
case D3DERR_DEVICELOST:
SpriteHandler->OnLostDevice();
D3DDevice->Reset(&d3dpp);
SpriteHandler->OnResetDevice();
break;
and it did not work.
I am not getting any messages or error codes
Quote:
Original post by Evil Steve Define "doesn't work". Does it crash? If so, with what error?Does Reset() fail?Do you release all D3DPOOL_DEFAULT resources before the reset and recreate them after?Do you call OnLostDevice() for all D3DX classes you create and call OnReset() after?Do you reset all your render states, streams, textures, materials, lights, matrices, etc after? Are you using the debug runtimes? Do they spit out any useful debug information? Have you tried resetting the device to go to/from windowed mode? Does that work?
Quote:
Original post by Evil Steve
What error does it return?
Also, although it's unrelated here, it's usually a bad idea to switch() on HRESULT error codes. You're only checking 2 of the 2 billion possible error codes. Also, the SDK docs don't cover all error codes. You should check the return value with FAILED() or SUCCEEDED)(, and then switch if it failed, and be sure to have a default case.
Quote:If you create any resources like vertex buffers, textures, render targets, etc in D3DPOOL_DEFAULT, then you need to destroy them and then re-create them after the reset, because they exist in video memory and when you reset the device, you wipe all video memory. Resources in D3DPOOL_MANAGED are ok, D3D will take care of them for you.
Original post by Jazonxyz
I dont know how to releae all D3DPOOL_DEFAULT resources and recreate them
What render state?
I have textures but I dont know how to reset them.
I am using debug runtimes
I dont get much debug information
I haven't tried resetting the device to go to/from windowed mode.
When Reset() succeeds, the device is in the same state as it was just after creating it. That means you need to set all of your renderstates (IDirect3DDevice9::SetRenderState()), textures (IDirect3DDevice9::SetTexture()), matrices (IDirect3DDevice9::SetTransform() - unless you're using shaders), etc.
If any D3D function fails and you're using the debug runtimes, D3D will spit out information i nthe debug output window, something like "(D3D) ERROR: Must release all D3DPOOL_DEFAULT resources before resetting device. Reset fails with D3DERR_INVALIDCALL." (Or something similar).
Quote:If any of your textures or surfaces are in the default pool (Not system memory, managed or scratch pools), then yes.
Original post by Jazonxyz
OK so I must release the things and reload them?
(I am only using textures and surfaces for a 2D game)
Quote:The debug runtimes (I see you're looking for how to enable them in your Other Thread) will tell you what the problem is in the debug output - it's not nessecarily that you haven't reset something.
Original post by Jazonxyz
I tried releasing them before D3DDevice->Reset() and Loading them afterwards
but it didn't work.
I still can't go back to fullscreen.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement