예제 #1
0
 public void Setup()
 {
     this.engine = new ValorEngine();
     this.form = new ValorForm();
     this.form.Engine = this.engine;
     this.context = new GraphicsBindingContext(this.form, Ri, Pi);
 }
예제 #2
0
파일: Program.cs 프로젝트: kgroat/Valor
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     f = new ValorForm {Engine = new ValorEngine()};
     var ticker = new GraphicsBindingContext(f);
     ticker.Start();
     Application.Run(f);
 }
예제 #3
0
 public GraphicsBindingContext(ValorForm form, double RenderInterval = 0, double PhysicsInterval = 0)
 {
     if (form == null)
     {
         throw new ArgumentNullException("The Form supplied was null.  BindingContext must reference either an Image or a Form.");
     }
     if (RenderInterval <= 0)
     {
         RenderInterval = 1000 / ValorEngine.Vfps;
     }
     if (PhysicsInterval <= 0)
     {
         PhysicsInterval = 1000 / ValorEngine.Cfps;
     }
     this.Form = form;
     this._GraphicsTimer = new Timer { Interval = RenderInterval };
     this._GraphicsTimer.Elapsed += _GraphicsTimer_Tick;
     this._PhysicsTimer = new Timer() { Interval = PhysicsInterval };
     this._PhysicsTimer.Elapsed += _PhysicsTimer_Tick;
 }