Skip to main content
gamedev.net
🔒 Locked

Direct3D9 - ERROR

Started by Mikie 5 replies 950+ views
Original Post
Mikie
Mikie
Hello Everyone! I've been having lots of fun with my new setup (DX9/VC2005B) - it's not as daunting as I first thought it might be. I've kept Vis6 for other coding projects cos it's so much quicker, on my machine anyway. OK, so, as I said its be fun but I'm stuck now with a 'strange' error message that I can't find a google answer for: Direct3D9: (ERROR) :Device cannot perform hardware processing. ValidateCreateDevice failed BG: I'm compiling the MapEditorLite demo from 'Strategy Game Programming with DX9' - At least now I have just 1 error, I was getting like 00s with Vis6. Can I assume that this error refers to my rather knacked gfx card's abilities or lack of? If so how might I be able to get around it - ie how do I get to the REF device instead? Thanks in advance for pointers <shudder> in the right direction
idloco
idloco
When you create the device put D3DDEVTYPE_REF instead of D3DDEVTYPE_HAL.
Like this...
   if(FAILED(Direct3D_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF,                                           hwnd, VertexProcessing,                                           &Present_Parameters, &D3D_Device)))      {         MessageBox(NULL, "CreateDevice() failed!  Make sure you have DirectX 9.",                    "Error!", MB_OK);         return false;      }


I hope it helps
------------------------------------ IDLoco Game Studios
mdias
mdias
To use the REF device, search your code for the IDirect3D9::CreateDevice() method, and rplace the flag D3DDEVTYPE_HAL by D3DDEVTYPE_REF in the 2nd parameter.

And yes, it's a feature that your hardware/video drivers lacks.

[edit] beaten to it by idloco.
Mikie
Mikie
Hey! Thanks for the quick response.

Unfortunately that doesn't seem to make a difference - the error is still reported, I've included a bit more below

Direct3D9: :====> EXIT: DLLMAIN(00d136a0): Process Attach: 000008e4Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFODirect3D9: (ERROR) :Device cannot perform hardware processing. ValidateCreateDevice failed.Direct3D9: :====> ENTER: DLLMAIN(00d136a0): Process Detach 000008e4, tid=00000d30Direct3D9: (INFO) :MemFini!Direct3D9: :====> EXIT: DLLMAIN(00d136a0): Process Detach 000008e4DINPUT8: unloaded before all objects released. (cRef:4)The thread 'Win32 Thread' (0xd30) has exited with code 0 (0x0).The program '[2276] D3D_MapEditorLite.exe: Native' has exited with code 0 (0x0).


Anything stand out from that? BTW the program window flashes up for an instant then disappears again.


ps I put in the MessageBox code from idloco and I didn't get the warning...
mdias
mdias
Quote:
Original post by Mikie
...

ps I put in the MessageBox code from idloco and I didn't get the warning...


This means that the error is not ocurring during the creation of the device, you should debug your code and go step by step to see which line of your code generates that debug output error.
break_r
break_r
Messaging the error is nice, but you're not really handling the error in a robust manner. Check the HRESULT using DXTRACE_ERR or other macros from dxerr9. You may discover something like D3DERR_INVALIDCALL which would tell you there's something wrong with a param to CreateDevice (ie. your presentation params). This narrows down the problem.

Regards.
Mikie
Mikie
Excellent - thanks y'all!

Here's what the issues were:

I changed the CreateDevice() to _REF from _HAL

if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, hWnd,D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice ) ) )


And I recieved the MessageBox error so as has been indicated the 'error' was elsewhere..

Looking through the code again I realised that when I was trying to compile with Vis6 and my prev DX9 setup I had changed some code to get it to compile at all... The reason for the changes being that the compiler was reporting

***
DrawText: does not take 12 args
D3DXCreateFont: does not take 5 arg
***

Using the DX docs I managed to work out what needed changing but as I hadn't commented the changes I couldn't immediately work out what was wrong! I reversed these changes back to what they should have been and hey presto - MapEditorLite runs perfectly if very slooooowly.

Thanks for you help :-)
moral of the thread: comment your code/changes!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.