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();
        }
Esempio n. 2
0
 private void TurtleGraphicsControl_Initialize(object sender, GraphicsDeviceEventArgs e)
 {
     if (this.InitializeGraphics != null)
         this.InitializeGraphics(this, e);
 }
Esempio n. 3
0
 private void TurtleGraphicsControl_Draw(object sender, GraphicsDeviceEventArgs e)
 {
     if (this.DrawScene != null)
         this.DrawScene(this, e);
 }
 protected virtual void OnInitialize(GraphicsDeviceEventArgs e)
 {
     if (this.Initialize != null)
         this.Initialize(this, e);
 }
 protected virtual void OnDraw(GraphicsDeviceEventArgs e)
 {
     if (this.Draw != null)
         this.Draw(this, e);
 }
Esempio n. 6
0
 private void GraphicsDeviceControl_Initialize(object sender, GraphicsDeviceEventArgs e)
 {
     this.graphics = new GraphicsBatch(e.GraphicsDevice);
 }
Esempio 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();
 }
Esempio 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();
            }
        }
Esempio n. 9
0
 private void View_InitializeGraphics(object sender, GraphicsDeviceEventArgs e)
 {
     this.renderer = new TurtleGraphicsRenderer(e.GraphicsDevice);
 }