├── .github └── workflows │ └── main.yml ├── .gitignore ├── .zigversion ├── LICENSE ├── README.md ├── build.zig ├── build.zig.zon ├── libs ├── sdl2 │ └── include │ │ ├── SDL.h │ │ ├── SDL_assert.h │ │ ├── SDL_atomic.h │ │ ├── SDL_audio.h │ │ ├── SDL_bits.h │ │ ├── SDL_blendmode.h │ │ ├── SDL_clipboard.h │ │ ├── SDL_config.h │ │ ├── SDL_config.h.cmake │ │ ├── SDL_config.h.in │ │ ├── SDL_config_android.h │ │ ├── SDL_config_emscripten.h │ │ ├── SDL_config_iphoneos.h │ │ ├── SDL_config_macosx.h │ │ ├── SDL_config_minimal.h │ │ ├── SDL_config_ngage.h │ │ ├── SDL_config_os2.h │ │ ├── SDL_config_pandora.h │ │ ├── SDL_config_windows.h │ │ ├── SDL_config_wingdk.h │ │ ├── SDL_config_winrt.h │ │ ├── SDL_config_xbox.h │ │ ├── SDL_copying.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_egl.h │ │ ├── SDL_endian.h │ │ ├── SDL_error.h │ │ ├── SDL_events.h │ │ ├── SDL_filesystem.h │ │ ├── SDL_gamecontroller.h │ │ ├── SDL_gesture.h │ │ ├── SDL_guid.h │ │ ├── SDL_haptic.h │ │ ├── SDL_hidapi.h │ │ ├── SDL_hints.h │ │ ├── SDL_joystick.h │ │ ├── SDL_keyboard.h │ │ ├── SDL_keycode.h │ │ ├── SDL_loadso.h │ │ ├── SDL_locale.h │ │ ├── SDL_log.h │ │ ├── SDL_main.h │ │ ├── SDL_messagebox.h │ │ ├── SDL_metal.h │ │ ├── SDL_misc.h │ │ ├── SDL_mouse.h │ │ ├── SDL_mutex.h │ │ ├── SDL_name.h │ │ ├── SDL_opengl.h │ │ ├── SDL_opengl_glext.h │ │ ├── SDL_opengles.h │ │ ├── SDL_opengles2.h │ │ ├── SDL_opengles2_gl2.h │ │ ├── SDL_opengles2_gl2ext.h │ │ ├── SDL_opengles2_gl2platform.h │ │ ├── SDL_opengles2_khrplatform.h │ │ ├── SDL_pixels.h │ │ ├── SDL_platform.h │ │ ├── SDL_power.h │ │ ├── SDL_quit.h │ │ ├── SDL_rect.h │ │ ├── SDL_render.h │ │ ├── SDL_revision.h │ │ ├── SDL_revision.h.cmake │ │ ├── SDL_rwops.h │ │ ├── SDL_scancode.h │ │ ├── SDL_sensor.h │ │ ├── SDL_shape.h │ │ ├── SDL_stdinc.h │ │ ├── SDL_surface.h │ │ ├── SDL_system.h │ │ ├── SDL_syswm.h │ │ ├── SDL_test.h │ │ ├── SDL_test_assert.h │ │ ├── SDL_test_common.h │ │ ├── SDL_test_compare.h │ │ ├── SDL_test_crc32.h │ │ ├── SDL_test_font.h │ │ ├── SDL_test_fuzzer.h │ │ ├── SDL_test_harness.h │ │ ├── SDL_test_images.h │ │ ├── SDL_test_log.h │ │ ├── SDL_test_md5.h │ │ ├── SDL_test_memory.h │ │ ├── SDL_test_random.h │ │ ├── SDL_thread.h │ │ ├── SDL_timer.h │ │ ├── SDL_touch.h │ │ ├── SDL_types.h │ │ ├── SDL_version.h │ │ ├── SDL_video.h │ │ ├── SDL_vulkan.h │ │ ├── begin_code.h │ │ └── close_code.h └── sdl3 │ └── include │ └── SDL3 │ ├── SDL.h │ ├── SDL_assert.h │ ├── SDL_asyncio.h │ ├── SDL_atomic.h │ ├── SDL_audio.h │ ├── SDL_begin_code.h │ ├── SDL_bits.h │ ├── SDL_blendmode.h │ ├── SDL_camera.h │ ├── SDL_clipboard.h │ ├── SDL_close_code.h │ ├── SDL_copying.h │ ├── SDL_cpuinfo.h │ ├── SDL_dialog.h │ ├── SDL_egl.h │ ├── SDL_endian.h │ ├── SDL_error.h │ ├── SDL_events.h │ ├── SDL_filesystem.h │ ├── SDL_gamepad.h │ ├── SDL_gpu.h │ ├── SDL_guid.h │ ├── SDL_haptic.h │ ├── SDL_hidapi.h │ ├── SDL_hints.h │ ├── SDL_init.h │ ├── SDL_intrin.h │ ├── SDL_iostream.h │ ├── SDL_joystick.h │ ├── SDL_keyboard.h │ ├── SDL_keycode.h │ ├── SDL_loadso.h │ ├── SDL_locale.h │ ├── SDL_log.h │ ├── SDL_main.h │ ├── SDL_main_impl.h │ ├── SDL_messagebox.h │ ├── SDL_metal.h │ ├── SDL_misc.h │ ├── SDL_mouse.h │ ├── SDL_mutex.h │ ├── SDL_oldnames.h │ ├── SDL_opengl.h │ ├── SDL_opengl_glext.h │ ├── SDL_opengles.h │ ├── SDL_opengles2.h │ ├── SDL_opengles2_gl2.h │ ├── SDL_opengles2_gl2ext.h │ ├── SDL_opengles2_gl2platform.h │ ├── SDL_opengles2_khrplatform.h │ ├── SDL_pen.h │ ├── SDL_pixels.h │ ├── SDL_platform.h │ ├── SDL_platform_defines.h │ ├── SDL_power.h │ ├── SDL_process.h │ ├── SDL_properties.h │ ├── SDL_rect.h │ ├── SDL_render.h │ ├── SDL_revision.h │ ├── SDL_scancode.h │ ├── SDL_sensor.h │ ├── SDL_stdinc.h │ ├── SDL_storage.h │ ├── SDL_surface.h │ ├── SDL_system.h │ ├── SDL_test.h │ ├── SDL_test_assert.h │ ├── SDL_test_common.h │ ├── SDL_test_compare.h │ ├── SDL_test_crc32.h │ ├── SDL_test_font.h │ ├── SDL_test_fuzzer.h │ ├── SDL_test_harness.h │ ├── SDL_test_log.h │ ├── SDL_test_md5.h │ ├── SDL_test_memory.h │ ├── SDL_thread.h │ ├── SDL_time.h │ ├── SDL_timer.h │ ├── SDL_touch.h │ ├── SDL_tray.h │ ├── SDL_version.h │ ├── SDL_video.h │ └── SDL_vulkan.h └── src ├── sdl2.zig ├── sdl2_image.zig ├── sdl2_ttf.zig ├── sdl2_version_check.zig └── sdl3.zig /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | push: 7 | branches: 8 | - main 9 | concurrency: 10 | # Cancels pending runs when a PR gets updated. 11 | group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} 12 | cancel-in-progress: true 13 | jobs: 14 | lint-and-build-and-test: 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | os: [ubuntu-latest] 19 | runs-on: ${{matrix.os}} 20 | steps: 21 | - name: Checkout repository 22 | uses: actions/checkout@v3 23 | - name: Read .zig-version 24 | id: zigversion 25 | uses: juliangruber/read-file-action@v1 26 | with: 27 | path: ./.zigversion 28 | - name: Install Zig 29 | uses: mlugg/setup-zig@v1 30 | with: 31 | version: ${{ steps.zigversion.outputs.content }} 32 | - name: Check format 33 | continue-on-error: true 34 | run: zig fmt --check . 35 | - name: Build and run tests 36 | run: zig build test 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore some special directories 2 | .zig-cache 3 | zig-out 4 | 5 | # Ignore some special OS files 6 | *.DS_Store 7 | -------------------------------------------------------------------------------- /.zigversion: -------------------------------------------------------------------------------- 1 | 0.14.0 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Michal Ziulek 4 | Copyright (c) 2024 zig-gamedev contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [zsdl](https://github.com/zig-gamedev/zsdl) 2 | 3 | Zigified bindings for SDL libs. Work in progress. 4 | 5 | ## Getting started (SDL2) 6 | 7 | Example `build.zig`: 8 | 9 | ```zig 10 | pub fn build(b: *std.Build) !void { 11 | 12 | const exe = b.addExecutable(.{ ... }); 13 | exe.linkLibC(); 14 | 15 | const zsdl = b.dependency("zsdl", .{}); 16 | 17 | exe.root_module.addImport("zsdl2", zsdl.module("zsdl2")); 18 | @import("zsdl").link_SDL2(exe); 19 | 20 | exe.root_module.addImport("zsdl2_ttf", zsdl.module("zsdl2_ttf")); 21 | @import("zsdl").link_SDL2_ttf(exe); 22 | 23 | exe.root_module.addImport("zsdl2_image", zsdl.module("zsdl2_image")); 24 | @import("zsdl").link_SDL2_image(exe); 25 | 26 | // Optionally use prebuilt libs instead of relying on system installed SDL... 27 | @import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe); 28 | if (@import("zsdl").prebuilt_sdl2.install(b, target.result, .bin), .{ 29 | .ttf = true, 30 | .image = true, 31 | }) |install_sdl2_step| { 32 | b.getInstallStep().dependOn(install_sdl2_step); 33 | } 34 | } 35 | ``` 36 | 37 | NOTE: If you want to use our prebuilt libraries also add the following to your `build.zig.zon`: 38 | ```zig 39 | .@"sdl2-prebuilt-macos" = .{ 40 | .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/f14773fa3de719b3a399b854c31eb4139d63842f.tar.gz", 41 | .hash = "12205cb2da6fb4a7fcf28b9cd27b60aaf12f4d4a55be0260b1ae36eaf93ca5a99f03", 42 | .lazy = true, 43 | }, 44 | .@"sdl2-prebuilt-x86_64-windows-gnu" = .{ 45 | .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8143e2a5c28dbace399cbff14c3e8749a1afd418.tar.gz", 46 | .hash = "1220ade6b84d06d73bf83cef22c73ec4abc21a6d50b9f48875f348b7942c80dde11b", 47 | .lazy = true, 48 | }, 49 | .@"sdl2-prebuilt-x86_64-linux-gnu" = .{ 50 | .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/2eccc574ad909b0d00b694b10c217a95145c47af.tar.gz", 51 | .hash = "12200ecb91c0596d0356ff39d573af83abcd44fecb27943589f11c2cd172763fea39", 52 | .lazy = true, 53 | }, 54 | ``` 55 | 56 | Now in your code you may import and use `zsdl2`: 57 | 58 | ```zig 59 | const std = @import("std"); 60 | const sdl = @import("zsdl2"); 61 | 62 | pub fn main() !void { 63 | ... 64 | try sdl.init(.{ .audio = true, .video = true }); 65 | defer sdl.quit(); 66 | 67 | const window = try sdl.Window.create( 68 | "zig-gamedev-window", 69 | sdl.Window.pos_undefined, 70 | sdl.Window.pos_undefined, 71 | 600, 72 | 600, 73 | .{ .opengl = true, .allow_highdpi = true }, 74 | ); 75 | defer window.destroy(); 76 | ... 77 | } 78 | ``` 79 | 80 | ## Getting started (SDL3) 81 | TODO 82 | -------------------------------------------------------------------------------- /build.zig.zon: -------------------------------------------------------------------------------- 1 | .{ 2 | .name = .zsdl, 3 | .fingerprint = 0x36e4ca3d13635aac, 4 | .version = "0.4.0-dev", 5 | .paths = .{ 6 | "build.zig", 7 | "build.zig.zon", 8 | "src", 9 | "libs", 10 | "README.md", 11 | "LICENSE", 12 | }, 13 | .dependencies = .{ 14 | .sdl3_prebuilt_macos = .{ 15 | .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/e89207914a0f0163c0fb543da4f530f645ef5969.tar.gz", 16 | .hash = "sdl3_prebuilt_macos-0.2.0-dev-A1UBS1aUdwCWfplgS5fNorbstvDxSi3LOHnSPzjmWZhl", 17 | .lazy = true, 18 | }, 19 | .sdl3_prebuilt_x86_64_windows_gnu = .{ 20 | .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2.tar.gz", 21 | .hash = "sdl3_prebuilt_x86_64_windows_gnu-0.2.0-dev-AAAAAI_mJADlsRyMxRFKobQJEbfs1p-37A9mmYEj7DW-", 22 | .lazy = true, 23 | }, 24 | .sdl3_prebuilt_x86_64_linux_gnu = .{ 25 | .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/b19959ed3aa87d8393640d7ba3aec142ae85487b.tar.gz", 26 | .hash = "sdl3_prebuilt_x86_64_linux_gnu-0.2.0-dev-qpwWsmyVNwBHzXjgC9Z-U02SXoUVMMxvCnI7XKocDcDn", 27 | .lazy = true, 28 | }, 29 | .sdl2_prebuilt_macos = .{ 30 | .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/7bc0fa9101342c019eed252d43f490660dfa411b.tar.gz", 31 | .hash = "sdl2_prebuilt_macos-0.2.0-dev-DaOxP5Eq2QBpNBkpXn2qjyI6_s0gINcbdUMpqI1KshaH", 32 | .lazy = true, 33 | }, 34 | .sdl2_prebuilt_x86_64_windows_gnu = .{ 35 | .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8de1512cedfa1fb3ab17ecf295af8cabd7f231f1.tar.gz", 36 | .hash = "sdl2_prebuilt_x86_64_windows_gnu-0.2.0-dev-HPeIhv2VaQBOWF4Fjtr7Vb9bA852pUtwUuQKdvNvkA98", 37 | .lazy = true, 38 | }, 39 | .sdl2_prebuilt_x86_64_linux_gnu = .{ 40 | .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/ce2b511c052c3fdc35c286ade8235d2830a50992.tar.gz", 41 | .hash = "sdl2_prebuilt_x86_64_linux_gnu-0.2.0-dev-NHZ_xrzSHwDJDoAxuVi000OEq428znS1fDRRJE8PlXHu", 42 | .lazy = true, 43 | }, 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_bits.h 24 | * 25 | * Functions for fiddling with bits and bitmasks. 26 | */ 27 | 28 | #ifndef SDL_bits_h_ 29 | #define SDL_bits_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \file SDL_bits.h 41 | */ 42 | 43 | /** 44 | * Get the index of the most significant bit. Result is undefined when called 45 | * with 0. This operation can also be stated as "count leading zeroes" and 46 | * "log base 2". 47 | * 48 | * \return the index of the most significant bit, or -1 if the value is 0. 49 | */ 50 | #if defined(__WATCOMC__) && defined(__386__) 51 | extern __inline int _SDL_bsr_watcom(Uint32); 52 | #pragma aux _SDL_bsr_watcom = \ 53 | "bsr eax, eax" \ 54 | parm [eax] nomemory \ 55 | value [eax] \ 56 | modify exact [eax] nomemory; 57 | #endif 58 | 59 | SDL_FORCE_INLINE int 60 | SDL_MostSignificantBitIndex32(Uint32 x) 61 | { 62 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 63 | /* Count Leading Zeroes builtin in GCC. 64 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html 65 | */ 66 | if (x == 0) { 67 | return -1; 68 | } 69 | return 31 - __builtin_clz(x); 70 | #elif defined(__WATCOMC__) && defined(__386__) 71 | if (x == 0) { 72 | return -1; 73 | } 74 | return _SDL_bsr_watcom(x); 75 | #elif defined(_MSC_VER) 76 | unsigned long index; 77 | if (_BitScanReverse(&index, x)) { 78 | return index; 79 | } 80 | return -1; 81 | #else 82 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson 83 | * , released in the public domain. 84 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 85 | */ 86 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 87 | const int S[] = {1, 2, 4, 8, 16}; 88 | 89 | int msbIndex = 0; 90 | int i; 91 | 92 | if (x == 0) { 93 | return -1; 94 | } 95 | 96 | for (i = 4; i >= 0; i--) 97 | { 98 | if (x & b[i]) 99 | { 100 | x >>= S[i]; 101 | msbIndex |= S[i]; 102 | } 103 | } 104 | 105 | return msbIndex; 106 | #endif 107 | } 108 | 109 | SDL_FORCE_INLINE SDL_bool 110 | SDL_HasExactlyOneBitSet32(Uint32 x) 111 | { 112 | if (x && !(x & (x - 1))) { 113 | return SDL_TRUE; 114 | } 115 | return SDL_FALSE; 116 | } 117 | 118 | /* Ends C function definitions when using C++ */ 119 | #ifdef __cplusplus 120 | } 121 | #endif 122 | #include "close_code.h" 123 | 124 | #endif /* SDL_bits_h_ */ 125 | 126 | /* vi: set ts=4 sw=4 expandtab: */ 127 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * Put UTF-8 text into the clipboard. 43 | * 44 | * \param text the text to store in the clipboard 45 | * \returns 0 on success or a negative error code on failure; call 46 | * SDL_GetError() for more information. 47 | * 48 | * \since This function is available since SDL 2.0.0. 49 | * 50 | * \sa SDL_GetClipboardText 51 | * \sa SDL_HasClipboardText 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 54 | 55 | /** 56 | * Get UTF-8 text from the clipboard, which must be freed with SDL_free(). 57 | * 58 | * This functions returns empty string if there was not enough memory left for 59 | * a copy of the clipboard's content. 60 | * 61 | * \returns the clipboard text on success or an empty string on failure; call 62 | * SDL_GetError() for more information. Caller must call SDL_free() 63 | * on the returned pointer when done with it (even if there was an 64 | * error). 65 | * 66 | * \since This function is available since SDL 2.0.0. 67 | * 68 | * \sa SDL_HasClipboardText 69 | * \sa SDL_SetClipboardText 70 | */ 71 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 72 | 73 | /** 74 | * Query whether the clipboard exists and contains a non-empty text string. 75 | * 76 | * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not. 77 | * 78 | * \since This function is available since SDL 2.0.0. 79 | * 80 | * \sa SDL_GetClipboardText 81 | * \sa SDL_SetClipboardText 82 | */ 83 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 84 | 85 | 86 | /* Ends C function definitions when using C++ */ 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | #include "close_code.h" 91 | 92 | #endif /* SDL_clipboard_h_ */ 93 | 94 | /* vi: set ts=4 sw=4 expandtab: */ 95 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_h_ 23 | #define SDL_config_h_ 24 | 25 | #include "SDL_platform.h" 26 | 27 | /** 28 | * \file SDL_config.h 29 | */ 30 | 31 | /* Add any platform that doesn't build using the configure system. */ 32 | #if defined(__WIN32__) 33 | #include "SDL_config_windows.h" 34 | #elif defined(__WINRT__) 35 | #include "SDL_config_winrt.h" 36 | #elif defined(__WINGDK__) 37 | #include "SDL_config_wingdk.h" 38 | #elif defined(__XBOXONE__) || defined(__XBOXSERIES__) 39 | #include "SDL_config_xbox.h" 40 | #elif defined(__MACOSX__) 41 | #include "SDL_config_macosx.h" 42 | #elif defined(__IPHONEOS__) 43 | #include "SDL_config_iphoneos.h" 44 | #elif defined(__ANDROID__) 45 | #include "SDL_config_android.h" 46 | #elif defined(__OS2__) 47 | #include "SDL_config_os2.h" 48 | #elif defined(__EMSCRIPTEN__) 49 | #include "SDL_config_emscripten.h" 50 | #elif defined(__NGAGE__) 51 | #include "SDL_config_ngage.h" 52 | #else 53 | /* This is a minimal configuration just to get SDL running on new platforms. */ 54 | #include "SDL_config_minimal.h" 55 | #endif /* platform config */ 56 | 57 | #ifdef USING_GENERATED_CONFIG_H 58 | #error Wrong SDL_config.h, check your include path? 59 | #endif 60 | 61 | #endif /* SDL_config_h_ */ 62 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_config_android.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_android_h_ 23 | #define SDL_config_android_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_android.h 30 | * 31 | * This is a configuration that can be used to build SDL for Android 32 | */ 33 | 34 | #include 35 | 36 | #define HAVE_GCC_ATOMICS 1 37 | 38 | #define STDC_HEADERS 1 39 | #define HAVE_ALLOCA_H 1 40 | #define HAVE_CTYPE_H 1 41 | #define HAVE_INTTYPES_H 1 42 | #define HAVE_LIMITS_H 1 43 | #define HAVE_MATH_H 1 44 | #define HAVE_SIGNAL_H 1 45 | #define HAVE_STDINT_H 1 46 | #define HAVE_STDIO_H 1 47 | #define HAVE_STRING_H 1 48 | #define HAVE_SYS_TYPES_H 1 49 | 50 | /* C library functions */ 51 | #define HAVE_DLOPEN 1 52 | #define HAVE_MALLOC 1 53 | #define HAVE_CALLOC 1 54 | #define HAVE_REALLOC 1 55 | #define HAVE_FREE 1 56 | #define HAVE_ALLOCA 1 57 | #define HAVE_GETENV 1 58 | #define HAVE_SETENV 1 59 | #define HAVE_PUTENV 1 60 | #define HAVE_SETENV 1 61 | #define HAVE_UNSETENV 1 62 | #define HAVE_QSORT 1 63 | #define HAVE_BSEARCH 1 64 | #define HAVE_ABS 1 65 | #define HAVE_BCOPY 1 66 | #define HAVE_MEMSET 1 67 | #define HAVE_MEMCPY 1 68 | #define HAVE_MEMMOVE 1 69 | #define HAVE_MEMCMP 1 70 | #define HAVE_STRLEN 1 71 | #define HAVE_STRLCPY 1 72 | #define HAVE_STRLCAT 1 73 | #define HAVE_STRCHR 1 74 | #define HAVE_STRRCHR 1 75 | #define HAVE_STRSTR 1 76 | #define HAVE_STRTOK_R 1 77 | #define HAVE_STRTOL 1 78 | #define HAVE_STRTOUL 1 79 | #define HAVE_STRTOLL 1 80 | #define HAVE_STRTOULL 1 81 | #define HAVE_STRTOD 1 82 | #define HAVE_ATOI 1 83 | #define HAVE_ATOF 1 84 | #define HAVE_STRCMP 1 85 | #define HAVE_STRNCMP 1 86 | #define HAVE_STRCASECMP 1 87 | #define HAVE_STRNCASECMP 1 88 | #define HAVE_VSSCANF 1 89 | #define HAVE_VSNPRINTF 1 90 | #define HAVE_ACOS 1 91 | #define HAVE_ACOSF 1 92 | #define HAVE_ASIN 1 93 | #define HAVE_ASINF 1 94 | #define HAVE_ATAN 1 95 | #define HAVE_ATANF 1 96 | #define HAVE_ATAN2 1 97 | #define HAVE_ATAN2F 1 98 | #define HAVE_CEIL 1 99 | #define HAVE_CEILF 1 100 | #define HAVE_COPYSIGN 1 101 | #define HAVE_COPYSIGNF 1 102 | #define HAVE_COS 1 103 | #define HAVE_COSF 1 104 | #define HAVE_EXP 1 105 | #define HAVE_EXPF 1 106 | #define HAVE_FABS 1 107 | #define HAVE_FABSF 1 108 | #define HAVE_FLOOR 1 109 | #define HAVE_FLOORF 1 110 | #define HAVE_FMOD 1 111 | #define HAVE_FMODF 1 112 | #define HAVE_LOG 1 113 | #define HAVE_LOGF 1 114 | #define HAVE_LOG10 1 115 | #define HAVE_LOG10F 1 116 | #define HAVE_LROUND 1 117 | #define HAVE_LROUNDF 1 118 | #define HAVE_POW 1 119 | #define HAVE_POWF 1 120 | #define HAVE_ROUND 1 121 | #define HAVE_ROUNDF 1 122 | #define HAVE_SCALBN 1 123 | #define HAVE_SCALBNF 1 124 | #define HAVE_SIN 1 125 | #define HAVE_SINF 1 126 | #define HAVE_SQRT 1 127 | #define HAVE_SQRTF 1 128 | #define HAVE_TAN 1 129 | #define HAVE_TANF 1 130 | #define HAVE_TRUNC 1 131 | #define HAVE_TRUNCF 1 132 | #define HAVE_SIGACTION 1 133 | #define HAVE_SETJMP 1 134 | #define HAVE_NANOSLEEP 1 135 | #define HAVE_SYSCONF 1 136 | #define HAVE_CLOCK_GETTIME 1 137 | 138 | #ifdef __LP64__ 139 | #define SIZEOF_VOIDP 8 140 | #else 141 | #define SIZEOF_VOIDP 4 142 | #endif 143 | 144 | /* Enable various audio drivers */ 145 | #define SDL_AUDIO_DRIVER_ANDROID 1 146 | #define SDL_AUDIO_DRIVER_OPENSLES 1 147 | #define SDL_AUDIO_DRIVER_AAUDIO 1 148 | #define SDL_AUDIO_DRIVER_DUMMY 1 149 | 150 | /* Enable various input drivers */ 151 | #define SDL_JOYSTICK_ANDROID 1 152 | #define SDL_JOYSTICK_HIDAPI 1 153 | #define SDL_JOYSTICK_VIRTUAL 1 154 | #define SDL_HAPTIC_ANDROID 1 155 | 156 | /* Enable sensor driver */ 157 | #define SDL_SENSOR_ANDROID 1 158 | 159 | /* Enable various shared object loading systems */ 160 | #define SDL_LOADSO_DLOPEN 1 161 | 162 | /* Enable various threading systems */ 163 | #define SDL_THREAD_PTHREAD 1 164 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 165 | 166 | /* Enable various timer systems */ 167 | #define SDL_TIMER_UNIX 1 168 | 169 | /* Enable various video drivers */ 170 | #define SDL_VIDEO_DRIVER_ANDROID 1 171 | 172 | /* Enable OpenGL ES */ 173 | #define SDL_VIDEO_OPENGL_ES 1 174 | #define SDL_VIDEO_OPENGL_ES2 1 175 | #define SDL_VIDEO_OPENGL_EGL 1 176 | #define SDL_VIDEO_RENDER_OGL_ES 1 177 | #define SDL_VIDEO_RENDER_OGL_ES2 1 178 | 179 | /* Enable Vulkan support */ 180 | /* Android does not support Vulkan in native code using the "armeabi" ABI. */ 181 | #if defined(__ARM_ARCH) && __ARM_ARCH < 7 182 | #define SDL_VIDEO_VULKAN 0 183 | #else 184 | #define SDL_VIDEO_VULKAN 1 185 | #endif 186 | 187 | /* Enable system power support */ 188 | #define SDL_POWER_ANDROID 1 189 | 190 | /* Enable the filesystem driver */ 191 | #define SDL_FILESYSTEM_ANDROID 1 192 | 193 | #endif /* SDL_config_android_h_ */ 194 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_config_minimal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_minimal_h_ 23 | #define SDL_config_minimal_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_minimal.h 30 | * 31 | * This is the minimal configuration that can be used to build SDL. 32 | */ 33 | 34 | #define HAVE_STDARG_H 1 35 | #define HAVE_STDDEF_H 1 36 | 37 | /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ 38 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 39 | /* Here are some reasonable defaults */ 40 | typedef unsigned int size_t; 41 | typedef signed char int8_t; 42 | typedef unsigned char uint8_t; 43 | typedef signed short int16_t; 44 | typedef unsigned short uint16_t; 45 | typedef signed int int32_t; 46 | typedef unsigned int uint32_t; 47 | typedef signed long long int64_t; 48 | typedef unsigned long long uint64_t; 49 | typedef unsigned long uintptr_t; 50 | #else 51 | #define HAVE_STDINT_H 1 52 | #define HAVE_INTTYPES_H 1 53 | #endif /* Visual Studio 2008 */ 54 | 55 | #ifdef __GNUC__ 56 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 57 | #endif 58 | 59 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 60 | #define SDL_AUDIO_DRIVER_DUMMY 1 61 | 62 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 63 | #define SDL_JOYSTICK_DISABLED 1 64 | 65 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 66 | #define SDL_HAPTIC_DISABLED 1 67 | 68 | /* Enable the stub HIDAPI */ 69 | #define SDL_HIDAPI_DISABLED 1 70 | 71 | /* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ 72 | #define SDL_SENSOR_DISABLED 1 73 | 74 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 75 | #define SDL_LOADSO_DISABLED 1 76 | 77 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 78 | #define SDL_THREADS_DISABLED 1 79 | 80 | /* Enable the stub timer support (src/timer/dummy/\*.c) */ 81 | #define SDL_TIMERS_DISABLED 1 82 | 83 | /* Enable the dummy video driver (src/video/dummy/\*.c) */ 84 | #define SDL_VIDEO_DRIVER_DUMMY 1 85 | 86 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ 87 | #define SDL_FILESYSTEM_DUMMY 1 88 | 89 | #endif /* SDL_config_minimal_h_ */ 90 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_config_ngage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_ngage_h_ 23 | #define SDL_config_ngage_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | typedef signed char int8_t; 29 | typedef unsigned char uint8_t; 30 | typedef signed short int16_t; 31 | typedef unsigned short uint16_t; 32 | typedef signed int int32_t; 33 | typedef unsigned int uint32_t; 34 | typedef signed long long int64_t; 35 | typedef unsigned long long uint64_t; 36 | typedef unsigned long uintptr_t; 37 | 38 | #define HAVE_STDARG_H 1 39 | #define HAVE_STDDEF_H 1 40 | #define HAVE_STDIO_H 1 41 | #define HAVE_STDLIB_H 1 42 | #define HAVE_MATH_H 1 43 | #define HAVE_CEIL 1 44 | #define HAVE_COPYSIGN 1 45 | #define HAVE_COS 1 46 | #define HAVE_EXP 1 47 | #define HAVE_FABS 1 48 | #define HAVE_FLOOR 1 49 | #define HAVE_LOG 1 50 | #define HAVE_LOG10 1 51 | #define HAVE_SCALBN 1 52 | #define HAVE_SIN 1 53 | #define HAVE_SQRT 1 54 | #define HAVE_TAN 1 55 | #define HAVE_MALLOC 1 56 | #define SDL_MAIN_NEEDED 1 57 | #define LACKS_SYS_MMAN_H 1 58 | 59 | /* Enable the N-Gage thread support (src/thread/ngage/\*.c) */ 60 | #define SDL_THREAD_NGAGE 1 61 | 62 | /* Enable the N-Gage timer support (src/timer/ngage/\*.c) */ 63 | #define SDL_TIMER_NGAGE 1 64 | 65 | /* Enable the N-Gage video driver (src/video/ngage/\*.c) */ 66 | #define SDL_VIDEO_DRIVER_NGAGE 1 67 | 68 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 69 | #define SDL_AUDIO_DRIVER_DUMMY 1 70 | 71 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 72 | #define SDL_JOYSTICK_DISABLED 1 73 | 74 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 75 | #define SDL_HAPTIC_DISABLED 1 76 | 77 | /* Enable the stub HIDAPI */ 78 | #define SDL_HIDAPI_DISABLED 1 79 | 80 | /* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ 81 | #define SDL_SENSOR_DISABLED 1 82 | 83 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 84 | #define SDL_LOADSO_DISABLED 1 85 | 86 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ 87 | #define SDL_FILESYSTEM_DUMMY 1 88 | 89 | #endif /* SDL_config_ngage_h_ */ 90 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_config_os2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_os2_h_ 23 | #define SDL_config_os2_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | #define SIZEOF_VOIDP 4 29 | 30 | #define SDL_AUDIO_DRIVER_DUMMY 1 31 | #define SDL_AUDIO_DRIVER_DISK 1 32 | #define SDL_AUDIO_DRIVER_OS2 1 33 | 34 | #define SDL_POWER_DISABLED 1 35 | #define SDL_HAPTIC_DISABLED 1 36 | 37 | #define SDL_SENSOR_DUMMY 1 38 | #define SDL_VIDEO_DRIVER_DUMMY 1 39 | #define SDL_VIDEO_DRIVER_OS2 1 40 | #define SDL_JOYSTICK_OS2 1 41 | #ifndef HAVE_LIBUSB_H /* see Makefile */ 42 | #define SDL_HIDAPI_DISABLED 1 43 | /*#undef SDL_JOYSTICK_HIDAPI */ 44 | #else 45 | #define SDL_JOYSTICK_HIDAPI 1 46 | #define HAVE_LIBUSB 1 47 | /* dynamically loaded libusb-1.0 dll: */ 48 | #define SDL_LIBUSB_DYNAMIC "usb100.dll" 49 | #endif 50 | /*#undef SDL_JOYSTICK_VIRTUAL */ 51 | 52 | /* Enable OpenGL support */ 53 | /* #undef SDL_VIDEO_OPENGL */ 54 | 55 | #define SDL_THREAD_OS2 1 56 | #define SDL_LOADSO_OS2 1 57 | #define SDL_TIMER_OS2 1 58 | #define SDL_FILESYSTEM_OS2 1 59 | 60 | /* use libsamplerate for audio rate conversion. */ 61 | /*#define HAVE_LIBSAMPLERATE_H 1 */ 62 | 63 | /* Enable dynamic libsamplerate support */ 64 | #define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL" 65 | 66 | #define HAVE_LIBC 1 67 | 68 | #define HAVE_STDARG_H 1 69 | #define HAVE_STDDEF_H 1 70 | #define HAVE_STDINT_H 1 71 | 72 | #define HAVE_SYS_TYPES_H 1 73 | #define HAVE_STDIO_H 1 74 | #define STDC_HEADERS 1 75 | #define HAVE_STDLIB_H 1 76 | #define HAVE_MALLOC_H 1 77 | #define HAVE_MEMORY_H 1 78 | #define HAVE_STRING_H 1 79 | #define HAVE_STRINGS_H 1 80 | #define HAVE_WCHAR_H 1 81 | #define HAVE_INTTYPES_H 1 82 | #define HAVE_LIMITS_H 1 83 | #define HAVE_CTYPE_H 1 84 | #define HAVE_MATH_H 1 85 | #define HAVE_FLOAT_H 1 86 | #define HAVE_SIGNAL_H 1 87 | 88 | #if 0 /* see Makefile */ 89 | #define HAVE_ICONV 1 90 | #define HAVE_ICONV_H 1 91 | #endif 92 | 93 | /* #undef HAVE_DLOPEN */ 94 | #define HAVE_MALLOC 1 95 | #define HAVE_CALLOC 1 96 | #define HAVE_REALLOC 1 97 | #define HAVE_FREE 1 98 | #if defined(__WATCOMC__) 99 | #define HAVE__FSEEKI64 1 100 | #define HAVE__FTELLI64 1 101 | #endif 102 | #define HAVE_ALLOCA 1 103 | #define HAVE_GETENV 1 104 | #define HAVE_SETENV 1 105 | #define HAVE_PUTENV 1 106 | /* OpenWatcom requires specific calling conventions for qsort and bsearch */ 107 | #ifndef __WATCOMC__ 108 | #define HAVE_QSORT 1 109 | #define HAVE_BSEARCH 1 110 | #endif 111 | #define HAVE_ABS 1 112 | #define HAVE_BCOPY 1 113 | #define HAVE_MEMSET 1 114 | #define HAVE_MEMCPY 1 115 | #define HAVE_MEMMOVE 1 116 | #define HAVE_MEMCMP 1 117 | #define HAVE_WCSLEN 1 118 | #define HAVE_WCSLCPY 1 119 | #define HAVE_WCSLCAT 1 120 | #define HAVE_WCSCMP 1 121 | #define HAVE__WCSICMP 1 122 | #define HAVE__WCSNICMP 1 123 | #define HAVE_WCSLEN 1 124 | #define HAVE_WCSLCPY 1 125 | #define HAVE_WCSLCAT 1 126 | /* #undef HAVE_WCSDUP */ 127 | #define HAVE__WCSDUP 1 128 | #define HAVE_WCSSTR 1 129 | #define HAVE_WCSCMP 1 130 | #define HAVE_WCSNCMP 1 131 | #define HAVE_STRLEN 1 132 | #define HAVE_STRLCPY 1 133 | #define HAVE_STRLCAT 1 134 | #define HAVE__STRREV 1 135 | #define HAVE__STRUPR 1 136 | #define HAVE__STRLWR 1 137 | /* #undef HAVE_INDEX */ 138 | /* #undef HAVE_RINDEX */ 139 | #define HAVE_STRCHR 1 140 | #define HAVE_STRRCHR 1 141 | #define HAVE_STRSTR 1 142 | /* #undef HAVE_STRTOK_R */ 143 | #define HAVE_ITOA 1 144 | #define HAVE__LTOA 1 145 | #define HAVE__ULTOA 1 146 | #define HAVE_STRTOL 1 147 | #define HAVE_STRTOUL 1 148 | #define HAVE__I64TOA 1 149 | #define HAVE__UI64TOA 1 150 | #define HAVE_STRTOLL 1 151 | #define HAVE_STRTOULL 1 152 | #define HAVE_STRTOD 1 153 | #define HAVE_ATOI 1 154 | #define HAVE_ATOF 1 155 | #define HAVE_STRCMP 1 156 | #define HAVE_STRNCMP 1 157 | #define HAVE_STRICMP 1 158 | #define HAVE_STRCASECMP 1 159 | #define HAVE_STRNCASECMP 1 160 | #define HAVE_SSCANF 1 161 | #define HAVE_VSSCANF 1 162 | #define HAVE_SNPRINTF 1 163 | #define HAVE_VSNPRINTF 1 164 | #define HAVE_SETJMP 1 165 | #define HAVE_ACOS 1 166 | /* #undef HAVE_ACOSF */ 167 | #define HAVE_ASIN 1 168 | /* #undef HAVE_ASINF */ 169 | #define HAVE_ATAN 1 170 | #define HAVE_ATAN2 1 171 | /* #undef HAVE_ATAN2F */ 172 | #define HAVE_CEIL 1 173 | /* #undef HAVE_CEILF */ 174 | /* #undef HAVE_COPYSIGN */ 175 | /* #undef HAVE_COPYSIGNF */ 176 | #define HAVE_COS 1 177 | /* #undef HAVE_COSF */ 178 | #define HAVE_EXP 1 179 | /* #undef HAVE_EXPF */ 180 | #define HAVE_FABS 1 181 | /* #undef HAVE_FABSF */ 182 | #define HAVE_FLOOR 1 183 | /* #undef HAVE_FLOORF */ 184 | #define HAVE_FMOD 1 185 | /* #undef HAVE_FMODF */ 186 | #define HAVE_LOG 1 187 | /* #undef HAVE_LOGF */ 188 | #define HAVE_LOG10 1 189 | /* #undef HAVE_LOG10F */ 190 | #define HAVE_POW 1 191 | /* #undef HAVE_POWF */ 192 | #define HAVE_SIN 1 193 | /* #undef HAVE_SINF */ 194 | /* #undef HAVE_SCALBN */ 195 | /* #undef HAVE_SCALBNF */ 196 | #define HAVE_SQRT 1 197 | /* #undef HAVE_SQRTF */ 198 | #define HAVE_TAN 1 199 | /* #undef HAVE_TANF */ 200 | /* #undef HAVE_TRUNC */ 201 | /* #undef HAVE_TRUNCF */ 202 | /* #undef HAVE_LROUND */ 203 | /* #undef HAVE_LROUNDF */ 204 | /* #undef HAVE_ROUND */ 205 | /* #undef HAVE_ROUNDF */ 206 | 207 | #endif /* SDL_config_os2_h_ */ 208 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_config_pandora.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_pandora_h_ 23 | #define SDL_config_pandora_h_ 24 | #define SDL_config_h_ 25 | 26 | /* This is a set of defines to configure the SDL features */ 27 | 28 | /* General platform specific identifiers */ 29 | #include "SDL_platform.h" 30 | 31 | #ifdef __LP64__ 32 | #define SIZEOF_VOIDP 8 33 | #else 34 | #define SIZEOF_VOIDP 4 35 | #endif 36 | 37 | #define SDL_BYTEORDER 1234 38 | 39 | #define STDC_HEADERS 1 40 | #define HAVE_ALLOCA_H 1 41 | #define HAVE_CTYPE_H 1 42 | #define HAVE_ICONV_H 1 43 | #define HAVE_INTTYPES_H 1 44 | #define HAVE_LIMITS_H 1 45 | #define HAVE_MALLOC_H 1 46 | #define HAVE_MATH_H 1 47 | #define HAVE_MEMORY_H 1 48 | #define HAVE_SIGNAL_H 1 49 | #define HAVE_STDARG_H 1 50 | #define HAVE_STDINT_H 1 51 | #define HAVE_STDIO_H 1 52 | #define HAVE_STDLIB_H 1 53 | #define HAVE_STRINGS_H 1 54 | #define HAVE_STRING_H 1 55 | #define HAVE_SYS_TYPES_H 1 56 | 57 | #define HAVE_DLOPEN 1 58 | #define HAVE_MALLOC 1 59 | #define HAVE_CALLOC 1 60 | #define HAVE_REALLOC 1 61 | #define HAVE_FREE 1 62 | #define HAVE_ALLOCA 1 63 | #define HAVE_GETENV 1 64 | #define HAVE_SETENV 1 65 | #define HAVE_PUTENV 1 66 | #define HAVE_UNSETENV 1 67 | #define HAVE_QSORT 1 68 | #define HAVE_BSEARCH 1 69 | #define HAVE_ABS 1 70 | #define HAVE_BCOPY 1 71 | #define HAVE_MEMSET 1 72 | #define HAVE_MEMCPY 1 73 | #define HAVE_MEMMOVE 1 74 | #define HAVE_STRLEN 1 75 | #define HAVE_STRCHR 1 76 | #define HAVE_STRRCHR 1 77 | #define HAVE_STRSTR 1 78 | #define HAVE_STRTOL 1 79 | #define HAVE_STRTOUL 1 80 | #define HAVE_STRTOLL 1 81 | #define HAVE_STRTOULL 1 82 | #define HAVE_ATOI 1 83 | #define HAVE_ATOF 1 84 | #define HAVE_STRCMP 1 85 | #define HAVE_STRNCMP 1 86 | #define HAVE_STRCASECMP 1 87 | #define HAVE_STRNCASECMP 1 88 | #define HAVE_VSSCANF 1 89 | #define HAVE_VSNPRINTF 1 90 | #define HAVE_M_PI 1 91 | #define HAVE_CEIL 1 92 | #define HAVE_COPYSIGN 1 93 | #define HAVE_COS 1 94 | #define HAVE_COSF 1 95 | #define HAVE_EXP 1 96 | #define HAVE_FABS 1 97 | #define HAVE_FLOOR 1 98 | #define HAVE_LOG 1 99 | #define HAVE_LOG10 1 100 | #define HAVE_LROUND 1 101 | #define HAVE_LROUNDF 1 102 | #define HAVE_ROUND 1 103 | #define HAVE_ROUNDF 1 104 | #define HAVE_SCALBN 1 105 | #define HAVE_SIN 1 106 | #define HAVE_SINF 1 107 | #define HAVE_SQRT 1 108 | #define HAVE_SQRTF 1 109 | #define HAVE_TAN 1 110 | #define HAVE_TANF 1 111 | #define HAVE_TRUNC 1 112 | #define HAVE_TRUNCF 1 113 | #define HAVE_SIGACTION 1 114 | #define HAVE_SETJMP 1 115 | #define HAVE_NANOSLEEP 1 116 | 117 | #define SDL_AUDIO_DRIVER_DUMMY 1 118 | #define SDL_AUDIO_DRIVER_OSS 1 119 | 120 | #define SDL_INPUT_LINUXEV 1 121 | #define SDL_JOYSTICK_LINUX 1 122 | #define SDL_JOYSTICK_VIRTUAL 1 123 | #define SDL_HAPTIC_LINUX 1 124 | 125 | #define SDL_SENSOR_DUMMY 1 126 | 127 | #define SDL_LOADSO_DLOPEN 1 128 | 129 | #define SDL_THREAD_PTHREAD 1 130 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 131 | 132 | #define SDL_TIMER_UNIX 1 133 | #define SDL_FILESYSTEM_UNIX 1 134 | 135 | #define SDL_VIDEO_DRIVER_DUMMY 1 136 | #define SDL_VIDEO_DRIVER_X11 1 137 | #define SDL_VIDEO_DRIVER_PANDORA 1 138 | #define SDL_VIDEO_RENDER_OGL_ES 1 139 | #define SDL_VIDEO_OPENGL_ES 1 140 | 141 | #endif /* SDL_config_pandora_h_ */ 142 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | 41 | 42 | /** 43 | * Set the SDL error message for the current thread. 44 | * 45 | * Calling this function will replace any previous error message that was set. 46 | * 47 | * This function always returns -1, since SDL frequently uses -1 to signify an 48 | * failing result, leading to this idiom: 49 | * 50 | * ```c 51 | * if (error_code) { 52 | * return SDL_SetError("This operation has failed: %d", error_code); 53 | * } 54 | * ``` 55 | * 56 | * \param fmt a printf()-style message format string 57 | * \param ... additional parameters matching % tokens in the `fmt` string, if 58 | * any 59 | * \returns always -1. 60 | * 61 | * \since This function is available since SDL 2.0.0. 62 | * 63 | * \sa SDL_ClearError 64 | * \sa SDL_GetError 65 | */ 66 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 67 | 68 | /** 69 | * Retrieve a message about the last error that occurred on the current 70 | * thread. 71 | * 72 | * It is possible for multiple errors to occur before calling SDL_GetError(). 73 | * Only the last error is returned. 74 | * 75 | * The message is only applicable when an SDL function has signaled an error. 76 | * You must check the return values of SDL function calls to determine when to 77 | * appropriately call SDL_GetError(). You should *not* use the results of 78 | * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set 79 | * an error string even when reporting success. 80 | * 81 | * SDL will *not* clear the error string for successful API calls. You *must* 82 | * check return values for failure cases before you can assume the error 83 | * string applies. 84 | * 85 | * Error strings are set per-thread, so an error set in a different thread 86 | * will not interfere with the current thread's operation. 87 | * 88 | * The returned string is internally allocated and must not be freed by the 89 | * application. 90 | * 91 | * \returns a message with information about the specific error that occurred, 92 | * or an empty string if there hasn't been an error message set since 93 | * the last call to SDL_ClearError(). The message is only applicable 94 | * when an SDL function has signaled an error. You must check the 95 | * return values of SDL function calls to determine when to 96 | * appropriately call SDL_GetError(). 97 | * 98 | * \since This function is available since SDL 2.0.0. 99 | * 100 | * \sa SDL_ClearError 101 | * \sa SDL_SetError 102 | */ 103 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 104 | 105 | /** 106 | * Get the last error message that was set for the current thread. 107 | * 108 | * This allows the caller to copy the error string into a provided buffer, but 109 | * otherwise operates exactly the same as SDL_GetError(). 110 | * 111 | * \param errstr A buffer to fill with the last error message that was set for 112 | * the current thread 113 | * \param maxlen The size of the buffer pointed to by the errstr parameter 114 | * \returns the pointer passed in as the `errstr` parameter. 115 | * 116 | * \since This function is available since SDL 2.0.14. 117 | * 118 | * \sa SDL_GetError 119 | */ 120 | extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); 121 | 122 | /** 123 | * Clear any previous error message for this thread. 124 | * 125 | * \since This function is available since SDL 2.0.0. 126 | * 127 | * \sa SDL_GetError 128 | * \sa SDL_SetError 129 | */ 130 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 131 | 132 | /** 133 | * \name Internal error functions 134 | * 135 | * \internal 136 | * Private error reporting function - used internally. 137 | */ 138 | /* @{ */ 139 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 140 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 141 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 142 | typedef enum 143 | { 144 | SDL_ENOMEM, 145 | SDL_EFREAD, 146 | SDL_EFWRITE, 147 | SDL_EFSEEK, 148 | SDL_UNSUPPORTED, 149 | SDL_LASTERROR 150 | } SDL_errorcode; 151 | /* SDL_Error() unconditionally returns -1. */ 152 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 153 | /* @} *//* Internal error functions */ 154 | 155 | /* Ends C function definitions when using C++ */ 156 | #ifdef __cplusplus 157 | } 158 | #endif 159 | #include "close_code.h" 160 | 161 | #endif /* SDL_error_h_ */ 162 | 163 | /* vi: set ts=4 sw=4 expandtab: */ 164 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_filesystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_filesystem.h 24 | * 25 | * \brief Include file for filesystem SDL API functions 26 | */ 27 | 28 | #ifndef SDL_filesystem_h_ 29 | #define SDL_filesystem_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Get the directory where the application was run from. 42 | * 43 | * This is not necessarily a fast call, so you should call this once near 44 | * startup and save the string if you need it. 45 | * 46 | * **Mac OS X and iOS Specific Functionality**: If the application is in a 47 | * ".app" bundle, this function returns the Resource directory (e.g. 48 | * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding 49 | * a property to the Info.plist file. Adding a string key with the name 50 | * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the 51 | * behaviour. 52 | * 53 | * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an 54 | * application in /Applications/SDLApp/MyApp.app): 55 | * 56 | * - `resource`: bundle resource directory (the default). For example: 57 | * `/Applications/SDLApp/MyApp.app/Contents/Resources` 58 | * - `bundle`: the Bundle directory. For example: 59 | * `/Applications/SDLApp/MyApp.app/` 60 | * - `parent`: the containing directory of the bundle. For example: 61 | * `/Applications/SDLApp/` 62 | * 63 | * The returned path is guaranteed to end with a path separator ('\' on 64 | * Windows, '/' on most other platforms). 65 | * 66 | * The pointer returned is owned by the caller. Please call SDL_free() on the 67 | * pointer when done with it. 68 | * 69 | * \returns an absolute path in UTF-8 encoding to the application data 70 | * directory. NULL will be returned on error or when the platform 71 | * doesn't implement this functionality, call SDL_GetError() for more 72 | * information. 73 | * 74 | * \since This function is available since SDL 2.0.1. 75 | * 76 | * \sa SDL_GetPrefPath 77 | */ 78 | extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); 79 | 80 | /** 81 | * Get the user-and-app-specific path where files can be written. 82 | * 83 | * Get the "pref dir". This is meant to be where users can write personal 84 | * files (preferences and save games, etc) that are specific to your 85 | * application. This directory is unique per user, per application. 86 | * 87 | * This function will decide the appropriate location in the native 88 | * filesystem, create the directory if necessary, and return a string of the 89 | * absolute path to the directory in UTF-8 encoding. 90 | * 91 | * On Windows, the string might look like: 92 | * 93 | * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\` 94 | * 95 | * On Linux, the string might look like: 96 | * 97 | * `/home/bob/.local/share/My Program Name/` 98 | * 99 | * On Mac OS X, the string might look like: 100 | * 101 | * `/Users/bob/Library/Application Support/My Program Name/` 102 | * 103 | * You should assume the path returned by this function is the only safe place 104 | * to write files (and that SDL_GetBasePath(), while it might be writable, or 105 | * even the parent of the returned path, isn't where you should be writing 106 | * things). 107 | * 108 | * Both the org and app strings may become part of a directory name, so please 109 | * follow these rules: 110 | * 111 | * - Try to use the same org string (_including case-sensitivity_) for all 112 | * your applications that use this function. 113 | * - Always use a unique app string for each one, and make sure it never 114 | * changes for an app once you've decided on it. 115 | * - Unicode characters are legal, as long as it's UTF-8 encoded, but... 116 | * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game 117 | * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. 118 | * 119 | * The returned path is guaranteed to end with a path separator ('\' on 120 | * Windows, '/' on most other platforms). 121 | * 122 | * The pointer returned is owned by the caller. Please call SDL_free() on the 123 | * pointer when done with it. 124 | * 125 | * \param org the name of your organization 126 | * \param app the name of your application 127 | * \returns a UTF-8 string of the user directory in platform-dependent 128 | * notation. NULL if there's a problem (creating directory failed, 129 | * etc.). 130 | * 131 | * \since This function is available since SDL 2.0.1. 132 | * 133 | * \sa SDL_GetBasePath 134 | */ 135 | extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); 136 | 137 | /* Ends C function definitions when using C++ */ 138 | #ifdef __cplusplus 139 | } 140 | #endif 141 | #include "close_code.h" 142 | 143 | #endif /* SDL_filesystem_h_ */ 144 | 145 | /* vi: set ts=4 sw=4 expandtab: */ 146 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * Begin recording a gesture on a specified touch device or all touch devices. 50 | * 51 | * If the parameter `touchId` is -1 (i.e., all devices), this function will 52 | * always return 1, regardless of whether there actually are any devices. 53 | * 54 | * \param touchId the touch device id, or -1 for all touch devices 55 | * \returns 1 on success or 0 if the specified device could not be found. 56 | * 57 | * \since This function is available since SDL 2.0.0. 58 | * 59 | * \sa SDL_GetTouchDevice 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 62 | 63 | 64 | /** 65 | * Save all currently loaded Dollar Gesture templates. 66 | * 67 | * \param dst a SDL_RWops to save to 68 | * \returns the number of saved templates on success or 0 on failure; call 69 | * SDL_GetError() for more information. 70 | * 71 | * \since This function is available since SDL 2.0.0. 72 | * 73 | * \sa SDL_LoadDollarTemplates 74 | * \sa SDL_SaveDollarTemplate 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 77 | 78 | /** 79 | * Save a currently loaded Dollar Gesture template. 80 | * 81 | * \param gestureId a gesture id 82 | * \param dst a SDL_RWops to save to 83 | * \returns 1 on success or 0 on failure; call SDL_GetError() for more 84 | * information. 85 | * 86 | * \since This function is available since SDL 2.0.0. 87 | * 88 | * \sa SDL_LoadDollarTemplates 89 | * \sa SDL_SaveAllDollarTemplates 90 | */ 91 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 92 | 93 | 94 | /** 95 | * Load Dollar Gesture templates from a file. 96 | * 97 | * \param touchId a touch id 98 | * \param src a SDL_RWops to load from 99 | * \returns the number of loaded templates on success or a negative error code 100 | * (or 0) on failure; call SDL_GetError() for more information. 101 | * 102 | * \since This function is available since SDL 2.0.0. 103 | * 104 | * \sa SDL_SaveAllDollarTemplates 105 | * \sa SDL_SaveDollarTemplate 106 | */ 107 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 108 | 109 | /* Ends C function definitions when using C++ */ 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | #include "close_code.h" 114 | 115 | #endif /* SDL_gesture_h_ */ 116 | 117 | /* vi: set ts=4 sw=4 expandtab: */ 118 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_guid.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_guid.h 24 | * 25 | * Include file for handling ::SDL_GUID values. 26 | */ 27 | 28 | #ifndef SDL_guid_h_ 29 | #define SDL_guid_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * An SDL_GUID is a 128-bit identifier for an input device that 42 | * identifies that device across runs of SDL programs on the same 43 | * platform. If the device is detached and then re-attached to a 44 | * different port, or if the base system is rebooted, the device 45 | * should still report the same GUID. 46 | * 47 | * GUIDs are as precise as possible but are not guaranteed to 48 | * distinguish physically distinct but equivalent devices. For 49 | * example, two game controllers from the same vendor with the same 50 | * product ID and revision may have the same GUID. 51 | * 52 | * GUIDs may be platform-dependent (i.e., the same device may report 53 | * different GUIDs on different operating systems). 54 | */ 55 | typedef struct { 56 | Uint8 data[16]; 57 | } SDL_GUID; 58 | 59 | /* Function prototypes */ 60 | 61 | /** 62 | * Get an ASCII string representation for a given ::SDL_GUID. 63 | * 64 | * You should supply at least 33 bytes for pszGUID. 65 | * 66 | * \param guid the ::SDL_GUID you wish to convert to string 67 | * \param pszGUID buffer in which to write the ASCII string 68 | * \param cbGUID the size of pszGUID 69 | * 70 | * \since This function is available since SDL 2.24.0. 71 | * 72 | * \sa SDL_GUIDFromString 73 | */ 74 | extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); 75 | 76 | /** 77 | * Convert a GUID string into a ::SDL_GUID structure. 78 | * 79 | * Performs no error checking. If this function is given a string containing 80 | * an invalid GUID, the function will silently succeed, but the GUID generated 81 | * will not be useful. 82 | * 83 | * \param pchGUID string containing an ASCII representation of a GUID 84 | * \returns a ::SDL_GUID structure. 85 | * 86 | * \since This function is available since SDL 2.24.0. 87 | * 88 | * \sa SDL_GUIDToString 89 | */ 90 | extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID); 91 | 92 | /* Ends C function definitions when using C++ */ 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | #include "close_code.h" 97 | 98 | #endif /* SDL_guid_h_ */ 99 | 100 | /* vi: set ts=4 sw=4 expandtab: */ 101 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * Dynamically load a shared object. 55 | * 56 | * \param sofile a system-dependent name of the object file 57 | * \returns an opaque pointer to the object handle or NULL if there was an 58 | * error; call SDL_GetError() for more information. 59 | * 60 | * \since This function is available since SDL 2.0.0. 61 | * 62 | * \sa SDL_LoadFunction 63 | * \sa SDL_UnloadObject 64 | */ 65 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 66 | 67 | /** 68 | * Look up the address of the named function in a shared object. 69 | * 70 | * This function pointer is no longer valid after calling SDL_UnloadObject(). 71 | * 72 | * This function can only look up C function names. Other languages may have 73 | * name mangling and intrinsic language support that varies from compiler to 74 | * compiler. 75 | * 76 | * Make sure you declare your function pointers with the same calling 77 | * convention as the actual library function. Your code will crash 78 | * mysteriously if you do not do this. 79 | * 80 | * If the requested function doesn't exist, NULL is returned. 81 | * 82 | * \param handle a valid shared object handle returned by SDL_LoadObject() 83 | * \param name the name of the function to look up 84 | * \returns a pointer to the function or NULL if there was an error; call 85 | * SDL_GetError() for more information. 86 | * 87 | * \since This function is available since SDL 2.0.0. 88 | * 89 | * \sa SDL_LoadObject 90 | * \sa SDL_UnloadObject 91 | */ 92 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 93 | const char *name); 94 | 95 | /** 96 | * Unload a shared object from memory. 97 | * 98 | * \param handle a valid shared object handle returned by SDL_LoadObject() 99 | * 100 | * \since This function is available since SDL 2.0.0. 101 | * 102 | * \sa SDL_LoadFunction 103 | * \sa SDL_LoadObject 104 | */ 105 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 106 | 107 | /* Ends C function definitions when using C++ */ 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | #include "close_code.h" 112 | 113 | #endif /* SDL_loadso_h_ */ 114 | 115 | /* vi: set ts=4 sw=4 expandtab: */ 116 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_locale.h 24 | * 25 | * Include file for SDL locale services 26 | */ 27 | 28 | #ifndef _SDL_locale_h 29 | #define _SDL_locale_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | /* *INDENT-OFF* */ 38 | extern "C" { 39 | /* *INDENT-ON* */ 40 | #endif 41 | 42 | 43 | typedef struct SDL_Locale 44 | { 45 | const char *language; /**< A language name, like "en" for English. */ 46 | const char *country; /**< A country, like "US" for America. Can be NULL. */ 47 | } SDL_Locale; 48 | 49 | /** 50 | * Report the user's preferred locale. 51 | * 52 | * This returns an array of SDL_Locale structs, the final item zeroed out. 53 | * When the caller is done with this array, it should call SDL_free() on the 54 | * returned value; all the memory involved is allocated in a single block, so 55 | * a single SDL_free() will suffice. 56 | * 57 | * Returned language strings are in the format xx, where 'xx' is an ISO-639 58 | * language specifier (such as "en" for English, "de" for German, etc). 59 | * Country strings are in the format YY, where "YY" is an ISO-3166 country 60 | * code (such as "US" for the United States, "CA" for Canada, etc). Country 61 | * might be NULL if there's no specific guidance on them (so you might get { 62 | * "en", "US" } for American English, but { "en", NULL } means "English 63 | * language, generically"). Language strings are never NULL, except to 64 | * terminate the array. 65 | * 66 | * Please note that not all of these strings are 2 characters; some are three 67 | * or more. 68 | * 69 | * The returned list of locales are in the order of the user's preference. For 70 | * example, a German citizen that is fluent in US English and knows enough 71 | * Japanese to navigate around Tokyo might have a list like: { "de", "en_US", 72 | * "jp", NULL }. Someone from England might prefer British English (where 73 | * "color" is spelled "colour", etc), but will settle for anything like it: { 74 | * "en_GB", "en", NULL }. 75 | * 76 | * This function returns NULL on error, including when the platform does not 77 | * supply this information at all. 78 | * 79 | * This might be a "slow" call that has to query the operating system. It's 80 | * best to ask for this once and save the results. However, this list can 81 | * change, usually because the user has changed a system preference outside of 82 | * your program; SDL will send an SDL_LOCALECHANGED event in this case, if 83 | * possible, and you can call this function again to get an updated copy of 84 | * preferred locales. 85 | * 86 | * \return array of locales, terminated with a locale with a NULL language 87 | * field. Will return NULL on error. 88 | * 89 | * \since This function is available since SDL 2.0.14. 90 | */ 91 | extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); 92 | 93 | /* Ends C function definitions when using C++ */ 94 | #ifdef __cplusplus 95 | /* *INDENT-OFF* */ 96 | } 97 | /* *INDENT-ON* */ 98 | #endif 99 | #include "close_code.h" 100 | 101 | #endif /* _SDL_locale_h */ 102 | 103 | /* vi: set ts=4 sw=4 expandtab: */ 104 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_metal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_metal.h 24 | * 25 | * Header file for functions to creating Metal layers and views on SDL windows. 26 | */ 27 | 28 | #ifndef SDL_metal_h_ 29 | #define SDL_metal_h_ 30 | 31 | #include "SDL_video.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). 41 | * 42 | * \note This can be cast directly to an NSView or UIView. 43 | */ 44 | typedef void *SDL_MetalView; 45 | 46 | /** 47 | * \name Metal support functions 48 | */ 49 | /* @{ */ 50 | 51 | /** 52 | * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified 53 | * window. 54 | * 55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on 56 | * its own. It is up to user code to do that. 57 | * 58 | * The returned handle can be casted directly to a NSView or UIView. To access 59 | * the backing CAMetalLayer, call SDL_Metal_GetLayer(). 60 | * 61 | * \since This function is available since SDL 2.0.12. 62 | * 63 | * \sa SDL_Metal_DestroyView 64 | * \sa SDL_Metal_GetLayer 65 | */ 66 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); 67 | 68 | /** 69 | * Destroy an existing SDL_MetalView object. 70 | * 71 | * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was 72 | * called after SDL_CreateWindow. 73 | * 74 | * \since This function is available since SDL 2.0.12. 75 | * 76 | * \sa SDL_Metal_CreateView 77 | */ 78 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); 79 | 80 | /** 81 | * Get a pointer to the backing CAMetalLayer for the given view. 82 | * 83 | * \since This function is available since SDL 2.0.14. 84 | * 85 | * \sa SDL_MetalCreateView 86 | */ 87 | extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); 88 | 89 | /** 90 | * Get the size of a window's underlying drawable in pixels (for use with 91 | * setting viewport, scissor & etc). 92 | * 93 | * \param window SDL_Window from which the drawable size should be queried 94 | * \param w Pointer to variable for storing the width in pixels, may be NULL 95 | * \param h Pointer to variable for storing the height in pixels, may be NULL 96 | * 97 | * \since This function is available since SDL 2.0.14. 98 | * 99 | * \sa SDL_GetWindowSize 100 | * \sa SDL_CreateWindow 101 | */ 102 | extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, 103 | int *h); 104 | 105 | /* @} *//* Metal support functions */ 106 | 107 | /* Ends C function definitions when using C++ */ 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | #include "close_code.h" 112 | 113 | #endif /* SDL_metal_h_ */ 114 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_misc.h 24 | * 25 | * \brief Include file for SDL API functions that don't fit elsewhere. 26 | */ 27 | 28 | #ifndef SDL_misc_h_ 29 | #define SDL_misc_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Open a URL/URI in the browser or other appropriate external application. 42 | * 43 | * Open a URL in a separate, system-provided application. How this works will 44 | * vary wildly depending on the platform. This will likely launch what makes 45 | * sense to handle a specific URL's protocol (a web browser for `http://`, 46 | * etc), but it might also be able to launch file managers for directories and 47 | * other things. 48 | * 49 | * What happens when you open a URL varies wildly as well: your game window 50 | * may lose focus (and may or may not lose focus if your game was fullscreen 51 | * or grabbing input at the time). On mobile devices, your app will likely 52 | * move to the background or your process might be paused. Any given platform 53 | * may or may not handle a given URL. 54 | * 55 | * If this is unimplemented (or simply unavailable) for a platform, this will 56 | * fail with an error. A successful result does not mean the URL loaded, just 57 | * that we launched _something_ to handle it (or at least believe we did). 58 | * 59 | * All this to say: this function can be useful, but you should definitely 60 | * test it on every platform you target. 61 | * 62 | * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for 63 | * local files, if supported. 64 | * \returns 0 on success, or -1 on error; call SDL_GetError() for more 65 | * information. 66 | * 67 | * \since This function is available since SDL 2.0.14. 68 | */ 69 | extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); 70 | 71 | /* Ends C function definitions when using C++ */ 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #include "close_code.h" 76 | 77 | #endif /* SDL_misc_h_ */ 78 | 79 | /* vi: set ts=4 sw=4 expandtab: */ 80 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * Get the current power supply details. 54 | * 55 | * You should never take a battery status as absolute truth. Batteries 56 | * (especially failing batteries) are delicate hardware, and the values 57 | * reported here are best estimates based on what that hardware reports. It's 58 | * not uncommon for older batteries to lose stored power much faster than it 59 | * reports, or completely drain when reporting it has 20 percent left, etc. 60 | * 61 | * Battery status can change at any time; if you are concerned with power 62 | * state, you should call this function frequently, and perhaps ignore changes 63 | * until they seem to be stable for a few seconds. 64 | * 65 | * It's possible a platform can only report battery percentage or time left 66 | * but not both. 67 | * 68 | * \param secs seconds of battery life left, you can pass a NULL here if you 69 | * don't care, will return -1 if we can't determine a value, or 70 | * we're not running on a battery 71 | * \param pct percentage of battery life left, between 0 and 100, you can pass 72 | * a NULL here if you don't care, will return -1 if we can't 73 | * determine a value, or we're not running on a battery 74 | * \returns an SDL_PowerState enum representing the current battery state. 75 | * 76 | * \since This function is available since SDL 2.0.0. 77 | */ 78 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 79 | 80 | /* Ends C function definitions when using C++ */ 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | #include "close_code.h" 85 | 86 | #endif /* SDL_power_h_ */ 87 | 88 | /* vi: set ts=4 sw=4 expandtab: */ 89 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "" 2 | #define SDL_REVISION_NUMBER 0 3 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_revision.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine SDL_REVISION "@SDL_REVISION@" 2 | #define SDL_REVISION_NUMBER 0 3 | 4 | #ifndef SDL_REVISION 5 | #define SDL_REVISION "" 6 | #endif 7 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_assert.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Assert API for test code and test cases 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_assert_h_ 37 | #define SDL_test_assert_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Fails the assert. 47 | */ 48 | #define ASSERT_FAIL 0 49 | 50 | /** 51 | * \brief Passes the assert. 52 | */ 53 | #define ASSERT_PASS 1 54 | 55 | /** 56 | * \brief Assert that logs and break execution flow on failures. 57 | * 58 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). 59 | * \param assertDescription Message to log with the assert describing it. 60 | */ 61 | void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); 62 | 63 | /** 64 | * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. 65 | * 66 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). 67 | * \param assertDescription Message to log with the assert describing it. 68 | * 69 | * \returns the assertCondition so it can be used to externally to break execution flow if desired. 70 | */ 71 | int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); 72 | 73 | /** 74 | * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. 75 | * 76 | * \param assertDescription Message to log with the assert describing it. 77 | */ 78 | void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); 79 | 80 | /** 81 | * \brief Resets the assert summary counters to zero. 82 | */ 83 | void SDLTest_ResetAssertSummary(void); 84 | 85 | /** 86 | * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. 87 | */ 88 | void SDLTest_LogAssertSummary(void); 89 | 90 | 91 | /** 92 | * \brief Converts the current assert summary state to a test result. 93 | * 94 | * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT 95 | */ 96 | int SDLTest_AssertSummaryToTestResult(void); 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | #include "close_code.h" 102 | 103 | #endif /* SDL_test_assert_h_ */ 104 | 105 | /* vi: set ts=4 sw=4 expandtab: */ 106 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_crc32.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_crc32.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Implements CRC32 calculations (default output is Perl String::CRC32 compatible). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_crc32_h_ 37 | #define SDL_test_crc32_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | 46 | /* ------------ Definitions --------- */ 47 | 48 | /* Definition shared by all CRC routines */ 49 | 50 | #ifndef CrcUint32 51 | #define CrcUint32 unsigned int 52 | #endif 53 | #ifndef CrcUint8 54 | #define CrcUint8 unsigned char 55 | #endif 56 | 57 | #ifdef ORIGINAL_METHOD 58 | #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ 59 | #else 60 | #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ 61 | #endif 62 | 63 | /** 64 | * Data structure for CRC32 (checksum) computation 65 | */ 66 | typedef struct { 67 | CrcUint32 crc32_table[256]; /* CRC table */ 68 | } SDLTest_Crc32Context; 69 | 70 | /* ---------- Function Prototypes ------------- */ 71 | 72 | /** 73 | * \brief Initialize the CRC context 74 | * 75 | * Note: The function initializes the crc table required for all crc calculations. 76 | * 77 | * \param crcContext pointer to context variable 78 | * 79 | * \returns 0 for OK, -1 on error 80 | * 81 | */ 82 | int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); 83 | 84 | 85 | /** 86 | * \brief calculate a crc32 from a data block 87 | * 88 | * \param crcContext pointer to context variable 89 | * \param inBuf input buffer to checksum 90 | * \param inLen length of input buffer 91 | * \param crc32 pointer to Uint32 to store the final CRC into 92 | * 93 | * \returns 0 for OK, -1 on error 94 | * 95 | */ 96 | int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); 97 | 98 | /* Same routine broken down into three steps */ 99 | int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); 100 | int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); 101 | int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); 102 | 103 | 104 | /** 105 | * \brief clean up CRC context 106 | * 107 | * \param crcContext pointer to context variable 108 | * 109 | * \returns 0 for OK, -1 on error 110 | * 111 | */ 112 | 113 | int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); 114 | 115 | 116 | /* Ends C function definitions when using C++ */ 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | #include "close_code.h" 121 | 122 | #endif /* SDL_test_crc32_h_ */ 123 | 124 | /* vi: set ts=4 sw=4 expandtab: */ 125 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_font.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_font_h_ 31 | #define SDL_test_font_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | #define FONT_CHARACTER_SIZE 8 42 | #define FONT_LINE_HEIGHT (FONT_CHARACTER_SIZE + 2) 43 | 44 | /** 45 | * \brief Draw a string in the currently set font. 46 | * 47 | * \param renderer The renderer to draw on. 48 | * \param x The X coordinate of the upper left corner of the character. 49 | * \param y The Y coordinate of the upper left corner of the character. 50 | * \param c The character to draw. 51 | * 52 | * \returns 0 on success, -1 on failure. 53 | */ 54 | int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c); 55 | 56 | /** 57 | * \brief Draw a UTF-8 string in the currently set font. 58 | * 59 | * The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets. 60 | * 61 | * \param renderer The renderer to draw on. 62 | * \param x The X coordinate of the upper left corner of the string. 63 | * \param y The Y coordinate of the upper left corner of the string. 64 | * \param s The string to draw. 65 | * 66 | * \returns 0 on success, -1 on failure. 67 | */ 68 | int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); 69 | 70 | /** 71 | * \brief Data used for multi-line text output 72 | */ 73 | typedef struct SDLTest_TextWindow 74 | { 75 | SDL_Rect rect; 76 | int current; 77 | int numlines; 78 | char **lines; 79 | } SDLTest_TextWindow; 80 | 81 | /** 82 | * \brief Create a multi-line text output window 83 | * 84 | * \param x The X coordinate of the upper left corner of the window. 85 | * \param y The Y coordinate of the upper left corner of the window. 86 | * \param w The width of the window (currently ignored) 87 | * \param h The height of the window (currently ignored) 88 | * 89 | * \returns the new window, or NULL on failure. 90 | * 91 | * \since This function is available since SDL 2.24.0 92 | */ 93 | SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h); 94 | 95 | /** 96 | * \brief Display a multi-line text output window 97 | * 98 | * This function should be called every frame to display the text 99 | * 100 | * \param textwin The text output window 101 | * \param renderer The renderer to use for display 102 | * 103 | * \since This function is available since SDL 2.24.0 104 | */ 105 | void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer); 106 | 107 | /** 108 | * \brief Add text to a multi-line text output window 109 | * 110 | * Adds UTF-8 text to the end of the current text. The newline character starts a 111 | * new line of text. The backspace character deletes the last character or, if the 112 | * line is empty, deletes the line and goes to the end of the previous line. 113 | * 114 | * \param textwin The text output window 115 | * \param fmt A printf() style format string 116 | * \param ... additional parameters matching % tokens in the `fmt` string, if any 117 | * 118 | * \since This function is available since SDL 2.24.0 119 | */ 120 | void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 121 | 122 | /** 123 | * \brief Add text to a multi-line text output window 124 | * 125 | * Adds UTF-8 text to the end of the current text. The newline character starts a 126 | * new line of text. The backspace character deletes the last character or, if the 127 | * line is empty, deletes the line and goes to the end of the previous line. 128 | * 129 | * \param textwin The text output window 130 | * \param text The text to add to the window 131 | * \param len The length, in bytes, of the text to add to the window 132 | * 133 | * \since This function is available since SDL 2.24.0 134 | */ 135 | void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len); 136 | 137 | /** 138 | * \brief Clear the text in a multi-line text output window 139 | * 140 | * \param textwin The text output window 141 | * 142 | * \since This function is available since SDL 2.24.0 143 | */ 144 | void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin); 145 | 146 | /** 147 | * \brief Free the storage associated with a multi-line text output window 148 | * 149 | * \param textwin The text output window 150 | * 151 | * \since This function is available since SDL 2.24.0 152 | */ 153 | void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin); 154 | 155 | /** 156 | * \brief Cleanup textures used by font drawing functions. 157 | */ 158 | void SDLTest_CleanupTextDrawing(void); 159 | 160 | /* Ends C function definitions when using C++ */ 161 | #ifdef __cplusplus 162 | } 163 | #endif 164 | #include "close_code.h" 165 | 166 | #endif /* SDL_test_font_h_ */ 167 | 168 | /* vi: set ts=4 sw=4 expandtab: */ 169 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_harness.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_harness.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | Defines types for test case definitions and the test execution harness API. 32 | 33 | Based on original GSOC code by Markus Kauppila 34 | */ 35 | 36 | #ifndef SDL_test_h_arness_h 37 | #define SDL_test_h_arness_h 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | 46 | /* ! Definitions for test case structures */ 47 | #define TEST_ENABLED 1 48 | #define TEST_DISABLED 0 49 | 50 | /* ! Definition of all the possible test return values of the test case method */ 51 | #define TEST_ABORTED -1 52 | #define TEST_STARTED 0 53 | #define TEST_COMPLETED 1 54 | #define TEST_SKIPPED 2 55 | 56 | /* ! Definition of all the possible test results for the harness */ 57 | #define TEST_RESULT_PASSED 0 58 | #define TEST_RESULT_FAILED 1 59 | #define TEST_RESULT_NO_ASSERT 2 60 | #define TEST_RESULT_SKIPPED 3 61 | #define TEST_RESULT_SETUP_FAILURE 4 62 | 63 | /* !< Function pointer to a test case setup function (run before every test) */ 64 | typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); 65 | 66 | /* !< Function pointer to a test case function */ 67 | typedef int (*SDLTest_TestCaseFp)(void *arg); 68 | 69 | /* !< Function pointer to a test case teardown function (run after every test) */ 70 | typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); 71 | 72 | /** 73 | * Holds information about a single test case. 74 | */ 75 | typedef struct SDLTest_TestCaseReference { 76 | /* !< Func2Stress */ 77 | SDLTest_TestCaseFp testCase; 78 | /* !< Short name (or function name) "Func2Stress" */ 79 | const char *name; 80 | /* !< Long name or full description "This test pushes func2() to the limit." */ 81 | const char *description; 82 | /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ 83 | int enabled; 84 | } SDLTest_TestCaseReference; 85 | 86 | /** 87 | * Holds information about a test suite (multiple test cases). 88 | */ 89 | typedef struct SDLTest_TestSuiteReference { 90 | /* !< "PlatformSuite" */ 91 | const char *name; 92 | /* !< The function that is run before each test. NULL skips. */ 93 | SDLTest_TestCaseSetUpFp testSetUp; 94 | /* !< The test cases that are run as part of the suite. Last item should be NULL. */ 95 | const SDLTest_TestCaseReference **testCases; 96 | /* !< The function that is run after each test. NULL skips. */ 97 | SDLTest_TestCaseTearDownFp testTearDown; 98 | } SDLTest_TestSuiteReference; 99 | 100 | 101 | /** 102 | * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). 103 | * 104 | * Note: The returned string needs to be deallocated by the caller. 105 | * 106 | * \param length The length of the seed string to generate 107 | * 108 | * \returns the generated seed string 109 | */ 110 | char *SDLTest_GenerateRunSeed(const int length); 111 | 112 | /** 113 | * \brief Execute a test suite using the given run seed and execution key. 114 | * 115 | * \param testSuites Suites containing the test case. 116 | * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. 117 | * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. 118 | * \param filter Filter specification. NULL disables. Case sensitive. 119 | * \param testIterations Number of iterations to run each test case. 120 | * 121 | * \returns the test run result: 0 when all tests passed, 1 if any tests failed. 122 | */ 123 | int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); 124 | 125 | 126 | /* Ends C function definitions when using C++ */ 127 | #ifdef __cplusplus 128 | } 129 | #endif 130 | #include "close_code.h" 131 | 132 | #endif /* SDL_test_h_arness_h */ 133 | 134 | /* vi: set ts=4 sw=4 expandtab: */ 135 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_md5.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | *********************************************************************** 32 | ** Header file for implementation of MD5 ** 33 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 34 | ** Created: 2/17/90 RLR ** 35 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 36 | ** Revised (for MD5): RLR 4/27/91 ** 37 | ** -- G modified to have y&~z instead of y&z ** 38 | ** -- FF, GG, HH modified to add in last register done ** 39 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 40 | ** -- distinct additive constant for each step ** 41 | ** -- round 4 added, working mod 7 ** 42 | *********************************************************************** 43 | */ 44 | 45 | /* 46 | *********************************************************************** 47 | ** Message-digest routines: ** 48 | ** To form the message digest for a message M ** 49 | ** (1) Initialize a context buffer mdContext using MD5Init ** 50 | ** (2) Call MD5Update on mdContext and M ** 51 | ** (3) Call MD5Final on mdContext ** 52 | ** The message digest is now in mdContext->digest[0...15] ** 53 | *********************************************************************** 54 | */ 55 | 56 | #ifndef SDL_test_md5_h_ 57 | #define SDL_test_md5_h_ 58 | 59 | #include "begin_code.h" 60 | /* Set up for C function definitions, even when using C++ */ 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | /* ------------ Definitions --------- */ 66 | 67 | /* typedef a 32-bit type */ 68 | typedef unsigned long int MD5UINT4; 69 | 70 | /* Data structure for MD5 (Message-Digest) computation */ 71 | typedef struct { 72 | MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ 73 | MD5UINT4 buf[4]; /* scratch buffer */ 74 | unsigned char in[64]; /* input buffer */ 75 | unsigned char digest[16]; /* actual digest after Md5Final call */ 76 | } SDLTest_Md5Context; 77 | 78 | /* ---------- Function Prototypes ------------- */ 79 | 80 | /** 81 | * \brief initialize the context 82 | * 83 | * \param mdContext pointer to context variable 84 | * 85 | * Note: The function initializes the message-digest context 86 | * mdContext. Call before each new use of the context - 87 | * all fields are set to zero. 88 | */ 89 | void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); 90 | 91 | 92 | /** 93 | * \brief update digest from variable length data 94 | * 95 | * \param mdContext pointer to context variable 96 | * \param inBuf pointer to data array/string 97 | * \param inLen length of data array/string 98 | * 99 | * Note: The function updates the message-digest context to account 100 | * for the presence of each of the characters inBuf[0..inLen-1] 101 | * in the message whose digest is being computed. 102 | */ 103 | 104 | void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, 105 | unsigned int inLen); 106 | 107 | 108 | /** 109 | * \brief complete digest computation 110 | * 111 | * \param mdContext pointer to context variable 112 | * 113 | * Note: The function terminates the message-digest computation and 114 | * ends with the desired message digest in mdContext.digest[0..15]. 115 | * Always call before using the digest[] variable. 116 | */ 117 | 118 | void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); 119 | 120 | 121 | /* Ends C function definitions when using C++ */ 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | #include "close_code.h" 126 | 127 | #endif /* SDL_test_md5_h_ */ 128 | 129 | /* vi: set ts=4 sw=4 expandtab: */ 130 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_test_random.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_random.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | A "32-bit Multiply with carry random number generator. Very fast. 33 | Includes a list of recommended multipliers. 34 | 35 | multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. 36 | period: (a*2^31)-1 37 | 38 | */ 39 | 40 | #ifndef SDL_test_random_h_ 41 | #define SDL_test_random_h_ 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /* --- Definitions */ 50 | 51 | /* 52 | * Macros that return a random number in a specific format. 53 | */ 54 | #define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) 55 | 56 | /* 57 | * Context structure for the random number generator state. 58 | */ 59 | typedef struct { 60 | unsigned int a; 61 | unsigned int x; 62 | unsigned int c; 63 | unsigned int ah; 64 | unsigned int al; 65 | } SDLTest_RandomContext; 66 | 67 | 68 | /* --- Function prototypes */ 69 | 70 | /** 71 | * \brief Initialize random number generator with two integers. 72 | * 73 | * Note: The random sequence of numbers returned by ...Random() is the 74 | * same for the same two integers and has a period of 2^31. 75 | * 76 | * \param rndContext pointer to context structure 77 | * \param xi integer that defines the random sequence 78 | * \param ci integer that defines the random sequence 79 | * 80 | */ 81 | void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, 82 | unsigned int ci); 83 | 84 | /** 85 | * \brief Initialize random number generator based on current system time. 86 | * 87 | * \param rndContext pointer to context structure 88 | * 89 | */ 90 | void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); 91 | 92 | 93 | /** 94 | * \brief Initialize random number generator based on current system time. 95 | * 96 | * Note: ...RandomInit() or ...RandomInitTime() must have been called 97 | * before using this function. 98 | * 99 | * \param rndContext pointer to context structure 100 | * 101 | * \returns a random number (32bit unsigned integer) 102 | * 103 | */ 104 | unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); 105 | 106 | 107 | /* Ends C function definitions when using C++ */ 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | #include "close_code.h" 112 | 113 | #endif /* SDL_test_random_h_ */ 114 | 115 | /* vi: set ts=4 sw=4 expandtab: */ 116 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_touch.h 24 | * 25 | * Include file for SDL touch event handling. 26 | */ 27 | 28 | #ifndef SDL_touch_h_ 29 | #define SDL_touch_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "begin_code.h" 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef Sint64 SDL_TouchID; 42 | typedef Sint64 SDL_FingerID; 43 | 44 | typedef enum 45 | { 46 | SDL_TOUCH_DEVICE_INVALID = -1, 47 | SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ 48 | SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ 49 | SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ 50 | } SDL_TouchDeviceType; 51 | 52 | typedef struct SDL_Finger 53 | { 54 | SDL_FingerID id; 55 | float x; 56 | float y; 57 | float pressure; 58 | } SDL_Finger; 59 | 60 | /* Used as the device ID for mouse events simulated with touch input */ 61 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) 62 | 63 | /* Used as the SDL_TouchID for touch events simulated with mouse input */ 64 | #define SDL_MOUSE_TOUCHID ((Sint64)-1) 65 | 66 | 67 | /** 68 | * Get the number of registered touch devices. 69 | * 70 | * On some platforms SDL first sees the touch device if it was actually used. 71 | * Therefore SDL_GetNumTouchDevices() may return 0 although devices are 72 | * available. After using all devices at least once the number will be 73 | * correct. 74 | * 75 | * This was fixed for Android in SDL 2.0.1. 76 | * 77 | * \returns the number of registered touch devices. 78 | * 79 | * \since This function is available since SDL 2.0.0. 80 | * 81 | * \sa SDL_GetTouchDevice 82 | */ 83 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); 84 | 85 | /** 86 | * Get the touch ID with the given index. 87 | * 88 | * \param index the touch device index 89 | * \returns the touch ID with the given index on success or 0 if the index is 90 | * invalid; call SDL_GetError() for more information. 91 | * 92 | * \since This function is available since SDL 2.0.0. 93 | * 94 | * \sa SDL_GetNumTouchDevices 95 | */ 96 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 97 | 98 | /** 99 | * Get the touch device name as reported from the driver or NULL if the index 100 | * is invalid. 101 | * 102 | * \since This function is available since SDL 2.0.22. 103 | */ 104 | extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index); 105 | 106 | /** 107 | * Get the type of the given touch device. 108 | * 109 | * \since This function is available since SDL 2.0.10. 110 | */ 111 | extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); 112 | 113 | /** 114 | * Get the number of active fingers for a given touch device. 115 | * 116 | * \param touchID the ID of a touch device 117 | * \returns the number of active fingers for a given touch device on success 118 | * or 0 on failure; call SDL_GetError() for more information. 119 | * 120 | * \since This function is available since SDL 2.0.0. 121 | * 122 | * \sa SDL_GetTouchFinger 123 | */ 124 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); 125 | 126 | /** 127 | * Get the finger object for specified touch device ID and finger index. 128 | * 129 | * The returned resource is owned by SDL and should not be deallocated. 130 | * 131 | * \param touchID the ID of the requested touch device 132 | * \param index the index of the requested finger 133 | * \returns a pointer to the SDL_Finger object or NULL if no object at the 134 | * given ID and index could be found. 135 | * 136 | * \since This function is available since SDL 2.0.0. 137 | * 138 | * \sa SDL_RecordGesture 139 | */ 140 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); 141 | 142 | /* Ends C function definitions when using C++ */ 143 | #ifdef __cplusplus 144 | } 145 | #endif 146 | #include "close_code.h" 147 | 148 | #endif /* SDL_touch_h_ */ 149 | 150 | /* vi: set ts=4 sw=4 expandtab: */ 151 | -------------------------------------------------------------------------------- /libs/sdl2/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /libs/sdl2/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2022 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Main include header for the SDL library, version 3.2.0 24 | * 25 | * It is almost always best to include just this one header instead of 26 | * picking out individual headers included here. There are exceptions to 27 | * this rule--SDL_main.h is special and not included here--but usually 28 | * letting SDL.h include the kitchen sink for you is the correct approach. 29 | */ 30 | 31 | #ifndef SDL_h_ 32 | #define SDL_h_ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #include 89 | 90 | #endif /* SDL_h_ */ 91 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryBits 24 | * 25 | * Functions for fiddling with bits and bitmasks. 26 | */ 27 | 28 | #ifndef SDL_bits_h_ 29 | #define SDL_bits_h_ 30 | 31 | #include 32 | 33 | #include 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | #if defined(__WATCOMC__) && defined(__386__) 40 | extern __inline int _SDL_bsr_watcom(Uint32); 41 | #pragma aux _SDL_bsr_watcom = \ 42 | "bsr eax, eax" \ 43 | parm [eax] nomemory \ 44 | value [eax] \ 45 | modify exact [eax] nomemory; 46 | #endif 47 | 48 | /** 49 | * Get the index of the most significant (set) bit in a 32-bit number. 50 | * 51 | * Result is undefined when called with 0. This operation can also be stated 52 | * as "count leading zeroes" and "log base 2". 53 | * 54 | * Note that this is a forced-inline function in a header, and not a public 55 | * API function available in the SDL library (which is to say, the code is 56 | * embedded in the calling program and the linker and dynamic loader will not 57 | * be able to find this function inside SDL itself). 58 | * 59 | * \param x the 32-bit value to examine. 60 | * \returns the index of the most significant bit, or -1 if the value is 0. 61 | * 62 | * \threadsafety It is safe to call this function from any thread. 63 | * 64 | * \since This function is available since SDL 3.2.0. 65 | */ 66 | SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x) 67 | { 68 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 69 | /* Count Leading Zeroes builtin in GCC. 70 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html 71 | */ 72 | if (x == 0) { 73 | return -1; 74 | } 75 | return 31 - __builtin_clz(x); 76 | #elif defined(__WATCOMC__) && defined(__386__) 77 | if (x == 0) { 78 | return -1; 79 | } 80 | return _SDL_bsr_watcom(x); 81 | #elif defined(_MSC_VER) && _MSC_VER >= 1400 82 | unsigned long index; 83 | if (_BitScanReverse(&index, x)) { 84 | return (int)index; 85 | } 86 | return -1; 87 | #else 88 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson 89 | * , released in the public domain. 90 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 91 | */ 92 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 93 | const int S[] = {1, 2, 4, 8, 16}; 94 | 95 | int msbIndex = 0; 96 | int i; 97 | 98 | if (x == 0) { 99 | return -1; 100 | } 101 | 102 | for (i = 4; i >= 0; i--) 103 | { 104 | if (x & b[i]) 105 | { 106 | x >>= S[i]; 107 | msbIndex |= S[i]; 108 | } 109 | } 110 | 111 | return msbIndex; 112 | #endif 113 | } 114 | 115 | /** 116 | * Determine if a unsigned 32-bit value has exactly one bit set. 117 | * 118 | * If there are no bits set (`x` is zero), or more than one bit set, this 119 | * returns false. If any one bit is exclusively set, this returns true. 120 | * 121 | * Note that this is a forced-inline function in a header, and not a public 122 | * API function available in the SDL library (which is to say, the code is 123 | * embedded in the calling program and the linker and dynamic loader will not 124 | * be able to find this function inside SDL itself). 125 | * 126 | * \param x the 32-bit value to examine. 127 | * \returns true if exactly one bit is set in `x`, false otherwise. 128 | * 129 | * \threadsafety It is safe to call this function from any thread. 130 | * 131 | * \since This function is available since SDL 3.2.0. 132 | */ 133 | SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x) 134 | { 135 | if (x && !(x & (x - 1))) { 136 | return true; 137 | } 138 | return false; 139 | } 140 | 141 | /* Ends C function definitions when using C++ */ 142 | #ifdef __cplusplus 143 | } 144 | #endif 145 | #include 146 | 147 | #endif /* SDL_bits_h_ */ 148 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* 23 | * This file reverses the effects of SDL_begin_code.h and should be included 24 | * after you finish any function and structure declarations in your headers. 25 | * 26 | * SDL's headers use this; applications generally should not include this 27 | * header directly. 28 | */ 29 | 30 | #ifndef SDL_begin_code_h 31 | #error SDL_close_code.h included without matching SDL_begin_code.h 32 | #endif 33 | #undef SDL_begin_code_h 34 | 35 | /* Reset structure packing at previous byte alignment */ 36 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 37 | #ifdef __BORLANDC__ 38 | #pragma nopackwarning 39 | #endif 40 | #pragma pack(pop) 41 | #endif /* Compiler needs structure packing set */ 42 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* Header file containing SDL's license. */ 23 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_guid.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* WIKI CATEGORY: GUID */ 23 | 24 | /** 25 | * # CategoryGUID 26 | * 27 | * A GUID is a 128-bit value that represents something that is uniquely 28 | * identifiable by this value: "globally unique." 29 | * 30 | * SDL provides functions to convert a GUID to/from a string. 31 | */ 32 | 33 | #ifndef SDL_guid_h_ 34 | #define SDL_guid_h_ 35 | 36 | #include 37 | 38 | #include 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /** 45 | * An SDL_GUID is a 128-bit identifier for an input device that identifies 46 | * that device across runs of SDL programs on the same platform. 47 | * 48 | * If the device is detached and then re-attached to a different port, or if 49 | * the base system is rebooted, the device should still report the same GUID. 50 | * 51 | * GUIDs are as precise as possible but are not guaranteed to distinguish 52 | * physically distinct but equivalent devices. For example, two game 53 | * controllers from the same vendor with the same product ID and revision may 54 | * have the same GUID. 55 | * 56 | * GUIDs may be platform-dependent (i.e., the same device may report different 57 | * GUIDs on different operating systems). 58 | * 59 | * \since This struct is available since SDL 3.2.0. 60 | */ 61 | typedef struct SDL_GUID { 62 | Uint8 data[16]; 63 | } SDL_GUID; 64 | 65 | /* Function prototypes */ 66 | 67 | /** 68 | * Get an ASCII string representation for a given SDL_GUID. 69 | * 70 | * \param guid the SDL_GUID you wish to convert to string. 71 | * \param pszGUID buffer in which to write the ASCII string. 72 | * \param cbGUID the size of pszGUID, should be at least 33 bytes. 73 | * 74 | * \since This function is available since SDL 3.2.0. 75 | * 76 | * \sa SDL_StringToGUID 77 | */ 78 | extern SDL_DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); 79 | 80 | /** 81 | * Convert a GUID string into a SDL_GUID structure. 82 | * 83 | * Performs no error checking. If this function is given a string containing 84 | * an invalid GUID, the function will silently succeed, but the GUID generated 85 | * will not be useful. 86 | * 87 | * \param pchGUID string containing an ASCII representation of a GUID. 88 | * \returns a SDL_GUID structure. 89 | * 90 | * \since This function is available since SDL 3.2.0. 91 | * 92 | * \sa SDL_GUIDToString 93 | */ 94 | extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_StringToGUID(const char *pchGUID); 95 | 96 | /* Ends C function definitions when using C++ */ 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | #include 101 | 102 | #endif /* SDL_guid_h_ */ 103 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* WIKI CATEGORY: SharedObject */ 23 | 24 | /** 25 | * # CategorySharedObject 26 | * 27 | * System-dependent library loading routines. 28 | * 29 | * Shared objects are code that is programmatically loadable at runtime. 30 | * Windows calls these "DLLs", Linux calls them "shared libraries", etc. 31 | * 32 | * To use them, build such a library, then call SDL_LoadObject() on it. Once 33 | * loaded, you can use SDL_LoadFunction() on that object to find the address 34 | * of its exported symbols. When done with the object, call SDL_UnloadObject() 35 | * to dispose of it. 36 | * 37 | * Some things to keep in mind: 38 | * 39 | * - These functions only work on C function names. Other languages may have 40 | * name mangling and intrinsic language support that varies from compiler to 41 | * compiler. 42 | * - Make sure you declare your function pointers with the same calling 43 | * convention as the actual library function. Your code will crash 44 | * mysteriously if you do not do this. 45 | * - Avoid namespace collisions. If you load a symbol from the library, it is 46 | * not defined whether or not it goes into the global symbol namespace for 47 | * the application. If it does and it conflicts with symbols in your code or 48 | * other shared libraries, you will not get the results you expect. :) 49 | * - Once a library is unloaded, all pointers into it obtained through 50 | * SDL_LoadFunction() become invalid, even if the library is later reloaded. 51 | * Don't unload a library if you plan to use these pointers in the future. 52 | * Notably: beware of giving one of these pointers to atexit(), since it may 53 | * call that pointer after the library unloads. 54 | */ 55 | 56 | #ifndef SDL_loadso_h_ 57 | #define SDL_loadso_h_ 58 | 59 | #include 60 | #include 61 | 62 | #include 63 | /* Set up for C function definitions, even when using C++ */ 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | /** 69 | * An opaque datatype that represents a loaded shared object. 70 | * 71 | * \since This datatype is available since SDL 3.2.0. 72 | * 73 | * \sa SDL_LoadObject 74 | * \sa SDL_LoadFunction 75 | * \sa SDL_UnloadObject 76 | */ 77 | typedef struct SDL_SharedObject SDL_SharedObject; 78 | 79 | /** 80 | * Dynamically load a shared object. 81 | * 82 | * \param sofile a system-dependent name of the object file. 83 | * \returns an opaque pointer to the object handle or NULL on failure; call 84 | * SDL_GetError() for more information. 85 | * 86 | * \threadsafety It is safe to call this function from any thread. 87 | * 88 | * \since This function is available since SDL 3.2.0. 89 | * 90 | * \sa SDL_LoadFunction 91 | * \sa SDL_UnloadObject 92 | */ 93 | extern SDL_DECLSPEC SDL_SharedObject * SDLCALL SDL_LoadObject(const char *sofile); 94 | 95 | /** 96 | * Look up the address of the named function in a shared object. 97 | * 98 | * This function pointer is no longer valid after calling SDL_UnloadObject(). 99 | * 100 | * This function can only look up C function names. Other languages may have 101 | * name mangling and intrinsic language support that varies from compiler to 102 | * compiler. 103 | * 104 | * Make sure you declare your function pointers with the same calling 105 | * convention as the actual library function. Your code will crash 106 | * mysteriously if you do not do this. 107 | * 108 | * If the requested function doesn't exist, NULL is returned. 109 | * 110 | * \param handle a valid shared object handle returned by SDL_LoadObject(). 111 | * \param name the name of the function to look up. 112 | * \returns a pointer to the function or NULL on failure; call SDL_GetError() 113 | * for more information. 114 | * 115 | * \threadsafety It is safe to call this function from any thread. 116 | * 117 | * \since This function is available since SDL 3.2.0. 118 | * 119 | * \sa SDL_LoadObject 120 | */ 121 | extern SDL_DECLSPEC SDL_FunctionPointer SDLCALL SDL_LoadFunction(SDL_SharedObject *handle, const char *name); 122 | 123 | /** 124 | * Unload a shared object from memory. 125 | * 126 | * Note that any pointers from this object looked up through 127 | * SDL_LoadFunction() will no longer be valid. 128 | * 129 | * \param handle a valid shared object handle returned by SDL_LoadObject(). 130 | * 131 | * \threadsafety It is safe to call this function from any thread. 132 | * 133 | * \since This function is available since SDL 3.2.0. 134 | * 135 | * \sa SDL_LoadObject 136 | */ 137 | extern SDL_DECLSPEC void SDLCALL SDL_UnloadObject(SDL_SharedObject *handle); 138 | 139 | /* Ends C function definitions when using C++ */ 140 | #ifdef __cplusplus 141 | } 142 | #endif 143 | #include 144 | 145 | #endif /* SDL_loadso_h_ */ 146 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryLocale 24 | * 25 | * SDL locale services. 26 | * 27 | * This provides a way to get a list of preferred locales (language plus 28 | * country) for the user. There is exactly one function: 29 | * SDL_GetPreferredLocales(), which handles all the heavy lifting, and offers 30 | * documentation on all the strange ways humans might have configured their 31 | * language settings. 32 | */ 33 | 34 | #ifndef SDL_locale_h 35 | #define SDL_locale_h 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | /* Set up for C function definitions, even when using C++ */ 42 | #ifdef __cplusplus 43 | /* *INDENT-OFF* */ 44 | extern "C" { 45 | /* *INDENT-ON* */ 46 | #endif 47 | 48 | /** 49 | * A struct to provide locale data. 50 | * 51 | * Locale data is split into a spoken language, like English, and an optional 52 | * country, like Canada. The language will be in ISO-639 format (so English 53 | * would be "en"), and the country, if not NULL, will be an ISO-3166 country 54 | * code (so Canada would be "CA"). 55 | * 56 | * \since This function is available since SDL 3.2.0. 57 | * 58 | * \sa SDL_GetPreferredLocales 59 | */ 60 | typedef struct SDL_Locale 61 | { 62 | const char *language; /**< A language name, like "en" for English. */ 63 | const char *country; /**< A country, like "US" for America. Can be NULL. */ 64 | } SDL_Locale; 65 | 66 | /** 67 | * Report the user's preferred locale. 68 | * 69 | * Returned language strings are in the format xx, where 'xx' is an ISO-639 70 | * language specifier (such as "en" for English, "de" for German, etc). 71 | * Country strings are in the format YY, where "YY" is an ISO-3166 country 72 | * code (such as "US" for the United States, "CA" for Canada, etc). Country 73 | * might be NULL if there's no specific guidance on them (so you might get { 74 | * "en", "US" } for American English, but { "en", NULL } means "English 75 | * language, generically"). Language strings are never NULL, except to 76 | * terminate the array. 77 | * 78 | * Please note that not all of these strings are 2 characters; some are three 79 | * or more. 80 | * 81 | * The returned list of locales are in the order of the user's preference. For 82 | * example, a German citizen that is fluent in US English and knows enough 83 | * Japanese to navigate around Tokyo might have a list like: { "de", "en_US", 84 | * "jp", NULL }. Someone from England might prefer British English (where 85 | * "color" is spelled "colour", etc), but will settle for anything like it: { 86 | * "en_GB", "en", NULL }. 87 | * 88 | * This function returns NULL on error, including when the platform does not 89 | * supply this information at all. 90 | * 91 | * This might be a "slow" call that has to query the operating system. It's 92 | * best to ask for this once and save the results. However, this list can 93 | * change, usually because the user has changed a system preference outside of 94 | * your program; SDL will send an SDL_EVENT_LOCALE_CHANGED event in this case, 95 | * if possible, and you can call this function again to get an updated copy of 96 | * preferred locales. 97 | * 98 | * \param count a pointer filled in with the number of locales returned, may 99 | * be NULL. 100 | * \returns a NULL terminated array of locale pointers, or NULL on failure; 101 | * call SDL_GetError() for more information. This is a single 102 | * allocation that should be freed with SDL_free() when it is no 103 | * longer needed. 104 | * 105 | * \since This function is available since SDL 3.2.0. 106 | */ 107 | extern SDL_DECLSPEC SDL_Locale ** SDLCALL SDL_GetPreferredLocales(int *count); 108 | 109 | /* Ends C function definitions when using C++ */ 110 | #ifdef __cplusplus 111 | /* *INDENT-OFF* */ 112 | } 113 | /* *INDENT-ON* */ 114 | #endif 115 | #include 116 | 117 | #endif /* SDL_locale_h */ 118 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_metal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryMetal 24 | * 25 | * Functions to creating Metal layers and views on SDL windows. 26 | * 27 | * This provides some platform-specific glue for Apple platforms. Most macOS 28 | * and iOS apps can use SDL without these functions, but this API they can be 29 | * useful for specific OS-level integration tasks. 30 | */ 31 | 32 | #ifndef SDL_metal_h_ 33 | #define SDL_metal_h_ 34 | 35 | #include 36 | 37 | #include 38 | /* Set up for C function definitions, even when using C++ */ 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /** 44 | * A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). 45 | * 46 | * \since This datatype is available since SDL 3.2.0. 47 | */ 48 | typedef void *SDL_MetalView; 49 | 50 | /** 51 | * \name Metal support functions 52 | */ 53 | /* @{ */ 54 | 55 | /** 56 | * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified 57 | * window. 58 | * 59 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on 60 | * its own. It is up to user code to do that. 61 | * 62 | * The returned handle can be casted directly to a NSView or UIView. To access 63 | * the backing CAMetalLayer, call SDL_Metal_GetLayer(). 64 | * 65 | * \param window the window. 66 | * \returns handle NSView or UIView. 67 | * 68 | * \since This function is available since SDL 3.2.0. 69 | * 70 | * \sa SDL_Metal_DestroyView 71 | * \sa SDL_Metal_GetLayer 72 | */ 73 | extern SDL_DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window *window); 74 | 75 | /** 76 | * Destroy an existing SDL_MetalView object. 77 | * 78 | * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was 79 | * called after SDL_CreateWindow. 80 | * 81 | * \param view the SDL_MetalView object. 82 | * 83 | * \since This function is available since SDL 3.2.0. 84 | * 85 | * \sa SDL_Metal_CreateView 86 | */ 87 | extern SDL_DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); 88 | 89 | /** 90 | * Get a pointer to the backing CAMetalLayer for the given view. 91 | * 92 | * \param view the SDL_MetalView object. 93 | * \returns a pointer. 94 | * 95 | * \since This function is available since SDL 3.2.0. 96 | */ 97 | extern SDL_DECLSPEC void * SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); 98 | 99 | /* @} *//* Metal support functions */ 100 | 101 | /* Ends C function definitions when using C++ */ 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | #include 106 | 107 | #endif /* SDL_metal_h_ */ 108 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryMisc 24 | * 25 | * SDL API functions that don't fit elsewhere. 26 | */ 27 | 28 | #ifndef SDL_misc_h_ 29 | #define SDL_misc_h_ 30 | 31 | #include 32 | #include 33 | 34 | #include 35 | 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /** 42 | * Open a URL/URI in the browser or other appropriate external application. 43 | * 44 | * Open a URL in a separate, system-provided application. How this works will 45 | * vary wildly depending on the platform. This will likely launch what makes 46 | * sense to handle a specific URL's protocol (a web browser for `http://`, 47 | * etc), but it might also be able to launch file managers for directories and 48 | * other things. 49 | * 50 | * What happens when you open a URL varies wildly as well: your game window 51 | * may lose focus (and may or may not lose focus if your game was fullscreen 52 | * or grabbing input at the time). On mobile devices, your app will likely 53 | * move to the background or your process might be paused. Any given platform 54 | * may or may not handle a given URL. 55 | * 56 | * If this is unimplemented (or simply unavailable) for a platform, this will 57 | * fail with an error. A successful result does not mean the URL loaded, just 58 | * that we launched _something_ to handle it (or at least believe we did). 59 | * 60 | * All this to say: this function can be useful, but you should definitely 61 | * test it on every platform you target. 62 | * 63 | * \param url a valid URL/URI to open. Use `file:///full/path/to/file` for 64 | * local files, if supported. 65 | * \returns true on success or false on failure; call SDL_GetError() for more 66 | * information. 67 | * 68 | * \since This function is available since SDL 3.2.0. 69 | */ 70 | extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url); 71 | 72 | /* Ends C function definitions when using C++ */ 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | #include 77 | 78 | #endif /* SDL_misc_h_ */ 79 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* 23 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 24 | */ 25 | 26 | #include 27 | 28 | #ifdef SDL_PLATFORM_IOS 29 | #include 30 | #include 31 | #else 32 | #include 33 | #include 34 | #endif 35 | 36 | #ifndef APIENTRY 37 | #define APIENTRY 38 | #endif 39 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* 23 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 24 | */ 25 | 26 | #include 27 | 28 | #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) 29 | 30 | #ifdef SDL_PLATFORM_IOS 31 | #include 32 | #include 33 | #else 34 | #include 35 | #include 36 | #include 37 | #endif 38 | 39 | #else /* _MSC_VER */ 40 | 41 | /* OpenGL ES2 headers for Visual Studio */ 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #endif /* _MSC_VER */ 48 | 49 | #ifndef APIENTRY 50 | #define APIENTRY GL_APIENTRY 51 | #endif 52 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* 5 | ** Copyright 2017-2020 The Khronos Group Inc. 6 | ** SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 10 | * 11 | * Adopters may modify khrplatform.h and this file to suit their platform. 12 | * Please contribute modifications back to Khronos as pull requests on the 13 | * public github repository: 14 | * https://github.com/KhronosGroup/OpenGL-Registry 15 | */ 16 | 17 | /*#include */ 18 | 19 | #ifndef GL_APICALL 20 | #define GL_APICALL KHRONOS_APICALL 21 | #endif 22 | 23 | #ifndef GL_APIENTRY 24 | #define GL_APIENTRY KHRONOS_APIENTRY 25 | #endif 26 | 27 | #endif /* __gl2platform_h_ */ 28 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_pen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryPen 24 | * 25 | * SDL pen event handling. 26 | * 27 | * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) 28 | * handling, e.g., for input and drawing tablets or suitably equipped mobile / 29 | * tablet devices. 30 | * 31 | * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen 32 | * starts providing input, SDL will assign it a unique SDL_PenID, which will 33 | * remain for the life of the process, as long as the pen stays connected. 34 | * 35 | * Pens may provide more than simple touch input; they might have other axes, 36 | * such as pressure, tilt, rotation, etc. 37 | */ 38 | 39 | #ifndef SDL_pen_h_ 40 | #define SDL_pen_h_ 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | /* Set up for C function definitions, even when using C++ */ 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | /** 52 | * SDL pen instance IDs. 53 | * 54 | * Zero is used to signify an invalid/null device. 55 | * 56 | * These show up in pen events when SDL sees input from them. They remain 57 | * consistent as long as SDL can recognize a tool to be the same pen; but if a 58 | * pen physically leaves the area and returns, it might get a new ID. 59 | * 60 | * \since This datatype is available since SDL 3.2.0. 61 | */ 62 | typedef Uint32 SDL_PenID; 63 | 64 | /** 65 | * The SDL_MouseID for mouse events simulated with pen input. 66 | * 67 | * \since This macro is available since SDL 3.2.0. 68 | */ 69 | #define SDL_PEN_MOUSEID ((SDL_MouseID)-2) 70 | 71 | /** 72 | * The SDL_TouchID for touch events simulated with pen input. 73 | * 74 | * \since This macro is available since SDL 3.2.0. 75 | */ 76 | #define SDL_PEN_TOUCHID ((SDL_TouchID)-2) 77 | 78 | 79 | /** 80 | * Pen input flags, as reported by various pen events' `pen_state` field. 81 | * 82 | * \since This datatype is available since SDL 3.2.0. 83 | */ 84 | typedef Uint32 SDL_PenInputFlags; 85 | 86 | #define SDL_PEN_INPUT_DOWN (1u << 0) /**< pen is pressed down */ 87 | #define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< button 1 is pressed */ 88 | #define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< button 2 is pressed */ 89 | #define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< button 3 is pressed */ 90 | #define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< button 4 is pressed */ 91 | #define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< button 5 is pressed */ 92 | #define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< eraser tip is used */ 93 | 94 | /** 95 | * Pen axis indices. 96 | * 97 | * These are the valid values for the `axis` field in SDL_PenAxisEvent. All 98 | * axes are either normalised to 0..1 or report a (positive or negative) angle 99 | * in degrees, with 0.0 representing the centre. Not all pens/backends support 100 | * all axes: unsupported axes are always zero. 101 | * 102 | * To convert angles for tilt and rotation into vector representation, use 103 | * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: 104 | * 105 | * `SDL_sinf(xtilt * SDL_PI_F / 180.0)`. 106 | * 107 | * \since This enum is available since SDL 3.2.0. 108 | */ 109 | typedef enum SDL_PenAxis 110 | { 111 | SDL_PEN_AXIS_PRESSURE, /**< Pen pressure. Unidirectional: 0 to 1.0 */ 112 | SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). */ 113 | SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). */ 114 | SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 */ 115 | SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ 116 | SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 */ 117 | SDL_PEN_AXIS_TANGENTIAL_PRESSURE, /**< Pressure from squeezing the pen ("barrel pressure"). */ 118 | SDL_PEN_AXIS_COUNT /**< Total known pen axis types in this version of SDL. This number may grow in future releases! */ 119 | } SDL_PenAxis; 120 | 121 | /* Ends C function definitions when using C++ */ 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | #endif /* SDL_pen_h_ */ 127 | 128 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryPlatform 24 | * 25 | * SDL provides a means to identify the app's platform, both at compile time 26 | * and runtime. 27 | */ 28 | 29 | #ifndef SDL_platform_h_ 30 | #define SDL_platform_h_ 31 | 32 | #include 33 | 34 | #include 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Get the name of the platform. 42 | * 43 | * Here are the names returned for some (but not all) supported platforms: 44 | * 45 | * - "Windows" 46 | * - "macOS" 47 | * - "Linux" 48 | * - "iOS" 49 | * - "Android" 50 | * 51 | * \returns the name of the platform. If the correct platform name is not 52 | * available, returns a string beginning with the text "Unknown". 53 | * 54 | * \since This function is available since SDL 3.2.0. 55 | */ 56 | extern SDL_DECLSPEC const char * SDLCALL SDL_GetPlatform(void); 57 | 58 | /* Ends C function definitions when using C++ */ 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #include 63 | 64 | #endif /* SDL_platform_h_ */ 65 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * # CategoryPower 27 | * 28 | * SDL power management routines. 29 | * 30 | * There is a single function in this category: SDL_GetPowerInfo(). 31 | * 32 | * This function is useful for games on the go. This allows an app to know if 33 | * it's running on a draining battery, which can be useful if the app wants to 34 | * reduce processing, or perhaps framerate, to extend the duration of the 35 | * battery's charge. Perhaps the app just wants to show a battery meter when 36 | * fullscreen, or alert the user when the power is getting extremely low, so 37 | * they can save their game. 38 | */ 39 | 40 | #include 41 | #include 42 | 43 | #include 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * The basic state for the system's power supply. 51 | * 52 | * These are results returned by SDL_GetPowerInfo(). 53 | * 54 | * \since This enum is available since SDL 3.2.0. 55 | */ 56 | typedef enum SDL_PowerState 57 | { 58 | SDL_POWERSTATE_ERROR = -1, /**< error determining power status */ 59 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 60 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 61 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 62 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 63 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 64 | } SDL_PowerState; 65 | 66 | /** 67 | * Get the current power supply details. 68 | * 69 | * You should never take a battery status as absolute truth. Batteries 70 | * (especially failing batteries) are delicate hardware, and the values 71 | * reported here are best estimates based on what that hardware reports. It's 72 | * not uncommon for older batteries to lose stored power much faster than it 73 | * reports, or completely drain when reporting it has 20 percent left, etc. 74 | * 75 | * Battery status can change at any time; if you are concerned with power 76 | * state, you should call this function frequently, and perhaps ignore changes 77 | * until they seem to be stable for a few seconds. 78 | * 79 | * It's possible a platform can only report battery percentage or time left 80 | * but not both. 81 | * 82 | * \param seconds a pointer filled in with the seconds of battery life left, 83 | * or NULL to ignore. This will be filled in with -1 if we 84 | * can't determine a value or there is no battery. 85 | * \param percent a pointer filled in with the percentage of battery life 86 | * left, between 0 and 100, or NULL to ignore. This will be 87 | * filled in with -1 we can't determine a value or there is no 88 | * battery. 89 | * \returns the current battery state or `SDL_POWERSTATE_ERROR` on failure; 90 | * call SDL_GetError() for more information. 91 | * 92 | * \since This function is available since SDL 3.2.0. 93 | */ 94 | extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent); 95 | 96 | /* Ends C function definitions when using C++ */ 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | #include 101 | 102 | #endif /* SDL_power_h_ */ 103 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_revision.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* WIKI CATEGORY: Version */ 23 | 24 | /* 25 | * SDL_revision.h contains the SDL revision, which might be defined on the 26 | * compiler command line, or generated right into the header itself by the 27 | * build system. 28 | */ 29 | 30 | #ifndef SDL_revision_h_ 31 | #define SDL_revision_h_ 32 | 33 | #ifdef SDL_WIKI_DOCUMENTATION_SECTION 34 | 35 | /** 36 | * This macro is a string describing the source at a particular point in 37 | * development. 38 | * 39 | * This string is often generated from revision control's state at build time. 40 | * 41 | * This string can be quite complex and does not follow any standard. For 42 | * example, it might be something like "SDL-prerelease-3.1.1-47-gf687e0732". 43 | * It might also be user-defined at build time, so it's best to treat it as a 44 | * clue in debugging forensics and not something the app will parse in any 45 | * way. 46 | * 47 | * \since This macro is available since SDL 3.0.0. 48 | */ 49 | #define SDL_REVISION "Some arbitrary string decided at SDL build time" 50 | #elif defined(SDL_VENDOR_INFO) 51 | #define SDL_REVISION "release-3.2.0-0-g535d80bad (" SDL_VENDOR_INFO ")" 52 | #else 53 | #define SDL_REVISION "release-3.2.0-0-g535d80bad" 54 | #endif 55 | 56 | #endif /* SDL_revision_h_ */ 57 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Include file for SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | #ifndef SDL_test_h_ 29 | #define SDL_test_h_ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /* Global definitions */ 50 | 51 | /* 52 | * Note: Maximum size of SDLTest log message is less than SDL's limit 53 | * to ensure we can fit additional information such as the timestamp. 54 | */ 55 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 56 | 57 | /* Ends C function definitions when using C++ */ 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #include 62 | 63 | #endif /* SDL_test_h_ */ 64 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Assertion functions of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | /* 29 | * 30 | * Assert API for test code and test cases 31 | * 32 | */ 33 | 34 | #ifndef SDL_test_assert_h_ 35 | #define SDL_test_assert_h_ 36 | 37 | #include 38 | 39 | #include 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /* Fails the assert. */ 46 | #define ASSERT_FAIL 0 47 | 48 | /* Passes the assert. */ 49 | #define ASSERT_PASS 1 50 | 51 | /* 52 | * Assert that logs and break execution flow on failures. 53 | * 54 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). 55 | * \param assertDescription Message to log with the assert describing it. 56 | */ 57 | void SDLCALL SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); 58 | 59 | /* 60 | * Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. 61 | * 62 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). 63 | * \param assertDescription Message to log with the assert describing it. 64 | * 65 | * \returns the assertCondition so it can be used to externally to break execution flow if desired. 66 | */ 67 | int SDLCALL SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); 68 | 69 | /* 70 | * Explicitly pass without checking an assertion condition. Updates assertion counter. 71 | * 72 | * \param assertDescription Message to log with the assert describing it. 73 | */ 74 | void SDLCALL SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); 75 | 76 | /* 77 | * Resets the assert summary counters to zero. 78 | */ 79 | void SDLCALL SDLTest_ResetAssertSummary(void); 80 | 81 | /* 82 | * Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. 83 | */ 84 | void SDLCALL SDLTest_LogAssertSummary(void); 85 | 86 | /* 87 | * Converts the current assert summary state to a test result. 88 | * 89 | * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT 90 | */ 91 | int SDLCALL SDLTest_AssertSummaryToTestResult(void); 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | #include 97 | 98 | #endif /* SDL_test_assert_h_ */ 99 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Comparison function of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | /* 29 | 30 | Defines comparison functions (i.e. for surfaces). 31 | 32 | */ 33 | 34 | #ifndef SDL_test_compare_h_ 35 | #define SDL_test_compare_h_ 36 | 37 | #include 38 | 39 | #include 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * Compares a surface and with reference image data for equality 47 | * 48 | * \param surface Surface used in comparison 49 | * \param referenceSurface Test Surface used in comparison 50 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 51 | * 52 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 53 | */ 54 | int SDLCALL SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 55 | 56 | /** 57 | * Compares 2 memory blocks for equality 58 | * 59 | * \param actual Memory used in comparison, displayed on the left 60 | * \param size_actual Size of actual in bytes 61 | * \param reference Reference memory, displayed on the right 62 | * \param size_reference Size of reference in bytes 63 | * 64 | * \returns 0 if the left and right memory block are equal, non-zero if they are non-equal. 65 | * 66 | * \since This function is available since SDL 3.2.0. 67 | */ 68 | int SDLCALL SDLTest_CompareMemory(const void *actual, size_t size_actual, const void *reference, size_t size_reference); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include 75 | 76 | #endif /* SDL_test_compare_h_ */ 77 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_crc32.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * CRC32 functions of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | /* 29 | 30 | Implements CRC32 calculations (default output is Perl String::CRC32 compatible). 31 | 32 | */ 33 | 34 | #ifndef SDL_test_crc32_h_ 35 | #define SDL_test_crc32_h_ 36 | 37 | #include 38 | 39 | #include 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /* ------------ Definitions --------- */ 46 | 47 | /* Definition shared by all CRC routines */ 48 | 49 | #ifndef CrcUint32 50 | #define CrcUint32 unsigned int 51 | #endif 52 | #ifndef CrcUint8 53 | #define CrcUint8 unsigned char 54 | #endif 55 | 56 | #ifdef ORIGINAL_METHOD 57 | #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ 58 | #else 59 | #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ 60 | #endif 61 | 62 | /* 63 | * Data structure for CRC32 (checksum) computation 64 | */ 65 | typedef struct SDLTest_Crc32Context { 66 | CrcUint32 crc32_table[256]; /* CRC table */ 67 | } SDLTest_Crc32Context; 68 | 69 | /* ---------- Function Prototypes ------------- */ 70 | 71 | /* 72 | * Initialize the CRC context 73 | * 74 | * Note: The function initializes the crc table required for all crc calculations. 75 | * 76 | * \param crcContext pointer to context variable 77 | * 78 | * \returns true on success or false on failure; call SDL_GetError() 79 | * for more information. 80 | * 81 | */ 82 | bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext); 83 | 84 | /* 85 | * calculate a crc32 from a data block 86 | * 87 | * \param crcContext pointer to context variable 88 | * \param inBuf input buffer to checksum 89 | * \param inLen length of input buffer 90 | * \param crc32 pointer to Uint32 to store the final CRC into 91 | * 92 | * \returns true on success or false on failure; call SDL_GetError() 93 | * for more information. 94 | * 95 | */ 96 | bool SDLCALL SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); 97 | 98 | /* Same routine broken down into three steps */ 99 | bool SDLCALL SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32); 100 | bool SDLCALL SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32); 101 | bool SDLCALL SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); 102 | 103 | /* 104 | * clean up CRC context 105 | * 106 | * \param crcContext pointer to context variable 107 | * 108 | * \returns true on success or false on failure; call SDL_GetError() 109 | * for more information. 110 | * 111 | */ 112 | 113 | bool SDLCALL SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext); 114 | 115 | /* Ends C function definitions when using C++ */ 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | #include 120 | 121 | #endif /* SDL_test_crc32_h_ */ 122 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_harness.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Test suite related functions of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | /* 29 | Defines types for test case definitions and the test execution harness API. 30 | 31 | Based on original GSOC code by Markus Kauppila 32 | */ 33 | 34 | #ifndef SDL_test_h_arness_h 35 | #define SDL_test_h_arness_h 36 | 37 | #include 38 | #include /* SDLTest_CommonState */ 39 | 40 | #include 41 | /* Set up for C function definitions, even when using C++ */ 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /* ! Definitions for test case structures */ 47 | #define TEST_ENABLED 1 48 | #define TEST_DISABLED 0 49 | 50 | /* ! Definition of all the possible test return values of the test case method */ 51 | #define TEST_ABORTED -1 52 | #define TEST_STARTED 0 53 | #define TEST_COMPLETED 1 54 | #define TEST_SKIPPED 2 55 | 56 | /* ! Definition of all the possible test results for the harness */ 57 | #define TEST_RESULT_PASSED 0 58 | #define TEST_RESULT_FAILED 1 59 | #define TEST_RESULT_NO_ASSERT 2 60 | #define TEST_RESULT_SKIPPED 3 61 | #define TEST_RESULT_SETUP_FAILURE 4 62 | 63 | /* !< Function pointer to a test case setup function (run before every test) */ 64 | typedef void (SDLCALL *SDLTest_TestCaseSetUpFp)(void **arg); 65 | 66 | /* !< Function pointer to a test case function */ 67 | typedef int (SDLCALL *SDLTest_TestCaseFp)(void *arg); 68 | 69 | /* !< Function pointer to a test case teardown function (run after every test) */ 70 | typedef void (SDLCALL *SDLTest_TestCaseTearDownFp)(void *arg); 71 | 72 | /* 73 | * Holds information about a single test case. 74 | */ 75 | typedef struct SDLTest_TestCaseReference { 76 | /* !< Func2Stress */ 77 | SDLTest_TestCaseFp testCase; 78 | /* !< Short name (or function name) "Func2Stress" */ 79 | const char *name; 80 | /* !< Long name or full description "This test pushes func2() to the limit." */ 81 | const char *description; 82 | /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ 83 | int enabled; 84 | } SDLTest_TestCaseReference; 85 | 86 | /* 87 | * Holds information about a test suite (multiple test cases). 88 | */ 89 | typedef struct SDLTest_TestSuiteReference { 90 | /* !< "PlatformSuite" */ 91 | const char *name; 92 | /* !< The function that is run before each test. NULL skips. */ 93 | SDLTest_TestCaseSetUpFp testSetUp; 94 | /* !< The test cases that are run as part of the suite. Last item should be NULL. */ 95 | const SDLTest_TestCaseReference **testCases; 96 | /* !< The function that is run after each test. NULL skips. */ 97 | SDLTest_TestCaseTearDownFp testTearDown; 98 | } SDLTest_TestSuiteReference; 99 | 100 | 101 | /* 102 | * Generates a random run seed string for the harness. The generated seed 103 | * will contain alphanumeric characters (0-9A-Z). 104 | * 105 | * \param buffer Buffer in which to generate the random seed. Must have a capacity of at least length + 1 characters. 106 | * \param length Number of alphanumeric characters to write to buffer, must be >0 107 | * 108 | * \returns A null-terminated seed string and equal to the in put buffer on success, NULL on failure 109 | */ 110 | char * SDLCALL SDLTest_GenerateRunSeed(char *buffer, int length); 111 | 112 | /* 113 | * Holds information about the execution of test suites. 114 | * */ 115 | typedef struct SDLTest_TestSuiteRunner SDLTest_TestSuiteRunner; 116 | 117 | /* 118 | * Create a new test suite runner, that will execute the given test suites. 119 | * It will register the harness cli arguments to the common SDL state. 120 | * 121 | * \param state Common SDL state on which to register CLI arguments. 122 | * \param testSuites NULL-terminated test suites containing test cases. 123 | * 124 | * \returns the test run result: 0 when all tests passed, 1 if any tests failed. 125 | */ 126 | SDLTest_TestSuiteRunner * SDLCALL SDLTest_CreateTestSuiteRunner(SDLTest_CommonState *state, SDLTest_TestSuiteReference *testSuites[]); 127 | 128 | /* 129 | * Destroy a test suite runner. 130 | * It will unregister the harness cli arguments to the common SDL state. 131 | * 132 | * \param runner The runner that should be destroyed. 133 | */ 134 | void SDLCALL SDLTest_DestroyTestSuiteRunner(SDLTest_TestSuiteRunner *runner); 135 | 136 | /* 137 | * Execute a test suite, using the configured run seed, execution key, filter, etc. 138 | * 139 | * \param runner The runner that should be executed. 140 | * 141 | * \returns the test run result: 0 when all tests passed, 1 if any tests failed. 142 | */ 143 | int SDLCALL SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner); 144 | 145 | /* Ends C function definitions when using C++ */ 146 | #ifdef __cplusplus 147 | } 148 | #endif 149 | #include 150 | 151 | #endif /* SDL_test_h_arness_h */ 152 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Logging related functions of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | /* 29 | * 30 | * Wrapper to log in the TEST category 31 | * 32 | */ 33 | 34 | #ifndef SDL_test_log_h_ 35 | #define SDL_test_log_h_ 36 | 37 | #include 38 | 39 | #include 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLCALL SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * Prints given prefix and buffer. 54 | * Non-printible characters in the raw data are substituted by printible alternatives. 55 | * 56 | * \param prefix Prefix message. 57 | * \param buffer Raw data to be escaped. 58 | * \param size Number of bytes in buffer. 59 | */ 60 | void SDLCALL SDLTest_LogEscapedString(const char *prefix, const void *buffer, size_t size); 61 | 62 | /** 63 | * Prints given message with a timestamp in the TEST category and the ERROR priority. 64 | * 65 | * \param fmt Message to be logged 66 | */ 67 | void SDLCALL SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 68 | 69 | /* Ends C function definitions when using C++ */ 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | #include 74 | 75 | #endif /* SDL_test_log_h_ */ 76 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * MD5 related functions of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | /* 29 | *********************************************************************** 30 | ** Header file for implementation of MD5 ** 31 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 32 | ** Created: 2/17/90 RLR ** 33 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 34 | ** Revised (for MD5): RLR 4/27/91 ** 35 | ** -- G modified to have y&~z instead of y&z ** 36 | ** -- FF, GG, HH modified to add in last register done ** 37 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 38 | ** -- distinct additive constant for each step ** 39 | ** -- round 4 added, working mod 7 ** 40 | *********************************************************************** 41 | */ 42 | 43 | /* 44 | *********************************************************************** 45 | ** Message-digest routines: ** 46 | ** To form the message digest for a message M ** 47 | ** (1) Initialize a context buffer mdContext using MD5Init ** 48 | ** (2) Call MD5Update on mdContext and M ** 49 | ** (3) Call MD5Final on mdContext ** 50 | ** The message digest is now in mdContext->digest[0...15] ** 51 | *********************************************************************** 52 | */ 53 | 54 | #ifndef SDL_test_md5_h_ 55 | #define SDL_test_md5_h_ 56 | 57 | #include 58 | 59 | #include 60 | /* Set up for C function definitions, even when using C++ */ 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | /* ------------ Definitions --------- */ 66 | 67 | /* typedef a 32-bit type */ 68 | typedef Uint32 MD5UINT4; 69 | 70 | /* Data structure for MD5 (Message-Digest) computation */ 71 | typedef struct SDLTest_Md5Context { 72 | MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ 73 | MD5UINT4 buf[4]; /* scratch buffer */ 74 | unsigned char in[64]; /* input buffer */ 75 | unsigned char digest[16]; /* actual digest after Md5Final call */ 76 | } SDLTest_Md5Context; 77 | 78 | /* ---------- Function Prototypes ------------- */ 79 | 80 | /** 81 | * initialize the context 82 | * 83 | * \param mdContext pointer to context variable 84 | * 85 | * Note: The function initializes the message-digest context 86 | * mdContext. Call before each new use of the context - 87 | * all fields are set to zero. 88 | */ 89 | void SDLCALL SDLTest_Md5Init(SDLTest_Md5Context *mdContext); 90 | 91 | /** 92 | * update digest from variable length data 93 | * 94 | * \param mdContext pointer to context variable 95 | * \param inBuf pointer to data array/string 96 | * \param inLen length of data array/string 97 | * 98 | * Note: The function updates the message-digest context to account 99 | * for the presence of each of the characters inBuf[0..inLen-1] 100 | * in the message whose digest is being computed. 101 | */ 102 | void SDLCALL SDLTest_Md5Update(SDLTest_Md5Context *mdContext, unsigned char *inBuf, 103 | unsigned int inLen); 104 | 105 | /** 106 | * complete digest computation 107 | * 108 | * \param mdContext pointer to context variable 109 | * 110 | * Note: The function terminates the message-digest computation and 111 | * ends with the desired message digest in mdContext.digest[0..15]. 112 | * Always call before using the digest[] variable. 113 | */ 114 | void SDLCALL SDLTest_Md5Final(SDLTest_Md5Context *mdContext); 115 | 116 | /* Ends C function definitions when using C++ */ 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | #include 121 | 122 | #endif /* SDL_test_md5_h_ */ 123 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * Memory tracking related functions of SDL test framework. 24 | * 25 | * This code is a part of the SDL test library, not the main SDL library. 26 | */ 27 | 28 | #ifndef SDL_test_memory_h_ 29 | #define SDL_test_memory_h_ 30 | 31 | #include 32 | 33 | #include 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * Start tracking SDL memory allocations 41 | * 42 | * \note This should be called before any other SDL functions for complete tracking coverage 43 | */ 44 | void SDLCALL SDLTest_TrackAllocations(void); 45 | 46 | /** 47 | * Fill allocations with random data 48 | * 49 | * \note This implicitly calls SDLTest_TrackAllocations() 50 | */ 51 | void SDLCALL SDLTest_RandFillAllocations(void); 52 | 53 | /** 54 | * Print a log of any outstanding allocations 55 | * 56 | * \note This can be called after SDL_Quit() 57 | */ 58 | void SDLCALL SDLTest_LogAllocations(void); 59 | 60 | /* Ends C function definitions when using C++ */ 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #include 65 | 66 | #endif /* SDL_test_memory_h_ */ 67 | -------------------------------------------------------------------------------- /libs/sdl3/include/SDL3/SDL_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2025 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * # CategoryVersion 24 | * 25 | * Functionality to query the current SDL version, both as headers the app was 26 | * compiled against, and a library the app is linked to. 27 | */ 28 | 29 | #ifndef SDL_version_h_ 30 | #define SDL_version_h_ 31 | 32 | #include 33 | 34 | #include 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * The current major version of SDL headers. 42 | * 43 | * If this were SDL version 3.2.1, this value would be 3. 44 | * 45 | * \since This macro is available since SDL 3.2.0. 46 | */ 47 | #define SDL_MAJOR_VERSION 3 48 | 49 | /** 50 | * The current minor version of the SDL headers. 51 | * 52 | * If this were SDL version 3.2.1, this value would be 2. 53 | * 54 | * \since This macro is available since SDL 3.2.0. 55 | */ 56 | #define SDL_MINOR_VERSION 2 57 | 58 | /** 59 | * The current micro (or patchlevel) version of the SDL headers. 60 | * 61 | * If this were SDL version 3.2.1, this value would be 1. 62 | * 63 | * \since This macro is available since SDL 3.2.0. 64 | */ 65 | #define SDL_MICRO_VERSION 0 66 | 67 | /** 68 | * This macro turns the version numbers into a numeric value. 69 | * 70 | * (1,2,3) becomes 1002003. 71 | * 72 | * \param major the major version number. 73 | * \param minor the minorversion number. 74 | * \param patch the patch version number. 75 | * 76 | * \since This macro is available since SDL 3.2.0. 77 | */ 78 | #define SDL_VERSIONNUM(major, minor, patch) \ 79 | ((major) * 1000000 + (minor) * 1000 + (patch)) 80 | 81 | /** 82 | * This macro extracts the major version from a version number 83 | * 84 | * 1002003 becomes 1. 85 | * 86 | * \param version the version number. 87 | * 88 | * \since This macro is available since SDL 3.2.0. 89 | */ 90 | #define SDL_VERSIONNUM_MAJOR(version) ((version) / 1000000) 91 | 92 | /** 93 | * This macro extracts the minor version from a version number 94 | * 95 | * 1002003 becomes 2. 96 | * 97 | * \param version the version number. 98 | * 99 | * \since This macro is available since SDL 3.2.0. 100 | */ 101 | #define SDL_VERSIONNUM_MINOR(version) (((version) / 1000) % 1000) 102 | 103 | /** 104 | * This macro extracts the micro version from a version number 105 | * 106 | * 1002003 becomes 3. 107 | * 108 | * \param version the version number. 109 | * 110 | * \since This macro is available since SDL 3.2.0. 111 | */ 112 | #define SDL_VERSIONNUM_MICRO(version) ((version) % 1000) 113 | 114 | /** 115 | * This is the version number macro for the current SDL version. 116 | * 117 | * \since This macro is available since SDL 3.2.0. 118 | * 119 | * \sa SDL_GetVersion 120 | */ 121 | #define SDL_VERSION \ 122 | SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION) 123 | 124 | /** 125 | * This macro will evaluate to true if compiled with SDL at least X.Y.Z. 126 | * 127 | * \since This macro is available since SDL 3.2.0. 128 | */ 129 | #define SDL_VERSION_ATLEAST(X, Y, Z) \ 130 | (SDL_VERSION >= SDL_VERSIONNUM(X, Y, Z)) 131 | 132 | /** 133 | * Get the version of SDL that is linked against your program. 134 | * 135 | * If you are linking to SDL dynamically, then it is possible that the current 136 | * version will be different than the version you compiled against. This 137 | * function returns the current version, while SDL_VERSION is the version you 138 | * compiled with. 139 | * 140 | * This function may be called safely at any time, even before SDL_Init(). 141 | * 142 | * \returns the version of the linked library. 143 | * 144 | * \since This function is available since SDL 3.2.0. 145 | * 146 | * \sa SDL_GetRevision 147 | */ 148 | extern SDL_DECLSPEC int SDLCALL SDL_GetVersion(void); 149 | 150 | /** 151 | * Get the code revision of SDL that is linked against your program. 152 | * 153 | * This value is the revision of the code you are linked with and may be 154 | * different from the code you are compiling with, which is found in the 155 | * constant SDL_REVISION. 156 | * 157 | * The revision is arbitrary string (a hash value) uniquely identifying the 158 | * exact revision of the SDL library in use, and is only useful in comparing 159 | * against other revisions. It is NOT an incrementing number. 160 | * 161 | * If SDL wasn't built from a git repository with the appropriate tools, this 162 | * will return an empty string. 163 | * 164 | * You shouldn't use this function for anything but logging it for debugging 165 | * purposes. The string is not intended to be reliable in any way. 166 | * 167 | * \returns an arbitrary string, uniquely identifying the exact revision of 168 | * the SDL library in use. 169 | * 170 | * \since This function is available since SDL 3.2.0. 171 | * 172 | * \sa SDL_GetVersion 173 | */ 174 | extern SDL_DECLSPEC const char * SDLCALL SDL_GetRevision(void); 175 | 176 | 177 | /* Ends C function definitions when using C++ */ 178 | #ifdef __cplusplus 179 | } 180 | #endif 181 | #include 182 | 183 | #endif /* SDL_version_h_ */ 184 | -------------------------------------------------------------------------------- /src/sdl2_image.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const sdl = @import("zsdl2"); 3 | 4 | test { 5 | _ = std.testing.refAllDeclsRecursive(@This()); 6 | } 7 | 8 | /// Load an image from a filesystem path into a software surface. 9 | pub fn load(file: [:0]const u8) !*sdl.Surface { 10 | return IMG_Load(file) orelse sdl.makeError(); 11 | } 12 | extern fn IMG_Load(file: [*:0]const u8) ?*sdl.Surface; 13 | 14 | /// Load an XPM image from a memory array. 15 | pub fn readXpmFromArray(xpm: *[*:0]const u8) !*sdl.Surface { 16 | return IMG_ReadXPMFromArray(xpm) orelse sdl.makeError(); 17 | } 18 | extern fn IMG_ReadXPMFromArray(xpm: *[*:0]const u8) ?*sdl.Surface; 19 | -------------------------------------------------------------------------------- /src/sdl2_ttf.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const sdl = @import("zsdl2"); 3 | 4 | test { 5 | _ = std.testing.refAllDeclsRecursive(@This()); 6 | } 7 | 8 | pub fn init() !void { 9 | if (TTF_Init() < 0) return sdl.makeError(); 10 | } 11 | extern fn TTF_Init() c_int; 12 | 13 | pub fn wasInit() bool { 14 | return TTF_WasInit() == 1; 15 | } 16 | extern fn TTF_WasInit() c_int; 17 | 18 | pub fn quit() void { 19 | TTF_Quit(); 20 | } 21 | extern fn TTF_Quit() void; 22 | 23 | pub const Font = opaque { 24 | pub fn open(file: [:0]const u8, ptsize: i32) !*Font { 25 | return TTF_OpenFont(file, ptsize) orelse sdl.makeError(); 26 | } 27 | extern fn TTF_OpenFont(file: [*c]const u8, ptsize: c_int) ?*Font; 28 | 29 | pub fn close(font: *Font) void { 30 | TTF_CloseFont(font); 31 | } 32 | extern fn TTF_CloseFont(font: *Font) void; 33 | 34 | pub fn renderTextSolid(font: *Font, text: [:0]const u8, fg: sdl.Color) !*sdl.Surface { 35 | return TTF_RenderText_Solid(font, text, fg) orelse sdl.makeError(); 36 | } 37 | extern fn TTF_RenderText_Solid(font: *Font, text: [*c]const u8, fg: sdl.Color) ?*sdl.Surface; 38 | 39 | pub fn renderTextShaded(font: *Font, text: [:0]const u8, fg: sdl.Color, bg: sdl.Color) !*sdl.Surface { 40 | return TTF_RenderText_Shaded(font, text, fg, bg) orelse sdl.makeError(); 41 | } 42 | extern fn TTF_RenderText_Shaded(font: *Font, text: [*c]const u8, fg: sdl.Color, bg: sdl.Color) ?*sdl.Surface; 43 | 44 | pub fn renderTextBlended(font: *Font, text: [:0]const u8, fg: sdl.Color) !*sdl.Surface { 45 | return TTF_RenderText_Blended(font, text, fg) orelse sdl.makeError(); 46 | } 47 | extern fn TTF_RenderText_Blended(font: *Font, text: [*c]const u8, fg: sdl.Color) ?*sdl.Surface; 48 | }; 49 | -------------------------------------------------------------------------------- /src/sdl2_version_check.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const sdl2 = @import("sdl2.zig"); 3 | 4 | test "compiled version should be same as linked version" { 5 | try std.testing.expectEqual(sdl2.VERSION, sdl2.getVersion()); 6 | } 7 | --------------------------------------------------------------------------------