c# directx tutorial problem

  • Thread starter Thread starter cprog84
  • Start date Start date
C

cprog84

I'm getting the following error when I run the mostly unmodified
DX SDK texture tutorial code in SharpDevelop:

System.NullReferenceException: Object reference not set to an instance of an
object.
at Microsoft.DirectX.Direct3D.D3DX.GetUnmanagedDevice(Device device)
at Microsoft.DirectX.Direct3D.TextureLoader.FromFile(Device device, String
srcFile)
at TextureTutorial.Textures.OnResetDevice(Object sender, EventArgs e) in
c:\Documents and Settings\Justin\My Document
s\SharpDevelop Projects\Direct3DTest\tutorial5.cs:line 97

I did a check which showed that the device is valid.
I'm a C++ student with DX knowledge, and I'm just starting to learn C#; am
I not setting up something right? The only thing I modified was commenting
out the following line because it was throwing an exception:

this.Icon = new Icon(this.GetType(), "directx.ico");

exception thrown was:

Unhandled Exception: System.ArgumentException:
Resource 'directx.ico' could not be found in class 'TextureTutorial.Textures'.
at System.Drawing.Icon..ctor(Type type, String resource) at
TextureTutorial.Textures..ctor() in c:\Documents and Settings\Justin\My
Documents\SharpDevelop Projects\Direct3DTe st\tutorial5.cs:line 53
at TextureTutorial.Textures.Main() in c:\Documents and Settings\Justin\My
Documents\SharpDevelop Projects\Direct3DTes t\tutorial5.cs:line 202

Thanks ahead for any help.
 
I'm not sure if this is related to your problem at all but when I installed
the directx sdk it didnt installed the managed files correctly. Had to go to
command line and install them. Think there's info at msdn on that.
You also have to add references to the directx files too.
Not sure if I'm helping you or not since it's been so long since I used it
and it's pretty vague to me. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top