Jump to content
  • Advertisement
Sign in to follow this  
murdock

Managed DirectX 9 Graphics and Game Programming Question?

This topic is 5124 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 have noticed that there are some problems with thet code samples in this book. These problems I believe are attributed to the updating of the SDK from 9.0b to 9.0c. I currently have 9.0c installed. Should I install 9.0b from the cd to compile the examples? Or, should I try something else?

Share this post


Link to post
Share on other sites
Advertisement
I would convert the examples, run them and fix problems. This will assist you in learning the Code.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi.
I have the same problem, not only with samples in this (great !) book, but in other examples too (Airplane, ...)
Some are quite easy to solve (Light doen't have to Commit()...), but sometimes 'bugs' are hard, when methods don't have the same parameters list before some "upgrade" and after.
I'd be happy to know what sort of "upgrade" append! And whey is a new version (9.0c) not completly able to run a (few) older one (9.0b) ??
Thorna

Share this post


Link to post
Share on other sites
For most of the examples, all you need to do is comment out Lights.Commit(); For other issues, try changing methods to be property settings intead. For example, instead of this.SetMyVector(someVector) woudl be this.setMyVector = someVector;

Hope that helps some,
Nathan

Share this post


Link to post
Share on other sites
i have the same problem but i can fix most of them.

I had a problem in chapter7 when trying to simplify the mesh. I keep getting null pointers and stuff. I dont know why. Has any one been able to simplify the mesh on page 125?

and .SetPosition() is now .Position =
aswell as setNormal

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hehe, I was on that simplifying the mesh last night and couldn't get it either. I tried by using the overload taking the stream and the one taking the ajd[]. Both would throw an exception.

I didn't have much time last night to play around with it, so I'll try again tonight to see if I can figure the Null pointer reference exception.

Shadx

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
And what about:

device.Material=XXX;
device.SetTexture(YYY);

I think there are some coherency issues...

Oh, there a no more TextureState or so, but TextureStateManager. A lot of samples don't work at the first run. Did the CD come in stores monthes before the book???
Thorna (no way to connect with my ù%*µ$£ password)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Spent a bit more time on this. I'm not sure if it's a directX bug or not but when you dispose the original reference to the mesh, it also disposes the newly returned mesh that we got from the clean operation. So by removing the dispose everything works fine. You need to modify the Clean to take the proper parameters also, so :

Mesh tmpMesh = Mesh.Clean(CleanType.Simplification,mesh,adj,adj);

simplifiedMesh = Mesh.Simplify(tmpMesh, adj, null, 1,MeshFlags.SimplifyVertex);


although the orignal mesh seems to get modified by the call to clean, using it instead of the tmpMesh in the Simplify call will not work (InvalidMeshException). At first I though the reference to the mesh and the tempmesh were the same since disposing one also disposes the other. I was wrong about that and it took me a few minutes before I caught my mistake.


Shadx

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
sweet. Ill try that out when i get home. Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!