Managed DirectX 9 Graphics and Game Programming Question?

Started by
7 comments, last by GameDev.net 19 years, 4 months ago
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?
Advertisement
I would convert the examples, run them and fix problems. This will assist you in learning the Code.
Mykre - BlogVirtual Realm :- XNA News and Resources from Down Under** For those Interested in an Australian XNA User Group Contact me though my site.
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
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
"There are those who said this day would never come, what do they have to say now?" - Halo 2 Trailer
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
--------------------------------Dr Cox: "People are ***tard coated ***tards with ***tard filling."
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
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)
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
sweet. Ill try that out when i get home. Thanks.

This topic is closed to new replies.

Advertisement