示例#1
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     form = new TestForm();
     render = new FunkyRenderContext(form);
     bind = new GraphicsBindingContext(form, RenderContext: render);
     render.Renderables.Add(FunkyPoly.CreateRectangle(100, 500, 50, 50, velocity: new Vector(2, -1), dTheta: .9f));
     bind.Start();
     Application.Run(form);
 }
 public GraphicsBindingContext(Image image, RenderContext RenderContext = null, int RenderInterval = 16, int PhysicsInterval = 16)
 {
     if (image == null)
     {
         throw new ArgumentNullException("The Image supplied was null.  BindingContext must reference either an Image or a Form.");
     }
     this.Image = image;
     this.Form = null;
     this._RenderContext = RenderContext;
     this.HWnd = null;
     this._GraphicsTimer = new Timer();
     this.RenderInterval = RenderInterval;
     this._GraphicsTimer.Tick += _GraphicsTimer_Tick;
     this._PhysicsTimer = new Timer();
     this.PhysicsInterval = PhysicsInterval;
     this._PhysicsTimer.Tick += _PhysicsTimer_Tick;
     this._lock = new object();
 }
 internal RenderablePhysicsEnvironment(RenderContext ctx)
 {
     this.ctx = ctx;
 }