Sign in to follow this  

Direct X program won't work on my Desktop

This topic is 3593 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

Hi, Maybe someone can help me.... I'm programming a game engine on my laptop PC using C++ & Direct X 9 SDK. It works fine on the laptop with 'USE_HARDWARE_VERTEX_PROCESSING' but it won't work properly on my desktop PC unless I choose 'USE_SOFTWARE_VERTEX_PROCESSING', where it works fine but ofcourse the frame rate becomes teadiously slow. The desktop sports a 6600 GT graphics card. Using the direct X 'examine caps' utility, i can see vertually no difference in the capabilities between the desktop graphics card & the Laptop graphics card. The program uses direct X lighting methods, and when i edit this out of the code, the program runs fine on the desktop (with hardware vertex processing), so this is clearly where the problem lies. But the graphics look 'pants' without the dx lighting code. Help...........

Share this post


Link to post
Share on other sites
"won't work properly" is a little vague. What exactly happens when you attempt to run your application in hardware vertex mode on your desktop?

Seeing as removing the lighting code improves things, post your lighting code and we'll see if we can't track the problem down from there.

Share this post


Link to post
Share on other sites
The nature of the 'not working' is as follows: The program doesn't crash, but it won't render graphics to the screen. It's just a blank white screen (it's designed to execute in windowed mode). The menu's continue to function as does sound effects.

here's the code which i have to take out to get it working:

g_pd3dDevice->SetLight(i, &light_struct[i]); ,

Remember that on the laptop it works just fine. It is only necessary to remove the above code on my desktop (with the 6600 gt graphics card), in order to get the app to execute properly.

Thanks for your interest and i egerly await any suggestions you may have.

Share this post


Link to post
Share on other sites
my compiler & dx9 sdk are installed on the laptop. The desk top only has direct 'runtime' files installed. I guess i could install the sdk on the desktop and try to uncover the problem using the dx debug mode. I'll do this if necessary but as a last resort since i've not used this facilty before, and being direct X, its bound to be teadiously fustrating & confusing, and involve reems of spaggehti.

The 'i' variable in the code snippit specifies which light to set , since their is more than one light source opperating in the program. The set light command is nested in a loop with the value of i incrementing from 1 to 50.

Remember, theirs no problem with the C++ code per sae, since its doing entirely what its supposed to do on the laptop, and works just fine on the desktop with 'software vertex processing'

I believe i've checked 'max active lights' caps and its thae same on the desktop & the laptop, so i don't believe this is the problem. I'll check again though, since you mentioned it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Damian_C
my compiler & dx9 sdk are installed on the laptop. The desk top only has direct 'runtime' files installed. I guess i could install the sdk on the desktop and try to uncover the problem using the dx debug mode. I'll do this if necessary but as a last resort since i've not used this facilty before, and being direct X, its bound to be teadiously fustrating & confusing, and involve reems of spaggehti.
It'll just be a case of installing the SDK, then following the instructions in the link I gave you to enable the debug runtimes, and then running DebugView or something to capture debug output, then running your app.

Quote:
Original post by Damian_C
The 'i' variable in the code snippit specifies which light to set , since their is more than one light source opperating in the program. The set light command is nested in a loop with the value of i incrementing from 1 to 50.
The fixed function only supports a maximum of 8 lights, so 50 is going to be way out.

Quote:
Original post by Damian_C
Remember, theirs no problem with the C++ code per sae, since its doing entirely what its supposed to do on the laptop, and works just fine on the desktop with 'software vertex processing'

I believe i've checked 'max active lights' caps and its thae same on the desktop & the laptop, so i don't believe this is the problem. I'll check again though, since you mentioned it.
It might not be the problem, but it's worth double checking. What card is in the laptop? Is it an NVidia card too, or an ATI card?

Share this post


Link to post
Share on other sites
The laptop card is ATI. Iv'e just checked the caps on both machines. both graphics cards support 8 active lites. The 'i = 1 to 50' reference in my earlier post is a miss print and should read 1 to 5. So this definately isn't the problem.

Your link regarding the Direct X debug looks really good so thanks for drawing my attention to it (and for putting it up, for that matter) . It does look a bit intimdating though.

If i use the debugger and it comes up with a messege like :

"Direct3D9: (ERROR) :Invalid iAdapter parameter. ValidateCreateDevice failed.
D3D9 Helper: IDirect3D9::CreateDevice failed: D3DERR_INVALIDCALL",

i can't see how this is going to give me any insight at all into what the problem is and how to solve it.

[Edited by - Damian_C on February 13, 2008 4:30:33 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Damian_C
The laptop card is ATI. Iv'e just checked the caps on both machines. both graphics cards support 8 active lites. The 'i = 1 to 50' reference in my earlier post is a miss print and should read 1 to 5. So this definately isn't the problem.
Have you tried the laptop with the reference rasterizer? If it doesn't work there, it's possible that you're passing a bad parameter in. Again, the debug runtimes should highlight that.

How are you rendering? Are you drawing indexed primtives? If so, are you sure that the NumVertices parameter is correct? ATI cards ignore this, but NVidia ones use it.

Share this post


Link to post
Share on other sites
I tried the reference rastarization on the laptop - it didn't make any difference.



The rendering consists of rendering a previously loaded mesh using the following code:

model[j].g_pMesh->DrawSubset( i );

where i loops through 0 to number of materials.

(This code is taken right out of the direct3d tutorials.)

So theres no 'NumVertices' parameter to worrie about.

[Edited by - Damian_C on February 14, 2008 12:58:33 AM]

Share this post


Link to post
Share on other sites

This topic is 3593 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