Go to file
Andrei Sabalenka 05dbef4381
hashtable: add generic hashtable
SDL_HashTable uses callbacks to calculate hash, compare keys and destroy items. Compiler doesn't know anything about functions that hashtable is going to call, so some optimizations can't be applied. But in almost all cases we know the functions to be called at compile time.

Generic hashtable is a reusable header that generates hashtable implementation for concrete hash, compare and destroy functions. It allows them to be inlined by the compiler, resulting in 1.5-4x performance boost compared to SDL_HashTable. The implementation is taken from SDL_HashTable, with a few improvements:

- Lowered max load factor to 128 (50%). Seems to be a good default value, as find is unlikely to load more than one cache line. The value also can be overriden by setting SDL_HASHTABLE_MAX_LOAD_FACTOR.

- Removed live bit field, using probe_len = 0 to indicate whether the item is live instead. Seems to be a bit faster, as CPU doesn't need to reset live bit each time probe_len is accessed.

- Removed max_probe_len. Unneeded, as we compare to probe_len of each item we visit, which is a stronger break condition.
2025-04-28 11:08:13 +03:00
.github Updated to GameInput v1.1 2025-04-11 13:42:58 -07:00
VisualC Updated to GameInput v1.1 2025-04-11 13:42:58 -07:00
VisualC-GDK Updated to GameInput v1.1 2025-04-11 13:42:58 -07:00
Xcode 8BitDo (#12661) 2025-03-31 09:56:01 -07:00
android-project Native functions renamed: {add,remove}AudioDevice to native{Add,Remove}AudioDevice 2025-03-23 15:25:33 +01:00
build-scripts docs: improve man page generation 2025-04-08 22:52:43 -04:00
cmake cmake: make SDL_CPU_xxx variable visible when using CMAKE_OSX_ARCHITECTURES 2025-04-03 19:07:24 +02:00
docs Sync SDL3 wiki -> header 2025-04-10 17:53:43 +00:00
examples Allow 01-joystick-polling example to be resizable 2025-04-10 08:58:40 -07:00
include Sync SDL3 wiki -> header 2025-04-13 16:33:01 +00:00
src hashtable: add generic hashtable 2025-04-28 11:08:13 +03:00
test Add SDL_CreateGPURenderer 2025-04-07 09:26:03 -07:00
wayland-protocols wayland: Add xdg_toplevel v7 edge constraint support 2025-04-13 11:10:49 -04:00
.clang-format Add 'wl_list_for_each_safe' to the clang-format macro list 2024-03-14 10:22:23 -04:00
.clang-tidy
.editorconfig .editorconfig: Remove excess apostrophe at *.cocci 2024-06-16 09:18:17 -07:00
.gitignore Allow in-tree build 2024-10-30 00:04:17 +01:00
.wikiheaders-options .wikiheaders-options: Removed wikipreamble setting. 2025-01-24 01:53:51 -05:00
Android.mk [SDL3] Adding input and FFB support for Logitech G29(PS3) on hidapi (#11598) 2025-03-17 07:24:39 -07:00
BUGS.txt Added a Discord link to BUGS.txt 2025-01-13 16:42:50 -08:00
CMakeLists.txt Updated to GameInput v1.1 2025-04-11 13:42:58 -07:00
CREDITS.md Updated the credits for SDL 3.0 2025-01-13 16:42:50 -08:00
INSTALL.md Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00
LICENSE.txt Updated copyright for 2025 2025-01-01 07:45:52 -08:00
README.md Updating documentation for the 3.2.0 release 2025-01-15 20:38:16 -08:00
WhatsNew.txt Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT 2025-03-05 09:07:05 -08:00

README.md

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)