Sign in to follow this  
Programmer101

Directx behaving very strangely

Recommended Posts

I have just added input to my directx powered program and it is being VERY strange. The problem is that when I initialize input my program crashes on exit. So I played around with it for a while to isolate the problem. Eventually I found that if I don't load my effect file with the D3DXSHADER_OPTIMIZATION_0,1,2,or 3 flag the program does not crash on exit. This works both ways, I can use D3DXSHADER_OPTIMIZATION_0,1,2,or 3 as long as I don't initialize input. Is there any relation between the two? I didn't think there was but apparently... I could just go without optimization but when I do my effects with multiple passes cause the program to crash on exit. This whole thing is really maddening because I have no idea why this is happening. Thats not the only thing that is weird. I also get an error on exit when I don't use the D3DXSHADER_DEBUG flag. I don't get it! Can anyone please help me. I guess an error on exit is better than on startup but this is insane and it will eventually drive me insane. Thanks.

Share this post


Link to post
Share on other sites
So you're saying that DirectInput and Direct3D appear to be inter-related somehow and that changes to one creates/solves a crash in another?

There isn't any reason for this and I've never heard of any known issues, bugs or reasons for this to happen. Hate to say it, but 99.9% likely that the bug is in your codes usage of the respective API's [headshake]

A crash on exit is very often due to bad resource management - failing to clear something up for example.

  • Have you stepped through your code to verify everything works as expected?
  • Are you checking all appropriate HRESULT's?
  • Run with debug runtimes (for both API's) and checked for error messages?
  • Run usual Visual Studio memory leak detection?
  • Is it reproducible on other systems?
  • Can you integrate your DInput code into a D3D SDK sample and reproduce the same characteristics?


hth
Jack

Share this post


Link to post
Share on other sites
Yeah that probably is the problem. I would think it was the result of bad resource management too but the two components work in my program fine when they are used by themselves. I'll try that stuff though.

Loading that effect has caused me worlds of problems on exit so maybe I'm doing that wrong and thats the problem.

Share this post


Link to post
Share on other sites

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