Need help with Sprites...

dhartles
11-29-2004, 09:51 PM
OK, in trying to build a tiling system, I cameto the realization that it appears to be easier to uses sprites for each tile in the map versus a texture on a vertex buffer. However the sprite sample from both Tom Miller's book, and another code sample of his on another web site do not work, so I'm stuck and need help.

The problem is in the sprite.Draw method (where sprite is a variable of type DirectX.Direct3D.Sprite)

The Draw function Tom uses is passing 5 parameters (texture, rectangle, vector3, vector3, and color)

However, this will not compile using MDX version 9.00.0900, as the exception states that the Draw method does not accept this number of parameters, it's now looking for 7! (texture, rectangle, vector2, vector2, single, vector2, color). All of his sample code is geared around the creation of the two vector3 parameters that are passed into the draw function, and I don't yet know how to change that to using 3 vector2's and a single.

Has anybody else run into this yet?? Or does anybody have a section of code working (using MDX9 in either VB or C#) to render a sprite??

TIA,
Dave

dhartles
11-29-2004, 10:34 PM
I fixed the issue with not having access to the correct sprite.Draw method by changing the referenced Direct3D.dll to the 9.00.1126 version.

However, now when I try to cimpile the app, I get a fatal error stating that the .exe cannot run with the current activer version of the .NET Runtime (which is 2.0). I should note that I have 4 other Managed_DirectX+VB and Managed_DirectX+C#.exe's running (but these all reference the 9.00.0900 dll's).

Does the active runtime have to be back at 1.1 for the 9.00.1126 dll's?? If so, how do I flip the active versions of the .NET runtime (some command line function?).

TIA,
Dave

dhartles
11-29-2004, 11:23 PM
I had originaly tried to port Tom's code from C# to VB.NET, and that''s what was giving me the .Net Runtime version error. I just put his code back in as a C# project, and it works.....evidently my translation skills are a little off....

Finally got the sample going myself, I posted my updates in hope that they may benefit someone else.

Later,
Dave

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum