using System; using System.Collections.Generic; using Blacklight.Core; using System.Diagnostics; using System.Windows.Forms; using System.Runtime.InteropServices; using Azimuth; using Blacklight.Core.Drawables; namespace Blacklight.Testbed { public partial class Testbed : Form { public Testbed() { InitializeComponent(); viewport.DrawableSurface.BackgroundColor = new Blacklight.Core.Color(0, 0.5, 1.0, 0); this.DoubleBuffered = true; this.ResizeRedraw = false; } public World world { get; set; } private void PolygonButton_Click(object sender, EventArgs e) { GraphicsAdapterManager.Singleton.SetCurrentModule("Blacklight.SharpDX9.Module"); if (world != null) { world.BindToViewport(viewport); viewport.DrawableSurface.BackgroundColor = new Blacklight.Core.Color(0, 0.5, 1.0, 0); world.DrawScene(); Refresh(); } } private void RectangleButton_Click(object sender, EventArgs e) { GraphicsAdapterManager.Singleton.SetCurrentModule("Blacklight.Core.NullModule"); if (world != null) { world.BindToViewport(viewport); viewport.DrawableSurface.BackgroundColor = new Blacklight.Core.Color(0, 0.5, 1.0, 0); world.DrawScene(); Refresh(); } } private void drawTimer_Tick(object sender, EventArgs e) { viewport.DrawableSurface.FrameReset(); world.DrawScene(); viewport.DrawableSurface.SubmitDrawCalls(); } } }