Original Post
Hi! I'm pretty new to Java (I've always used C++), and I've run into a bit of a problem... Here's the code: This returns the following runtime error: (you guessed it...) java.lang.NullPointerException! I can't figure out what is causing the problem! I've tried initializing the variable triArray in as many ways as I can think of, and nothing eliminates the error! It's driving me mad! Any help would be greatly appreciated. Thanks for your time. ~~ Alex
Triangle[] triArray; // The array used for depth testing when adding triangles to the draw buffer
...
...
triArray = new Triangle[drawBuffer.size()];
drawBuffer.toArray(triArray);