• Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Kit kat bar

Sign in to follow this  


I was starting to work with index buffers today. All I wanted to do was create a few quads with them (nothing special). After a good while having no success, tearing out my hair and wondering why something so simple is giving me so much problems.

I decided to take a break and go have super, during the course of the meal: it hits me (I was using D3DFMT_INDEX16 for index buffers and locking it using an interger array -- which of course is wrong on a 32 bit machine).

An important lesson is to take breaks every once and awhile, it just might help.
Sign in to follow this  

1 Comment

Recommended Comments

Today I forgot my own history (I must be getting alysmers)... and was doomed to repeat the same mistake.

I was trying on my terrain class, so far its nothing but a quad packed with veriticies and compacted with an indexbuffer. The formulas I was using.

//Verticies = ((2^n)+1)^2
//Indicies = (2^n)^2 * 6
//Triangles = (2^n)^2 * 2

When n<9 I was having no problem, it was rendering fast and the whole picture was showing. However when n>8 it was only rendering a portion of the terrain/quad... it turns out that I was using shorts for my indexbuffer, the values where going higher than that of a short can handle.

Share this comment

Link to comment

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