Rectangle renderers work.
This commit is contained in:
12
Demo/Demo.cs
12
Demo/Demo.cs
@@ -31,16 +31,13 @@ namespace Demo
|
||||
{
|
||||
// TODO: Add your initialization logic here
|
||||
basicEffect = new BasicEffect(GraphicsDevice);
|
||||
basicEffect.View = Matrix.CreateLookAt(new Vector3(graphics.PreferredBackBufferWidth/2f, graphics.PreferredBackBufferHeight/2f, 1f), Vector3.Forward, Vector3.Up);
|
||||
basicEffect.World = Matrix.Identity;
|
||||
basicEffect.Projection = Matrix.CreateOrthographic(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1);
|
||||
basicEffect.VertexColorEnabled = true;
|
||||
|
||||
vertices = new VertexPositionColor[5];
|
||||
vertices[0] = new VertexPositionColor(new Vector3(5, 5, 0), Color.Red);
|
||||
vertices[1] = new VertexPositionColor(new Vector3(10, 5, 0), Color.Red);
|
||||
vertices = new VertexPositionColor[4];
|
||||
vertices[0] = new VertexPositionColor(new Vector3(0, 0, 0), Color.Red);
|
||||
vertices[1] = new VertexPositionColor(new Vector3(10, 0, 0), Color.Red);
|
||||
vertices[2] = new VertexPositionColor(new Vector3(10, 10, 0), Color.Red);
|
||||
vertices[3] = new VertexPositionColor(new Vector3(5, 10, 0), Color.Red);
|
||||
vertices[3] = new VertexPositionColor(new Vector3(0, 10, 0), Color.Red);
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
@@ -52,6 +49,7 @@ namespace Demo
|
||||
{
|
||||
// Create a new SpriteBatch, which can be used to draw textures.
|
||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
basicEffect.World = Matrix.CreateOrthographicOffCenter(new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height), 0, 1);
|
||||
|
||||
// TODO: use this.Content to load your game content here
|
||||
}
|
||||
|
Reference in New Issue
Block a user