Jump to content

- - - - -

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

4: Adsense

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.

Note: GameDev.net moderates comments.