Ejemplo n.º 1
0
        protected override void OnCreateControl()
        {
            base.OnCreateControl();

            if (!GraphicsDevice.IsDeviceCreated)
            {
                GraphicsDevice.CreateDevice(this.Handle, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
                graphicsDeviceEventArgs = new GraphicsDeviceEventArgs(GraphicsDevice);
            }

            this.OnInitialize(graphicsDeviceEventArgs);

            this.DoDraw();
        }
Ejemplo n.º 2
0
 private void TurtleGraphicsControl_Initialize(object sender, GraphicsDeviceEventArgs e)
 {
     if (this.InitializeGraphics != null)
         this.InitializeGraphics(this, e);
 }
Ejemplo n.º 3
0
 private void TurtleGraphicsControl_Draw(object sender, GraphicsDeviceEventArgs e)
 {
     if (this.DrawScene != null)
         this.DrawScene(this, e);
 }
Ejemplo n.º 4
0
 protected virtual void OnInitialize(GraphicsDeviceEventArgs e)
 {
     if (this.Initialize != null)
         this.Initialize(this, e);
 }
Ejemplo n.º 5
0
 protected virtual void OnDraw(GraphicsDeviceEventArgs e)
 {
     if (this.Draw != null)
         this.Draw(this, e);
 }
Ejemplo n.º 6
0
 private void GraphicsDeviceControl_Initialize(object sender, GraphicsDeviceEventArgs e)
 {
     this.graphics = new GraphicsBatch(e.GraphicsDevice);
 }
Ejemplo n.º 7
0
 private void GraphicsDeviceControl_Draw(object sender, GraphicsDeviceEventArgs e)
 {
     this.graphics.Begin();
     this.graphics.DrawFilledRectangle(new Rectangle(10, 10, 100, 100), Color.Red);
     this.graphics.End();
 }
Ejemplo n.º 8
0
        private void View_DrawScene(object sender, GraphicsDeviceEventArgs e)
        {
            if (this.program != null)
            {
                this.renderer.Begin(new Vector2(this.view.SceneWidth / 2, this.view.SceneHeight / 2));

                this.program.Draw(this.renderer);

                this.renderer.End();
            }
        }
Ejemplo n.º 9
0
 private void View_InitializeGraphics(object sender, GraphicsDeviceEventArgs e)
 {
     this.renderer = new TurtleGraphicsRenderer(e.GraphicsDevice);
 }