Skip to main content
GameDev.net gamedev.net
🔒 Locked

index on index buffer?

Started by yuppies Nov 6, 2004 at 4:23 AM 5 replies 950+ views
Original Post
yuppies
yuppies
im just curious why DirectX index buffer only accepts short values for specifying the index? ive tried using an integer array for specifying index but it doesnt work., then finally i consult some tutorials and all of them are using an array of short for indices, whats the logical explanation for this? pls enlighten my innocent mind..
j-ho
j-ho
the 3rd (format) parameter can be D3DFMT_INDEX16 or D3DFMT_INDEX32

That should sort you out :)
Namethatnobodyelsetook
Namethatnobodyelsetook
99% of cards in use don't support index32. For nVidia, upto and including GeForce 4 doesn't have index32. GeForceFX may, I'm not sure. 6800/6600 probably does. As for ATI, I'm not sure when they added index32 support.
WarAmp
WarAmp
16 bit indices are used because
A) It's rare to have more than 65536 vertices in a vertex buffer.
B) With 16-bit indices, the driver can pack both into a 32 bit word and transfer 2 indices across the bus at once. So its a bandwidth savings.
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.
Supernat02
Supernat02
You said that you tried integers. A common mistake (without even thinking about it) is to use int instead of unsigned int. You may see some tutorials that use DWORD.

Chris
Chris ByersMicrosoft DirectX MVP - 2005

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.