indigodarkwolf / box16

A fork of the official X16 emulator, converted to C++20 and with a bunch of features tweaked and added.
MIT License
41 stars 19 forks source link

VSync can be disabled by holding the titlebar in warpmode #62

Closed Yazwh0 closed 1 year ago

Yazwh0 commented 1 year ago

Put the app in warp mode, and then hold the title bar (when the mouse is not moving here, the left button is down.)

box16vsync

indigodarkwolf commented 1 year ago

That's going to be an interesting one to solve. The problem is that I don't have a great way to check whether V-sync is working on certain drivers that don't support it, so I have to rely on a timer-based mechanism. The problem there being that things which block execution of Box16 in general are causing this timer to observe "Oops, no frames drawn in X seconds, must be V-sync!"

And it happens that dragging the title bar like that is something which blocks execution. I can't immediately tell if you're on Windows or Linux, but I suspect the behavior is the same on both. Dragging the title bar definitely blocks execution on Windows -- that's even the default behavior unless specifically overridden by the application's Windows event handler routine, because dealing with client window events properly is such a pain in the butt and nobody does it properly, MS handles them by default.

indigodarkwolf commented 1 year ago

Okay, this didn't end up being that interesting to solve, I'm just timing how long the event processing takes and discounting that from the rendering timer that disables vsync.

https://github.com/indigodarkwolf/box16/commit/0a21a93c1c6c8aea14e748dd19d574d7df2cf650