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(); }
private void TurtleGraphicsControl_Initialize(object sender, GraphicsDeviceEventArgs e) { if (this.InitializeGraphics != null) this.InitializeGraphics(this, e); }
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); }
private void GraphicsDeviceControl_Initialize(object sender, GraphicsDeviceEventArgs e) { this.graphics = new GraphicsBatch(e.GraphicsDevice); }
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(); }
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(); } }
private void View_InitializeGraphics(object sender, GraphicsDeviceEventArgs e) { this.renderer = new TurtleGraphicsRenderer(e.GraphicsDevice); }