|
-
Mar 18th, 2002, 12:32 PM
#1
Thread Starter
Addicted Member
D3D8 CreateDevice call....
I am making a call to the CreateDevice function and im having a problem...
Code:
if( FAILED( d3d->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVICETYPE_REF, hWnd,
D3DSOFTWARE_VERTEXPROCESSING,
&d3dpp, &d3ddev) ) )
return E_FAIL;
When i run the program (which compiles fine) it cause an unhandled exception and the debugger says its in the "&d3dpp, &d3ddev) ) )" line....... what is causing this error???
d3ddev is a valid LPDIRECT3DDEVICE8 and d3dpp is D3DPRESENT_PARAMETERS... d3d is a D3D8 object... whats wrong???
To protect time is to protect everything...
-
Mar 18th, 2002, 04:47 PM
#2
Most likely the call to Direct3DCreate failed and p3d is a NULL pointer.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Mar 18th, 2002, 07:02 PM
#3
Why are you creating a REF device?
Z.
-
Mar 19th, 2002, 12:01 AM
#4
Thread Starter
Addicted Member
I am setting it to D3DDEVICETYPE_REF instead of D3DDEVICETYPE_HAL b/c my computer sux and its graphics car doesnt support HAL rendering...
I did some trial and error and found that the reason for the error was that the hWnd passed to the function was NULL... for some reason the CreateWindow function isnt working... But i causes no error????
To protect time is to protect everything...
-
Mar 19th, 2002, 07:27 PM
#5
Post the window creation code, so we can take a look at it =).
Go buy a new card =). Even my 6 year old ATI Rage Pro supports HAL to some extent.
Z.
-
Mar 20th, 2002, 08:49 AM
#6
Thread Starter
Addicted Member
Ok, heres the code to the Create Window function:
Code:
HWND hWnd = CreateWindow( wc.lpszClassName, "", WS_OVERLAPPEDWINDOW,
100, 100, 500, 400, GetDesktopWindow(), NULL, hInstance, NULL );
theres nothing wrong with it that i can tell, it has the same stuff as other examples. The hWnd just keeps returning NULL.
Yeah, i am writing this on my older computer, which has a ATI Rage Pro also, and when i try to run HAL it says no suitable device found. I have my program set to do either HAL or REF depending on a bool variable that will be loaded from a config file. I am just using REF for debugging purposes.
To protect time is to protect everything...
-
Mar 20th, 2002, 09:59 AM
#7
Get the latest drivers, from the ATI site.
Z.
-
Mar 20th, 2002, 10:12 AM
#8
Thread Starter
Addicted Member
Ok...
Anyway... I fixed my problem. I was using a struct to hold all of my d3d objects and when i went to ZeroMemory the d3dpp it ZeroMemoried the whole struct... so i fixed that.
To protect time is to protect everything...
-
Mar 20th, 2002, 03:56 PM
#9
Ahhh. That makes sense =).
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|