• Advertisement
Sign in to follow this  

[solved] CustomVertex SetPosition not defined (MDX)

This topic is 4350 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

Hey guys, I purchased a book "Managed DirectX 9" by Tom Miller and I wanted to see if I had setup my environment correctly. I have DX9 (april 2006) installed and I'm using Visual Studio 2005 Standard Edition. I copied the code that came with the disk on my harddrive and loaded the project. When I try to compile and run I guess this error: 'Microsoft.DirectX.Direct3D.CustomVertex.PositionNormalColored' does not contain a definition for 'SetPosition' Here's the code with the line that contains the line:
CustomVertex.PositionColored[] verts = new CustomVertex.PositionColored[3];
            
            verts[0].SetPosition(new Vector3(0.0f, 1.0f, 1.0f));
            verts[0].Color = System.Drawing.Color.Aqua.ToArgb();
            verts[1].SetPosition(new Vector3(-1.0f, -1.0f, 1.0f));
            verts[1].Color = System.Drawing.Color.Black.ToArgb();
            verts[2].SetPosition(new Vector3(1.0f, -1.0f, 1.0f));
            verts[2].Color = System.Drawing.Color.Purple.ToArgb();
If I should include anymore code I'd be more than willing to post more. I've always ended up quitting my attemps at coding with DX because of errors like this ones (compiling errors right off the bat). I'd really like to get this going so any help is appreciated. Thanks edit: Sorry to be a bother I figured it out. The book uses an older version of the SDK and in the newer version SetPosition was replaced with an attribute. So here's my new code.
            CustomVertex.PositionColored[] verts = new CustomVertex.PositionColored[3];
            verts[0].Position = new Vector3(0.0f, 1.0f, 1.0f);
            verts[0].Color = System.Drawing.Color.Aqua.ToArgb();
            verts[1].Position = new Vector3(-1.0f, -1.0f, 1.0f);
            verts[1].Color = System.Drawing.Color.Black.ToArgb();
            verts[2].Position = new Vector3(1.0f, -1.0f, 1.0f);
            verts[2].Color = System.Drawing.Color.Purple.ToArgb();
edit2: I kept the thread instead of deleting it because I found other forums where people had the exact same problem. If the mods consider this to be pointless, feel free to nuke it ;-) [Edited by - sanch3x on May 28, 2006 7:17:20 PM]

Share this post


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

  • Advertisement