I'm creating a bounding box and for debugging would like to see where it is. It is define as four corners and I simply want to draw line in between these 4 corners.
I managed to Google how to do this:
public void Draw(GraphicsDevice graphicsDevice)
{
int num = mCorners.Length;
VertexPositionColor[] primitiveList = new VertexPositionColor[num];
for (int i = 0; i < num; ++i)
{
primitiveList[i] = new VertexPositionColor(new Vector3(mCorners[i], 0), Color.White);
}
short[] triangleStripIndices = new short[] { 0, 1, 2, 3, };
graphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(PrimitiveType.LineStrip, primitiveList, 0, 4, triangleStripIndices, 0, 3);
}
However, when this code is ran the app just closes. It is in debug mode but there is no stack trace, crash message, error log etc. It just closes, making it very hard to debug.
I've found a similar question that doesn't have an answer: XNA 4.0 app closes suddenly when it hits a method without throwing any exceptions. The suggestion was is it being initialised properly, and yes mine is. The GraphicsDevice is passed around as a parameter and not obtained statically.
Does anybody know what may be causing this?
Thanks,