2026-06-23 04:20:12
Suwako
c++
gamedev
sdl2

【C++】Pong and Brick Breaker Windows Version Release

After writing the Snake tutorial, I tested the game on other OSes as well.
I noticed something interesting: thanks to Wine/Proton/CrossOver, the Windows ecosystem has become one of the most reliable cross-platform targets.
And now with the arrival of FEX-Emu (part of Proton), x64 Windows executables can also run on AArch64 Linux machines.
Windows offers the best backward compatibility among all OSes.
It's quite ironic that the worst OS in history is also the best target platform.

When I ran the Windows version of Snake via Wine on FreeBSD, it performed exactly the same as on Windows.
On the other hand, the native FreeBSD version had performance issues such as SFX delays.
Another issue is that because Raylib depends on OpenGL, the game can be statically linked on Windows, but it's impossible on Unix-like, BeOS-like, or Amiga-like systems.
On Plan9-like systems, static linking is preferred so it might be possible, but I don't think OpenGL itself exists on Plan9.

On Unix-like OSes, statically linking OpenGL or Vulkan is virtually impossible.
The .so files that the binary depends on need to communicate with Mesa to interact with the GPU, which is extremely troublesome.
However, that doesn't happen on Windows.
Statically linked Windows executables also run perfectly fine on FreeBSD via Wine.

For this reason, I felt like re-releasing Pong and Brick Breaker for Windows, and this time I embedded all assets inside the executable so it can be distributed as a single file.
It will run as-is on any computer.

I originally planned to remake it with Raylib, but since the game is already two years old and was initially released only for Linux and BSD, I thought it was worth keeping it with SDL2 to prove that multiple libraries can be used.
I made minor adjustments to Pong so that text is displayed on the title bar.
This is because it was originally made in OpenBSD's DWM environment, which had no title bar.
Brick Breaker already had a title bar added in a recent bug-fix release.

The most troublesome part was linking SDL2_ttf, which depends on FreeType and further on multiple libraries, and there was an issue where Brotli and BZ2 insisted on DLL files for no reason.
I solved this problem by stripping them away like this:

> vcpkg install freetype[core,png,zlib]:x64-windows-static
> vcpkg install sdl sdl2-ttf sdl2-mixer --triplet=x64-windows-static

Just like with Snake, the repository includes all the necessary libraries and header files, so you won't have repeated heart attacks when trying to compile from source.

Here are the updated repositories:
Pong
Brick Breaker

Downloadable executables are here:
Pong
Brick Breaker

That's all