Jump to content
  • Advertisement
Sign in to follow this  


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

In my program, I used to create my index buffer using D3DFMT_INDEX16, but I've found that for my current needs, my indices easily exceed 65536. So I changed the call to
if(FAILED(m_Graphics->GetDeviceCOM()->CreateIndexBuffer(ILIMIT*sizeof(unsigned long),
			MessageBox(NULL, "CreateIndexBuffer failed", "Failure", MB_OK);
			return FALSE;

However, when I get to DrawIndexedPrimitive, I'm given the error: Direct3D9: (ERROR) :Index stream does not have required number of indices. DrawIndexedPrimitive failed. It doesn't? I didn't change anything except the size of the indices. The numbers should still be the same. Anyone have a clue as to what else might have to be changed? Cheers! [Edited by - silverRohan on February 8, 2005 7:38:01 PM]

Share this post

Link to post
Share on other sites
Check your MaxVertexIndex value in the capabilities struct or in the capabilities viewer utility provided by the SDK. I'm guessing most hardware currently only supports 65534 (which is what my laptop here currently says), thus 16 bit indices. 32 bit indices isn't something that you can depend on as being broadly available yet.

So it appears that for now you'll just have to redesign your rendering process so that vertices used in a single DrawIndexedPrimitive() call are never more than 65534 indices away from each other.

Original post by Namethatnobodyelsetook
You are still allocating limit * sizeof(short) instead of sizeof(long). Also be aware many cards don't support 32bit indices.
Silly me, I didn't even notice that.

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!