Files
kaizen/external/SDL/docs/README-windows.md
T
iris 00cc9309cb Squashed 'external/ircolib/' changes from ce3cd726c..de6e324bd
de6e324bd separate emu thread
10d3daf86 Roms List improvements
95d202f37 Let's make the rom list process on a separate thread so the emulator doesnt take ages to load.
fc306967f Wow the ROM Header was just completely busted. Game list view works now
bad1691ee fuck this shit
2b59e5f46 game list in progress
d26417b83 remappable inputs in progress
ac4af8106 input
e72abc240 update readme
430139dc9 Qt6 frontend
3080d4d45 Fix this small bug too
08cd13b85 Cop0 unused functions do not actually pose a threat (as per manual). They don't do anything, so shall we.
61bb4fb44 make idle loop detection a little more specific with where the load goes
b037de4c3 SAZDFsdff
12e81e73e need to figure out why n64-systemtest loops indefinitely at some address that appears to be valid (i think it's me not invalidating the cache properly)
204f0e13b idle skipping seems to work!
cb8bb634a sdkfjlasdf
58e5c89c1 Fix compilation issue on my machine (no idea)
24fb2898e attempting more serious idle skipping
214719577 Place rsp.Step inside cached interpreter. Gains about 3 more fps
bb97dcc23 mmmmm
920b77d38 wjkhasdfjhkasdf
430ccdab4 it's a start...
4f42a673a Cached interpreter plays Mario 64. Start looking into RSP as well
c9a030787 idle skipping works!
5fbda03ce new idea
366637aba Idle skipping... maybe?
609fa2fb0 Cache instructions implemented but broken lmao. Commented out for now
e140a6d12 - Stop using inheritance for CPU, instead use composition. - Introduce KAIZEN_JIT_ENABLED optional define instead of relying on __aarch64__ and the like. - More cache work
68e613057 prep cache impl
811b4d809 fix clang format
fda755f7d idk
d5024ebbf small MI refactor in preparation of (eventually) implementing the RDRAM interface properly
694b45341 Merge commit '206dcdedf195fb320913584180edb12c7731e396' as 'external/SDL'
206dcdedf Squashed 'external/SDL/' content from commit 4d17b99d0a
4d16e1cb4 need to update sdl
848b19920 Fix compilation error
db61b5299 Merge commit 'e94a94559f28e49678fbcf72199a5258137b0fe9' as 'external/imgui'
e94a94559 Squashed 'external/imgui/' content from commit 02e9b8cac
52edb3757 need to update imgui
c1a705e86 Emulate weird JALR behaviour
4b4c32f4b Fix exception for "unusable COP1" in 4 instructions i missed accidentally (again)
df5828142 Bug putting 0s in the log everywhere
f8b580048 Make isviewer a sink to file
8241e9735 Fix exception for "unusable COP1" in 4 instructions i missed accidentally
b29715f20 small changes
d9a620bc1 make use of my new small utility library
0d1aa938e Add 'external/ircolib/' from commit 'ce3cd726c8df8388d554abf8bb55d55020eb4450'
e64eb40b3 Fuck git

git-subtree-dir: external/ircolib
git-subtree-split: de6e324bde
2026-06-15 11:56:38 +02:00

6.2 KiB

Windows

Old systems

WinRT, Windows Phone, and UWP are no longer supported.

All desktop Windows versions, back to Windows XP, are still supported.

LLVM and Intel C++ compiler support

SDL will build with the Visual Studio project files with LLVM-based compilers, such as the Intel oneAPI C++ compiler, but you'll have to manually add the "-msse3" command line option to at least the SDL_audiocvt.c source file, and possibly others. This may not be necessary if you build SDL with CMake instead of the included Visual Studio solution.

Details are here: https://github.com/libsdl-org/SDL/issues/5186

MinGW-w64 compiler support

SDL can be built with MinGW-w64 and CMake. Minimum tested MinGW-w64 version is 8.0.3.

On a Windows host, you first need to install and set up the MSYS2 environment, which provides the MinGW-w64 toolchain. Install MSYS2, typically to C:\msys64, and follow the instructions on the MSYS2 wiki to use the MinGW-w64 shell to update all components in the MSYS2 environment. This generally amounts to running pacman -Syuu from the mingw64 shell, but refer to MSYS2's documentation for more details. Once the MSYS2 environment has been updated, install the x86_64 MinGW toolchain from the mingw64 shell with the command pacman -S mingw-w64-x86_64-toolchain. (You can additionally install mingw-w64-i686-toolchain if you intend to build 32-bit binaries as well. The remainder of this section assumes you only want to build 64-bit binaries.)

To build and install SDL, you can use PowerShell or any CMake-compatible IDE. First, install CMake, Ninja, and Git. These tools can be installed using any number of tools, such as the MSYS2's pacman, winget, Chocolatey, or by manually downloading and running the installers. Clone SDL to an appropriate location with git and run the following commands from the root of the cloned repository:

mkdir build
cmake -S . -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-x86_64.cmake
cmake --build build --parallel
cmake --install build --prefix C:/Libraries

This installs SDL to C:\Libraries. You can specify another directory of your choice as desired. Ensure that your CMAKE_PREFIX_PATH includes C:\Libraries when you want to build against this copy of SDL. The simplest way to do this is to pass it to CMake as an option at configuration time:

cmake .. -G Ninja -DCMAKE_PREFIX_PATH=C:/Libraries

You will also need to configure CMake to use the MinGW-w64 toolchain to build your own project. Here is a minimal toolchain file that you could use for this purpose:

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc REQUIRED)
find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++ REQUIRED)
find_program(CMAKE_RC_COMPILER NAMES x86_64-w64-mingw32-windres windres REQUIRED)

Save this in your project and refer to it at configuration time with the option -DCMAKE_TOOLCHAIN_FILE.

On Windows, you also need to copy SDL3.dll to an appropriate directory so that the game can find it at runtime. For guidance, see README-cmake.md.

Below is a minimal CMakeLists.txt file to build your game linked against a system SDL that was built with the MinGW-w64 toolchain. See README-cmake.md for more details on including SDL in your CMake project.

cmake_minimum_required(VERSION 3.15)
project(mygame)

find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3-shared)

add_executable(mygame WIN32 mygame.c)
target_link_libraries(mygame PRIVATE SDL3::SDL3)

# On Windows, copy SDL3.dll to the build directory
if(WIN32)
    add_custom_command(
        TARGET mygame POST_BUILD
        COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:SDL3::SDL3-shared> $<TARGET_FILE_DIR:mygame>
        VERBATIM
    )
endif()

OpenGL ES 2.x support

SDL has support for OpenGL ES 2.x under Windows via two alternative implementations.

The most straightforward method consists in running your app in a system with a graphic card paired with a relatively recent (as of November of 2013) driver which supports the WGL_EXT_create_context_es2_profile extension. Vendors known to ship said extension on Windows currently include nVidia and Intel.

The other method involves using the ANGLE library. If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile extension is found, SDL will try to load the libEGL.dll library provided by ANGLE.

To obtain the ANGLE binaries, you can either compile from source from https://chromium.googlesource.com/angle/angle or copy the relevant binaries from a recent Chrome/Chromium install for Windows. The files you need are:

  • libEGL.dll
  • libGLESv2.dll
  • d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler) or d3dcompiler_43.dll (supports Windows XP or later)

If you compile ANGLE from source, you can configure it so it does not need the d3dcompiler_* DLL at all (for details on this, see their documentation). However, by default SDL will try to preload the d3dcompiler_46.dll to comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to support Windows XP) or to skip this step at all, you can use the SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details).

Known Bugs:

  • SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears that there's a bug in the library which prevents the window contents from refreshing if this is set to anything other than the default value.

Vulkan Surface Support

Support for creating Vulkan surfaces is configured on by default. To disable it change the value of SDL_VIDEO_VULKAN to 0 in SDL_config_windows.h. You must install the Vulkan SDK in order to use Vulkan graphics in your application.

Transparent Window Support

SDL uses the Desktop Window Manager (DWM) to create transparent windows. DWM is always enabled from Windows 8 and above. Windows 7 only enables DWM with Aero Glass theme.

However, it cannot be guaranteed to work on all hardware configurations (an example is hybrid GPU systems, such as NVIDIA Optimus laptops).