Jump to content
  • Advertisement
  • entries
  • comments
  • views

Just WOW...This is what I get for following other tutorials

Sign in to follow this  
Paul C Skertich


For some odd reason, I kept on getting confused between the Indices and the vertex buffer. This one tutorial had it where DWORD Indices = 0,1 -

you know what I mean right? Yeah

So, today I was looking at www.rastertek.com and realized that Indice is just a number. The Index Buffer just takes in the number of indices to draw and does it. There's no need to figure out DWORD 0,1,5, crap like that.

How did I come to this conclusion? I wanted to see what if I don't even use sizeof(DWORD) * 36.... and just put sizeof(unsigned long) * 36. Compiler didn't care nor did the index buffer because the vertex buffer already had the information stored. Which again makes me think of a grocery list when people go to the store, they go down the list and check off what they got. A vertex Buffer just like a grocery list - checks off the vertex position. The index Buffer looks at the stored vertex buffer and connects them.

So, I went a head and changed the index buffer to (unsigned long) * 12 which as expected draw 12 connected lines instead of 36. Even though the DrawIndex had 36 - it still draw 12 regardless because of what's stored in Index Buffer.

WOW! Just wow! I hate it when all of a sudden things just get clearier and clearier.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!