SDL 3.4 strengthens interoperability between the 3D GPU API and 2D rendering

  • SDL 3.4 strengthens interoperability between the 3D GPU API and 2D rendering, with new renderers, GPU states, and support for YUV and HDR.
  • This version adds native PNG support, new texture scaling and routing options, animated cursors, and advanced input and window events.
  • It includes specific enhancements for Windows, macOS, Linux, Emscripten, iOS, and visionOS, along with expanded support for controllers, HID, and atomic KMSDRM.
  • SDL 3.4 is established as a mature version of SDL3, with greater stability, better performance, and deeper integration with Steam, Vulkan, and web platforms.

SLD 3.4

If you work in video game development or cross-platform multimedia applications, you've probably heard of SDL. the arrival de SDL 3.4The library takes a significant leap forward in terms of graphics capabilities, platform support, and tools for refining the user experience, across desktop, web, and mobile devices. This is no minor update: it encompasses everything from the 2D rendering engine and 3D GPU API to audio handling, drivers, pen input, modern Linux systems, and more.

Although SDL 3 continues to evolve, the branch 3.4 presents itself as a very solid version Designed to help new and ongoing projects take advantage of performance improvements, new APIs, and better integration with environments like Emscripten, Wayland, Vision Pro, or even PlayStation 2 in very specific contexts. Let's take a closer look at what's new in SDL 3.4, why it's relevant for your next project, and what technical details you should keep in mind if you want to get the most out of it.

Most important general new features of SDL 3.4

The main line of work of SDL 3.4 focuses on Improve interoperability between 3D and 2DThis is key for game engines and applications that blend 2D interfaces with 3D content. Until now, combining both layers could require more work from the developer; this version introduces new utilities and properties that facilitate this process.

In addition to the graphics, the update includes native support for PNG imagesThere are notable improvements to the input system (mouse, stylus, gestures, on-screen keyboard) and a host of specific changes for Windows, macOS, Linux, Emscripten, iOS, visionOS, and other less common platforms. Integration with the Steam ecosystem and its runtime has also been refined, which is crucial for Linux gaming and cross-platform development aimed at Steam distribution.

SDL 3
Related article:
SDL 3: The New Era for Linux Development and Cross-Platform Games

Interoperability between the 3D GPU API and 2D rendering

One of the strengths of SDL 3.4 is the boost to the integration between 3D and 2DThe library introduces new functions for creating GPU-based 2D renderers and for exchanging information between GPU textures and pixel formats handled by SDL.

  • It adds SDL_CreateGPURenderer() to create a 2D renderer that leverages the underlying GPU API.
  • With SDL_GetGPURendererDevice() You can retrieve the GPU device associated with that renderer.
  • They join SDL_CreateGPURenderState(), SDL_SetGPURenderStateFragmentUniforms(), SDL_SetGPURenderState() and SDL_DestroyGPURenderState() to work with fragment shaders within 2D GPU rendering.
  • Now they are admitted YUV textures and HDR color spaces in the GPU-based 2D renderer, which is especially interesting for high-end video and content.

It also incorporates features such as SDL_GetGPUDeviceProperties()This returns GPU device properties, including device name, driver name and version, and other information relevant for compatibility or diagnostic decisions. Additionally, `SDL_GetPixelFormatFromGPUTextureFormat()` and `SDL_GetGPUTextureFormatFromPixelFormat()` facilitate conversion between GPU texture formats and SDL pixel formats.

In parallel, the property is included SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER To create a 2D texture from an existing GPU texture, and SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER to obtain the GPU texture associated with a 2D texture when using the 2D GPU renderer. This approach significantly reduces friction when mixing content generated in the GPU API with the classic SDL 2D pipeline.

Improvements in 2D rendering and texture handling

SDL 3.4 goes beyond mere interoperability and adds specific functions for fine-tune the quality and control of 2D renderingFor example, SDL_RenderTexture9GridTiled() is introduced, which allows 9-grid rendering with textures in "tiled" mode instead of stretching them, avoiding deformations in interface elements or frames.

To manage how textures scale, the following are added SDL_GetDefaultTextureScaleMode() and SDL_SetDefaultTextureScaleMode(), which allows setting a default scaling mode for new textures. Related to this are SDL_GetRenderTextureAddressMode() and SDL_SetRenderTextureAddressMode(), along with the constant SDL_TEXTURE_ADDRESS_WRAP, which provides texture wrap support when the renderer indicates that it supports wrapping (SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN).

A very interesting new feature for games with a retro aesthetic is SDL_SCALEMODE_PIXELART, a scaling algorithm designed for pixel art that avoids the classic blurring of other filtering modes, preserving defined edges even when greatly enlarging the image.

There is also the possibility of working with texture palettesSDL_SetTexturePalette() and SDL_GetTexturePalette() allow you to assign and query palettes in textures, which is useful if you are recreating old graphic styles or want to optimize certain memory and bandwidth flows.

In terms of surfaces, SDL 3.4 incorporates SDL_RotateSurface() To create rotated copies of a surface, SDL_FLIP_HORIZONTAL_AND_VERTICAL is added to flip surfaces simultaneously on both axes. Additionally, the SDL_PROP_SURFACE_ROTATION_NUMBER property (later replaced by SDL_PROP_SURFACE_ROTATION_FLOAT in the final release candidate changes) is used to specify the angle required to correctly display camera images.

Native PNG support and surface loading

One of the most welcome improvements in terms of practicality is that SDL 3.4 includes native support for PNG...without relying on external libraries in many cases. This simplifies a lot of small projects and prototypes.

  • SDL_LoadPNG() and SDL_LoadPNG_IO() allow loading PNG images directly as surfaces.
  • SDL_SavePNG() and SDL_SavePNG_IO() are used to save surfaces in PNG format.
  • With SDL_LoadSurface() SDL_LoadSurface_IO() automatically detects whether the file is BMP or PNG and loads it onto a surface without you having to worry about the format.

This integrated support translates into fewer dependencies and external configurationsThis is especially useful when compiling for multiple platforms or using SDL within environments like Emscripten, where reducing the number of helper libraries makes a difference in both binary size and complexity.

Input: mouse, stylus, gestures, and on-screen keyboard

SDL 3.4 significantly improves everything related to advanced input devicesIn the mouse domain, SDL_SetRelativeMouseTransform() is introduced, which allows applying a custom transformation to the relative mouse input, useful for scaling techniques, axis inversion, or special mappings.

Regarding pencils and styluses, it appears SDL_GetPenDeviceType()which allows you to distinguish whether the pen is acting directly on the screen or on a separate touchpad, a very useful detail for adapting the UX according to the type of device.

On devices with a virtual keyboard, SDL adds events such as SDL_EVENT_SCREEN_KEYBOARD_SHOWN and SDL_EVENT_SCREEN_KEYBOARD_HIDDEN, which report when the on-screen keyboard is shown or hidden. This gives you leeway to adjust the interface, move elements, or prevent text fields from being covered.

The gesture system is also being expanded with events SDL_EVENT_PINCH_BEGIN, SDL_EVENT_PINCH_UPDATE and SDL_EVENT_PINCH_ENDwhich detect pinch gestures for zooming and similar actions. Additionally, in the Wayland environment, support for more than five mouse buttons is corrected, and precision scrolling is introduced in X11, improving the smoothness of fine scrolling.

Finally, SDL 3.4 incorporates SDL_GetEventDescription(), a function to get an English description of an event, intended for logging and debugging, something very useful when you're tracking rare input behaviors across multiple platforms.

Audio: more flexible workflows and no system reprocessing

The audio subsystem also receives its fair share of improvements, with a strong focus on Efficient processing and pipeline controlTo begin with, SDL_EVENT_AUDIO_DEVICE_ADDED is now also sent during initialization for each detected audio device, making it easier to discover and list devices without having to wait for dynamic events.

Two new features, SDL_PutAudioStreamDataNoCopy() and SDL_PutAudioStreamPlanarData(), give more options when working with audio streams: the first avoids unnecessary copies in certain cases, and the second allows data to be entered in planar format instead of interleaved, ideal for advanced streams or integration with high-level audio processing libraries.

In addition, the SDL_HINT_AUDIO_DEVICE_RAW_STREAM hint takes center stage: this hint indicates that the operating system You should not apply additional processing to the audio. (such as noise cancellation). This is key if your application or game already handles the processing and you don't want the OS to interfere and distort the result. Also introduced is SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN, which allows certain streams to survive beyond the audio subsystem's lifecycle, something useful in more complex architectures.

HID Controllers and Devices

SDL 3.4 significantly improves support for controllers and HID devices, expanding the range of hardware that works out of the box without external configuration. In particular, it adds Improved support for 8BitDo controllersFlyDigi and Hand Held Legend SINput, which makes it easier for many third-party gamepads to work more consistently.

It is also incorporated Wired Nintendo Switch 2 controller stand When SDL is compiled with libusb, this is interesting for users who prefer a direct connection over wireless mode. At the HID API level, SDL_hid_get_properties() appears to associate SDL properties with HID devices, and the SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER property allows retrieving the libusb handle associated with an SDL_hid_device when it has been opened with libusb.

These improvements are in addition to the fact that SDL 3.4 includes support for the new Steam Controller within its entry ecosystem, and that fits very well with its role within the Steam runtime and the focus on gaming on Linux and other platforms.

Events, system and general utilities

Beyond the graphical and input aspects, SDL 3.4 introduces a series of changes to the event system and general utilities that are worth knowing about. For example, SDL_EVENT_WINDOW_EXPOSED It now populates the data1 field with true when sent during a live window resize, providing extra context.

It adds SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGEDThis event triggers when the usable desktop boundaries change (for example, when moving taskbars or panels). It also incorporates SDL_EVENT_SCREEN_KEYBOARD_SHOWN/SDL_EVENT_SCREEN_KEYBOARD_HIDDEN and the previously mentioned pinch events, thus providing a more comprehensive event ecosystem for dynamic UI scenarios.

On the profit side, SDL_HINT_MAIN_CALLBACK_RATE can now be set as a floating-point value, giving more precision; SDL_AddAtomicU32() It adds support for atomic additions on 32-bit unsigned integers; and SDL_GetSystemPageSize() returns the system page size, useful for low-level memory tasks.

Also included SDL_ALIGNED()This macro indicates that certain data should have a specific alignment, which is very relevant for performance optimizations and the use of SIMD instructions. Meanwhile, SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER allows you to define a custom release function for the memory used by SDL_IOFromMem() and SDL_IOFromConstMem(), giving you more control when integrating SDL with your own allocators.

Another interesting improvement is the support for detailed log output When the DEBUG_INVOCATION environment variable is set to "1", intended for deep debugging of library initialization and behavior in complex contexts.

Specific improvements in Windows

On Windows, SDL 3.4 includes significant changes affecting audio, video, and the input system. One of the interesting points is the hint feature. SDL_HINT_RENDER_DIRECT3D11_WARPThis allows you to activate WARP (D3D11's software rasterizer). This is useful on machines without a compatible GPU or in virtualized environments where there is no direct acceleration but you still want to use the API.

The WASAPI driver takes advantage of SDL_HINT_AUDIO_DEVICE_STREAM_ROLE To adjust the audio stream category, an important integration for system-consistent behavior (e.g., game audio, communications, etc.). It also relies on SDL_HINT_AUDIO_DEVICE_RAW_STREAM to indicate whether or not the driver should apply extra processing.

The hint is entered on the keyboard input side. SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYSThis allows you to disable certain system shortcuts when using raw input, which is very practical for games that need to capture key combinations without system interference. And at the GameInput API level, SDL_HINT_WINDOWS_GAMEINPUT It is disabled by default, which reduces potential conflicts in some environments until it is explicitly configured.

It is also added SDL_PROP_DISPLAY_WINDOWS_HMONITOR_POINTER To obtain the HMONITOR associated with a screen, something very useful if you mix SDL with classic Win32 code and need to coordinate windows or monitors.

macOS, iOS, and visionOS

On macOS, SDL 3.4 includes a very practical hint: SDL_HINT_MAC_PRESS_AND_HOLDThis setting controls whether holding down a key repeats the keystroke or opens the accent menu. This allows you to adjust keyboard behavior for games and applications that require rapid key repetition instead of the typical macOS accent menu.

On iOS, SDL now supports window scenesThis resolves the "CLIENT OF UIKIT REQUIRES UPDATE" warning and aligns the library with modern UIKit practices. The SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER property is introduced to specify the window scene when creating an SDL window, helping to properly integrate the app into the iOS windowing system.

In visionOS and devices like the Apple Vision Pro, SDL 3.4 adjusts window behavior and refresh rates. The default refresh rate is increases to 90 Hzproviding a smoother experience, and SDL_SetWindowSize() effectively changes the window size on Vision Pro headsets, giving more control over the layout in mixed reality environments.

Linux, Wayland, KMS/DRM and Vulkan

In the Linux world, SDL 3.4 comes with a lot of new features. For one thing, it adds atomic support for KMSDRMThis improves stability and synchronization by working directly with the kernel's graphics subsystem. Related to this, the hint SDL_HINT_KMSDRM_ATOMIC allows control over whether or not KMSDRM will use this atomic functionality.

For Wayland, the following is incorporated: SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTERThis feature allows you to obtain the wl_output associated with a screen, facilitating deep integrations with the compositor. Additionally, issues with mice with more than five buttons have been fixed, and precision scrolling under X11 has been improved, providing a much finer sense of control in applications that rely heavily on scrolling.

Regarding Vulkan, SDL 3.4 introduces render batching and other improvements for APIs like Vulkan, which reduces redundant draw calls and improves overall performance. Work is also being done on the logic that detects the More powerful Vulkan GPU In systems with multiple GPUs, it helps to automatically choose the most suitable device, especially in hybrid or laptop systems with integrated and dedicated GPUs.

Additionally, the SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER property is added to configure Vulkan options when creating the GPU device, and SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN to require hardware acceleration when creating said device. At a more system-level level, SDL is also positioned as X11 toolkit with the introduction of X11TK as its own X11 toolkit for SDL.

Emscripten and browser usage

SDL 3.4 significantly improves its integration with Emscripten and execution in web browsersThis is key if you want to port your game or app to the web without rewriting it from scratch. One of the new features allows the SDL window to "fill the document" without necessarily being fullscreen.

In a previous version, SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT was introduced, and in the final release it is reorganized around the flag SDL_WINDOW_FILL_DOCUMENT and the SDL_SetWindowFillDocument() function, along with several related properties. Notable examples include:

  • SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING and SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING, to set and query the ID of the canvas used by SDL.
  • SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN and SDL_PROP_WINDOW_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN, to indicate and check if the window should occupy the entire document.
  • SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING and SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING, to specify and query the element to which the keyboard input is linked.

These options offer very fine control over How does SDL integrate with the DOM and the canvas?This helps avoid hacks and intermediate layers when working with Emscripten. They also make it easier to make SDL compatible with web frameworks or more complex integrations where the canvas is only one part of the page.

PlayStation 2 and other less common platforms

Although it may be surprising, SDL 3.4 also pays attention to veteran platforms like PlayStation 2Added hints to control display parameters: SDL_HINT_PS2_GS_WIDTH, SDL_HINT_PS2_GS_HEIGHT, SDL_HINT_PS2_GS_PROGRESSIVE and SDL_HINT_PS2_GS_MODE, which allow you to adjust resolution, progressive mode and general settings of the Graphics Synthesizer.

These details make it clear that SDL remains a very flexible option for homebrew projects, emulation, or research on older platforms, apart from its strong focus on modern PCs, mobile and web.

Process management, camera permissions, and ELF metadata

At the system level, SDL 3.4 adds the property SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRINGThis is used to configure the working directory of new processes created from SDL. This simplifies running subprocesses or external tools from your SDL application without having to access the operating system's API.

In the field of photography, SDL_GetCameraPermissionState() now returns a value of the type SDL_CameraPermissionState instead of a generic integer, better aligning semantics and facilitating permission management on mobile and desktop platforms.

In Unix systems, SDL includes ELF notes that describe its non-mandatory library facilities Following the format documented at systemd.io/ELF_DLOPEN_METADATA, the idea is that distributions can analyze these notes and automatically generate packaging dependencies using tools like package-notes. SDL provides the SDL_ELF_NOTE_DLOPEN macro so that other libraries and games can do the same, facilitating much cleaner dependency management.

Window progress and animated cursors

To improve the user experience, SDL 3.4 adds features designed to show progress and enrich the interfaceFor example, SDL_SetWindowProgressState(), SDL_SetWindowProgressValue(), SDL_GetWindowProgressState(), and SDL_GetWindowProgressValue() are introduced to display progress bars on the window icon in the Windows and Linux taskbar.

This feature allows the user to see the state of a long operation (downloads, uploads, internal builds, etc.) even if the window is not in the foreground. It's a rather elegant way to provide feedback without having to design additional HUDs.

On the other hand, SDL_CreateAnimatedCursor() allows create animated color cursorsThis adds a touch of visual polish to games or tools where the cursor communicates states (loading, possible action, alert, etc.). Combined with the new hint SDL_HINT_MOUSE_DPI_SCALE_CURSORS, which now defaults to "0" to prevent cursors from unexpectedly changing size in DPI-scaled environments, it provides more predictable control over the pointer's appearance.

With this set of changes—from 3D/2D GPU integration, native PNG support, input and audio improvements, to attention to modern Linux, Emscripten, visionOS, and classic consoles—SDL 3.4 solidifies its position as a a very complete toolbox for cross-platform developmentminimizing external dependencies and offering a solid foundation on which to iterate without spending all day debugging problems unrelated to your own code.