C# Developers' Journal (original) (raw)

9:33a

Out of range exception. Okay, I know I'm missing something blissfully obvious, but that is my lot in life.

Code:

( codeCollapse )

On the second iteration through, on the first line in the FOR block, I get this error: "Make sure that the maximum index on a list is less than the list size."

I've stared at it until I'm blue in the face, and can't see where the index would be larger. (WIDTH is hardcoded to 4 and HEIGHT to 3 in the variable declaration block.) Especially when x=0 and y=1.

Ideas? Thankee much. (This is using VS 2005 standard, by the by. I'm using SHORTs instead of INTs thanks to an old vidcard that doesn't support INT-size index buffers. grumble.)