Add support for `eglSwapInterval()` to enable or disable VSync on
Wayland.
Also add status messages for enabling or disabling VSync, for both EGL
and GLX.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
wxWidgets 3.2+ has experimental `wxGLCanvas` support for Wayland EGL,
enable it for those versions.
The `glXQueryExtensionsString()` method for enabling or disabling vsync
does not work on Wayland currently, so it's disabled.
TODO: Enable/disable vsync on Wayland EGL.
Fix#1028.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
* Remove the custom handling for pre-3.1.4 builds on Windows since
both the mingw and msvc builds now use 3.2.
* Remove wxDPIChangedEvent handling, since this triggers a resize,
which has the same effect.
* Implement main/WinMain ourselves, rather than relying on wxWidgets
macros. This allows us to initialize the console earlier in the
process.
* Add an explicit dependency on the manifest file to trigger a link
when it is modified.
This converts the HiDPIAware into a series of helper functions, using
wxWidgets native support starting with wxWidgets 3.1.4. Custom
implementations are provided for Mac and Windows.
In addition, this fixes a few issues with the Windows build:
* Use the same defines variables in the MSVC and MinGW builds, with
g++ and Clang.
* Add a custom manifest for the application, indicating full DPI
support and support for recent Windows versions so the application
will no longer run in compatibility mode by default.
* Manually spawn a console in debug builds if none is attached and
always use the parent console if it is available otherwise, even in
release builds. This also removes the /subsystem:console linker
argument.
The static lib is now called `SDL2-static.lib` and the debug version is
called `SDL2-staticd.lib`.
Adjust our `cmake/FindSDL2.cmake` for the new vcpkg naming convention.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Remove constexpr in user-input.h as LLVM 13 complains that it is
illegal.
Use variant-lite as nonstd::variant and related types as some variant
functions are macOS 10.14 Mojave only.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
* Remove the wx prefix and make UserInput a class in the config
namespace.
* Make UserInput constexpr-constructible. This should reduce program
startup time by having the compiler pre-allocate UserInput objects.
* Change initialization of UserInput objects to be made via
constructor. A previous approach would have limited creation of
UserInput objects to a few places but that proved unworkable in the
long run.
* Changed the string to enum conversions to be built at runtime from
the existing constant array rather than redefining the strings.
* Fixed an issue in the initialization of the `checkable_mi` array.
A test had been mistakenly removed during the refactor.
* Fixed an issue where changing a bool or int option would cause an
assertion error at runtime. Changed helper methods definitions to
use a pointer to a variable rather than take a parameter by
reference, clarifying the intent from the caller perspective.
* Fixed the `renderer` enum definition to properly exclude Direct3D or
Quartz2D depending on the platform.
* Various comment fixes.
This change introduces a new class to handle all of the INI options
data, VbamOption. A VbamOption represents a single option in the INI
file. It is not constructible outside of its implementation, which
prevents the initialization of incorrectly formatted options.
Internally, a VbamOption points to a global variable in memory, which
holds the value used at runtime. This is because various parts of the
codebase edit the global variable rather than going through a central
registry. This also means we need to separately update the INI values.
In the future, we may be able to convert all existing reads and writes
to the global variable to go through VbamOption. Individual UX elements
could link directly to getters/setters for a specific VbamOption rather
than have duplicate data.
VbamOption replaces the opt_desc struct and the global opts array. All
users of opt_desc and the global opts array have been updated.
This is a necessary preliminary change to better support a refactor of
accelerators, through wxUserInput.
Issue: #745, #158
Add default menu accelerator `CTRL+I` to `ChangeIFB` which is the menu
item to change the interframe blending algorithm.
CMD+I on macOS.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
When changing the interframe blending algorithm via:
`Options -> Video -> Change interframe blending`
, show the short name of the algorithm instead of the list number in the
OSD.
Store a pointer to the wxChoice of interframe algorithms read from the
XRC for easy access.
Shorten the names of the algorithms in the XRC selection list.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use namespace strutils:: instead of the `str_` prefix for the functions.
Remove `vec_find` as it's just an alias for `wxArrayString::Index(str)`
and is not a function on a string.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>