Enabled VSyncing by default.

This commit is contained in:
the_fiddler 2007-11-08 15:57:10 +00:00
parent 188ea93280
commit 2cb2bef32f

View file

@ -125,7 +125,8 @@ namespace OpenTK
glWindow.Destroy += new DestroyEvent(glWindow_Destroy); glWindow.Destroy += new DestroyEvent(glWindow_Destroy);
CreateWindow(mode, title); CreateWindow(mode, title);
this.vsync = VSyncMode.Adaptive; //this.vsync = VSyncMode.Adaptive;
this.VSync = VSyncMode.On;
} }
void glWindow_Destroy(object sender, EventArgs e) void glWindow_Destroy(object sender, EventArgs e)
@ -483,10 +484,20 @@ namespace OpenTK
//sleep_granularity = System.Math.Round(1000.0 * update_watch.Elapsed.TotalSeconds / test_times, MidpointRounding.AwayFromZero) / 1000.0; //sleep_granularity = System.Math.Round(1000.0 * update_watch.Elapsed.TotalSeconds / test_times, MidpointRounding.AwayFromZero) / 1000.0;
//update_watch.Reset(); // We don't want to affect the first UpdateFrame! //update_watch.Reset(); // We don't want to affect the first UpdateFrame!
OnLoadInternal(EventArgs.Empty); try
{
OnLoadInternal(EventArgs.Empty);
}
catch (Exception e)
{
Trace.WriteLine(String.Format("OnLoad failed: {0}", e.ToString()));
return;
}
Debug.Print("Elevating priority.");
Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
Debug.Print("Entering main loop.");
while (!isExiting) while (!isExiting)
{ {
// Process events // Process events
@ -843,7 +854,7 @@ namespace OpenTK
{ {
if (value == VSyncMode.Off) if (value == VSyncMode.Off)
Context.VSync = false; Context.VSync = false;
else if (value == VSyncMode.On) else
Context.VSync = true; Context.VSync = true;
vsync = value; vsync = value;