Skip to main content
GameDev.net gamedev.net
🔒 Locked

Dx8 Create device problems

Started by patindahat Jan 1, 2003 at 11:24 PM 3 replies 1k views
Original Post
patindahat
patindahat
I''m getting a bad return value from IDirect3D8::CreateDevice. It is not D3D_OK. I''m trying to start with a full screen program but all the examples Microsoft provides in the SDK are windowed, unfortunally nothing runs at a reasonable speed when windowed on my computer. The following is a bit if proof of microsoft documentation quality and the code to show what error code I''m getting (not sure which) According to the documentation with the dx8.1SDK there are 4 possible return values: D3DERR_INVALIDCALL D3DERR_NOTAVAILABLE D3DERR_OUTOFVIDEOMEMORY D3D_OK Here is my code that I quickly whipped up trying to figure out what was going on: DWORD RetValue = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, g_hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &D3DPP, &g_pD3DDevice); if(D3D_OK != RetValue) { if(D3DERR_INVALIDCALL == RetValue) MessageBox(g_hWnd, "D3DERR_INVALIDCALL", "CreateDevice Return value", MB_OK); else if(D3DERR_NOTAVAILABLE == RetValue) MessageBox(g_hWnd, "D3DERR_NOTAVAILABLE", "CreateDevice Return value", MB_OK); else if(D3DERR_OUTOFVIDEOMEMORY == RetValue) MessageBox(g_hWnd, "D3DERR_OUTOFVIDEOMEMORY ", "CreateDevice Return value", MB_OK); else MessageBox(g_hWnd, "Other ERROR, MICROSOFT DOCUMENTATION INCORRECT", "CreateDevice Return value", MB_OK); return RET_INITD3D_CREATEDEVICEFAIL; } else MessageBox(g_hWnd, "D3D_OK!", "CreateDevice Return value", MB_OK); So whatever happens a message box MUST popup..... the bad part is its the "Other ERROR, MICROSOFT DOCUMENTATION INCORRECT" one. Which means there is at least a 4th possible return value for IDirect3D8::CreateDevice. I''m stuck. And I don''t know what I can do to fix the problem. Thanks for any help, Patrick
patindahat
patindahat
I found out what the error code was.... It''s E_OUTOFMEMORY.... Now I don''t understand how that can be. I''ve restarted, then tried running the program. I got the same error. Yet I can start other games, and I can start IE, or any other program on my computer. Any information would be great, I''m confused.

Patrick
kressilac
kressilac
I believe the E_* errors are COM errors. Often times DirectX redefines a COM error into a DirectX specific error, but since CreateDevice is a COM method it is possible for that COM method to return ANY COM error regardless of the documentation. Its not supposed to but COM doesn''t know its calling a DirectX method so it won''t restrict it if it does return a normal COM error message.

Kressilac

As for why you are running out of memory, I have no idea. I''d google for references to E_OUTOFMEMORY when creating a D3D device. I''d check the E_OUTOFMEMORY error under the normal MSDN COM reference to see if anything useful could be had there.
Derek Licciardi (Kressilac)Elysian Productions Inc.
patindahat
patindahat
Thanks for the help. I''m pretty sure its a driver problem. Anything DX8 or 9 just doesn''t work.

My video card is a Voodoo3 (PCI) know of any new drivers (I got 3rd party ones that are supposed to work with DX8.1b)

Pat

Topic Locked

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

Sign in to reply to this topic.