0
votes

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
Not helpful - but can I ask why you're shooting for 120fps? That's quite a high framerate to be shooting for..Simon Whitehead
I just want more accurate updating. In every game limited to 60fps I played, there was a small lag when moving the mouse for example.Szymski
You can sample the mouse more quickly than you update the screen; you can run the simulation multiple times as well, if you like.user146043
(Have no idea what OpenGL4Net is) Why draw on WM_PAINT? How that WM_PAINT gets sent? Do you have vertical synchronization turned on?n0rd
@SimonWhitehead: There are many good reasons for aiming for a very high framerate. Virtual Reality (think Oculus Rift) for example. 75Hz seems to be the absolute minimum required to make things comportable. As for the latency issue: While higher framerates of course reduce the absolute latency the relative latency (i.e. how much lags the image behind the input in relation to the update interval) depends on the structure of the event processing. Many naively written programs have a relative latency close to 1, but you want to get it as close to 0 as possible.datenwolf

1 Answers

2
votes

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.