Jump to content
  • Advertisement
Sign in to follow this  

Stream Error / Draw Primitive failed

This topic is 4521 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'm trying to learn Vertex / Index buffers better since I don't understand them at all (any article suggestions would be appreciated). Anyways, I am trying to draw one triangle onto the screen and the Debugged output says (ERROR) : Stream 0 does not have required number of vertices (ERROR) : DrawPrimitive failed. Here's my three vertices and my calls
	Device->CreateVertexBuffer(3 * sizeof(Vertex), D3DUSAGE_WRITEONLY, FVF_VERTEX, D3DPOOL_MANAGED, &VB, 0);

	Vertex* v;
	VB->Lock(0, 0, (void**)&v, 0);

	v[0] = Vertex(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
	v[1] = Vertex(2.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
	v[2] = Vertex(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);


Device->SetStreamSource(0, VB, 0, sizeof(Vertex));
		Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 3);

Thanks, Carl

Share this post

Link to post
Share on other sites
Well in MDX the last parameter of Device.DrawPrimitives is the number of primitives so you might want to try:

Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);

Since you're drawing one triangle.

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.

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!