Pergunta

I've searched but couldn't find a result for this that didn't involve XNA.

Basically, I'm making a map editor using a C# binding of SFML attached to a panel's handle in my form. It runs at 550 FPS, which results in my main loop being called way too much, using too much resources (10% CPU for a small map editor).

I only really need 60 fps for this, and I know that will result in the cpu usage going down a lot.

Does anyone know how to do this? I've heard that it's impossible because WinForms s no function to access the graphic drivers VSync setting; but there must be a way, right?

Thanks.

Foi útil?

Solução

I ended up using a WinForms timer to do my game loop processing. I get an effective 60 FPS by setting the interval of the ticks.

This reduces the CPU usage to 0.1% while still having the same functionality.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top