Drawing primitives with game components

For anyone drawing with primitives in their main draw class and a game components draw class make sure that you set the verticies and indicies on the graphics device in each draw class as the graphics device is shared:

graphics.GraphicsDevice.Vertices[0].SetSource(vertexBuffer, 0, VertexPositionNormalTexture.SizeInBytes);

graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.Indices.SetData(indices);


otherwise you may be wondering why your objects are not being drawn how you intended.

0 comments: