Sign in to follow this  

DX8 Program won't run in DX9

This topic is 4272 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found one of my older programs that I wrote in DX8, when I compile and link it (In MSDV 6.0) I get zero errors and zero warnings, however when I execute the program it doesn't do anything, it doesn't show any error messages, it doesn't change the screen resolution. YOu can't tell that I am even trying to run a program I tried debugging it, and it seems to jump out on the first line. This is driving me crazy. I am probably missing something really simple. Can anybody help me? P.S. The game I wrote in DX7 won't work either, but it at least runs enough to spit out the error that it can't initialize the graphics.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sr_Guapo
Are you linking to the correct libraries?


I am linking to these, do I need to change anything?

d3dx8.lib d3d8.lib dxguid.lib dxerr8.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Share this post


Link to post
Share on other sites
Quote:
Original post by treeway
It's probably failing on the CreateDevice function.


Your right, by messing with a messagebox I manage to pinpoint the problem to here.

if(FAILED(d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &dev))){
Close();
return(FALSE);
}

Anybody have any idea how to fix this?


Share this post


Link to post
Share on other sites
Catch the return value with an
HRESULT hr = d3d->CreateDevice(blah blah);
What do you get?

This is from the documentation on the return values of the specific method:
Quote:

Return Value


If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values.


D3DERR_INVALIDCALL The method call is invalid. For example, a method's parameter may have an invalid value.
D3DERR_NOTAVAILABLE This device does not support the queried technique.
D3DERR_OUTOFVIDEOMEMORY Direct3D does not have enough display memory to perform the operation.

Share this post


Link to post
Share on other sites
How about the version the trow into the direct3dcreate8 function?
The version will most likly be 9 while the thing you are using is
8.

Tjaalie,

PS I don't know if this can give you an error. Just guessing the version
you pass there isn't for nothing.

Share this post


Link to post
Share on other sites
Quote:
Original post by someusername
Catch the return value with an
HRESULT hr = d3d->CreateDevice(blah blah);
What do you get?

This is from the documentation on the return values of the specific method:
Quote:

Return Value


If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values.


Ok, I found out that it is getting the NOTAVAILABLE error. I am going to search how to fix it right now.

Share this post


Link to post
Share on other sites

This topic is 4272 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this