Texture not drawing on cubes
- by Christian Frantz
I can draw the cubes fine but they are just solid black besides the occasional lighting that goes on. The basic effect is being set for each cube also.
public void Draw(BasicEffect effect)
{
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
device.SetVertexBuffer(vertexBuffer);
device.Indices = indexBuffer;
device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 8, 0, 12);
}
}
The cubes draw method. TextureEnabled is set to true in my main draw method. My texture is also loading fine.
public Cube(GraphicsDevice graphicsDevice, Vector3 Position, Texture2D Texture)
{
device = graphicsDevice;
texture = Texture;
cubePosition = Position;
effect = new BasicEffect(device);
}
The constructor seems fine too. Could this be caused by the Vector2's of my VertexPositionNormalTexture? Even if they were out of order something should still be drawn other than a black cube