Form limits to 60 FPS

1.1k Views Asked by At

I decided to use OpenGL4Net library for my game engine. The point is I've got only 60 frames per second. I want 120 at least.

That's what I use for rendering:

protected override void WndProc(ref Message m)
    {
        switch (m.Msg)
        {
            case Windows.WM_PAINT: App.AppInstance.Loop(); break;
            default: base.WndProc(ref m); break;
        }
    }

It's in the form. App.AppInstance.Loop() is just for counting fps, updating things and rendering.

Help me. Is it possible to increase fps limit in a form? Or maybe there's a different way to render and update engine?

1

There are 1 best solutions below

0
On

What is the refresh rate of your monitor?

The problem sounds like VSync is enabled. You can turn VSync on/off using gl.SwapInterval(int). A value of 0 turns VSync off, and a value of 1 turns VSync on.

VSync actually isn't a bad thing because your monitor will only refresh so fast. Even though you may be drawing 120fps or more, you monitor will only display 60 of those.