Files @ r24845:fab6f86c6617
Branch filter:

Location: cpp/openttd-patchpack/source/cmake/FindXaudio2.cmake

Patric Stout
Fix: [Win32] now we are drawing on a tick, no longer use WM_PAINT

WM_PAINT hits when-ever Windows feels like, but always after we
marked the screen as dirty. In result, it was lagging behind,
giving a sub-60fps experience.

With the new draw-tick there is no longer a need to be driven by
WM_PAINT, so it is better anyway to drive the drawing ourself. As
an added bonus this makes the win32 driver more like the others.
# Autodetect if xaudio2 can be used.

include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "")

check_cxx_source_compiles("
    #include <cstdio>
    #include <windows.h>

    #undef NTDDI_VERSION
    #undef _WIN32_WINNT

    #define NTDDI_VERSION    NTDDI_WIN8
    #define _WIN32_WINNT     _WIN32_WINNT_WIN8

    #include <xaudio2.h>
    int main() { printf(\"%s\\\\n\", XAUDIO2_DLL_A); return 0; }"
    XAUDIO2_FOUND
)