Sign in to follow this  
Battagline

DirectX Visual C# NEED HELP!

Recommended Posts

I have a level builder for a game I'm working on that is written in C# using DirectX 9. I have recently downgraded the Game that I'm working on to DirectX 8, and uninstalled DirectX 9. I then realized that I needed DX9 for my Level Builder and Re-installed it. All of a sudden I'm getting strange run time Errors that are rather non descript when I set up my lighting. Here's the problem code: m_Device.Lights[0].Type = LightType.Point; m_Device.Lights[0].Diffuse = Color.White; m_Device.Lights[0].Ambient = Color.White; m_Device.Lights[0].Direction = new Vector3(0, -1, -1); m_Device.Lights[0].Range = 100000.0f; m_Device.Lights[0].Commit(); m_Device.Lights[0].Enabled = true; When the code hits the Commit line it throws the following exception: Error in the application. -2146232832 (Unknown) at Microsoft.DirectX.Direct3D.Light.Commit() I'm pretty stumped by this. It appears to still be pointing to DX9 in the "References" folder under solution explorer I have a reference to the Managed DirectX helper function version 1.0.1901.0, which is what it was prior to the issue. Anyone with any ideas as to what this may be... HELP PLEASE!

Share this post


Link to post
Share on other sites
Thanks, I was able to fix the problem by reverting to an older version of DirectX 9. The thing that I don't understand, is if I used Light.Update, I got a compiler error, but if I used Light.Commit I got a run time error. Is it possible I was pointing to one library for compile and another for run time? Does anyone know how to check that?

Thanks for your help

Share this post


Link to post
Share on other sites
A long long time ago on a computer not particularly distant Managed DirectX had this problem where it could not find the DLLs it needed in the GAC (Maybe it could not see the GAC at all -- probably we will never know). To get it to work the poor programmer whould have to copy the dlls from the magically hidden GAC to somewhere where the compiler could find them. This was about the time that Light.Commit() was still used.

So yes I think it could be using different assembly versions -- make sure that there are not some old dlls floating around or referred to by your project. Also: the GAC can have multiple versions of the same dll in it make sure you are using the right one in your project.

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