Example #1
0
        protected override void Initialize()
        {
            this.screen = _Screen.GetInstance();
            this.screen.SetWidth(graphics.PreferredBackBufferWidth);
            this.screen.SetHeight(graphics.PreferredBackBufferHeight);

            this.camera = new _Camera();

            this.triangle = new _Triangle(GraphicsDevice);

            base.Initialize();
        }
        public void Draw(_Camera camera)
        {
            this.device.SetVertexBuffer(this.buffer);

            this.effect.World              = this.world;
            this.effect.View               = camera.GetView();
            this.effect.Projection         = camera.GetProjection();
            this.effect.VertexColorEnabled = true;

            foreach (EffectPass pass in this.effect.CurrentTechnique.Passes)
            {
                pass.Apply();

                this.device.DrawUserPrimitives <VertexPositionColor>(PrimitiveType.TriangleList,
                                                                     this.verts, 0, 1);
            }
        }