Jump to content
  • Advertisement
Sign in to follow this  
ThunderMusic_80

problem with ATI and DrawIndexedPrimitives

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

Hi, I was wondering if anyone has some troubles using DrawIndexedPrimitives with an ATI video card? Trying to run the example on indexed primitives downloaded from this site (http://www.codesampler.com/dx9src/dx9src_2.htm#dx9_indexed_geometry) I get a driver error when the device tries to present the rendered primitive (when the program calls the Present() method after drawing indexed primitives). I have an ATI Radeon All-In-Wonder card with 32MB on it. It's not much memory, but it should not matter because the program only tries to draw a cube... For those of you who don't want to download the code, here is the Render() method :
private void Render()
{
	d3dDevice.Clear( ClearFlags.Target | ClearFlags.ZBuffer, 
                             Color.FromArgb(255, 0, 0, 0), 1.0f, 0 );

	d3dDevice.BeginScene();

        d3dDevice.Transform.World = Matrix.RotationYawPitchRoll( Geometry.DegreeToRadian(spinX),
                Geometry.DegreeToRadian(spinY), 0.0f) * 
                Matrix.Translation(0.0f, 0.0f, 5.0f);

	if( useIndexedGeometry == true )
	{
		d3dDevice.VertexFormat = Vertex.FVF_Flags;
		d3dDevice.SetStreamSource( 0, vertexBuffer_indexed, 0 );
		d3dDevice.Indices = indexBuffer;

		d3dDevice.DrawIndexedPrimitives( PrimitiveType.TriangleStrip, 0, 0, 8,  0, 2 );
		d3dDevice.DrawIndexedPrimitives( PrimitiveType.TriangleStrip, 0, 0, 8,  4, 2 );
		d3dDevice.DrawIndexedPrimitives( PrimitiveType.TriangleStrip, 0, 0, 8,  8, 2 );
		d3dDevice.DrawIndexedPrimitives( PrimitiveType.TriangleStrip, 0, 0, 8, 12, 2 );
		d3dDevice.DrawIndexedPrimitives( PrimitiveType.TriangleStrip, 0, 0, 8, 16, 2 );
		d3dDevice.DrawIndexedPrimitives( PrimitiveType.TriangleStrip, 0, 0, 8, 20, 2 );
	}
	else
	{
		d3dDevice.VertexFormat = Vertex.FVF_Flags;
		d3dDevice.SetStreamSource( 0, vertexBuffer, 0 );
		d3dDevice.DrawPrimitives( PrimitiveType.TriangleStrip,  0, 2 );
		d3dDevice.DrawPrimitives( PrimitiveType.TriangleStrip,  4, 2 );
		d3dDevice.DrawPrimitives( PrimitiveType.TriangleStrip,  8, 2 );
		d3dDevice.DrawPrimitives( PrimitiveType.TriangleStrip, 12, 2 );
		d3dDevice.DrawPrimitives( PrimitiveType.TriangleStrip, 16, 2 );
		d3dDevice.DrawPrimitives( PrimitiveType.TriangleStrip, 20, 2 );
	}

	d3dDevice.EndScene();

	d3dDevice.Present(); // Crash on this line with indexed primitives
}


Anyone knows about a solution to this?

thanks

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!