NightmareX2000's picture

VSync on Update Frame Event ?

I'm using GameWindow on C# and i'm quite new using OpenTK.

VSync = VSyncMode.On;
Context.VSync = true;
game.Run(30, 60);

While using the code FPS is as i expected - 60.
But "Update Per Second" goes about 500 - 700.
Could someone please tell me how to enable Vsync on UpdateFrame event or anything like that?
Please help...

-Thanks in Advance-

Inline Images

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
migueltk's picture

Can you show the code you use to calculate FPS and UPS?

NightmareX2000's picture
this.Title = "FPS: " + (this.RenderFrequency).ToString("F2") + " UPS: " + (this.UpdateFrequency).ToString("F2");
NightmareX2000's picture

Any help ? or is that an issue ???

migueltk's picture

It may be a bug! Here he was treated, but it is unclear whether the problem was resolved.

My advice, updates the state by overriding the "OnUpdateFrame ()" and draw all by overriding the "OnRenderFrame ()" and forget UpdateFrecuency.

Greetings ...

migueltk's picture

It may be a bug! Here he was treated, http://www.opentk.com/node/2269 but it is unclear whether the problem was resolved.
My advice, updates the state by overriding the "OnUpdateFrame ()" and draw all by overriding the "OnRenderFrame ()" and forget UpdateFrecuency.
Greetings ...

NightmareX2000's picture

When i use the following code inside of the overriden "OnUpdateFrame(FrameEventArgs e)" it seems like everythings normal (fps and ups)... but when i open TaskManager i see that my program is always using %45 - %50 CPU - as CPU has double-kernel (Edit: I mean it's dual core - my awful english mistake).

this.Title = "FPS: " + (this.RenderFrequency).ToString("F2") + " UPS: " + (1 / e.Time).ToString("F2");

Another strangeness is that even if i set Context.VSync = false and VSync = VSyncMode.Off frame frequencies are completely same...
Screenshot