forked from Green-Sky/tomato
Squashed 'external/sdl/SDL/' changes from 399bc709b7..0d7df16812
0d7df16812 Timers are a required platform feature 518b070aa9 Fixed drop event coordinate conversion 3ca8cee874 Sync SDL3 wiki -> header 8bf74280e0 docs: Note SDL_UpdateWindowSurfaceRects can update beyond specified areas. 9408299bad Set the number of audio devices to 0 if audio hasn't been initialized be0ba78c56 Convert the coordinates in drop events as well (thanks @Dragon-Baroque!) e6c8872fdc Fixed bug #7614: Segmentation Fault in SDL_BlitSurface ce0e0675de Fixed bug #8301 - Software renderer draws long lines incorrectly / SDL_RENDERLINEMETHOD_GEOMETRY 6e48d4532c Added raw input device handle for WM_INPUT mouse button handling cf5e0637b5 Touchpads already have their right/left buttons swapped in raw input fb2d7ed83e Restore window minimum and maximum size if it is recreated 915afae514 Remove force using one thread 64a3e2d17d Remove ps2_driver from workflow 464a41411e Sync SDL3 wiki -> header 4f3d4bd110 wayland: Add the ability to import and wrap external surfaces 99f6bcf504 Sync SDL3 wiki -> header 3a4ac15a27 Make Xbox GDK code public (and fix some GDK code rot) (#8844) 649556befa win32: Let windows manage the floating state unless explicitly overridden d4a9748740 win32: Fix test failures 101f903bb1 testgeometry: allow to use arrows to move the triangle 4033a0a83b Prevent ASAN warning: like SDL_triangle.c:305:30: runtime error: left shift of negative value -672 (even if the value was correctly computed) f0b9c7f0f0 Let Windows track floating window state 98be55894e Moved window state change handling from WM_WINDOWPOSCHANGING to WM_WINDOWPOSCHANGED 7efeb36131 Pass the frame DPI to WIN_AdjustWindowRectForHWND() e4ee1cade7 Revert "SDL_windowsevents.c: fixed -Werror=unused-variable" f8cce4ead4 SDL_windowsevents.c: fixed -Werror=unused-variable 277fded7ba Refactor AdjustWindowRectEx() into WIN_AdjustWindowRectForHWND() 312160935d Removed deprecated use of __IPHONEOS__ (thanks @Dragon-Baroque!) 483155bbf9 Fixed borderless window client area calculation cf0d1d7234 Fixed ASAN warning, runtime error: left shift of 160 by 24 places cannot be represented in type 'int' 0c6b070761 Capture debug macros off by default b5bc64aa55 Fixed pause key on Windows (thanks Mikhail!) d766f68cb3 Fix compile error with XInputOnGameInput.h ec2159d492 tests: Clean up the window creation properties in the Wayland custom surface example 9a77813df0 WinMain is specified by the Win32 API as having extern "C" linkage 6407e0cc37 Added attribution for GIP protocol handling (thanks @medusalix!) 3a219caf3d wayland: Restore accidentally removed line of code ccae9c1ef6 Only initialize audio drivers that have been requested 590d0bec6f Revert "Make sure new windows have mouse and keyboard focus if there's no windowing system" 5948ea997f Make sure new windows have mouse and keyboard focus if there's no windowing system 05d18aab1c Sync SDL3 wiki -> header 4b6df89238 wayland: Add a property to allow creation of a wl_egl_window object even if OpenGL is not enabled f7dd0f9491 wayland: Allow the creation of roleless window surfaces for custom application use 4417250d0d wayland: Remove the registry from the window properties 392796e49c wayland: Eliminate redundant protocol checks 82f2c4d581 render: Renamed SDL_GetTextureRenderer to SDL_GetRendererFromTexture. 95066ce2a0 Sync SDL3 wiki -> header df438a3170 opengl: OpenGL renderers need to support texture target in properties. 8e7c0b34d7 test: If SDL_CreateRenderer() fails, say why 022ff075b9 test: When listing test-cases, say which ones are disabled 44adab7dfd Sync SDL3 wiki -> header 059fb560ba gamepad: Clarify range and direction of axes 4942027117 Sync SDL3 wiki -> header e056f52f7d include: Remove string literals from properties documentation. e8c595af5c Sync SDL3 wiki -> header adef35b9ec include: Attempt to make new properties documentation wiki bridge friendly. 4ffec098b7 Sync SDL3 wiki -> header 9bc7cfc755 render: Added SDL_GetTextureRenderer(). 7eae08cfc4 Removed SDL_GL_BindTexture() and SDL_GL_UnbindTexture() 4d5bffc323 Sync SDL3 wiki -> header 1a13dae219 Added constant definitions for SDL properties 3deefa6b43 Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT 2348e8b6a2 Add hint to make SDL handle dbus_shutdown() d3daba791a Don't try to send the PS third-party feature request to the Logitech G815 keyboard 014a63b4b5 Renamed ShowTextInput/HideTextInput to ShowScreenKeyboard/HideScreenKeyboard on Android 3a9a52fe6c updateKeyboard should use the SDL window's screen instead of the view window's screen, which may be nil. e100992c17 Added mapping for the RX Gamepad, e.g. Pandora Box 7 139a0931a3 Fix memory barriers on ARMv5 21c80ac843 Added a practical example of confirm/cancel gamepad button handling 787a15f760 Fix Mac child windows that are created hidden showing if their parent window is shown d6b1fc9576 Add SDL_MAC_REGISTER_ACTIVATION_HANDLERS hint to allow disabling the normal application startup/activation/deactivation handlers 7c5e694022 Ignore a new warning in Visual Studio 2022 73d02184d7 docs: Add Wayland to the SysWM migration example c03c01e9b2 Make sure we get mouse events as soon as possible 5cbdeab799 Rename SDL_mslibc_x64.asm -> SDL_mslibc_x64.masm ed62d6e7de cocoa: Set the titled flag on fullscreen space windows b4b5dbd92f testcontroller.c: fixed warnings. 31851a50d2 Fixed dropping raw input because of mixing GetRawInputBuffer() and WM_INPUT handling 987744aae8 Fix Duplicated includes 2b369a14ab Fixed allocation and alignment of raw input buffers bec1b8f849 Add basic rumble support to Steam Deck 8fe4a45edf Use GetRawInputBuffer() instead processing raw input one at a time 87b8f09657 Fixed warning: no previous prototype for function 'SDL_PrivateGetGamepadButtonFromString' [-Wmissing-prototypes] c2951655ff Fixed warning: missing field 'window' initializer [-Wmissing-field-initializers] 5b3ee51c6c Updated copyright for 2024 a7b79c483c Remove unused 'window' variable from -[Cocoa_WindowListener windowWillExitFullScreen] dd2d809407 AndroidShowToast: make OneShotTask members private final 44c2f344d6 Fixed build 2faae8457d The C standard defines a boolean expression as a signed integer value. e3d50619f8 Fixed fatal error: SDL_pen.h: No such file or directory dfe1a37bab Fixed error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] 423b1fafcd Fixed warning C4047: 'function': '__x_ABI_CWindows_CGaming_CInput_CIRawGameController **' differs in levels of indirection from '__x_ABI_CWindows_CGaming_CInput_CIRawGameController *' 7681695875 Revert "Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions" 8f94102b04 tests: Use unsigned format specifiers for printing flags 5d0c893723 wayland: Remove bitfield specifiers from boolean values 530b41d531 Fixed warnings in SDL_pen.c 9906d6d3bc Fixed warning C4244: '=': conversion from 'SDL_bool' to 'Uint8', possible loss of data ebd7f9adbd Fixed warning C4245: 'initializing': conversion from 'int' to 'Uint32', signed/unsigned mismatch in SDL_video.c dc1c27885e Fixed warning C4389: '!=': signed/unsigned mismatch in SDL_blit.c e813c72b3c Fixed warning C4245: 'return': conversion from 'int' to 'SDL_JoystickID', signed/unsigned mismatch dce626f469 Fixed warning C4244: 'function': conversion from 'int' to 'Uint16', possible loss of data 7f376277e5 Fixed warning C4244: 'initializing': conversion from 'SDL_bool' to 'Uint8', possible loss of data 61db102da9 Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions d71454da17 Store the surface properties in the reserved pointer of a surface b6a92c113f wayland: Don't apply old libdecor window dimensions 39e24e52c8 Fixed example of creating a window with properties dc450ba908 Added an example of creating a window with position ce4fe32ce3 Added documentation for getting the X11 display from an SDL window 327d31a5d9 Added documentation for getting the NSWindow from an SDL window 3976bbef2a Added documentation for getting the X11 window from an SDL window ffb8515c21 Use the Valve code name for the Steam Deck controller 43c40d30a2 Added comment for the BDA Pro Ex controller 61704b5862 Removed an assertion it's possible to hit c24b33d8d9 Fixed building with older Windows SDK 70ba3f2830 Report the D-Pad for HIDAPI gamepads as a hat ce329d60e4 Added support for alpha blending using palette alpha 9c3e831e33 uikit: Send fullscreen enter/leave events 5df3eac925 Sync SDL3 wiki -> header 0dfdf1f3f2 Fixed crash if joystick functions are passed a NULL joystick 4ce935b910 Fix static build with libdecor 0.2.0 5d6d149862 Allow passing in `extrainfo` value to `GetMouseMessageSource()` e0df963ef0 Fix wrong bit count in comment c2a55cd2c5 Add missing `(void)` in functions params a3c8f2f6cb Consolidate mouse-touch event checking logic d747daf03d Use correct touch check flag a961066d0b Add basic touch/finger support to `testpen.c` a3b5eb07b2 Removed extern "C" linkage from main() declaration 50e309bb17 Include SDL_events.h in SDL_main.h cae657140c Add Access Controller 74418e1aa8 Made the cursor list check a compile time assert instead of a runtime one d6fb0d91d8 Added testpen to the Visual Studio solution bbdd41f287 Fix windows touch using wrong axis for normalisation a28ac29aa0 Add missing cursor types 6daf2e943f Try SDL_UDEV_deviceclass to detect joysticks even if in a container 1bf78ed544 We get a resize event when the view enters fullscreen mode on iOS e3b5999bb4 Use the application requested size to determine automatic orientation on iOS 278e3f9184 Whoops, fixed setting fullscreen flag 69e60e0f1b Fixed setting fullscreen mode on iOS 0e5ea3cc4b Fixed infinite recursion when adding an accelerometer as joystick on iOS c3d84c3342 Record the initial input report mode and only restore simple mode if that's what we started with 10a8b750a0 Use common generic syscond for platforms with no cond implementation 4914e5bb78 PS2 use WaitSemaEx for waiting for semaphore with timeout bb0e0ae080 Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!) 312f98c2a1 Make sure the string is terminated, fixed invalid read in SDL_PrivateParseGamepadConfigString() 199f7cc3b1 x11: Ignore border extents when the border hint is unset 07e9603398 Sync SDL3 wiki -> header ffd82fb7c4 Add scaleMode to SDL_SoftStretch(), remove SDL_SoftStretchLinear(). 5dba04b29b Remove SDL_{Set,Get}SurfaceScale(). Add Scale parameter to SDL_BlitSurfaceScaled() and SDL_BlitSurfaceScaledUnchecked() (see #8732) e66896406d cocoa: Set appropriate flags on fullscreen spaces windows 57fcb9044c video: Remove more assumptions about window state in the video layer cb90653695 win32: use USER_DEFAULT_SCREEN_DPI instead of explicit 96 value a2e05480d6 Use crc16 return value when calculating GUID 2ad50e9675 Make the SDL3 surface ABI compatible with SDL2 f72d6a7fd9 Use more verbose names for properties, to match upcoming public property names 1f1ee6f77c Use the original manufacturer and product strings for the joystick CRC 4bb5e1f0f9 Added migration notes for migrating Steam Input support from SDL2 to SDL3 56f111dffc Fix compilation / same as sdl2-compat 72c366bf3d Fixed whitespace 3152b98e87 win32: minor fixup in WIN_UpdateKeymap() 2c4360ce8f Sync SDL3 wiki -> header c981a597dc Added Steam Input API support for game controllers a8f4f40d08 Sync more Steam Controller header definitions for the Steam Deck e6e54b22c8 Ignore all surface comparison output files in the testautomation directory 9d13be743b Make sure we're rendering whenever the activity might be visible, even if we don't have focus. 69ec0322d3 win32: Make leaving fullscreen when the window already isn't fullscreen a no-op 8f79e0b7f8 win32: Fix high-DPI debug logging a4496f7dcf Update doc: SDL_SoftStretch() and SDL_SoftStretchLinear() #8667 43309d38ed joystick: Extract 0x02a9 and 0x0291 PIDs into separate defines. 84a0d5f623 Added SDL_SetSurfaceScaleMode() and SDL_GetSurfaceScaleMode() to control scale mode using SDL_BlitSurfaceScaled() 4d5949dcf6 Added a controller name for the Steam virtual gamepad 695846f2ed Pass through the name of the controller for the XInput mapping 1745289b1b x11: Don't move the window when restoring and ensure that resize and position events are sent when entering or leaving fullscreen 08a7ca4d53 XInput: Use XInputGetCapabilitiesEx instead of fragile GuessXInputDevice 7f75178908 Verify that the %p format specifier works for 64-bit pointers 72b7acfe8a Don't create a TLS error buffer if we're just clearing the error 240e7747c8 Fix #8702: Add SDL_hidapi_steamdeck.c to Xcode target b937c54b66 win32: Set all size and position variables for external windows 8c285828e5 Fixed return value for SDL_UDEV_AddCallback() cbf9012c74 Fixed build 5547007915 Added test for inverted cursor 0ab13f2498 joystick: fixup for Wireless Xbox 360 Controller VID/PID detection in WGI backend. 627d134b9e Add support for monochrome cursors with inverted pixels under Windows. 21879faf48 wayland: Handle mouse focus when receiving touch events 58a5f5cbe8 Allow sendCommand() to be overridden by derived classes e6d8ef1a5b Revert "Back out Steam virtual gamepad changes" b0e7b7db6f Don't unload graphics libraries until after the window has been destroyed. 69288038ed Refactor away some additional integer types. f3048e3cd2 Add new file to vcxproj files. 5a21febecb Add new steam deck HIDAPI controller to controller database. 67d44c1017 Disable lizard mode while steam deck HID device is opened. 6dd6827343 Translate steam deck HID reports to SDL events. 94f621e030 Implement steam deck HIDAPI initialization. c1a7d0f96e Add steam deck detection and HIDAPI driver scaffold. 0baee3e676 Reversed test to be easier to read, more efficient, and match other code bddbd1e317 cocoa: Check the resizable flag along with zoomed status when resizing 835c733f4d video: Only sync when programmatically entering/exiting fullscreen c790572674 Use existing XUSB driver software PID 0x02a1 instead of PID 0x02fe 581d1cab25 You should call present when using a software renderer as well. 5173b0c2cc Make built-in joystick device lists extendable by using hints 34eb24ebc4 Back out Steam virtual gamepad changes 7529d25b2b Use the Steam virtual gamepad slot as the gamepad player index 445f08a0fb Print the gamepad player index when opening a gamepad 17723381da Sort Steam virtual gamepads by Steam controller slot f3d8a2def5 audio: Fixed resource leak in unlikely failure case during device add. 63ae84e140 x11: Improve sync algorithm 7e5511d3cd x11: Move unrelated variables out of XFixes #ifdef 3c5e9e6112 We can wait up to 500ms in onNativeSurfaceDestroyed(), so wait at least that long in onDestroy() 53cda988f4 Clear any errors from a previous run a197efe3a7 pen: fix leak caused by pen subsystem fbb0914b78 wayland+x11: free system cursors when quiting video 7484d02a2e testshape: use SDL_test to create multiple windows 20250aecc5 Sync SDL3 wiki -> header 4fd778119b video: Implement asynchronous windowing ace385a134 Revert "Fixed warning C33010: Unchecked lower bound for enum scancode used as index." e482f00a17 SDL_string.c (SDL_vsscanf): fix gcc build f00ecf5f19 Fixed building with older Windows SDK 7ca43995a1 Fixed warning C4028: formal parameter 1 different from declaration aab7432f5f Fixed analyze warnings for SDL_dynapi_procs.h c484140f56 Fixed warning C33010: Unchecked lower bound for enum scancode used as index. 02a116217d Fixed Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). 91da942b33 Fixed warning C28251: Inconsistent annotation for 'SDL_RWvprintf_REAL': this instance has no annotations. b8840801cc Fixed analyze warnings in SDL_xinputhaptic.c 8e0d728c67 Fixed warning C26451: Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). 6a736d7766 Fixed warning C6340: Mismatch on sign: 'unsigned char' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 1fcc75ba81 Fixed warning C6340: Mismatch on sign: 'unsigned char' passed as _Param_(4) when some signed type is required in call to 'SDL_snprintf_REAL'. 7f2e16db8b Fixed warning C6340: Mismatch on sign: 'const unsigned short' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 163de8e697 Fixed warning C6001: Using uninitialized memory 'rdi'. e29393e407 Fixed warning C6001: Using uninitialized memory 'devName'. 0f34ca2e71 Fixed analyze warnings in SDL_xinputjoystick.c 2b5c7db645 Fixed analyze warnings in SDL_render_d3d12.c a28769759b Fixed warning C26052: Potentially unconstrained access using expression '(signed char *)info' 6ee34380f4 Fixed warning C6011: Dereferencing NULL pointer 'viewport'. 230581f4a8 Fixed warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2). 3775d9be4b Fixed warning C28251: Inconsistent annotation for 'SDL_LogMessageV_REAL': this instance has no annotations. b512182222 Fixed warning C6340: Mismatch on sign: 'unsigned int' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 8a82f7e837 Fixed warning C33005: VARIANT '&valueX' was provided as an _In_ or _InOut_ parameter but was not initialized fda039e6f8 Fixed analyzer warnings for SDL_string.c 22f44aefe7 Fixed warning C6340: Mismatch on sign: 'int' passed as _Param_(3) when some unsigned type is required in call to 'SDL_sscanf_REAL'. eab2d97d07 Fixed warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2). 41bfcad5d7 Fixed warning C6340: Mismatch on sign: 'unsigned short' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 54dc73aa88 Fixed warning C6386: Buffer overrun while writing to 'palette_saved_alpha': the writable size is 'sizeof(Uint8)*((palette_saved_alpha_ncolors))' bytes, but '2' bytes might be written. 0dad56354c Fixed warning C6326: Potential comparison of a constant with another constant. c9b243fb56 Fixed warning C6263: Using _alloca in a loop: this can quickly overflow stack. 4ccc53edfe Fixed warning C6011: Dereferencing NULL pointer 'display'. 3db4695ac7 warning C6340: Mismatch on sign: 'unsigned int' passed as _Param_(3) when some signed type is required in call to 'SDL_LogDebug_REAL'. c7d81d936a Fixed warning C6031: Return value ignored: 'GetKeyboardState'. 69b9d44bdc Fixed warning C26451: Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). a9b87ee201 Fixed warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days. Code that does not take that into account can loop indefinitely. GetTickCount64 operates on 64 bit values and does not have that problem 21f273ecc7 Fixed warning C6255: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead. 0c4cb3d153 Fixed warning C26451: Arithmetic overflow: Using operator '<<' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '<<' to avoid overflow (io.2). 06f8f9a891 Fixed warning C6326: Potential comparison of a constant with another constant. 3e54061fa8 Fixed warning C6011: Dereferencing NULL pointer 'SDL_disabled_events[hi]'. 226f8fde09 Fixed warning C28182: Dereferencing NULL pointer. 'streams[j]' contains the same NULL value as 'stream' did. fe6b3ab0b0 Fixed warning C6031: Return value ignored: 'CLSIDFromString'. f3b0149756 Fixed warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2). 6cfce101fb Don't call the property cleanup function if setting the property fails 14380ec48a Fixed signed/unsigned comparison warning ac0751a652 Added SDL_strnstr() 7c71e72193 SDL_render: Call InvalidateCachedState to initialise some of driverdata values (eg '*_dirty' to 1). At the earliest place, immediatly after driverdata is set. (Doing it in SDL_render.c, after creation, would be too late, because there're renderers that already use/change those values in the CreateRender() function). 058213366b Make sure we use alpha of 0 when clearing a transparent window with no content ecd56bb8f0 Removed SDL_GetErrorMsg(), trivially implemented in application code 66e532fa61 Handle out of memory errors without any allocation 579681a372 fixed SDL_SCANCODE_LEFT array position in scancodes_windows.h 675423f096 Sync SDL3 wiki -> header 744a29b88f WGI: Cleanup code a bit (#8647) e4582e6edc Sync SDL3 wiki -> header df0fd55891 wikiheaders.pl: README files are no longer in Windows endline format. 1072b6e86e docs: fixed typo f184dea16c uikit: Patched to compile. 447b508a77 error: SDL's allocators now call SDL_OutOfMemory on error. 70b65d4170 cocoa: Resync modifier keypressed on NSEventTypeFlagsChanged event. d1b831e232 include: Clarified documentation for two functions. daa38dc793 touch: Replace GetNumTouchDevices/GetTouchDevice with a single function. dd47da8a5c gamepad: Replace GetNumMappings/GetMappingByIndex with a single function. dfee3f9e92 render: Replaced SDL_RenderFlush with SDL_FlushRenderer. eef5c53668 docs: Moved CREDITS and INSTALL to markdown format. f32575dfab docs: Convert everything to Unix-style endlines. c5daf8adb1 testcontroller: Don't query the mapping list until after they are available. df05d5eff4 Fix scroll wheel handling in testmouse 63d4bd4e57 SDL_SendKeyboardText: remove workaround from 1e12d7c, fix use of iscntrl fea6e7afb1 cmake: copy sources to binary directory in separate target 9faa7977bd UWP: Add support for supplementary Unicode characters input 7b628ea4d5 Win32: Simplify Unicode text input code 411c70abb1 Fix the target membership of SDL_pen.h (thanks kanjitalk755!) 3e6513c773 document the purpose of SDL_SetTextInputRect 1e12d7cfb6 Make sure we don't pass UTF-8 to SDL_iscntrl() 9a206adbee UWP: Use Windows.UI.Core.CoreDispatcher.AcceleratorKeyActivated event for keyboard 309ea2d5f9 UWP: Simplify Win32 scan code to SDL scan code mapping acc5bb89f8 [Win32] Better keyboard button mapping to SDL scan codes 6b28065e9e Reformat Win32 scan code table 7e86b6aef2 Win32: Fix keymap for keyboard layouts that can print UTF-16 surrogates and ligatures 08c6ac1b16 test: SDLTest_PrintEvent now reports key event mod state. 571e9796b9 Fixed the GameCube HIDAPI controller mapping dd984dcd9f Removed HIDAPI controller mappings 3817f5126e cocoa: Use `-[NSApplicationDelegate applicationSupportsSecureRestorableState]`. c5b0ff77d7 test: testwm2 now displays keyboard mod state. 5772e00c3f cmake: disable oss by default on OpenBSD, not FreeBSD ceac93ade2 Set framebuffer_srgb_capable to the actual value obtained (#8634) ed3fad1880 cmake: disable oss by default on Linux, NetBSD and FreeBSD 6bb40f1d8d SDL_VideoCapture: allow add/remove device at runtime on linux f0e47f8ee0 Added support for the NACON Revolution 5 Pro controller 2f806c89b5 initial import of hidapi netbsd uhid native backend from mainstream 1b284cd415 X11 pen detection: fix misclassification due to improper init c4ca64deaf ci: do 'brew update' & don't run dependent checks on installed things d486de6349 cmake: fixed iconv detection test program 42a8139fd6 render: Clip bresenham lines against a real viewport thing. 4a40a272bd render: Patched to compile. 983f178b7d render: Clip lines before Bresenham algorithm generates points. db7f6425d0 rect: Avoid numeric overflow on massive lines in SDL_IntersectRectAndLine. e548044a82 ci: add NetBSD to test matrix dd5b8db3a6 SDL_hidapi requires libusb >= 1.0.16 6ba90f7775 render: Batching is always enabled now! b24d6bd59a opengl: Creating a texture trashes the cached `texturing` state, fix it. dcf04559db render: GL-based renderers should treat adaptive vsync as vsync being enabled. 74a2542564 x11: Deal with difference in GLX_EXT_swap_control_tear behavior. 08fac5b1b2 SDL_PenModifyForWacomID: return zero as axis_flags upon failure. aaba01aee4 hidapi: syncing with mainstream: 5730eb67f0 add HAVE_GCC_DIAGNOSTIC_PRAGMA to SDL_internal.h, use it 42c8366fdc revise iconv detection: a45b371de0 cmake: create and install SDL3::Jar target for Android 53544cabaa psp: fix copy/paste error from SDL2 in PSP_VideoQuit(). 6cde96f9a0 psp: Hook up event subsystem init/quit. e9659f5738 Removed some function declarations that don't actually exist. 3264e64738 SDL_RunApp: Make sure argc/argv are stable if the caller didn't define them. eca79e38db Removed test shape images 81fc7ded78 Removed the window shape API for SDL 3.0 45938bbfa5 Corrected comment 059e550e98 Fix 3DS Analog Values (#8581) dbf14df80f Fix joysticks returning invalid device IDs d2db3f3993 ci: cache android ndk archive d6291d4d42 alloca: use alloca from <stdlib.h> on NetBSD f26a93211f SDL_bsdjoystick: fix -Wundef warning on FreeBSD d1def7f033 cmake: add openbsd wscons sources to build, if supported 86d77bbcc5 kmsdrm: restrict KMSDRM_ReleaseVT/KMSDRM_AcquireVT to SDL_INPUT_LINUXEV 94ad1a4ae4 SDL_bsdjoystick.c: fix -Wundef warning. e761770c24 No, this wasn't right b7d7e54895 Fixed uninitialized variable 119e02f314 Always use 'm' for controllers provided by the MFI joystick driver 75df4cc5c2 Don't tickle PS4 Bluetooth controllers in simple mode 0d431015bf Extract BMP magic into separate define 0413f6fc49 Use SDL_iscntrl() call instead of manual code that is doing the same (#8593) fd91178d7f Make size cursors be double arrows on Wayland 5e9b0820f3 Add cursors for X11/Wayland window resizing 91e122316c Use SDL_small_alloc() instead of SDL_stack_alloc() in CreateMaskBitmap() b76f8de298 Hit testing tweaks for X11 and Wayland (#8582) 5b1c68c2f3 testshader: Don't make local variables with the same name as GL entry points. 30a2291d59 Fixed compatibility with sdl2-compat (thanks @sezero!) 49d58bc73a Cleanup WIN_CreateCursor() code a bit 4722269fb6 tests: Print window occluded log events 5db781cc3d Use the correct pixel formats for OpenGL ES on big endian 05e7dcf8f8 Support returning <8bpp surfaces in SDL_LoadBMP_RW 773ec1cfcb Extend blitting support for all <8bpp formats 753bbd199e Add SDL_PIXELFORMAT_INDEX2LSB and SDL_PIXELFORMAT_INDEX2MSB fda69e5e79 Test both MSB and LSB indexed surfaces in testautomation 39870031d1 use format string attributes for functions accepting va_list params, too 666301f9f9 Fixed build with older macOS SDK 238987df3b Always use physicalInputProfile on OS versions that support it e424dcca4b More fixing the build with older macOS SDKs 4ebb0c6dac Revert "Fixed build" 7abacc9f9f Fixed build ac1f896f89 Fixed building with older macOS SDK 8043dad369 Fixed build warning 5c8c3931f2 Removed outdated information about SDL_GetWindowWMInfo() e0d0d140b2 Fixed SDL_GetWindowWMInfo() code example f61c0f3dc1 SDL_HINT_TV_REMOTE_AS_JOYSTICK should only affect Siri Remotes on Apple TV 51fc134cad Added support for the second generation Siri Remote on Apple TV bfba9de43a Revert "Map Siri Remote touchpad to D-Pad for consistency with physicalInputProfile mapping" f2c12fe5f3 Removed TODO.txt d4448fe3d2 Update virtual joystick test now that we're just using abxy for mappings, for compatibility f40f272107 Fixed build 34bdd321bf Improved navigation while setting up controller mapping 57e5c7f6ee We'll just use the legacy names for face buttons in the mappings 051ed397d1 Removed testautomation_syswm.c from the Xcode project fb08c22abf Disable controller state debug messages 2999634f29 Map Siri Remote touchpad to D-Pad for consistency with physicalInputProfile mapping 2ff9255f29 Print the GUID for controllers that don't have a mapping 64939d3586 Switch the menu button on the Apple TV remote to the B button to match UI guidelines 0fe5713964 Improved GCController handling on Apple platforms aaf54b09a1 Revert "Cleanup WIN_CreateCursor() code a bit" e923a458ea audio: Protect against race conditions when closing a physical device. 8fa0746d4a audio: Fix postmix state when migrating to new default devices. 078995bbe0 x11: Set the skip taskbar and skip pager atoms on utility windows a58af6d0d1 wasapi: Reference devices when proxying to management thread. 34392db9c3 Fixed IOS_SupportedHIDDevice() returning SDL_FALSE before initialization 708f18d49e Added SDL_HINT_JOYSTICK_IOKIT and SDL_HINT_JOYSTICK_MFI to control whether the IOKit and GCController drivers should be used for joystick support. bd4966999b Replacing SDL_SCANCODE_AUDIOMUTE by SDL_SCANCODE_MUTE on Windows 15504da0b8 Fixed mouse wheel scrolling direction on iOS f5600fd9f4 Fall back to using the physical profile for Apple controllers if they don't match a standard profile 924de4df48 Enable transparent windows when using the D3D11 renderer 1c64366b80 Added SDL_CreateRendererWithProperties() and SDL_CreateTextureWithProperties() 7203641597 Note that the SDL window properties are read-only e0c45c6c98 Renamed SDL_WINDOW_FOREIGN to SDL_WINDOW_EXTERNAL 229b7b9d50 SDL_CreateWindowWithPosition() and SDL_CreateWindowFrom() have been replaced with SDL_CreateWindowWithProperties() 2c1fbe1967 Revert "Check to make sure the Windows joystick device has buttons and axes" edd044e901 Fixed the ROG PUGIO II showing up as a game controller 861b1ebd12 properties: Use a mutex instead of an RWLock to guard the hash table dd8ab67bd9 Sync wiki -> headers. 91460fc13d include: Fixed up documentation in SDL_pen.h 876c97454a Cleanup WIN_CreateCursor() code a bit 8766aa39d6 Sync wiki -> headers. e5ffd6d8eb include: Removed `\link` and `\endlink` Doxygen tags. 1c4723ac66 SDL_CreateWindowFrom() now takes a set of properties that describe the native window and options. 6afae6681b Allow casting properties of different types bd269b0f41 Added SDL_SetBooleanProperty() and SDL_GetBooleanProperty() c47ac5b2df include: Fixed copy/paste error 0efb3d90e0 audio: removed a fixed FIXME comment. 69cae07cc1 cpuinfo: Fix detection of physical memory above 2GB on NetBSD 45fc828c95 move SDL_EVENT_WINDOW_PEN_ENTER and SDL_EVENT_WINDOW_PEN_LEAVE down 0907f345cb Added property types: pointer, string, number, float 7c80ac6df7 API for pressure-sensitive pens + XInput2/Wayland d3e43668d0 Revert "Sync SDL3 wiki -> header" 43571769f1 Sync SDL3 wiki -> header 843873626c Handle window resizing on the render thread in D3D11 and D3D12 f66f61de01 Fixed missing "0" in the button list 04b6b2979f Re-add SDL_assert() with non boolean ptr syntax (#8530) b374105975 Replaced SDL_GetTextureDXGIResource() with texture properties 09d1e9defb Only update the battery status for Bluetooth Switch Pro controllers 87794d03ad Added shortened name for "Nintendo Co., Ltd." fbb6934905 Added support for the Dragonrise GameCube adapter with VID 0x1843 d98e1bdfe1 Use the standard gamepad type for Switch Pro controllers using the GameCube form factor a5a47d3bee Fixed crash if there is no controller mapping 312faf9305 Updated documentation for the controller face buttons 2991b9f6ac SDL now represents gamepad buttons as positional elements with a separate label 8708ba7393 Don't leak if realloc fails 36b2d2e463 Fix memory leak in SDL_SendDrop() dfb87e1099 Fix uninitialised variable 'properties' e54c5e0204 Fix condition in SDLTest_TrackAllocations() 89408a9705 wasapi: ResetWasapiDevice no longer blocks on management thread. aa7baf63aa Sync wiki -> headers. 74f3643bfa wayland: Add missing break to switch statement 2d6bae70b4 Older gcc does not support #pragma GCC diagnostic inside functions d8600f717e Pointer as bool (libsdl-org#7214) 23db971681 x11: Ignore deprecated declaration of XKeycodeToKeysym 61c39ce848 ci: re-enable Intel compilers on ci 4ac3f5c07e Updated Xcode project with the video capture API 59f93e20a7 Add SDL Video Capture, with back-end for linux/macos/ios/android 3ab98a3572 Removed debug print statements (thanks @stsp!) f4b61fff30 Implemented VT switching for KMSDRM on Linux 391a3d23d0 cmake: the compile-time pdb does not have a suffix, if set a6541166bc cmake: also install pdb files of static libraries 2e3f574f8f cmake: don't add the C runtime library to the .obj file (when using MSVC) bea34c5380 Fixed a memory leak at window creation. b5347c3364 Fixed emscripten and iOS builds 02f356439d Allow the application to draw while Windows is in a modal move/resize loop 1934417b4d Show the existing mapping when a controller is connected 407a3cb4e0 Fixed infinite recursion initializing properties 979214363f Added SDL_GetGlobalProperties() 151cdfa99f Added the "SDL.window.wayland.registry" property 6c91b28e71 Added the "SDL.renderer.d3d12.command_queue" property 4e8d1ec983 Fixed crash trying to create a metal view with the dummy driver fd4a2cce9e SDL_syswm.h has been removed and replaced with window properties aea6e6de6f Simplified SDL_SetProperty() and added SDL_SetPropertyWithCleanup() a1941fad6c Replaced SDL_RenderGetD3D11Device(), SDL_RenderGetD3D12Device(), and SDL_RenderGetD3D9Device() with renderer properties. 0cd4b7d3e3 Added display properties a02afbaea5 Clean up window properties when the window is destroyed 8668943746 Standardized property names for internal SDL properties a4c6b38fef Fixed FreeBSD build d9e6dcc650 Fixed FreeBSD build 7cc3e94eb2 Store the requested muted state ce9e1bd324 Don't mute the console input if we can't read the keyboard 0a1b6b270f sdlchecks.cmake: Clarified the reason why shared X11 mode doesn't work 80b2bbad21 Removed useless branch test 15bc12165a Actually we need to enumerate the 8BitDo Xbox SKUs 8049af3355 Assume all 8BitDo Xbox controllers have a share button ed1e0c1530 Make sure joysticks are locked when adding and removing them 415283ef38 Fixed checking for linux/input.h fea2504a37 Prioritize the pipewire audio driver over ALSA 04e98d2236 Added missing calls to SDL_InvalidParamError("surface") 521bbcc15e Destroy the window surface if we've created it for the software renderer 28e623c504 Added a mapping for the Atari VCS controller connected over Bluetooth (thanks @WizzardSK!) 4106697774 Make sure we include the null terminator in XLookupStringAsUTF8() b5057edf29 Remove unused SDL_TextureModulate enum 9458cbf75e Removed unused SDL_OSEvent 1a57f6bb29 wayland: Remove QtWayland extensions 5f920d6639 fix emscripten build after commit 07cb7c10 22016b4eae Enable the 5th player LED on the DualSense controller 66cf30c2de Removed misleading comment dbcd390cdf Log drag and drop position updates in SDL test programs 07cb7c10a1 Fixed connecting and disconnecting real-joysticks closing virtual joysticks in Emscripten (thanks David!) 869257a5c1 SDL_migration.cocci: Added a thing for SDL_Vulkan_CreateSurface. c6d9fb1ad7 hidapi: Avoid memcpy'ing to NULL. 4d1aecc225 vulkan: Patched to compile on iOS. fccec65afe Sync SDL3 wiki -> header 2f92807087 vulkan: SDL_Vulkan_CreateSurface now accepts an app-provided allocator. c53843a961 docs: Remove Doxygen `\brief` tags. c132295ad7 SDL_FlushEventMemory is not a public procedure. 7ac281f800 Sync wiki -> headers. f7d40b7594 Added 10-bit pixel formats in addition to SDL_PIXELFORMAT_ARGB2101010 3e4d7e48b0 Fixed memory leak in XInput code bc3d9e99f3 Only save ibus_addr_file after we've successfully read an address from it. 04dfca958a Added a note to events indicating that memory is owned by SDL 20cd789bab Improved migration documentation for the event memory change. 459f17257c cmake: fix MSVC unrecognized option link warning 761390b62f cmake: detect linker id, and assume MSVC does not support version scripts d2e005ee13 dynapi: remove duplicated SDL_LoadWAV entries 21ff699251 test: Fix popup test crash on exit 70c149c88f Automatically clean up memory associated with events 1a83bf2399 fix a possible memory leak in SDL_vasprintf() 59b37d0e5b cmake: fix Windows unrecognized option link warning 9302d7732d Fixed touch normalized coordinates ff3c20a799 Sync SDL3 wiki -> header 17a0fe3a0c Sync SDL3 wiki -> header 14d2471a8f Sync SDL3 wiki -> header 2ad22eeeb5 Sync SDL3 wiki -> header 930438dfb7 Added note that the #ifdef is for !__IOS__ c56583fe45 Fix duplicate symbol on iOS/tvOS 2b62f25a6f Add SDL_sysmain_callbacks.c to the Xcode project 4ab31ca678 Fix dropping file event 5dce4bc716 Makes SDLInputConnection and DummyEdit public classes (thanks Cole!) d3f2eb2aba Use XINPUT_STATE instead of XINPUT_STATE_EX (thanks Andrew!) 3a482ebae0 Add createSDLMainRunnable() to SDLActivity (thanks Cole!) b9784feb24 Fixed potential uninitialized memory access (thanks Mathieu!) 75ea3a8d32 Dynamically allocate long text for SDL_EVENT_TEXT_INPUT events 2a1660ab51 Additional cleanup for SDL_RWprintf() (thanks @sezero!) e5f2cea234 Sync wiki -> headers ad842dd5ad Fixed a typo in SDL_log.h f9d11807c0 Added SDL_RWprintf() and SDL_RWvprintf() to do formatted printing to an SDL_rwops stream 52c4e3eab3 events: Update self-referential pointers when copying event objects 91f0456391 Add the source application for drag and drop events (thanks Nathan!) 1a8bf31a69 include: Fixing whitespace on SDL_MixAudioFormat. d07a264a9b Use the default UCS2/UCS4 conversion rather than non-portable INTERNAL encoding 780b6612a9 wayland: Wayland_Vulkan_GetInstanceExtensions didn't set the count variable. 46b940d571 Updated documentation to note that the event callback is called on the same thread as the main iteration callback 4481754359 Make sure we only dispatch events on the main thread when using application callbacks 274da8561c Updated the migration guide to note that you can check the return value of SDL_AddEventWatch() ad9dcdbbce Clarify that you should use the other field when reading the event a19029e3c1 docs: Updated README-main-functions.md based on feedback. 019468dc59 main: Check for SDL_AddEventWatch failure, now that it can report it. 7e445da569 Added SDL_CleanupEvent() c4bf05fd9d Added subsystem refcount tests to testautomation 7f65ed6461 Handle subsystem dependencies recursively a6b85c81cc Fixed build 3ab6670cb1 Sync SDL3 wiki -> header f439ccfc1a Updated return values for SDL event functions e0379c3b37 Grab events in large chunks in SDL_IterateMainCallbacks() ad5264e54f Don't run SDL_IterateMainCallbacks() if the init call returns an exit code dad1a84be4 Fixed building Vivante video driver fe175d025f Fixed building Vivante video driver 0b460f34ba The HP HyperX controllers have a share button f3261fedcc Code cleanup now that SDL_bool is equivalent to a C boolean expression a76d8e39aa Changed SDL_bool from an enum to unsigned int cf7e5bd0e8 Sync SDL3 wiki -> header 853c28e624 docs: Added first draft of README-main-functions.md 70d75b4a23 Sync wiki -> headers ea02630143 More audio migration clarification 14980b25a8 Clarify documentation for audio callback migration 6cf84e2c5b cmake: fold HAVE_INPUT_EVENTS into HAVE_LINUX_INPUT_H 5e869d1b35 fix Cocoa_Vulkan_GetInstanceExtensions prototype for Mac 07a776f255 include: Fixed documentation for SDL_Vulkan_GetInstanceExtensions. 5b3a2c6df6 docs: Updated SDL_Vulkan_GetInstanceExtensions info in README-migration.md. 9224a0a2d8 Fix emscripten, android, uikit and windows d0d8b28df1 Change SDL_Vulkan_GetInstanceExtensions 338974bb29 SDL_test_memory.c: fix build against older windows SDKs. 618d15bce6 Fixed typo ad0af48883 Check to make sure the Windows joystick device has buttons and axes ac6b32bb02 gendynapi.py: Discard SDLMAIN_DECLSPEC functions. 9c664b0062 main: Added _optional_ callback entry points. 9323417e9c Fixed gendyapi.py parsing of SDL_RELEASE_GENERIC 759cdf6159 audio: Fixed GetFirstAudioDeviceAdded(). 0e614d9179 audio: Massive reworking on thread locking. 40fb76196c audio: Don't let simplified audio streams bind to new devices. 24e3328cca audio: Don't reset device ID counter on subsystem init/quit. 5d95cbde37 cmake: reset check state before testing -fobjc-arc f18120c83c cmake: check -fobjc-arc compiler flag on Apple platforms 4aacc4b92e cmake: file(RELATIVE_PATH) needs 2 absolute paths dcc8805c21 testaudio: Fixed compiler warning on Visual Studio. 9cb259e865 audio: Never SDL_PushEvent from anywhere but SDL_UpdateAudio(). 875e45e70b wayland: Sanity check pointers and protocols before confining 0e87b71d08 wayland: Check the relative pointer handle before destroying 6127ac0871 Use SDL_DISABLE_ALLOCA instead of HAVE_ALLOCA in SDL_stdinc.h 552bee47cb Clear any previous errors if we successfully show a message box 343da852a6 Don't try to use the Wayland messagebox if we're not in Wayland f63e9a8a3f wasapi: Handle disconnected devices that get reconnected. 5fa7b291d4 wasapi: Fixed memory leak if new audio devices fail to add. 468c386686 wasapi: Handle disconnect notifications from the management thread, too. ce3be02b48 wasapi: If device is marked as a zombie, don't try to resuscitate it. 85923049a6 wasapi: Patched to compile. 9bec57309c wasapi: Proxy default device change handling to management thread. c45b5121ce audio: Fixed potential race condition. 8b6da3c701 Fixed making the EGL context current when resuming on Android 2e9eb1073d Sync SDL3 wiki -> header e6116d399a mutex: Removed SDL_MUTEX_MAXWAIT. 82f48be3ef Sync SDL3 wiki -> header 899eb0d042 thread: Locking mutexes and rwlocks are now void functions. 082ef41566 alsa: Fix crash from invalid handle pointer a9aa15c792 CI: change FreeBSD CI runner to cross-platform-actions. 23ceae94c9 Fixed Xbox 360 Controller support using libusb on Linux ace0c2c297 mutex: Fixed bug where generic SDL_TryLockMutex would incorrectly block. f52b330ed8 Added support for the HP HyperX Clutch Gladiate controller b61706373c n3ds: Check that audio thread name starts with "SDLAudioP" 6827b3331d n3ds systhread - use 80kb thread stack size as default, remove hard cap e4cd1d4059 n3ds systhread - prefer to put audio thread on system core 1023d8ec84 SDL_n3dsaudio.c - don't risk leaving current_priority uninitialized 07171be596 SDL_n3dsaudio.h: use triple buffering 6efe957159 SDL_n3dsaudio.c: separate mixer locks from audio device locks 39a961ba41 Added support for "%[]" sscanf syntax 124a0050b6 Fixed warning: no previous prototype for function 'SDL_UpdateAudio' b16165a33f rwlock: SDL_UnlockRWLock was incorrectly tagged with SDL_RELEASE_SHARED. 865dd04068 pulseaudio: Don't use a hash for device change detection. b8cc51875a Fixed build 0413e21e54 Fixed audio device removed events for ALSA 5ba03d377a Revert "Fixed audio device removed events for ALSA" a774694be0 pulseaudio: Simplified default device change detection code. e57fef8f0b Fixed audio device removed events for ALSA 4280d4b359 Fixed warning C4210: nonstandard extension used: function given file scope 182cfc3265 pulseaudio: Rework how we manage default devices and hotplug. b2ae1e835f pulseaudio: Change debug printf calls to use SDL_Log instead. 38afd48daf Added a single source of SDL object IDs e07f6c0a17 SDL_IsJoystickProductWheel() returns SDL_TRUE for Asetek wheelbases (thanks @IOBYTE!) c98a14fdeb Renamed display added/removed events for consistency with the rest of the API c2a3112b6f Added "--substring" to the help for rename_symbols.py a844d90942 Add missing error reporting in Android_JNI_FileOpen() 4ac38d13dd alsa: Don't touch free'd memory in hotplug thread. 43d41c9dcb audio: Another attempt to make device add/remove work vs event watchers. 9abc692156 audio: Another attempt to deal with device destruction from device thread. 33c9eeec7c Revert "audio: Device threads don't increment physical device refcounts." e5a15f94e2 Revert "Check to make sure the Windows joystick device has buttons and axes" 70fd8e2ba2 Lock joysticks when adding gamepad mappings 76f81797b7 audio: Device threads don't increment physical device refcounts. 594fda4120 Sync SDL3 wiki -> header 0d7c5a2c56 Updated Android API documentation 0df888c584 Moved Android low latency audio behind a hint "SDL_ANDROID_LOW_LATENCY_AUDIO" 142366c837 Sync SDL3 wiki -> header 3a4c9d6990 Fixed build error when API logging is enabled 1f8f82b379 Removed redundant thread-safety information a6edc75fe7 Sync SDL3 wiki -> header 3c8edeb79b Clarified SDL property thread-safety information 4fa821cb3e Sync SDL3 wiki -> header 1c70760c0b Added thread-safety information for the new SDL properties API 15533dce05 Cleaned up warnings from check_stdlib_usage.py bf269571fc jack: Removed FIXME comment that has since been fixed. 797b70877d audio: Remove stub header SDL_audio_c.h. 9d7c57234a audio: Cleaned out most remaining `/* */` comments for `//` style. 0ff67dc21b video: Fix compiler warning about SDL_ReadSurfacePixel not being declared. 81c77396af opensles: Patched to compile. 442e84916a opensles: Fixed capitalization to match other SDL backends. 34914bfb49 alsa: Clean up device handles, now that hotplug thread cleanup is in place. 48d80efb51 Fixed warning C4701: potentially uninitialized local variable 'props' used f7dc63bcc3 audio: another windows wasapi build fix. dd98330076 audio: fix windows wasapi build. 7a52f7b3fd audio: Split Deinitialize into two stages. e55e556f32 alsa: Fixed minor memory leak. b45a0d9016 Updated the documentation for SDL_LoadWAV_RW() 435e7ce663 Check for device disconnection in HIDAPI_JoystickOpen() b733adb503 audio: Fix device refcounting vs ProvidesOwnCallbackThread backends. c6f08c2553 testaudio: Removed debugging code. d5dac0ad27 testaudio: Deal with a texture being unexpectedly NULL when scaling. b19e68c8ec testaudio: Properly display playback progress, regardless of data source. 8c39269279 audio: Fix audio stream format when binding to a capture device. f26b838a3e jack: Check for sample rate and buffer size changes from the server. 063cb0df6b audio: Fixed comment typo. "deref" should be "unref" 354611a0c6 testaudio: Fixed some bugs Valgrind pointed out. a17f3ba916 audio: Reworked audio device disconnect management. 6ddd96a4d0 Fix some wrong gamepad/controller event enums 8df68b4120 hashtable: Moved over to single-line comments. 1c6d996108 testaudio: if the SDL_Renderer is already gone, don't destroy SDL_Textures. b22ffb9797 audio: Fix some logic errors in the new device hashtable code. e526dc64bd Don't set unused variable 6664437748 hashtable: Don't rearrange bucket elements during SDL_FindInHashTable. 8ac5c84ad1 audio: device thread shouldn't touch `thread_alive` after object is free'd. b17151eb16 testaudio: Don't crash if renderer is NULL (happens during shutdown). 7f408e57ee audio: Keep all available devices in a hashtable instead of linked lists. 0aba2c97db hashtable: SDL_IterateHashTable might as well provide both key and value. 95a9271dbf audio: Never lock a device while holding the device_list_lock. 9aeabb0b05 Fix macOS build error by #8269 382751c4b5 testffmpeg: print usage of options to change audio/video codec f91bde64d5 testffmpeg: Only enable blending if we're using a texture format that supports it 516d6f9efc testffmpeg: added support for YUVA formats using swscale ac71831350 Sync wiki -> headers d18f910248 testffmpeg: added the ability to specify audio and video codecs 72034b9a07 wayland: Fix primary selection handling when the protocol isn't supported e152129787 Fixes #8190. From #7249, reverted the hunks other than #7239. b79db0a6ea Fixed potential wraparound issue with property IDs c9ccf0670c Add unsupported functions to dynapi 25ce87979d Always provide an implementation for all SDL3 symbols 3a36433a3c cmake: test -Wl,--version-script with minimal version script 0efa196989 dynapi: implement SDL_DYNAPI_entry even when building SDL without dynapi support bf64fecf19 testffmpeg: allow resizing of the video window efa9a45048 Clarified that testffmpeg will resize the window to the video size 4368f70ff9 Added properties to various SDL objects 973c8b3273 Added SDL properties API 2bca4671a6 audio: Allow audio streams to be created when the subsystem isn't initialized. 1ae33f6751 cmake: optionally install pdb's 0d5cad91b1 We need audio converters initialized in SDL_InitAudio() 1c3a0ade74 audio: Whoops, this stream format change is only for capture devices. 10fab3a39e pulseaudio: Stop the threaded mainloop before destroying the context. 0b71898cb1 Make it clear that the string comparison isn't a boolean check 6c8ad975c7 Like mutexes, operations on NULL rwlocks are no-ops c552cc6847 We don't require the audio system to be initialized for audio format conversion 9a5f7b17c6 Use SDL wrapped getenv function 044046bc50 audio: Fixed assertions when capture devices have wrong audio formats. bb2f767f5d testaudio: Make program usable without a 3-button mouse. 321fc18417 README-migration.md: Added note about SDL_HasRDTSC removal. 82f54af617 x11: Properly check for XInput2 support before using it. b654427537 Added support for the PowerA Nintendo Switch Nano Wired Controller dc2a5f6ab2 Fixed error C2054: expected '(' to follow 'inline' a7ae1de9a6 Fixed warning C4028: formal parameter different from declaration 3a47fb7208 The sensor and joystick instance ID generator isn't guarded by a lock. aee4862958 ci: stop FreeBSD job after 30 minutes 99fa0d6cae Disable low latency audio by default when using AAudio on Android ebfbd7327b testffmpeg: use SDL_test to parse arguments and track memory ee53e4d319 cmake: check ffmpeg capability instead of version 2d62c65a75 Fixed build warning bf72704bfd audio: Disable NEON sample conversion until test failures are fixed 0fe95cfba3 Sync wiki -> header adcace6f95 Added a "--software" option to testffmpeg 86ada8a9f0 fix testffmpeg.c build. 303f4e965c testffmpeg works with ffmpeg 5.1.3 and newer 2bd478ae65 Added SDL_GetTextureDXGIResource() to get the DXGI resource associated with a render texture. a842446f62 Added support for 0-copy decode and display using D3D11 d830cd140b Added support for 0-copy decode and display using Apple VideoToolbox 1bf913b29a Added support for 0-copy decode and display using VAAPI and EGL ce8161e0cf Make sure we're building with ffmpeg 6.0 or newer ed6381b68d Allow setting any number of sprites over the video ebf5e08fa1 cmake: use *_STATIC_* variables when linking to a static ffmpeg 88f2fb9dcf Added an example of video decoding with ffmpeg d88bf687a8 surface: Document the in-memory layout of the pixels 3698630bbc pixels: Document the naming convention 04edb38cdf shape: Use SDL[Test]_ReadSurfacePixel f5745c3a67 surface: Add a private SDL_ReadSurfacePixel 0d68f45879 test: Extract SDLTest_ReadSurfacePixel 55a1458ed0 audio: Changes to one logical device must update all sibling logical devices. 8e03ea4383 hashtable: Use Create/Destroy naming, in the SDL3 style. 568902b64e hashtable: Added src/SDL_hashtable.[ch]. 8745a9949b add-source-to-projects.pl: Fix adding files in the base src dir. 836927edf8 wayland: Try to skip the Wayland driver if not connecting to or in a Wayland session 2a9480c815 wayland: Add null check for zenity version string f30392da5b Fix assertion in LINUX_JoystickSetSensorsEnabled() 4e59bf6cb9 SDLTest_CompareSurfaces: Output RGBA values of first differing pixel b2ddfbbec3 SDLTest_CompareSurfaces: If surfaces differ, log their formats b028fd9604 SDLTest_CompareSurfaces: Log better messages if NULL or different sizes 183606d3d4 testdrawchessboard: clean up renderer and window 4f0642bf47 triangle: don't read destination pixel when you're going to discard it anyways 4cd0c13823 blit_slow: don't read destination pixel when you're going to discard it anyways 49abb9c1fa aaudio: Fixed a comment. 0eb8651d5e Do not report gyro/accelerometer if we can't read axes info ff57867516 audio: Fixed copy/paste error that was checking wrong variable. d2d4914ac3 audio: WaitDevice/WaitCaptureDevice now returns a result. a0820ed833 directsound: Cleaned up WaitDevice. 6c33a05bdb audio: Removed unused AllowsArbitraryDeviceNames variable. f1fc198278 audio: Destroy the logical audio device before sending DEVICE_REMOVED event. 64ec208479 Fix log message spelling 9111c5e178 tests: Disable mouse warp test under Wayland de5068f4e4 audio: Commented out a currently-incorrect assert. 3abb464f10 ci: disable Intel compilers 251f8fa272 Revert "Do a better job of finding default ALSA devices" 8857b0f13a Use the device audio format for the lowest latency 806e11ac00 Update sample processing bookkeeping when recovering the AAudio audio device 482c238953 aaudio: Deal with device recovery. a8813b58a6 aaudio: Change an int to an SDL_bool. 8923305f34 We don't need to wait a full 10 ms, just delay a bit 6a152676bb Wait a bit when snd_pcm_avail() returns 0 b4372de186 alsa: Cleaned up remaining debug logging. a063c943dc pulseaudio: Use pa_stream_begin_write to avoid an extra buffer copy. 0471a93706 alsa: Simplified PlayDevice and CaptureFromDevice. 776d9d0ee3 alsa: Convert `/* */` comments to `//` comments. 64fee85c69 alsa: More efficient audio thread iteration. 47cba08259 VisualC/pkg-support/cmake: remove subdir from public header include path 61e9a9dd56 pulseaudio: Just feed the device whenever it asks for any amount of data. 4f76f9b0a7 pulseaudio: Use correct buffer size of stream, wait less between fills. d95d2d7051 SDLTest_CompareSurfaces: Decode pixels correctly on big-endian platforms d65861f049 Do a better job of finding default ALSA devices ba65ef5ce7 Recover from -EPIPE in snd_pcm_avail() 5be5000fa1 cmake: make HEADERS_DIR a required argument of SDL_generate_manpages 5c1a91a4e1 ci: make sure perl is installed + build docs with MSVC toolchain 6248472c0c test: Accept small numerical differences in more mathematical tests a2c5dc6507 pulseaudio: Added typedef needed for compat with ancient Pulse installs. f24551f6d1 pulseaudio: More workarounds for extremely old Pulse installs. 441a5b707b audio: Adjusted const/static fields on some variables. 280c2c1d7d pulseaudio: Revert "pulseaudio: Require PulseAudio 5.0 or later for SDL3." 4db2b968af audio: simple-copy path should check if device is paused. 505dc4c39c wasapi: Deal with device failures when we aren't holding the device lock. ea5f59c234 Removed unused code a6854098f7 Fixed stuttering on Android when using the AAudio driver a5175e5ed0 audio: Fixed bug when setting up mixing formats. 9667aa18e6 wayland: Check that the data device supports the release method before calling it 4454dc400b wayland: Null all Wayland manager objects after freeing e1789b320e video: Streamline a little deinit code. 2a1058713c Bump libdecor feature check to look for 0.2.0 f5886f11d0 cmake: let every test depends on pretest f45761908a Move check for SDL_Delay upper bounds to testtimer a84389f6bb libm: use union for infinity 474c8d0073 testautomation: don't do float equality tests a6bc6b882c ci: always upload the artifacts 85e3099ba4 testautomation: only require accelated renderer with non-dummy video driver 26fd231151 ci: run tests on msvc workflow 0e955a9127 cmake: run testautomation with CTest 1375d2049d SDL_iconv_string() defaults to UTF-8 70a1bc6973 Check for NULL before dereferencing newly allocated memory 752f14e5a6 wayland: Convert some memcpy calls to copyp 9284a03053 wayland: Remove some unnecessary helper functions git-subtree-dir: external/sdl/SDL git-subtree-split: 0d7df16812c75c4a587d7d2673e3d1a5f2c2879b
This commit is contained in:
parent
644725478f
commit
852f2a6343
1
.github/workflows/android.yml
vendored
1
.github/workflows/android.yml
vendored
@ -23,6 +23,7 @@ jobs:
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup_ndk
|
||||
with:
|
||||
local-cache: true
|
||||
ndk-version: r21e
|
||||
- name: Build (Android.mk)
|
||||
if: ${{ matrix.platform.name == 'Android.mk' }}
|
||||
|
56
.github/workflows/cpactions.yml
vendored
Normal file
56
.github/workflows/cpactions.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
name: Build (C/P Actions)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
freebsd:
|
||||
runs-on: ubuntu-latest
|
||||
name: '${{ matrix.platform.name }} ${{ matrix.platform.os-version }}'
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: FreeBSD, os: freebsd, os-version: 13.2, os-arch: x86-64, artifact: SDL-freebsd-x64,
|
||||
sdl-cmake-configure-arguments: '-DSDL_CHECK_REQUIRED_INCLUDES="/usr/local/include" -DSDL_CHECK_REQUIRED_LINK_OPTIONS="-L/usr/local/lib"',
|
||||
setup-cmd: 'sudo pkg update',
|
||||
install-cmd: 'sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd',
|
||||
}
|
||||
- { name: NetBSD, os: netbsd, os-version: 9.3, os-arch: x86-64, artifact: SDL-netbsd-x64,
|
||||
sdl-cmake-configure-arguments: '',
|
||||
setup-cmd: 'export PATH="/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH";export PKG_CONFIG_PATH="/usr/pkg/lib/pkgconfig";export PKG_PATH="https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f "1 2" -d.)/All/";echo "PKG_PATH=$PKG_PATH";echo "uname -a -> \"$(uname -a)\"";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update',
|
||||
install-cmd: 'sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1',
|
||||
}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
uses: cross-platform-actions/action@v0.21.1
|
||||
with:
|
||||
operating_system: ${{ matrix.platform.os }}
|
||||
architecture: ${{ matrix.platform.os-arch }}
|
||||
version: ${{ matrix.platform.os-version }}
|
||||
run: |
|
||||
${{ matrix.platform.setup-cmd }}
|
||||
${{ matrix.platform.install-cmd }}
|
||||
cmake -S . -B build -GNinja \
|
||||
-Wdeprecated -Wdev -Werror \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSDL_WERROR=ON \
|
||||
${{ matrix.platform.sdl-cmake-configure-arguments }}
|
||||
cmake --build build/ --config Release --verbose
|
||||
cmake --build build/ --config Release --target package
|
||||
|
||||
cmake --build build/ --config Release --target clean
|
||||
rm -rf build/dist/_CPack_Packages
|
||||
rm -rf build/CMakeFiles
|
||||
rm -rf build/docs
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: ${{ matrix.platform.artifact }}
|
||||
path: build/dist/SDL3*
|
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
@ -43,6 +43,7 @@ jobs:
|
||||
${{ matrix.platform.msys-env }}-cc
|
||||
${{ matrix.platform.msys-env }}-cmake
|
||||
${{ matrix.platform.msys-env }}-ninja
|
||||
${{ matrix.platform.msys-env }}-perl
|
||||
${{ matrix.platform.msys-env }}-pkg-config
|
||||
${{ matrix.platform.msys-env }}-clang-tools-extra
|
||||
|
||||
@ -65,6 +66,8 @@ jobs:
|
||||
- name: Setup Macos dependencies
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
brew update
|
||||
brew install \
|
||||
ninja \
|
||||
pkg-config \
|
||||
@ -73,12 +76,16 @@ jobs:
|
||||
- name: Setup Intel oneAPI
|
||||
if: matrix.platform.intel
|
||||
run: |
|
||||
# Setup oneAPI repo
|
||||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
|
||||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
|
||||
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
|
||||
# Download the key to system keyring
|
||||
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
|
||||
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
|
||||
|
||||
# Add signed entry to apt sources and configure the APT client to use Intel repository:
|
||||
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
|
||||
|
||||
# Update package list
|
||||
sudo apt-get update -y
|
||||
|
||||
|
||||
# Install oneAPI
|
||||
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
|
||||
|
||||
@ -103,6 +110,7 @@ jobs:
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
${{ matrix.platform.cmake }}
|
||||
- name: Build (CMake)
|
||||
id: build
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
cmake --build build/ --config Release --verbose --parallel
|
||||
@ -123,6 +131,7 @@ jobs:
|
||||
cmake --install build/ --config Release
|
||||
( cd cmake_prefix; find . ) | LC_ALL=C sort -u
|
||||
- name: Package (CPack)
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
run: |
|
||||
cmake --build build/ --config Release --target package
|
||||
- name: Verify CMake configuration files
|
||||
@ -141,6 +150,7 @@ jobs:
|
||||
export PKG_CONFIG_PATH=$(echo "${{ github.workspace }}/cmake_prefix/lib/pkgconfig" | sed -e 's#\\#/#g')
|
||||
cmake/test/test_pkgconfig.sh
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: ${{ matrix.platform.artifact }}
|
||||
|
33
.github/workflows/msvc.yml
vendored
33
.github/workflows/msvc.yml
vendored
@ -21,9 +21,9 @@ jobs:
|
||||
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON, artifact: 'SDL-VC-static-VCRT-x86' }
|
||||
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64, artifact: 'SDL-clang-cl-x64' }
|
||||
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32, artifact: 'SDL-clang-cl-x86' }
|
||||
- { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32' }
|
||||
- { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-arm64' }
|
||||
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", nowerror: true,
|
||||
- { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32', notests: true }
|
||||
- { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-arm64', notests: true }
|
||||
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", nowerror: true, notests: true,
|
||||
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0', artifact: 'SDL-VC-UWP' }
|
||||
|
||||
steps:
|
||||
@ -36,12 +36,20 @@ jobs:
|
||||
srcdir = r"${{ github.workspace }}".replace("\\", "/")
|
||||
builddir = f"{ srcdir }/build"
|
||||
os.makedirs(builddir)
|
||||
cmakelists_txt = textwrap.dedent(f"""\
|
||||
# Always build .PDB symbol file
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction")
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries")
|
||||
cmake_minimum_required(VERSION 3.0...3.25)
|
||||
project(sdl_user)
|
||||
enable_testing()
|
||||
add_subdirectory("{ srcdir }" SDL)
|
||||
""")
|
||||
print(cmakelists_txt)
|
||||
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
||||
f.write(textwrap.dedent(f"""\
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(sdl_user)
|
||||
add_subdirectory("{ srcdir }" SDL)
|
||||
"""))
|
||||
f.write(cmakelists_txt)
|
||||
- name: Configure (CMake)
|
||||
run: cmake -S build -B build `
|
||||
-Wdeprecated -Wdev -Werror `
|
||||
@ -53,12 +61,15 @@ jobs:
|
||||
-DSDL_VENDOR_INFO="Github Workflow" `
|
||||
-DSDL_DISABLE_INSTALL=OFF `
|
||||
-DSDL_DISABLE_INSTALL_CPACK=OFF `
|
||||
-DSDL_DISABLE_INSTALL_DOCS=OFF `
|
||||
${{ matrix.platform.flags }} `
|
||||
-DCMAKE_INSTALL_PREFIX=prefix
|
||||
- name: Build (CMake)
|
||||
run: cmake --build build/ --config Release --parallel
|
||||
id: build
|
||||
run: |
|
||||
cmake --build build/ --config Release --parallel
|
||||
- name: Run build-time tests
|
||||
if: "! contains(matrix.platform.name, 'ARM')"
|
||||
if: ${{ !matrix.platform.notests }}
|
||||
run: |
|
||||
$env:SDL_TESTS_QUICK=1
|
||||
ctest -VV --test-dir build/ -C Release -j2
|
||||
@ -67,6 +78,7 @@ jobs:
|
||||
echo "SDL3_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
|
||||
cmake --install build/
|
||||
- name: Package (CPack)
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
run: |
|
||||
cmake --build build/ --config Release --target PACKAGE
|
||||
- name: Verify CMake configuration files
|
||||
@ -83,6 +95,7 @@ jobs:
|
||||
if: ${{ matrix.platform.project != '' }}
|
||||
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: ${{ matrix.platform.artifact }}
|
||||
|
15
.github/workflows/ps2.yml
vendored
15
.github/workflows/ps2.yml
vendored
@ -17,15 +17,6 @@ jobs:
|
||||
apk update
|
||||
apk add cmake gmp mpc1 mpfr4 ninja pkgconf make git
|
||||
|
||||
# To be removed once ps2_drivers is part of PS2DEV
|
||||
- name: Install ps2_drivers lib
|
||||
run: |
|
||||
git clone https://github.com/fjtrujy/ps2_drivers.git
|
||||
cd ps2_drivers
|
||||
make -j $(getconf _NPROCESSORS_ONLN) clean
|
||||
make -j $(getconf _NPROCESSORS_ONLN)
|
||||
make -j $(getconf _NPROCESSORS_ONLN) install
|
||||
|
||||
- name: Configure (CMake)
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
@ -36,7 +27,7 @@ jobs:
|
||||
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- name: Build (CMake)
|
||||
run: cmake --build build --config Release --verbose -- -j 1
|
||||
run: cmake --build build --config Release --verbose
|
||||
- name: Install (CMake)
|
||||
run: |
|
||||
set -eu
|
||||
@ -45,7 +36,7 @@ jobs:
|
||||
( cd cmake_prefix; find ) | LC_ALL=C sort -u
|
||||
- name: Package (CPack)
|
||||
run: |
|
||||
cmake --build build/ --config Release --target package -- -j 1
|
||||
cmake --build build/ --config Release --target package
|
||||
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
@ -55,7 +46,7 @@ jobs:
|
||||
-DTEST_SHARED=FALSE \
|
||||
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build cmake_config_build --verbose -- -j 1
|
||||
cmake --build cmake_config_build --verbose
|
||||
- name: Verify sdl3.pc
|
||||
run: |
|
||||
export CC=mips64r5900el-ps2-elf-gcc
|
||||
|
5
.github/workflows/vita.yml
vendored
5
.github/workflows/vita.yml
vendored
@ -87,6 +87,11 @@ jobs:
|
||||
run: |
|
||||
cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi
|
||||
|
||||
- name: Fix vita.toolchain.cmake
|
||||
run: |
|
||||
# cache PKG_CONFIG_PATH
|
||||
sed -i -E 's/set\( PKG_CONFIG_EXECUTABLE "\$\{VITASDK}\/bin\/arm-vita-eabi-pkg-config" )/set( PKG_CONFIG_EXECUTABLE "${VITASDK}\/bin\/arm-vita-eabi-pkg-config" CACHE PATH "Path of pkg-config executable" )/' ${VITASDK}/share/vita.toolchain.cmake
|
||||
|
||||
- name: Configure (CMake)
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
|
70
.github/workflows/vmactions.yml
vendored
70
.github/workflows/vmactions.yml
vendored
@ -1,70 +0,0 @@
|
||||
name: Build (VM Actions)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
freebsd:
|
||||
runs-on: macos-12
|
||||
name: FreeBSD
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
uses: vmactions/freebsd-vm@v0
|
||||
with:
|
||||
mem: 8192
|
||||
usesh: true
|
||||
prepare: |
|
||||
pkg install -y \
|
||||
cmake \
|
||||
ninja \
|
||||
pkgconf \
|
||||
libXcursor \
|
||||
libXext \
|
||||
libXinerama \
|
||||
libXi \
|
||||
libXfixes \
|
||||
libXrandr \
|
||||
libXScrnSaver \
|
||||
libXxf86vm \
|
||||
wayland \
|
||||
wayland-protocols \
|
||||
libxkbcommon \
|
||||
mesa-libs \
|
||||
libglvnd \
|
||||
evdev-proto \
|
||||
libinotify \
|
||||
alsa-lib \
|
||||
jackit \
|
||||
pipewire \
|
||||
pulseaudio \
|
||||
sndio \
|
||||
dbus \
|
||||
zh-fcitx \
|
||||
ibus \
|
||||
libsamplerate \
|
||||
libudev-devd
|
||||
|
||||
run: |
|
||||
cmake -S . -B build -GNinja \
|
||||
-Wdeprecated -Wdev -Werror \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSDL_HIDAPI_LIBUSB=OFF \
|
||||
-DSDL_CHECK_REQUIRED_INCLUDES="/usr/local/include" \
|
||||
-DSDL_CHECK_REQUIRED_LINK_OPTIONS="-L/usr/local/lib"
|
||||
cmake --build build/ --config Release --verbose -- -j`sysctl -n hw.ncpu`
|
||||
cmake --build build/ --config Release --target package
|
||||
|
||||
cmake --build build/ --config Release --target clean
|
||||
rm -rf build/dist/_CPack_Packages
|
||||
rm -rf build/CMakeFiles
|
||||
rm -rf build/docs
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: SDL-freebsd
|
||||
path: build/dist/SDL3*
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -66,8 +66,7 @@ VisualC/tests/gamepadmap/button.bmp
|
||||
VisualC/tests/gamepadmap/gamepadmap.bmp
|
||||
VisualC/tests/gamepadmap/gamepadmap_back.bmp
|
||||
VisualC/tests/loopwave/sample.wav
|
||||
VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
|
||||
VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
|
||||
VisualC/tests/testautomation/*.bmp
|
||||
VisualC/tests/testgamepad/axis.bmp
|
||||
VisualC/tests/testgamepad/button.bmp
|
||||
VisualC/tests/testgamepad/gamepadmap.bmp
|
||||
@ -80,6 +79,7 @@ VisualC/tests/testscale/sample.bmp
|
||||
VisualC/tests/testsprite/icon.bmp
|
||||
VisualC/tests/testyuv/testyuv.bmp
|
||||
VisualC-GDK/**/Layout
|
||||
VisualC-GDK/shaders/*.h
|
||||
|
||||
# for Android
|
||||
android-project/local.properties
|
||||
|
@ -24,6 +24,7 @@ LOCAL_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
|
||||
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
|
||||
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
|
||||
|
237
CMakeLists.txt
237
CMakeLists.txt
@ -220,6 +220,12 @@ if(VITA OR PSP OR PS2 OR N3DS OR RISCOS)
|
||||
set(SDL_LOADSO_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
if((RISCOS OR UNIX_SYS) AND NOT (LINUX OR NETBSD OR OPENBSD))
|
||||
set(SDL_OSS_DEFAULT ON)
|
||||
else()
|
||||
set(SDL_OSS_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
if(SDL_SHARED_DEFAULT AND SDL_STATIC_DEFAULT AND SDL_SHARED_AVAILABLE)
|
||||
if(DEFINED BUILD_SHARED_LIBS)
|
||||
# When defined, use BUILD_SHARED_LIBS as default
|
||||
@ -295,6 +301,7 @@ dep_option(SDL_LASX "Use LASX assembly routines" ON "SDL_ASSEMBLY
|
||||
|
||||
set_option(SDL_LIBC "Use the system C library" ${SDL_LIBC_DEFAULT})
|
||||
set_option(SDL_SYSTEM_ICONV "Use iconv() from system-installed libraries" ${SDL_SYSTEM_ICONV_DEFAULT})
|
||||
set_option(SDL_LIBICONV "Prefer iconv() from libiconv, if available, over libc version" OFF)
|
||||
set_option(SDL_GCC_ATOMICS "Use gcc builtin atomics" ${SDL_GCC_ATOMICS_DEFAULT})
|
||||
dep_option(SDL_DBUS "Enable D-Bus support" ON ${UNIX_SYS} OFF)
|
||||
set_option(SDL_DISKAUDIO "Support the disk writer audio driver" ON)
|
||||
@ -305,7 +312,7 @@ dep_option(SDL_OPENGL "Include OpenGL support" ON "NOT VISIONOS" OF
|
||||
dep_option(SDL_OPENGLES "Include OpenGL ES support" ON "NOT VISIONOS" OFF)
|
||||
set_option(SDL_PTHREADS "Use POSIX threads for multi-threading" ${SDL_PTHREADS_DEFAULT})
|
||||
dep_option(SDL_PTHREADS_SEM "Use pthread semaphores" ON "SDL_PTHREADS" OFF)
|
||||
dep_option(SDL_OSS "Support the OSS audio API" ON "UNIX_SYS OR RISCOS" OFF)
|
||||
dep_option(SDL_OSS "Support the OSS audio API" ${SDL_OSS_DEFAULT} "UNIX_SYS OR RISCOS" OFF)
|
||||
set_option(SDL_ALSA "Support the ALSA audio API" ${UNIX_SYS})
|
||||
dep_option(SDL_ALSA_SHARED "Dynamically load ALSA audio support" ON "SDL_ALSA" OFF)
|
||||
set_option(SDL_JACK "Support the JACK audio API" ${UNIX_SYS})
|
||||
@ -329,7 +336,6 @@ set_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
|
||||
dep_option(SDL_WAYLAND_SHARED "Dynamically load Wayland support" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR "Use client-side window decorations on Wayland" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_WAYLAND_LIBDECOR_SHARED "Dynamically load libdecor support" ON "SDL_WAYLAND_LIBDECOR;SDL_WAYLAND_SHARED" OFF)
|
||||
dep_option(SDL_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "SDL_WAYLAND" OFF)
|
||||
dep_option(SDL_RPI "Use Raspberry Pi video driver" ON "UNIX_SYS;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
|
||||
dep_option(SDL_ROCKCHIP "Use ROCKCHIP Hardware Acceleration video driver" ON "UNIX_SYS;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF)
|
||||
set_option(SDL_COCOA "Use Cocoa video driver" ${APPLE})
|
||||
@ -344,6 +350,7 @@ set_option(SDL_METAL "Enable Metal support" ${APPLE})
|
||||
set_option(SDL_KMSDRM "Use KMS DRM video driver" ${UNIX_SYS})
|
||||
dep_option(SDL_KMSDRM_SHARED "Dynamically load KMS DRM support" ON "SDL_KMSDRM" OFF)
|
||||
set_option(SDL_OFFSCREEN "Use offscreen video driver" ON)
|
||||
dep_option(SDL_VIDEO_CAPTURE "Enable video capturing" ON SDL_VIDEO OFF)
|
||||
option_string(SDL_BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" OFF)
|
||||
option_string(SDL_FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" OFF)
|
||||
dep_option(SDL_HIDAPI "Enable the HIDAPI subsystem" ON "NOT VISIONOS" OFF)
|
||||
@ -423,7 +430,7 @@ if(WINDOWS_STORE)
|
||||
sdl_compile_options(PRIVATE "-ZW")
|
||||
endif()
|
||||
|
||||
check_linker_flag(C "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym" HAVE_WL_VERSION_SCRIPT)
|
||||
check_linker_supports_version_file(HAVE_WL_VERSION_SCRIPT)
|
||||
if(HAVE_WL_VERSION_SCRIPT)
|
||||
sdl_shared_link_options("-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym")
|
||||
else()
|
||||
@ -475,6 +482,7 @@ sdl_glob_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/hidapi/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/libm/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/locale/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/main/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/misc/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/power/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/render/*.c"
|
||||
@ -486,6 +494,18 @@ sdl_glob_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/video/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.c"
|
||||
)
|
||||
if(MSVC AND TARGET SDL3-shared)
|
||||
if(SDL_CPU_X64)
|
||||
enable_language(ASM_MASM)
|
||||
set(asm_src "${SDL3_SOURCE_DIR}/src/stdlib/SDL_mslibc_x64.masm")
|
||||
target_compile_options(SDL3-shared PRIVATE "$<$<COMPILE_LANGUAGE:ASM_MASM>:/nologo>")
|
||||
set_property(SOURCE "${asm_src}" PROPERTY LANGUAGE "ASM_MASM")
|
||||
target_sources(SDL3-shared PRIVATE "${asm_src}")
|
||||
elseif(SDL_CPU_ARM32 OR SDL_CPU_ARM64)
|
||||
# FIXME: ARM assembler (armasm.exe/armasm64.exe) is NOT ASM_MASM, and does currently not work with CMake
|
||||
# (https://gitlab.kitware.com/cmake/cmake/-/issues/18912)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_INTELCC)
|
||||
# warning #39: division by zero
|
||||
@ -985,12 +1005,21 @@ if(NOT HAVE_ARMNEON)
|
||||
set(SDL_DISABLE_NEON 1)
|
||||
endif()
|
||||
|
||||
set(SDL_DISABLE_ALLOCA 0)
|
||||
check_include_file("alloca.h" "HAVE_ALLOCA_H")
|
||||
if(MSVC)
|
||||
check_include_file("malloc.h" "HAVE_MALLOC")
|
||||
check_symbol_exists("_alloca" "malloc.h" _ALLOCA_IN_MALLOC_H)
|
||||
if(NOT HAVE_ALLOCA_H AND NOT _ALLOCA_IN_MALLOC_H)
|
||||
set(SDL_DISABLE_ALLOCA 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define anything.
|
||||
if(SDL_LIBC)
|
||||
set(available_headers)
|
||||
set(HAVE_LIBC TRUE)
|
||||
set(headers_to_check
|
||||
alloca.h
|
||||
ctype.h
|
||||
float.h
|
||||
iconv.h
|
||||
@ -1022,7 +1051,7 @@ if(SDL_LIBC)
|
||||
endforeach()
|
||||
|
||||
set(symbols_to_check
|
||||
abs acos acosf alloca asin asinf atan atan2 atan2f atanf atof atoi
|
||||
abs acos acosf asin asinf atan atan2 atan2f atanf atof atoi
|
||||
bcopy bsearch
|
||||
calloc ceil ceilf copysign copysignf cos cosf
|
||||
_Exit exp expf
|
||||
@ -1036,7 +1065,7 @@ if(SDL_LIBC)
|
||||
realloc rindex round roundf
|
||||
scalbn scalbnf setenv sin sinf sqr sqrt sqrtf sscanf strchr
|
||||
strcmp strlcat strlcpy strlen strncmp strnlen
|
||||
strrchr strstr strtod strtok_r strtol strtoll strtoul strtoull
|
||||
strrchr strstr strnstr strtod strtok_r strtol strtoll strtoul strtoull
|
||||
tan tanf trunc truncf
|
||||
unsetenv
|
||||
vsnprintf vsscanf
|
||||
@ -1066,8 +1095,6 @@ if(SDL_LIBC)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(NOT WINDOWS)
|
||||
check_include_file(linux/input.h HAVE_LINUX_INPUT_H)
|
||||
|
||||
check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE)
|
||||
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
||||
check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
|
||||
@ -1079,24 +1106,31 @@ if(SDL_LIBC)
|
||||
check_symbol_exists(poll "poll.h" HAVE_POLL)
|
||||
|
||||
if(SDL_SYSTEM_ICONV)
|
||||
check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
|
||||
if(HAVE_LIBICONV)
|
||||
find_package(Iconv)
|
||||
if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
|
||||
set(HAVE_ICONV 1)
|
||||
set(HAVE_SYSTEM_ICONV TRUE)
|
||||
pkg_check_modules(PC_ICONV iconv)
|
||||
if(PC_ICONV_FOUND)
|
||||
sdl_link_dependency(iconv LIBS Iconv::Iconv CMAKE_MODULE Iconv PKG_CONFIG_SPECS iconv)
|
||||
else()
|
||||
sdl_link_dependency(iconv LIBS Iconv::Iconv CMAKE_MODULE Iconv PKG_CONFIG_LIBS iconv)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)
|
||||
if(HAVE_BUILTIN_ICONV)
|
||||
set(HAVE_ICONV 1)
|
||||
set(HAVE_SYSTEM_ICONV TRUE)
|
||||
check_c_source_compiles("
|
||||
#define LIBICONV_PLUG 1 /* in case libiconv header is in include path */
|
||||
#include <stddef.h>
|
||||
#include <iconv.h>
|
||||
int main(int argc, char **argv) {
|
||||
return !iconv_open(NULL,NULL);
|
||||
}" ICONV_IN_LIBC)
|
||||
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES iconv)
|
||||
check_c_source_compiles("
|
||||
#include <stddef.h>
|
||||
#include <iconv.h>
|
||||
int main(int argc, char **argv) {
|
||||
return !iconv_open(NULL,NULL);
|
||||
}" ICONV_IN_LIBICONV)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(ICONV_IN_LIBC OR ICONV_IN_LIBICONV)
|
||||
set(HAVE_ICONV 1)
|
||||
set(HAVE_SYSTEM_ICONV TRUE)
|
||||
if(ICONV_IN_LIBICONV AND (SDL_LIBICONV OR (NOT ICONV_IN_LIBC)))
|
||||
sdl_link_dependency(iconv LIBS iconv)
|
||||
set(SDL_USE_LIBICONV 1)
|
||||
set(HAVE_LIBICONV TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -1330,6 +1364,10 @@ if(ANDROID)
|
||||
VERSION "${SDL3_VERSION}"
|
||||
)
|
||||
set_property(TARGET SDL3-jar PROPERTY OUTPUT "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}.jar")
|
||||
add_library(SDL3__Jar INTERFACE)
|
||||
add_library(SDL3::Jar ALIAS SDL3__Jar)
|
||||
get_property(sdl3_jar_location TARGET SDL3-jar PROPERTY JAR_FILE)
|
||||
set_property(TARGET SDL3__Jar PROPERTY JAR_FILE "${sdl3_jar_location}")
|
||||
set(javasourcesjar "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}-sources.jar")
|
||||
string(REGEX REPLACE "${android_java_sources_root}/" "" sdl_relative_java_sources "${SDL_JAVA_SOURCES}")
|
||||
add_custom_command(
|
||||
@ -1362,6 +1400,9 @@ elseif(EMSCRIPTEN)
|
||||
# project. Uncomment at will for verbose cross-compiling -I/../ path info.
|
||||
sdl_compile_options(PRIVATE "-Wno-warn-absolute-paths")
|
||||
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/emscripten/*.c")
|
||||
set(HAVE_SDL_MAIN_CALLBACKS TRUE)
|
||||
|
||||
if(SDL_MISC)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/emscripten/*.c")
|
||||
set(HAVE_SDL_MISC TRUE)
|
||||
@ -1457,14 +1498,12 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
if(UNIX)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/unix/*.c")
|
||||
|
||||
if (HAVE_LINUX_INPUT_H)
|
||||
check_c_source_compiles("
|
||||
#include <linux/input.h>
|
||||
#ifndef EVIOCGNAME
|
||||
#error EVIOCGNAME() ioctl not available
|
||||
#endif
|
||||
int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS)
|
||||
endif()
|
||||
check_c_source_compiles("
|
||||
#include <linux/input.h>
|
||||
#ifndef EVIOCGNAME
|
||||
#error EVIOCGNAME() ioctl not available
|
||||
#endif
|
||||
int main(int argc, char** argv) { return 0; }" HAVE_LINUX_INPUT_H)
|
||||
|
||||
if(LINUX)
|
||||
check_c_source_compiles("
|
||||
@ -1500,11 +1539,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
}" HAVE_INPUT_WSCONS)
|
||||
endif()
|
||||
|
||||
if(HAVE_INPUT_EVENTS)
|
||||
if(HAVE_LINUX_INPUT_H)
|
||||
set(SDL_INPUT_LINUXEV 1)
|
||||
endif()
|
||||
|
||||
if(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
|
||||
if(SDL_HAPTIC AND HAVE_LINUX_INPUT_H)
|
||||
set(SDL_HAPTIC_LINUX 1)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/haptic/linux/*.c")
|
||||
set(HAVE_SDL_HAPTIC TRUE)
|
||||
@ -1557,7 +1596,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
set(SDL_USE_IME 1)
|
||||
endif()
|
||||
|
||||
if(FREEBSD AND NOT HAVE_INOTIFY)
|
||||
if((FREEBSD OR NETBSD) AND NOT HAVE_INOTIFY)
|
||||
set(LibInotify_PKG_CONFIG_SPEC libinotify)
|
||||
pkg_check_modules(PC_LIBINOTIFY IMPORTED_TARGET ${LibInotify_PKG_CONFIG_SPEC})
|
||||
if(PC_LIBINOTIFY_FOUND)
|
||||
@ -1592,7 +1631,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
sdl_sources("${SDL3_SOURCE_DIR}/src/core/linux/SDL_udev.c")
|
||||
endif()
|
||||
|
||||
if(HAVE_INPUT_EVENTS)
|
||||
if(HAVE_LINUX_INPUT_H)
|
||||
sdl_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev.c"
|
||||
"${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c"
|
||||
@ -1603,6 +1642,13 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||
sdl_sources("${SDL3_SOURCE_DIR}/src/core/freebsd/SDL_evdev_kbd_freebsd.c")
|
||||
endif()
|
||||
|
||||
if(HAVE_INPUT_WSCONS)
|
||||
sdl_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/core/openbsd/SDL_wscons_kbd.c"
|
||||
"${SDL3_SOURCE_DIR}/src/core/openbsd/SDL_wscons_mouse.c"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Always compiled for Linux, unconditionally:
|
||||
sdl_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev_capabilities.c"
|
||||
@ -1717,7 +1763,7 @@ elseif(WINDOWS)
|
||||
|
||||
if(TARGET SDL3-shared AND MSVC AND NOT SDL_LIBC)
|
||||
# Prevent codegen that would use the VC runtime libraries.
|
||||
target_compile_options(SDL3-shared PRIVATE "/GS-" "/Gs1048576")
|
||||
target_compile_options(SDL3-shared PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:/GS-> $<$<COMPILE_LANGUAGE:C,CXX>:/Gs1048576>)
|
||||
if(SDL_CPU_X86)
|
||||
target_compile_options(SDL3-shared PRIVATE "/arch:SSE")
|
||||
endif()
|
||||
@ -1783,16 +1829,6 @@ elseif(WINDOWS)
|
||||
#include <windows.h>
|
||||
#include <xinput.h>
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_H)
|
||||
check_c_source_compiles("
|
||||
#include <windows.h>
|
||||
#include <xinput.h>
|
||||
XINPUT_GAMEPAD_EX x1;
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_GAMEPAD_EX)
|
||||
check_c_source_compiles("
|
||||
#include <windows.h>
|
||||
#include <xinput.h>
|
||||
XINPUT_STATE_EX s1;
|
||||
int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_STATE_EX)
|
||||
check_c_source_compiles("
|
||||
#define COBJMACROS
|
||||
#include <windows.gaming.input.h>
|
||||
@ -1922,8 +1958,8 @@ elseif(WINDOWS)
|
||||
vccorlib$<$<CONFIG:Debug>:d>.lib
|
||||
msvcrt$<$<CONFIG:Debug>:d>.lib
|
||||
LINK_OPTIONS
|
||||
-nodefaultlib:vccorlib$<$<CONFIG:Debug>:d>
|
||||
-nodefaultlib:msvcrt$<$<CONFIG:Debug>:d>
|
||||
/nodefaultlib:vccorlib$<$<CONFIG:Debug>:d>
|
||||
/nodefaultlib:msvcrt$<$<CONFIG:Debug>:d>
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -2012,6 +2048,8 @@ elseif(WINDOWS)
|
||||
elseif(APPLE)
|
||||
# TODO: rework this all for proper macOS, iOS and Darwin support
|
||||
|
||||
# !!! FIXME: all the `if(IOS OR TVOS OR VISIONOS)` checks should get merged into one variable, so we're ready for the next platform (or just WatchOS).
|
||||
|
||||
# We always need these libs on macOS at the moment.
|
||||
# !!! FIXME: we need Carbon for some very old API calls in
|
||||
# !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
|
||||
@ -2023,12 +2061,22 @@ elseif(APPLE)
|
||||
set(SDL_FRAMEWORK_FOUNDATION 1)
|
||||
set(SDL_FRAMEWORK_COREVIDEO 1)
|
||||
|
||||
# iOS can use a CADisplayLink for main callbacks. macOS just uses the generic one atm.
|
||||
if(IOS OR TVOS OR VISIONOS)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/ios/*.m")
|
||||
set(HAVE_SDL_MAIN_CALLBACKS TRUE)
|
||||
endif()
|
||||
|
||||
# Requires the darwin file implementation
|
||||
if(SDL_FILE)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/file/cocoa/*.m")
|
||||
set(HAVE_SDL_FILE TRUE)
|
||||
endif()
|
||||
|
||||
if(IOS OR TVOS OR MACOSX OR DARWIN)
|
||||
sdl_sources("${SDL3_SOURCE_DIR}/src/video/SDL_video_capture_apple.m")
|
||||
endif()
|
||||
|
||||
if(SDL_MISC)
|
||||
if(IOS OR TVOS OR VISIONOS)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/ios/*.m")
|
||||
@ -2131,7 +2179,7 @@ elseif(APPLE)
|
||||
set(SDL_TIMER_UNIX 1)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/timer/unix/*.c")
|
||||
set(HAVE_SDL_TIMERS TRUE)
|
||||
endif(SDL_TIMERS)
|
||||
endif()
|
||||
|
||||
if(SDL_FILESYSTEM)
|
||||
set(SDL_FILESYSTEM_COCOA 1)
|
||||
@ -2212,6 +2260,10 @@ elseif(APPLE)
|
||||
|
||||
# Actually load the frameworks at the end so we don't duplicate include.
|
||||
if(SDL_FRAMEWORK_COREVIDEO)
|
||||
find_library(COREMEDIA CoreMedia)
|
||||
if(COREMEDIA)
|
||||
sdl_link_dependency(corevideo LINK_OPTIONS "-Wl,-framework,CoreMedia")
|
||||
endif()
|
||||
sdl_link_dependency(corevideo LINK_OPTIONS "-Wl,-framework,CoreVideo")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COCOA)
|
||||
@ -2418,7 +2470,7 @@ elseif(VITA)
|
||||
"${SDL3_SOURCE_DIR}/src/thread/vita/SDL_sysmutex.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/vita/SDL_syssem.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/vita/SDL_systhread.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/vita/SDL_syscond.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_systls.c"
|
||||
)
|
||||
@ -2549,6 +2601,7 @@ elseif(PSP)
|
||||
if(SDL_THREADS)
|
||||
set(SDL_THREAD_PSP 1)
|
||||
sdl_glob_sources(
|
||||
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_systls.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c"
|
||||
"${SDL3_SOURCE_DIR}/src/thread/psp/*.c"
|
||||
@ -2778,8 +2831,12 @@ if(NOT HAVE_SDL_THREADS)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_SDL_TIMERS)
|
||||
set(SDL_TIMER_DUMMY 1)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/timer/dummy/*.c")
|
||||
message(FATAL_ERROR "Timers are needed by many SDL subsystems and may not be disabled")
|
||||
endif()
|
||||
|
||||
# Most platforms use this.
|
||||
if(NOT HAVE_SDL_MAIN_CALLBACKS)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/generic/*.c")
|
||||
endif()
|
||||
|
||||
# config variables may contain generator expression, so we need to generate SDL_build_config.h in 2 steps:
|
||||
@ -2804,7 +2861,7 @@ set(SDL_REVISION "" CACHE STRING "Custom SDL revision (overrides SDL_REVISION_SU
|
||||
if(NOT SDL_REVISION)
|
||||
set(SDL_REVISION_SUFFIX "" CACHE STRING "Suffix for the SDL revision")
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt")
|
||||
# If VERSION exists, it contains the SDL version
|
||||
# If VERSION.txt exists, it contains the SDL version
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" SDL_REVISION_CENTER)
|
||||
string(STRIP "${SDL_REVISION_CENTER}" SDL_REVISION_CENTER)
|
||||
else()
|
||||
@ -2952,6 +3009,12 @@ if(ANDROID)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
cmake_push_check_state(RESET)
|
||||
check_c_compiler_flag(-fobjc-arc COMPILER_SUPPORTS_FOBJC_ARC)
|
||||
cmake_pop_check_state()
|
||||
if(NOT COMPILER_SUPPORTS_FOBJC_ARC)
|
||||
message(FATAL_ERROR "Compiler does not support -fobjc-arc: this is required on Apple platforms")
|
||||
endif()
|
||||
sdl_compile_options(PRIVATE "-fobjc-arc")
|
||||
endif()
|
||||
|
||||
@ -2959,6 +3022,24 @@ if(PS2)
|
||||
sdl_compile_options(PRIVATE "-Wno-error=declaration-after-statement")
|
||||
endif()
|
||||
|
||||
if(NOT SDL_LIBC)
|
||||
if(MSVC)
|
||||
set(saved_CMAKE_TRY_COMPILE_TARGET_TYPE "${CMAKE_TRY_COMPILE_TARGET_TYPE}")
|
||||
cmake_push_check_state(RESET)
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
||||
check_c_compiler_flag("/Zl" COMPILER_SUPPORTS_Zl)
|
||||
cmake_pop_check_state()
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "${saved_CMAKE_TRY_COMPILE_TARGET_TYPE}")
|
||||
if(COMPILER_SUPPORTS_Zl)
|
||||
# /Zl omits the default C runtime library name from the .obj file.
|
||||
sdl_compile_options(PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/Zl>")
|
||||
if(TARGET SDL3_test)
|
||||
target_compile_options(SDL3_test PRIVATE "/Zl")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
get_property(sources TARGET SDL3-collector PROPERTY INTERFACE_SOURCES)
|
||||
foreach(SOURCE_FILE IN LISTS sources)
|
||||
@ -3029,9 +3110,15 @@ if(SDL_SHARED)
|
||||
)
|
||||
endif()
|
||||
if(NOT SDL_LIBC)
|
||||
if(MSVC AND SDL_CPU_X86)
|
||||
# FIXME: should be added for all architectures (missing symbols for ARM)
|
||||
target_link_libraries(SDL3-shared PRIVATE "-nodefaultlib:MSVCRT")
|
||||
if(MSVC AND (NOT MSVC_CLANG AND NOT WINDOWS_STORE))
|
||||
# Don't try to link with the default set of libraries.
|
||||
# Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB.
|
||||
target_link_options(SDL3-shared PRIVATE "/NODEFAULTLIB")
|
||||
if(SDL_CPU_ARM32)
|
||||
# linking to msvcrt.lib avoid unresolved external symbols
|
||||
# (__rt_sdiv, __rt_udiv, __rt_sdiv64, _rt_udiv64, __dtou64, __u64tod, __i64tos)
|
||||
target_link_libraries(SDL3-shared PRIVATE msvcrt.lib)
|
||||
endif()
|
||||
endif()
|
||||
if(HAS_Q_NO_USE_LIBIRC)
|
||||
target_compile_options(SDL3-shared PRIVATE /Q_no-use-libirc)
|
||||
@ -3066,14 +3153,6 @@ if(SDL_SHARED)
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
# Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB.
|
||||
if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT SDL_CPU_ARM32)
|
||||
# Don't try to link with the default set of libraries.
|
||||
if(NOT WINDOWS_STORE)
|
||||
# FIXME: is this needed? "-nodefaultlib:MSVCRT" ia already added when SDL_LIBC is false
|
||||
target_link_options(SDL3-shared PRIVATE "/NODEFAULTLIB")
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(SDL3-shared PRIVATE ${SDL_CMAKE_DEPENDS})
|
||||
target_include_directories(SDL3-shared
|
||||
PRIVATE
|
||||
@ -3231,6 +3310,7 @@ sdl_cmake_config_find_pkg_config_commands(SDL_TEST_FIND_PKG_CONFIG_COMMANDS
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(cmake/SDL3Config.cmake.in SDL3Config.cmake
|
||||
NO_SET_AND_CHECK_MACRO
|
||||
PATH_VARS CMAKE_INSTALL_PREFIX
|
||||
INSTALL_DESTINATION "${SDL_SDL_INSTALL_CMAKEDIR}"
|
||||
)
|
||||
@ -3264,6 +3344,9 @@ if(NOT SDL_DISABLE_INSTALL)
|
||||
FRAMEWORK DESTINATION "."
|
||||
RESOURCE DESTINATION "${SDL_SDL_INSTALL_RESOURCEDIR}"
|
||||
)
|
||||
if(MSVC)
|
||||
SDL_install_pdb(SDL3-shared "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_STATIC)
|
||||
@ -3272,6 +3355,9 @@ if(NOT SDL_DISABLE_INSTALL)
|
||||
FRAMEWORK DESTINATION "."
|
||||
RESOURCE DESTINATION "${SDL_SDLstatic_INSTALL_RESOURCEDIR}"
|
||||
)
|
||||
if(MSVC)
|
||||
SDL_install_pdb(SDL3-static "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_TEST_LIBRARY)
|
||||
@ -3280,6 +3366,9 @@ if(NOT SDL_DISABLE_INSTALL)
|
||||
FRAMEWORK DESTINATION "."
|
||||
RESOURCE DESTINATION "${SDL_SDLtest_INSTALL_RESOURCEDIR}"
|
||||
)
|
||||
if(MSVC)
|
||||
SDL_install_pdb(SDL3_test "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
##### Install CMake Targets #####
|
||||
@ -3351,10 +3440,19 @@ if(NOT SDL_DISABLE_INSTALL)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(SDL_INSTALL_JAVADIR "${CMAKE_INSTALL_DATAROOTDIR}/java" CACHE PATH "Path where to install java clases + java sources")
|
||||
if(TARGET SDL3-jar)
|
||||
install(FILES "${SDL3_BINARY_DIR}/SDL3.jar" "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}.jar"
|
||||
set(SDL_INSTALL_JAVADIR "${CMAKE_INSTALL_DATAROOTDIR}/java" CACHE PATH "Path where to install java clases + java sources")
|
||||
install(FILES $<TARGET_PROPERTY:SDL3-jar,INSTALL_FILES>
|
||||
DESTINATION "${SDL_INSTALL_JAVADIR}/SDL3")
|
||||
configure_package_config_file(cmake/SDL3jarTargets.cmake.in SDL3jarTargets.cmake
|
||||
INSTALL_DESTINATION "${SDL_SDL_INSTALL_CMAKEDIR}"
|
||||
PATH_VARS SDL_INSTALL_JAVADIR
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SDL3jarTargets.cmake"
|
||||
DESTINATION "${SDL_SDL_INSTALL_CMAKEDIR}"
|
||||
)
|
||||
endif()
|
||||
if(TARGET SDL3-javasources)
|
||||
install(FILES "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}-sources.jar"
|
||||
@ -3364,6 +3462,7 @@ if(NOT SDL_DISABLE_INSTALL)
|
||||
|
||||
if(NOT SDL_DISABLE_INSTALL_DOCS)
|
||||
SDL_generate_manpages(
|
||||
HEADERS_DIR "${PROJECT_SOURCE_DIR}/include/SDL3"
|
||||
SYMBOL "SDL_Init"
|
||||
WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-scripts/wikiheaders.pl"
|
||||
REVISION "${SDL_REVISION}"
|
||||
|
34
CREDITS.md
Normal file
34
CREDITS.md
Normal file
@ -0,0 +1,34 @@
|
||||
# Simple DirectMedia Layer CREDITS
|
||||
|
||||
Thanks to everyone who made this possible, including:
|
||||
|
||||
- Cliff Matthews, for giving me a reason to start this project. :) -- Executor rocks! *grin*
|
||||
- Ryan Gordon for helping everybody out and keeping the dream alive. :)
|
||||
- Gabriel Jacobo for his work on the Android port and generally helping out all around.
|
||||
- Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
|
||||
- Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
|
||||
- Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
|
||||
- Alfred Reynolds for the game controller API and general (in)sanity
|
||||
- Jørgen Tjernø¸ for numerous magical macOS fixes.
|
||||
- Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
|
||||
- Julian Winter for the SDL 2.0 website.
|
||||
- Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
|
||||
- Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
|
||||
- Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
|
||||
- Jim Grandpre for his work on multi-touch and gesture recognition during
|
||||
the Google Summer of Code 2010.
|
||||
- Edgar "bobbens" Simo for his force feedback API development during the
|
||||
Google Summer of Code 2008.
|
||||
- Aaron Wishnick for his work on audio resampling and pitch shifting during
|
||||
the Google Summer of Code 2008.
|
||||
- Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
|
||||
Google Summer of Code 2008.
|
||||
- Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
|
||||
- Everybody at Loki Software, Inc. for their great contributions!
|
||||
|
||||
And a big hand to everyone else who has contributed over the years.
|
||||
|
||||
THANKS! :)
|
||||
|
||||
-- Sam Lantinga <slouken@libsdl.org>
|
||||
|
53
CREDITS.txt
53
CREDITS.txt
@ -1,53 +0,0 @@
|
||||
|
||||
Simple DirectMedia Layer CREDITS
|
||||
Thanks to everyone who made this possible, including:
|
||||
|
||||
* Cliff Matthews, for giving me a reason to start this project. :)
|
||||
-- Executor rocks! *grin*
|
||||
|
||||
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
|
||||
|
||||
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
|
||||
|
||||
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
|
||||
|
||||
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
|
||||
|
||||
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
|
||||
|
||||
* Alfred Reynolds for the game controller API and general (in)sanity
|
||||
|
||||
* Jørgen Tjernø for numerous magical macOS fixes.
|
||||
|
||||
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
|
||||
|
||||
* Julian Winter for the SDL 2.0 website.
|
||||
|
||||
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
|
||||
|
||||
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
|
||||
|
||||
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
|
||||
|
||||
* Jim Grandpre for his work on multi-touch and gesture recognition during
|
||||
the Google Summer of Code 2010.
|
||||
|
||||
* Edgar "bobbens" Simo for his force feedback API development during the
|
||||
Google Summer of Code 2008.
|
||||
|
||||
* Aaron Wishnick for his work on audio resampling and pitch shifting during
|
||||
the Google Summer of Code 2008.
|
||||
|
||||
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
|
||||
Google Summer of Code 2008.
|
||||
|
||||
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
|
||||
|
||||
* Everybody at Loki Software, Inc. for their great contributions!
|
||||
|
||||
And a big hand to everyone else who has contributed over the years.
|
||||
|
||||
THANKS! :)
|
||||
|
||||
-- Sam Lantinga <slouken@libsdl.org>
|
||||
|
64
INSTALL.md
Normal file
64
INSTALL.md
Normal file
@ -0,0 +1,64 @@
|
||||
# To compile and install SDL:
|
||||
|
||||
## Windows with Visual Studio:
|
||||
|
||||
Read ./docs/README-visualc.md
|
||||
|
||||
## Windows building with mingw-w64 for x86:
|
||||
|
||||
Run: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-i686.cmake && cmake --build build && cmake --install build`
|
||||
|
||||
## Windows building with mingw-w64 for x64:
|
||||
|
||||
Run: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-x86_64.cmake && cmake --build build && cmake --install build`
|
||||
|
||||
## macOS with Xcode:
|
||||
|
||||
Read docs/README-macos.md
|
||||
|
||||
## macOS from the command line:
|
||||
|
||||
Run: `cmake -S . -B build && cmake --build build && cmake --install build`
|
||||
|
||||
## Linux and other UNIX systems:
|
||||
|
||||
Run: `cmake -S . -B build && cmake --build build && cmake --install build`
|
||||
|
||||
## Android:
|
||||
|
||||
Read docs/README-android.md
|
||||
|
||||
## iOS:
|
||||
|
||||
Read docs/README-ios.md
|
||||
|
||||
## Using CMake:
|
||||
|
||||
Read docs/README-cmake.md
|
||||
|
||||
# Example code
|
||||
|
||||
Look at the example programs in ./test, and check out the online
|
||||
documentation at https://wiki.libsdl.org/SDL3/
|
||||
|
||||
# Discussion
|
||||
|
||||
## Forums/mailing lists
|
||||
|
||||
Join the SDL developer discussions, sign up on
|
||||
|
||||
https://discourse.libsdl.org/
|
||||
|
||||
and go to the development forum
|
||||
|
||||
https://discourse.libsdl.org/c/sdl-development/6
|
||||
|
||||
Once you sign up, you can use the forum through the website, or as a mailing
|
||||
list from your email client.
|
||||
|
||||
## Announcement list
|
||||
|
||||
Sign up for the announcement list through the web interface:
|
||||
|
||||
https://www.libsdl.org/mailing-list.php
|
||||
|
43
INSTALL.txt
43
INSTALL.txt
@ -1,43 +0,0 @@
|
||||
|
||||
To compile and install SDL:
|
||||
|
||||
1. Windows with Visual Studio:
|
||||
* Read ./docs/README-visualc.md
|
||||
|
||||
Windows building with mingw-w64 for x86:
|
||||
* Run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-i686.cmake && cmake --build build && cmake --install build
|
||||
|
||||
Windows building with mingw-w64 for x64:
|
||||
* Run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-x86_64.cmake && cmake --build build && cmake --install build
|
||||
|
||||
macOS with Xcode:
|
||||
* Read docs/README-macos.md
|
||||
|
||||
macOS from the command line:
|
||||
* Run: cmake -S . -B build && cmake --build build && cmake --install build
|
||||
|
||||
Linux and other UNIX systems:
|
||||
* Run: cmake -S . -B build && cmake --build build && cmake --install build
|
||||
|
||||
Android:
|
||||
* Read docs/README-android.md
|
||||
|
||||
iOS:
|
||||
* Read docs/README-ios.md
|
||||
|
||||
Using Cmake:
|
||||
* Read docs/README-cmake.md
|
||||
|
||||
2. Look at the example programs in ./test, and check out the online
|
||||
documentation at https://wiki.libsdl.org/
|
||||
|
||||
3. Join the SDL developer discussions, sign up on
|
||||
https://discourse.libsdl.org/
|
||||
and go to the development forum
|
||||
https://discourse.libsdl.org/c/sdl-development/6
|
||||
|
||||
4. Sign up for the announcement list through the web interface:
|
||||
https://www.libsdl.org/mailing-list.php
|
||||
|
||||
That's it!
|
||||
Sam Lantinga <slouken@libsdl.org>
|
@ -1,4 +1,4 @@
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
36
README.md
36
README.md
@ -1,18 +1,18 @@
|
||||
|
||||
# Simple DirectMedia Layer (SDL) Version 3.0
|
||||
|
||||
https://www.libsdl.org/
|
||||
|
||||
Simple DirectMedia Layer is a cross-platform development library designed
|
||||
to provide low level access to audio, keyboard, mouse, joystick, and graphics
|
||||
hardware via OpenGL and Direct3D. It is used by video playback software,
|
||||
emulators, and popular games including Valve's award winning catalog
|
||||
and many Humble Bundle games.
|
||||
|
||||
More extensive documentation is available in the docs directory, starting
|
||||
with [README.md](docs/README.md). If you are migrating to SDL 3.0 from SDL 2.0,
|
||||
the changes are extensively documented in [README-migration.md](docs/README-migration.md).
|
||||
|
||||
Enjoy!
|
||||
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
||||
# Simple DirectMedia Layer (SDL) Version 3.0
|
||||
|
||||
https://www.libsdl.org/
|
||||
|
||||
Simple DirectMedia Layer is a cross-platform development library designed
|
||||
to provide low level access to audio, keyboard, mouse, joystick, and graphics
|
||||
hardware via OpenGL and Direct3D. It is used by video playback software,
|
||||
emulators, and popular games including Valve's award winning catalog
|
||||
and many Humble Bundle games.
|
||||
|
||||
More extensive documentation is available in the docs directory, starting
|
||||
with [README.md](docs/README.md). If you are migrating to SDL 3.0 from SDL 2.0,
|
||||
the changes are extensively documented in [README-migration.md](docs/README-migration.md).
|
||||
|
||||
Enjoy!
|
||||
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
10
TODO.txt
10
TODO.txt
@ -1,10 +0,0 @@
|
||||
Future work roadmap:
|
||||
* http://wiki.libsdl.org/Roadmap
|
||||
|
||||
* Check 1.2 revisions:
|
||||
3554 - Need to resolve semantics for locking keys on different platforms
|
||||
4874 - Do we want screen rotation? At what level?
|
||||
4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
|
||||
4865 - See if this is still needed (mouse coordinate clamping)
|
||||
4866 - See if this is still needed (blocking window repositioning)
|
||||
|
@ -11,6 +11,9 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcontroller", "tests\testcontroller\testcontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgdk", "tests\testgdk\testgdk.vcxproj", "{1C9A3F71-35A5-4C56-B292-F4375B3C3649}"
|
||||
EndProject
|
||||
|
@ -59,6 +59,7 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@ -129,7 +130,7 @@
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
@ -169,6 +170,12 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox Series)</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
|
||||
<Midl>
|
||||
@ -197,6 +204,12 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox One)</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
|
||||
<Midl>
|
||||
@ -214,7 +227,7 @@
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
@ -257,6 +270,12 @@
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox Series)</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
|
||||
<Midl>
|
||||
@ -286,6 +305,12 @@
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Building shader blobs (Xbox One)</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h" />
|
||||
@ -329,6 +354,7 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2ext.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2platform.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_pen.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
|
||||
@ -340,11 +366,9 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_rwops.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_scancode.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_shape.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_surface.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_system.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_syswm.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test_assert.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test_common.h" />
|
||||
@ -407,6 +431,7 @@
|
||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
|
||||
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
|
||||
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
|
||||
@ -417,6 +442,7 @@
|
||||
<ClInclude Include="..\..\src\libm\math_libm.h" />
|
||||
<ClInclude Include="..\..\src\libm\math_private.h" />
|
||||
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
|
||||
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
|
||||
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
|
||||
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
|
||||
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
|
||||
@ -455,6 +481,12 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp">
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
||||
@ -467,11 +499,15 @@
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
||||
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\SDL_guid.c" />
|
||||
<ClInclude Include="..\..\src\SDL_hashtable.h" />
|
||||
<ClInclude Include="..\..\src\SDL_hints_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_internal.h" />
|
||||
<ClInclude Include="..\..\src\SDL_list.h" />
|
||||
<ClInclude Include="..\..\src\SDL_log_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_properties_c.h" />
|
||||
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
|
||||
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
|
||||
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
|
||||
@ -517,12 +553,10 @@
|
||||
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
||||
@ -532,7 +566,6 @@
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
|
||||
@ -540,8 +573,6 @@
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
|
||||
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
|
||||
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
|
||||
@ -557,6 +588,8 @@
|
||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_runapp.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
|
||||
@ -581,11 +614,15 @@
|
||||
<ClCompile Include="..\..\src\events\SDL_events.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_pen.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_quit.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_touch.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
|
||||
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
|
||||
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
|
||||
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
|
||||
@ -623,6 +660,7 @@
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
|
||||
@ -630,6 +668,7 @@
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
|
||||
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
|
||||
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
|
||||
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
|
||||
@ -699,6 +738,7 @@
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
|
||||
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
|
||||
@ -712,8 +752,10 @@
|
||||
<ClCompile Include="..\..\src\SDL_assert.c" />
|
||||
<ClCompile Include="..\..\src\SDL_list.c" />
|
||||
<ClCompile Include="..\..\src\SDL_error.c" />
|
||||
<ClCompile Include="..\..\src\SDL_hashtable.c" />
|
||||
<ClCompile Include="..\..\src\SDL_hints.c" />
|
||||
<ClCompile Include="..\..\src\SDL_log.c" />
|
||||
<ClCompile Include="..\..\src\SDL_properties.c" />
|
||||
<ClCompile Include="..\..\src\SDL_utils.c" />
|
||||
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
|
||||
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
|
||||
@ -724,6 +766,9 @@
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
|
||||
<MASM Condition="'$(Platform)'=='x64'" Include="..\..\src\stdlib\SDL_mslibc_x64.masm">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</MASM>
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
|
||||
@ -761,10 +806,11 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_rect.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_shape.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_surface.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_video.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_video_capture.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
||||
@ -776,7 +822,6 @@
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
|
||||
@ -787,5 +832,6 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
File diff suppressed because it is too large
Load Diff
@ -4,3 +4,4 @@ find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -del
|
||||
find . -depth -type d \( -name Gaming.Desktop.x64 \) -exec rm -rv {} \;
|
||||
find . -depth -type d \( -name Gaming.Xbox.Scarlett.x64 \) -exec rm -rv {} \;
|
||||
find . -depth -type d \( -name Gaming.Xbox.XboxOne.x64 \) -exec rm -rv {} \;
|
||||
rm shaders/*.h
|
||||
|
19
VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl
Normal file
19
VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl
Normal file
@ -0,0 +1,19 @@
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define ColorRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
"DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
"DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
"DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0)"
|
||||
|
||||
[RootSignature(ColorRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET0
|
||||
{
|
||||
return input.color;
|
||||
}
|
43
VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl
Normal file
43
VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl
Normal file
@ -0,0 +1,43 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureUV : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.1644, 0.0000, 1.5960};
|
||||
const float3 Gcoeff = {1.1644, -0.3918, -0.8130};
|
||||
const float3 Bcoeff = {1.1644, 2.0172, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
43
VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl
Normal file
43
VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl
Normal file
@ -0,0 +1,43 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureUV : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.1644, 0.0000, 1.7927};
|
||||
const float3 Gcoeff = {1.1644, -0.2132, -0.5329};
|
||||
const float3 Bcoeff = {1.1644, 2.1124, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
43
VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl
Normal file
43
VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl
Normal file
@ -0,0 +1,43 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureUV : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {0.0, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.0000, 0.0000, 1.4020};
|
||||
const float3 Gcoeff = {1.0000, -0.3441, -0.7141};
|
||||
const float3 Bcoeff = {1.0000, 1.7720, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
43
VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl
Normal file
43
VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl
Normal file
@ -0,0 +1,43 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureUV : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.1644, 0.0000, 1.5960};
|
||||
const float3 Gcoeff = {1.1644, -0.3918, -0.8130};
|
||||
const float3 Bcoeff = {1.1644, 2.0172, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
43
VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl
Normal file
43
VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl
Normal file
@ -0,0 +1,43 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureUV : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.1644, 0.0000, 1.7927};
|
||||
const float3 Gcoeff = {1.1644, -0.2132, -0.5329};
|
||||
const float3 Bcoeff = {1.1644, 2.1124, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
43
VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl
Normal file
43
VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl
Normal file
@ -0,0 +1,43 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureUV : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {0.0, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.0000, 0.0000, 1.4020};
|
||||
const float3 Gcoeff = {1.0000, -0.3441, -0.7141};
|
||||
const float3 Bcoeff = {1.0000, 1.7720, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
24
VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl
Normal file
24
VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl
Normal file
@ -0,0 +1,24 @@
|
||||
Texture2D theTexture : register(t0);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define TextureRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(TextureRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
return theTexture.Sample(theSampler, input.tex) * input.color;
|
||||
}
|
46
VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl
Normal file
46
VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl
Normal file
@ -0,0 +1,46 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureU : register(t1);
|
||||
Texture2D theTextureV : register(t2);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define YUVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(YUVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.1644, 0.0000, 1.5960};
|
||||
const float3 Gcoeff = {1.1644, -0.3918, -0.8130};
|
||||
const float3 Bcoeff = {1.1644, 2.0172, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.y = theTextureU.Sample(theSampler, input.tex).r;
|
||||
yuv.z = theTextureV.Sample(theSampler, input.tex).r;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
46
VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl
Normal file
46
VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl
Normal file
@ -0,0 +1,46 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureU : register(t1);
|
||||
Texture2D theTextureV : register(t2);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define YUVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(YUVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.1644, 0.0000, 1.7927};
|
||||
const float3 Gcoeff = {1.1644, -0.2132, -0.5329};
|
||||
const float3 Bcoeff = {1.1644, 2.1124, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.y = theTextureU.Sample(theSampler, input.tex).r;
|
||||
yuv.z = theTextureV.Sample(theSampler, input.tex).r;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
46
VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl
Normal file
46
VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl
Normal file
@ -0,0 +1,46 @@
|
||||
Texture2D theTextureY : register(t0);
|
||||
Texture2D theTextureU : register(t1);
|
||||
Texture2D theTextureV : register(t2);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
struct PixelShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define YUVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(YUVRS)]
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
const float3 offset = {0.0, -0.501960814, -0.501960814};
|
||||
const float3 Rcoeff = {1.0000, 0.0000, 1.4020};
|
||||
const float3 Gcoeff = {1.0000, -0.3441, -0.7141};
|
||||
const float3 Bcoeff = {1.0000, 1.7720, 0.0000};
|
||||
|
||||
float4 Output;
|
||||
|
||||
float3 yuv;
|
||||
yuv.x = theTextureY.Sample(theSampler, input.tex).r;
|
||||
yuv.y = theTextureU.Sample(theSampler, input.tex).r;
|
||||
yuv.z = theTextureV.Sample(theSampler, input.tex).r;
|
||||
|
||||
yuv += offset;
|
||||
Output.r = dot(yuv, Rcoeff);
|
||||
Output.g = dot(yuv, Gcoeff);
|
||||
Output.b = dot(yuv, Bcoeff);
|
||||
Output.a = 1.0f;
|
||||
|
||||
return Output * input.color;
|
||||
}
|
95
VisualC-GDK/shaders/D3D12_VertexShader.hlsl
Normal file
95
VisualC-GDK/shaders/D3D12_VertexShader.hlsl
Normal file
@ -0,0 +1,95 @@
|
||||
#pragma pack_matrix( row_major )
|
||||
|
||||
struct VertexShaderConstants
|
||||
{
|
||||
matrix model;
|
||||
matrix projectionAndView;
|
||||
};
|
||||
ConstantBuffer<VertexShaderConstants> Constants : register(b0);
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float3 pos : POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
#define ColorRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
"DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
"DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
"DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0)"
|
||||
|
||||
#define TextureRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define YUVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define NVRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=32, b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
[RootSignature(ColorRS)]
|
||||
VertexShaderOutput mainColor(VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output;
|
||||
float4 pos = float4(input.pos, 1.0f);
|
||||
|
||||
// Transform the vertex position into projected space.
|
||||
pos = mul(pos, Constants.model);
|
||||
pos = mul(pos, Constants.projectionAndView);
|
||||
output.pos = pos;
|
||||
|
||||
// Pass through texture coordinates and color values without transformation
|
||||
output.tex = input.tex;
|
||||
output.color = input.color;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
[RootSignature(TextureRS)]
|
||||
VertexShaderOutput mainTexture(VertexShaderInput input)
|
||||
{
|
||||
return mainColor(input);
|
||||
}
|
||||
|
||||
[RootSignature(YUVRS)]
|
||||
VertexShaderOutput mainYUV(VertexShaderInput input)
|
||||
{
|
||||
return mainColor(input);
|
||||
}
|
||||
|
||||
[RootSignature(NVRS)]
|
||||
VertexShaderOutput mainNV(VertexShaderInput input)
|
||||
{
|
||||
return mainColor(input);
|
||||
}
|
35
VisualC-GDK/shaders/buildshaders.bat
Normal file
35
VisualC-GDK/shaders/buildshaders.bat
Normal file
@ -0,0 +1,35 @@
|
||||
if %2.==one. goto setxboxone
|
||||
rem Xbox Series compile
|
||||
set XBOXDXC="%GameDKLatest%\GXDK\bin\Scarlett\DXC.exe"
|
||||
set SUFFIX=_Series.h
|
||||
goto startbuild
|
||||
|
||||
:setxboxone
|
||||
set XBOXDXC="%GameDKLatest%\GXDK\bin\XboxOne\DXC.exe"
|
||||
set SUFFIX=_One.h
|
||||
|
||||
:startbuild
|
||||
echo Building with %XBOXDXC%
|
||||
cd "%1\shaders"
|
||||
rem Root Signatures
|
||||
%XBOXDXC% -E ColorRS -T rootsig_1_1 -rootsig-define ColorRS -Fh D3D12_RootSig_Color%SUFFIX% -Vn D3D12_RootSig_Color D3D12_VertexShader.hlsl
|
||||
%XBOXDXC% -E TextureRS -T rootsig_1_1 -rootsig-define TextureRS -Fh D3D12_RootSig_Texture%SUFFIX% -Vn D3D12_RootSig_Texture D3D12_VertexShader.hlsl
|
||||
%XBOXDXC% -E YUVRS -T rootsig_1_1 -rootsig-define YUVRS -Fh D3D12_RootSig_YUV%SUFFIX% -Vn D3D12_RootSig_YUV D3D12_VertexShader.hlsl
|
||||
%XBOXDXC% -E NVRS -T rootsig_1_1 -rootsig-define NVRS -Fh D3D12_RootSig_NV%SUFFIX% -Vn D3D12_RootSig_NV D3D12_VertexShader.hlsl
|
||||
rem Vertex Shaders
|
||||
%XBOXDXC% -E mainColor -T vs_6_0 -Fh D3D12_VertexShader_Color%SUFFIX% -Vn D3D12_VertexShader_Color D3D12_VertexShader.hlsl
|
||||
%XBOXDXC% -E mainTexture -T vs_6_0 -Fh D3D12_VertexShader_Texture%SUFFIX% -Vn D3D12_VertexShader_Texture D3D12_VertexShader.hlsl
|
||||
%XBOXDXC% -E mainNV -T vs_6_0 -Fh D3D12_VertexShader_NV%SUFFIX% -Vn D3D12_VertexShader_NV D3D12_VertexShader.hlsl
|
||||
%XBOXDXC% -E mainYUV -T vs_6_0 -Fh D3D12_VertexShader_YUV%SUFFIX% -Vn D3D12_VertexShader_YUV D3D12_VertexShader.hlsl
|
||||
rem Pixel Shaders
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_Colors%SUFFIX% -Vn D3D12_PixelShader_Colors D3D12_PixelShader_Colors.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_BT601%SUFFIX% -Vn D3D12_PixelShader_NV12_BT601 D3D12_PixelShader_NV12_BT601.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_BT709%SUFFIX% -Vn D3D12_PixelShader_NV12_BT709 D3D12_PixelShader_NV12_BT709.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_JPEG%SUFFIX% -Vn D3D12_PixelShader_NV12_JPEG D3D12_PixelShader_NV12_JPEG.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_BT601%SUFFIX% -Vn D3D12_PixelShader_NV21_BT601 D3D12_PixelShader_NV21_BT601.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_BT709%SUFFIX% -Vn D3D12_PixelShader_NV21_BT709 D3D12_PixelShader_NV21_BT709.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_JPEG%SUFFIX% -Vn D3D12_PixelShader_NV21_JPEG D3D12_PixelShader_NV21_JPEG.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_Textures%SUFFIX% -Vn D3D12_PixelShader_Textures D3D12_PixelShader_Textures.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_BT601%SUFFIX% -Vn D3D12_PixelShader_YUV_BT601 D3D12_PixelShader_YUV_BT601.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_BT709%SUFFIX% -Vn D3D12_PixelShader_YUV_BT709 D3D12_PixelShader_YUV_BT709.hlsl
|
||||
%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_JPEG%SUFFIX% -Vn D3D12_PixelShader_YUV_JPEG D3D12_PixelShader_YUV_JPEG.hlsl
|
@ -139,7 +139,7 @@
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
|
||||
@ -211,7 +211,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
|
||||
@ -273,6 +273,12 @@
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDL_test\SDL_test.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\test\gamepadutils.c" />
|
||||
@ -298,7 +304,7 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
@ -330,4 +336,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
@ -18,9 +18,6 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
@ -34,6 +31,9 @@
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="PackageLayout.xml" />
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="logos">
|
||||
@ -49,4 +49,4 @@
|
||||
<UniqueIdentifier>{e704dcb9-c83c-4c94-a139-b0f3e3f428f2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@ -53,23 +53,14 @@ static struct
|
||||
int soundpos; /* Current play position */
|
||||
} wave;
|
||||
|
||||
static SDL_AudioDeviceID device;
|
||||
|
||||
static void
|
||||
close_audio()
|
||||
{
|
||||
if (device != 0) {
|
||||
SDL_CloseAudioDevice(device);
|
||||
device = 0;
|
||||
}
|
||||
}
|
||||
static SDL_AudioStream *stream;
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void
|
||||
quit(int rc)
|
||||
{
|
||||
SDL_free(sprites);
|
||||
close_audio();
|
||||
SDL_DestroyAudioStream(stream);
|
||||
SDL_free(wave.sound);
|
||||
SDLTest_CommonQuit(state);
|
||||
/* If rc is 0, just let main return normally rather than calling exit.
|
||||
@ -80,49 +71,13 @@ quit(int rc)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
open_audio()
|
||||
static int fillerup(void)
|
||||
{
|
||||
/* Initialize fillerup() variables */
|
||||
device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0);
|
||||
if (!device) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
|
||||
SDL_free(wave.sound);
|
||||
quit(2);
|
||||
const int minimum = (wave.soundlen / SDL_AUDIO_FRAMESIZE(wave.spec)) / 2;
|
||||
if (SDL_GetAudioStreamQueued(stream) < minimum) {
|
||||
SDL_PutAudioStreamData(stream, wave.sound, wave.soundlen);
|
||||
}
|
||||
|
||||
/* Let the audio run */
|
||||
SDL_PlayAudioDevice(device);
|
||||
}
|
||||
|
||||
static void
|
||||
reopen_audio()
|
||||
{
|
||||
close_audio();
|
||||
open_audio();
|
||||
}
|
||||
|
||||
void SDLCALL
|
||||
fillerup(void *unused, Uint8 *stream, int len)
|
||||
{
|
||||
Uint8 *waveptr;
|
||||
int waveleft;
|
||||
|
||||
/* Set up the pointers */
|
||||
waveptr = wave.sound + wave.soundpos;
|
||||
waveleft = wave.soundlen - wave.soundpos;
|
||||
|
||||
/* Go! */
|
||||
while (waveleft <= len) {
|
||||
SDL_memcpy(stream, waveptr, waveleft);
|
||||
stream += waveleft;
|
||||
len -= waveleft;
|
||||
waveptr = wave.sound;
|
||||
waveleft = wave.soundlen;
|
||||
wave.soundpos = 0;
|
||||
}
|
||||
SDL_memcpy(stream, waveptr, len);
|
||||
wave.soundpos += len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -371,6 +326,7 @@ loop()
|
||||
}
|
||||
DrawSprites(state->renderers[i], sprites[i]);
|
||||
}
|
||||
fillerup();
|
||||
}
|
||||
|
||||
int
|
||||
@ -385,7 +341,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||
if (state == NULL) {
|
||||
if (!state) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -448,7 +404,7 @@ main(int argc, char *argv[])
|
||||
/* Create the windows, initialize the renderers, and load the textures */
|
||||
sprites =
|
||||
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
|
||||
if (sprites == NULL) {
|
||||
if (!sprites) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
|
||||
quit(2);
|
||||
}
|
||||
@ -463,19 +419,17 @@ main(int argc, char *argv[])
|
||||
|
||||
soundname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav");
|
||||
|
||||
if (soundname == NULL) {
|
||||
if (!soundname) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
/* Load the wave file into memory */
|
||||
if (SDL_LoadWAV(soundname, &wave.spec, &wave.sound, &wave.soundlen) == NULL) {
|
||||
if (SDL_LoadWAV(soundname, &wave.spec, &wave.sound, &wave.soundlen) == -1) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", soundname, SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
wave.spec.callback = fillerup;
|
||||
|
||||
/* Show the list of available drivers */
|
||||
SDL_Log("Available audio drivers:");
|
||||
for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
|
||||
@ -484,7 +438,12 @@ main(int argc, char *argv[])
|
||||
|
||||
SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
|
||||
|
||||
open_audio();
|
||||
stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_OUTPUT, &wave.spec, NULL, NULL);
|
||||
if (!stream) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s\n", SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));
|
||||
|
||||
/* Main render loop */
|
||||
done = 0;
|
||||
|
@ -139,7 +139,7 @@
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@ -223,7 +223,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@ -346,7 +346,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
|
@ -18,9 +18,6 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
@ -35,6 +32,9 @@
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="PackageLayout.xml" />
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="logos">
|
||||
|
@ -139,7 +139,7 @@
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@ -223,7 +223,7 @@
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
@ -346,7 +346,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
|
||||
|
@ -18,9 +18,6 @@
|
||||
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
|
||||
<Filter>xboxseries</Filter>
|
||||
</CopyFileToFolders>
|
||||
@ -34,6 +31,9 @@
|
||||
<Filter>logos</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="PackageLayout.xml" />
|
||||
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
|
||||
<Filter>wingdk</Filter>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="logos">
|
||||
|
@ -67,10 +67,12 @@
|
||||
<ClInclude Include="..\include\SDL3\SDL_mouse.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_mutex.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_opengles2.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_pen.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_pixels.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_platform.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_platform_defines.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_power.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_properties.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_quit.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_rect.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_render.h" />
|
||||
@ -78,17 +80,16 @@
|
||||
<ClInclude Include="..\include\SDL3\SDL_rwops.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_scancode.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_sensor.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_shape.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_stdinc.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_surface.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_system.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_syswm.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_thread.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_timer.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_touch.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_types.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_version.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_video.h" />
|
||||
<ClInclude Include="..\include\SDL3\SDL_video_capture.h" />
|
||||
<ClInclude Include="..\src\audio\disk\SDL_diskaudio.h" />
|
||||
<ClInclude Include="..\src\audio\dummy\SDL_dummyaudio.h" />
|
||||
<ClInclude Include="..\src\audio\SDL_audiodev_c.h" />
|
||||
@ -126,12 +127,14 @@
|
||||
<ClInclude Include="..\src\joystick\SDL_gamepad_c.h" />
|
||||
<ClInclude Include="..\src\joystick\SDL_gamepad_db.h" />
|
||||
<ClInclude Include="..\src\joystick\SDL_joystick_c.h" />
|
||||
<ClInclude Include="..\src\joystick\SDL_steam_virtual_gamepad.h" />
|
||||
<ClInclude Include="..\src\joystick\SDL_sysjoystick.h" />
|
||||
<ClInclude Include="..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
|
||||
<ClInclude Include="..\src\joystick\windows\SDL_dinputjoystick_c.h" />
|
||||
<ClInclude Include="..\src\joystick\windows\SDL_windowsjoystick_c.h" />
|
||||
<ClInclude Include="..\src\joystick\windows\SDL_xinputjoystick_c.h" />
|
||||
<ClInclude Include="..\src\locale\SDL_syslocale.h" />
|
||||
<ClInclude Include="..\src\main\SDL_main_callbacks.h" />
|
||||
<ClInclude Include="..\src\render\direct3d11\SDL_render_winrt.h" />
|
||||
<ClInclude Include="..\src\render\direct3d11\SDL_shaders_d3d11.h" />
|
||||
<ClInclude Include="..\src\render\opengles2\SDL_gles2funcs.h" />
|
||||
@ -151,10 +154,12 @@
|
||||
<ClInclude Include="..\src\SDL_assert_c.h" />
|
||||
<ClInclude Include="..\src\SDL_error_c.h" />
|
||||
<ClInclude Include="..\src\SDL_fatal.h" />
|
||||
<ClInclude Include="..\src\SDL_hashtable.h" />
|
||||
<ClInclude Include="..\src\SDL_hints_c.h" />
|
||||
<ClInclude Include="..\src\SDL_internal.h" />
|
||||
<ClInclude Include="..\src\SDL_list.h" />
|
||||
<ClInclude Include="..\src\SDL_log_c.h" />
|
||||
<ClInclude Include="..\src\SDL_properties_c.h" />
|
||||
<ClInclude Include="..\src\sensor\dummy\SDL_dummysensor.h" />
|
||||
<ClInclude Include="..\src\sensor\SDL_sensor_c.h" />
|
||||
<ClInclude Include="..\src\sensor\SDL_syssensor.h" />
|
||||
@ -175,8 +180,8 @@
|
||||
<ClInclude Include="..\src\video\SDL_pixels_c.h" />
|
||||
<ClInclude Include="..\src\video\SDL_rect_c.h" />
|
||||
<ClInclude Include="..\src\video\SDL_RLEaccel_c.h" />
|
||||
<ClInclude Include="..\src\video\SDL_shape_internals.h" />
|
||||
<ClInclude Include="..\src\video\SDL_sysvideo.h" />
|
||||
<ClInclude Include="..\src\video\SDL_sysvidocapture.h" />
|
||||
<ClInclude Include="..\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="..\src\video\winrt\SDL_winrtevents_c.h" />
|
||||
<ClInclude Include="..\src\video\winrt\SDL_winrtgamebar_cpp.h" />
|
||||
@ -247,6 +252,8 @@
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="..\src\core\SDL_runapp.c" />
|
||||
<ClCompile Include="..\src\core\windows\SDL_windows.c" />
|
||||
<ClCompile Include="..\src\core\windows\SDL_xinput.c" />
|
||||
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_common.cpp">
|
||||
@ -299,6 +306,7 @@
|
||||
<ClCompile Include="..\src\events\SDL_events.c" />
|
||||
<ClCompile Include="..\src\events\SDL_keyboard.c" />
|
||||
<ClCompile Include="..\src\events\SDL_mouse.c" />
|
||||
<ClCompile Include="..\src\events\SDL_pen.c" />
|
||||
<ClCompile Include="..\src\events\SDL_quit.c" />
|
||||
<ClCompile Include="..\src\events\SDL_touch.c" />
|
||||
<ClCompile Include="..\src\events\SDL_windowevents.c" />
|
||||
@ -324,6 +332,7 @@
|
||||
<ClCompile Include="..\src\joystick\controller_type.c" />
|
||||
<ClCompile Include="..\src\joystick\SDL_gamepad.c" />
|
||||
<ClCompile Include="..\src\joystick\SDL_joystick.c" />
|
||||
<ClCompile Include="..\src\joystick\SDL_steam_virtual_gamepad.c" />
|
||||
<ClCompile Include="..\src\joystick\virtual\SDL_virtualjoystick.c" />
|
||||
<ClCompile Include="..\src\joystick\windows\SDL_dinputjoystick.c" />
|
||||
<ClCompile Include="..\src\joystick\windows\SDL_windowsjoystick.c" />
|
||||
@ -332,6 +341,8 @@
|
||||
<ClCompile Include="..\src\loadso\windows\SDL_sysloadso.c" />
|
||||
<ClCompile Include="..\src\locale\SDL_locale.c" />
|
||||
<ClCompile Include="..\src\locale\winrt\SDL_syslocale.c" />
|
||||
<ClCompile Include="..\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="..\src\main\SDL_main_callbacks.c" />
|
||||
<ClCompile Include="..\src\misc\SDL_url.c" />
|
||||
<ClCompile Include="..\src\misc\winrt\SDL_sysurl.cpp">
|
||||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
@ -380,6 +391,7 @@
|
||||
<ClCompile Include="..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||
<ClCompile Include="..\src\render\SDL_d3dmath.c" />
|
||||
<ClCompile Include="..\src\render\SDL_render.c" />
|
||||
<ClCompile Include="..\src\render\SDL_render_unsupported.c" />
|
||||
<ClCompile Include="..\src\render\SDL_yuv_sw.c" />
|
||||
<ClCompile Include="..\src\render\software\SDL_blendfillrect.c" />
|
||||
<ClCompile Include="..\src\render\software\SDL_blendline.c" />
|
||||
@ -391,11 +403,13 @@
|
||||
<ClCompile Include="..\src\render\software\SDL_triangle.c" />
|
||||
<ClCompile Include="..\src\SDL.c" />
|
||||
<ClCompile Include="..\src\SDL_assert.c" />
|
||||
<ClCompile Include="..\src\SDL_hashtable.c" />
|
||||
<ClCompile Include="..\src\SDL_list.c" />
|
||||
<ClCompile Include="..\src\SDL_error.c" />
|
||||
<ClCompile Include="..\src\SDL_guid.c" />
|
||||
<ClCompile Include="..\src\SDL_hints.c" />
|
||||
<ClCompile Include="..\src\SDL_log.c" />
|
||||
<ClCompile Include="..\src\SDL_properties.c" />
|
||||
<ClCompile Include="..\src\SDL_utils.c" />
|
||||
<ClCompile Include="..\src\sensor\dummy\SDL_dummysensor.c" />
|
||||
<ClCompile Include="..\src\sensor\SDL_sensor.c" />
|
||||
@ -405,6 +419,9 @@
|
||||
<ClCompile Include="..\src\stdlib\SDL_iconv.c" />
|
||||
<ClCompile Include="..\src\stdlib\SDL_malloc.c" />
|
||||
<ClCompile Include="..\src\stdlib\SDL_mslibc.c" />
|
||||
<MASM Condition="'$(Platform)'=='x64'" Include="..\src\stdlib\SDL_mslibc_x64.masm" >
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</MASM>
|
||||
<ClCompile Include="..\src\stdlib\SDL_qsort.c" />
|
||||
<ClCompile Include="..\src\stdlib\SDL_stdlib.c" />
|
||||
<ClCompile Include="..\src\stdlib\SDL_string.c" />
|
||||
@ -503,10 +520,11 @@
|
||||
<ClCompile Include="..\src\video\SDL_pixels.c" />
|
||||
<ClCompile Include="..\src\video\SDL_rect.c" />
|
||||
<ClCompile Include="..\src\video\SDL_RLEaccel.c" />
|
||||
<ClCompile Include="..\src\video\SDL_shape.c" />
|
||||
<ClCompile Include="..\src\video\SDL_stretch.c" />
|
||||
<ClCompile Include="..\src\video\SDL_surface.c" />
|
||||
<ClCompile Include="..\src\video\SDL_video.c" />
|
||||
<ClCompile Include="..\src\video\SDL_video_capture.c" />
|
||||
<ClCompile Include="..\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="..\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="..\src\video\winrt\SDL_winrtevents.cpp">
|
||||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
@ -659,6 +677,7 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
@ -858,5 +877,6 @@
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
@ -7,6 +7,12 @@
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{68e1b30b-19ed-4612-93e4-6260c5a979e5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="main">
|
||||
<UniqueIdentifier>{00004a2523fc69c7128c60648c860000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="main\generic">
|
||||
<UniqueIdentifier>{0000318d975e0a2867ab1d5727bf0000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\SDL3\SDL_begin_code.h">
|
||||
@ -99,6 +105,9 @@
|
||||
<ClInclude Include="..\include\SDL3\SDL_opengles2.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_pen.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_pixels.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -129,9 +138,6 @@
|
||||
<ClInclude Include="..\include\SDL3\SDL_scancode.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_shape.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_stdinc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -141,9 +147,6 @@
|
||||
<ClInclude Include="..\include\SDL3\SDL_system.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_syswm.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_thread.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -162,6 +165,9 @@
|
||||
<ClInclude Include="..\include\SDL3\SDL_video.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\SDL3\SDL_video_capture.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\joystick\SDL_gamepad_c.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -255,6 +261,9 @@
|
||||
<ClInclude Include="..\src\joystick\SDL_joystick_c.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\joystick\SDL_steam_virtual_gamepad.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\joystick\SDL_sysjoystick.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
@ -270,6 +279,9 @@
|
||||
<ClInclude Include="..\src\joystick\windows\SDL_xinputjoystick_c.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\main\SDL_main_callbacks.h">
|
||||
<Filter>main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\render\direct3d11\SDL_render_winrt.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
@ -324,6 +336,9 @@
|
||||
<ClInclude Include="..\src\SDL_fatal.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\SDL_hashtable.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\SDL_hints_c.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
@ -333,6 +348,9 @@
|
||||
<ClInclude Include="..\src\SDL_log_c.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\SDL_properties_c.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\locale\SDL_syslocale.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
@ -387,10 +405,10 @@
|
||||
<ClInclude Include="..\src\video\SDL_RLEaccel_c.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\video\SDL_shape_internals.h">
|
||||
<ClInclude Include="..\src\video\SDL_sysvideo.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\video\SDL_sysvideo.h">
|
||||
<ClInclude Include="..\src\video\SDL_sysvideocapture.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\video\winrt\SDL_winrtevents_c.h">
|
||||
@ -492,6 +510,12 @@
|
||||
<ClCompile Include="..\src\audio\wasapi\SDL_wasapi_winrt.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\core\SDL_core_unsupported.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\core\SDL_runapp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\core\windows\SDL_windows.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -528,6 +552,9 @@
|
||||
<ClCompile Include="..\src\events\SDL_mouse.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\events\SDL_pen.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\events\SDL_quit.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -561,6 +588,9 @@
|
||||
<ClCompile Include="..\src\joystick\SDL_joystick.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\joystick\SDL_steam_virtual_gamepad.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\joystick\virtual\SDL_virtualjoystick.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -576,6 +606,12 @@
|
||||
<ClCompile Include="..\src\loadso\windows\SDL_sysloadso.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\main\generic\SDL_sysmain_callbacks.c">
|
||||
<Filter>main\generic</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\main\SDL_main_callbacks.c">
|
||||
<Filter>main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\power\SDL_power.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -600,6 +636,9 @@
|
||||
<ClCompile Include="..\src\render\SDL_render.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\render\SDL_render_unsupported.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\render\SDL_yuv_sw.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -639,12 +678,24 @@
|
||||
<ClCompile Include="..\src\SDL_guid.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_hashtable.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_hints.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_list.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_log.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_utils.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_properties.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\locale\SDL_locale.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -756,9 +807,6 @@
|
||||
<ClCompile Include="..\src\video\SDL_RLEaccel.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\video\SDL_shape.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\video\SDL_stretch.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -768,6 +816,12 @@
|
||||
<ClCompile Include="..\src\video\SDL_video.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\video\SDL_video_capture.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\video\SDL_video_unsupported.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\video\winrt\SDL_winrtevents.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -795,12 +849,6 @@
|
||||
<ClCompile Include="..\src\video\winrt\SDL_winrtgamebar.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_list.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\SDL_utils.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\haptic\windows\SDL_dinputhaptic.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -851,6 +899,9 @@
|
||||
<ClCompile Include="..\src\stdlib\SDL_mslibc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<MASM Include="..\src\stdlib\SDL_mslibc_x64.masm">
|
||||
<Filter>stdlib</Filter>
|
||||
</MASM>
|
||||
<ClCompile Include="..\src\core\windows\pch.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@ -50,6 +50,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsensor", "tests\testsen
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsurround", "tests\testsurround\testsurround.vcxproj", "{70B894A9-E306-49E8-ABC2-932A952A5E5F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpen", "tests\testpen\testpen.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -250,6 +252,14 @@ Global
|
||||
{70B894A9-E306-49E8-ABC2-932A952A5E5F}.Release|Win32.Build.0 = Release|Win32
|
||||
{70B894A9-E306-49E8-ABC2-932A952A5E5F}.Release|x64.ActiveCfg = Release|x64
|
||||
{70B894A9-E306-49E8-ABC2-932A952A5E5F}.Release|x64.Build.0 = Release|x64
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|x64.Build.0 = Debug|x64
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|Win32.Build.0 = Release|Win32
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|x64.ActiveCfg = Release|x64
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -277,6 +287,7 @@ Global
|
||||
{40FB7794-D3C3-4CFE-BCF4-A80C97635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A4} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
||||
{70B894A9-E306-49E8-ABC2-932A952A5E5F} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
||||
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C320C9F2-1A8F-41D7-B02B-6338F872BCAD}
|
||||
|
@ -43,6 +43,7 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@ -279,10 +280,12 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2ext.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2platform.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_pen.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_properties.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_quit.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_render.h" />
|
||||
@ -290,11 +293,9 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_rwops.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_scancode.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_shape.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_surface.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_system.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_syswm.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test_assert.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test_common.h" />
|
||||
@ -331,6 +332,7 @@
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_unsupported.h" />
|
||||
<ClInclude Include="..\..\src\events\blank_cursor.h" />
|
||||
<ClInclude Include="..\..\src\events\default_cursor.h" />
|
||||
<ClInclude Include="..\..\src\events\scancodes_windows.h" />
|
||||
@ -355,6 +357,7 @@
|
||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h" />
|
||||
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
|
||||
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
|
||||
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
|
||||
@ -365,6 +368,7 @@
|
||||
<ClInclude Include="..\..\src\libm\math_libm.h" />
|
||||
<ClInclude Include="..\..\src\libm\math_private.h" />
|
||||
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
|
||||
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
|
||||
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
|
||||
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
|
||||
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
|
||||
@ -394,11 +398,15 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\SDL_guid.c" />
|
||||
<ClInclude Include="..\..\src\SDL_hashtable.h" />
|
||||
<ClInclude Include="..\..\src\SDL_hints_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_internal.h" />
|
||||
<ClInclude Include="..\..\src\SDL_list.h" />
|
||||
<ClInclude Include="..\..\src\SDL_log_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_properties_c.h" />
|
||||
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
|
||||
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
|
||||
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
|
||||
@ -443,12 +451,10 @@
|
||||
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
|
||||
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
|
||||
@ -458,7 +464,6 @@
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
|
||||
@ -466,8 +471,6 @@
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
|
||||
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
|
||||
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
|
||||
@ -483,6 +486,8 @@
|
||||
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\core\SDL_runapp.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
|
||||
@ -500,6 +505,7 @@
|
||||
<ClCompile Include="..\..\src\events\SDL_events.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_pen.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_quit.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_touch.c" />
|
||||
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
|
||||
@ -524,6 +530,7 @@
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
|
||||
@ -531,6 +538,7 @@
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
|
||||
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
|
||||
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
|
||||
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
|
||||
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
|
||||
@ -577,6 +585,7 @@
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
|
||||
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
|
||||
@ -588,10 +597,12 @@
|
||||
<ClCompile Include="..\..\src\render\software\SDL_triangle.c" />
|
||||
<ClCompile Include="..\..\src\SDL.c" />
|
||||
<ClCompile Include="..\..\src\SDL_assert.c" />
|
||||
<ClCompile Include="..\..\src\SDL_list.c" />
|
||||
<ClCompile Include="..\..\src\SDL_error.c" />
|
||||
<ClCompile Include="..\..\src\SDL_hashtable.c" />
|
||||
<ClCompile Include="..\..\src\SDL_hints.c" />
|
||||
<ClCompile Include="..\..\src\SDL_list.c" />
|
||||
<ClCompile Include="..\..\src\SDL_log.c" />
|
||||
<ClCompile Include="..\..\src\SDL_properties.c" />
|
||||
<ClCompile Include="..\..\src\SDL_utils.c" />
|
||||
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
|
||||
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
|
||||
@ -602,6 +613,9 @@
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
|
||||
<MASM Condition="'$(Platform)'=='x64'" Include="..\..\src\stdlib\SDL_mslibc_x64.masm" >
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</MASM>
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
|
||||
@ -635,10 +649,11 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_rect.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_shape.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_surface.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_video.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_video_capture.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
|
||||
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
|
||||
@ -650,7 +665,6 @@
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
|
||||
@ -661,5 +675,6 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -169,6 +169,12 @@
|
||||
<Filter Include="render\direct3d12">
|
||||
<UniqueIdentifier>{f48c2b17-1bee-4fec-a7c8-24cf619abe08}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="main">
|
||||
<UniqueIdentifier>{00001967ea2801028a046a722a070000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="main\generic">
|
||||
<UniqueIdentifier>{0000ddc7911820dbe64274d3654f0000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h">
|
||||
@ -288,6 +294,9 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_pen.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
@ -300,6 +309,9 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_power.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_properties.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_quit.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
@ -321,9 +333,6 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_shape.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
@ -333,9 +342,6 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_system.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_syswm.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_test.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
@ -387,7 +393,11 @@
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_vulkan.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h">
|
||||
<Filter>main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\SDL_error_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_hashtable.h" />
|
||||
<ClInclude Include="..\..\src\SDL_list.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_metal.h">
|
||||
<Filter>API Headers</Filter>
|
||||
@ -415,7 +425,7 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\audio\SDL_audioresample.h">
|
||||
<Filter>audio</Filter>
|
||||
</ClInclude>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\core\windows\SDL_hid.h">
|
||||
<Filter>core\windows</Filter>
|
||||
</ClInclude>
|
||||
@ -440,6 +450,9 @@
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h">
|
||||
<Filter>dynapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_unsupported.h">
|
||||
<Filter>dynapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h">
|
||||
<Filter>events</Filter>
|
||||
</ClInclude>
|
||||
@ -488,6 +501,9 @@
|
||||
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h">
|
||||
<Filter>joystick</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h">
|
||||
<Filter>joystick</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h">
|
||||
<Filter>joystick</Filter>
|
||||
</ClInclude>
|
||||
@ -578,9 +594,6 @@
|
||||
<ClInclude Include="..\..\src\video\SDL_rect_c.h">
|
||||
<Filter>video</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\SDL_shape_internals.h">
|
||||
<Filter>video</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\SDL_sysvideo.h">
|
||||
<Filter>video</Filter>
|
||||
</ClInclude>
|
||||
@ -611,9 +624,6 @@
|
||||
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
@ -638,9 +648,6 @@
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
@ -813,6 +820,7 @@
|
||||
<ClInclude Include="..\..\src\SDL_hints_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_internal.h" />
|
||||
<ClInclude Include="..\..\src\SDL_log_c.h" />
|
||||
<ClInclude Include="..\..\src\SDL_properties_c.h" />
|
||||
<ClInclude Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.h">
|
||||
<Filter>render\direct3d12</Filter>
|
||||
</ClInclude>
|
||||
@ -820,12 +828,20 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c">
|
||||
<Filter>main\generic</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c">
|
||||
<Filter>main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\SDL.c" />
|
||||
<ClCompile Include="..\..\src\SDL_assert.c" />
|
||||
<ClCompile Include="..\..\src\SDL_error.c" />
|
||||
<ClCompile Include="..\..\src\SDL_guid.c" />
|
||||
<ClCompile Include="..\..\src\SDL_hashtable.c" />
|
||||
<ClCompile Include="..\..\src\SDL_hints.c" />
|
||||
<ClCompile Include="..\..\src\SDL_list.c" />
|
||||
<ClCompile Include="..\..\src\SDL_properties.c" />
|
||||
<ClCompile Include="..\..\src\SDL_utils.c" />
|
||||
<ClCompile Include="..\..\src\audio\SDL_audio.c">
|
||||
<Filter>audio</Filter>
|
||||
@ -857,6 +873,12 @@
|
||||
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c">
|
||||
<Filter>atomic</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\SDL_runapp.c">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\windows\SDL_hid.c">
|
||||
<Filter>core\windows</Filter>
|
||||
</ClCompile>
|
||||
@ -893,6 +915,9 @@
|
||||
<ClCompile Include="..\..\src\events\SDL_mouse.c">
|
||||
<Filter>events</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\events\SDL_pen.c">
|
||||
<Filter>events</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\events\SDL_quit.c">
|
||||
<Filter>events</Filter>
|
||||
</ClCompile>
|
||||
@ -923,6 +948,9 @@
|
||||
<ClCompile Include="..\..\src\joystick\SDL_joystick.c">
|
||||
<Filter>joystick</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c">
|
||||
<Filter>joystick</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\libm\e_atan2.c">
|
||||
<Filter>libm</Filter>
|
||||
</ClCompile>
|
||||
@ -1061,6 +1089,9 @@
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
@ -1142,9 +1173,6 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_rect.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\SDL_shape.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\SDL_stretch.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
@ -1154,6 +1182,12 @@
|
||||
<ClCompile Include="..\..\src\video\SDL_video.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\SDL_video_capture.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\SDL_yuv.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
@ -1199,9 +1233,6 @@
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
@ -1283,6 +1314,9 @@
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c">
|
||||
<Filter>render</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c">
|
||||
<Filter>render</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c">
|
||||
<Filter>render</Filter>
|
||||
</ClCompile>
|
||||
@ -1353,6 +1387,9 @@
|
||||
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c">
|
||||
<Filter>stdlib</Filter>
|
||||
</ClCompile>
|
||||
<MASM Include="..\..\src\stdlib\SDL_mslibc_x64.masm">
|
||||
<Filter>stdlib</Filter>
|
||||
</MASM>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
|
||||
|
@ -40,7 +40,7 @@ else()
|
||||
endif()
|
||||
|
||||
set_and_check(_sdl3_prefix "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
set(_sdl3_include_dirs "${_sdl3_prefix}/include;${_sdl3_prefix}/include/SDL3")
|
||||
set(_sdl3_include_dirs "${_sdl3_prefix}/include")
|
||||
unset(_sdl3_prefix)
|
||||
|
||||
set(SDL3_LIBRARIES SDL3::SDL3)
|
||||
|
@ -209,17 +209,24 @@
|
||||
<ClCompile Include="..\..\..\test\testautomation_main.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_math.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_mouse.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_pen.c">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)\..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)\..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)\..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)\..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\test\testautomation_pixels.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_platform.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_properties.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_rect.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_render.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_rwops.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_stdlib.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_surface.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_syswm.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_timer.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_video.c" />
|
||||
<ClCompile Include="..\..\..\test\testautomation_subsystems.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\test\testautomation_suites.h" />
|
||||
|
204
VisualC/tests/testpen/testpen.vcxproj
Normal file
204
VisualC/tests/testpen/testpen.vcxproj
Normal file
@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}</ProjectGuid>
|
||||
<RootNamespace>testpower</RootNamespace>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug/testpower.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug/testpower.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release/testpower.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release/testpower.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
|
||||
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SDL_test\SDL_test.vcxproj">
|
||||
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\test\testpen.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -33,6 +33,9 @@
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
000028F8113A53F4333E0000 /* SDL_main_callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = 00009366FB9FBBD54C390000 /* SDL_main_callbacks.c */; };
|
||||
000040E76FDC6AE48CBF0000 /* SDL_hashtable.c in Sources */ = {isa = PBXBuildFile; fileRef = 000078E1881E857EBB6C0000 /* SDL_hashtable.c */; };
|
||||
0000A4DA2F45A31DC4F00000 /* SDL_sysmain_callbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 0000BB287BA0A0178C1A0000 /* SDL_sysmain_callbacks.m */; platformFilters = (ios, maccatalyst, macos, tvos, watchos, ); };
|
||||
007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; platformFilters = (macos, ); };
|
||||
007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; platformFilters = (ios, maccatalyst, macos, ); };
|
||||
00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; platformFilters = (macos, ); };
|
||||
@ -49,6 +52,9 @@
|
||||
566E26D8246274CC00718109 /* SDL_locale.c in Sources */ = {isa = PBXBuildFile; fileRef = 566E26CD246274CB00718109 /* SDL_locale.c */; };
|
||||
566E26E1246274CC00718109 /* SDL_syslocale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26CE246274CC00718109 /* SDL_syslocale.h */; };
|
||||
56A2373329F9C113003CCA5F /* SDL_sysrwlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 56A2373229F9C113003CCA5F /* SDL_sysrwlock.c */; };
|
||||
63134A222A7902CF0021E9A6 /* SDL_pen.h in Headers */ = {isa = PBXBuildFile; fileRef = 63134A212A7902CF0021E9A6 /* SDL_pen.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
63134A252A7902FD0021E9A6 /* SDL_pen_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 63134A232A7902FD0021E9A6 /* SDL_pen_c.h */; };
|
||||
63134A262A7902FD0021E9A6 /* SDL_pen.c in Sources */ = {isa = PBXBuildFile; fileRef = 63134A242A7902FD0021E9A6 /* SDL_pen.c */; };
|
||||
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 75E09158241EA924004729E1 /* SDL_virtualjoystick.c */; };
|
||||
75E09163241EA924004729E1 /* SDL_virtualjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 75E09159241EA924004729E1 /* SDL_virtualjoystick_c.h */; };
|
||||
9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */ = {isa = PBXBuildFile; fileRef = 9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */; };
|
||||
@ -63,6 +69,7 @@
|
||||
A75FDBB823E4CBC700529352 /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = F59C710300D5CB5801000001 /* ReadMe.txt */; };
|
||||
A75FDBC523EA380300529352 /* SDL_hidapi_rumble.h in Headers */ = {isa = PBXBuildFile; fileRef = A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */; };
|
||||
A75FDBCE23EA380300529352 /* SDL_hidapi_rumble.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */; };
|
||||
A79745702B2E9D39009D224A /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */; };
|
||||
A7D8A94B23E2514000DCD162 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A57123E2513D00DCD162 /* SDL.c */; };
|
||||
A7D8A95123E2514000DCD162 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A57323E2513D00DCD162 /* SDL_spinlock.c */; };
|
||||
A7D8A95723E2514000DCD162 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A57423E2513D00DCD162 /* SDL_atomic.c */; };
|
||||
@ -89,7 +96,6 @@
|
||||
A7D8AB2523E2514100DCD162 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5DD23E2513D00DCD162 /* SDL_log.c */; };
|
||||
A7D8AB2B23E2514100DCD162 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5DF23E2513D00DCD162 /* SDL_timer.c */; };
|
||||
A7D8AB3123E2514100DCD162 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5E023E2513D00DCD162 /* SDL_timer_c.h */; };
|
||||
A7D8AB3723E2514100DCD162 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5E223E2513D00DCD162 /* SDL_systimer.c */; };
|
||||
A7D8AB4923E2514100DCD162 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5E823E2513D00DCD162 /* SDL_systimer.c */; };
|
||||
A7D8AB5B23E2514100DCD162 /* SDL_offscreenevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5EE23E2513D00DCD162 /* SDL_offscreenevents_c.h */; };
|
||||
A7D8AB6123E2514100DCD162 /* SDL_offscreenwindow.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5EF23E2513D00DCD162 /* SDL_offscreenwindow.c */; };
|
||||
@ -109,7 +115,6 @@
|
||||
A7D8ABF723E2514100DCD162 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A60A23E2513D00DCD162 /* SDL_nullvideo.h */; };
|
||||
A7D8ABFD23E2514100DCD162 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A60B23E2513D00DCD162 /* SDL_nullevents_c.h */; };
|
||||
A7D8AC0323E2514100DCD162 /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A60C23E2513D00DCD162 /* SDL_rect_c.h */; };
|
||||
A7D8AC0923E2514100DCD162 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A60D23E2513D00DCD162 /* SDL_shape_internals.h */; };
|
||||
A7D8AC0F23E2514100DCD162 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A60E23E2513D00DCD162 /* SDL_video.c */; };
|
||||
A7D8AC2D23E2514100DCD162 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A61423E2513D00DCD162 /* SDL_surface.c */; };
|
||||
A7D8AC3323E2514100DCD162 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A61523E2513D00DCD162 /* SDL_RLEaccel.c */; };
|
||||
@ -127,7 +132,6 @@
|
||||
A7D8ADF223E2514100DCD162 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A66423E2513E00DCD162 /* SDL_blit_A.c */; };
|
||||
A7D8AE7623E2514100DCD162 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A67B23E2513E00DCD162 /* SDL_clipboard.c */; };
|
||||
A7D8AE7C23E2514100DCD162 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A67C23E2513E00DCD162 /* SDL_yuv.c */; };
|
||||
A7D8AE8223E2514100DCD162 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A67E23E2513E00DCD162 /* SDL_cocoashape.h */; };
|
||||
A7D8AE8823E2514100DCD162 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A67F23E2513E00DCD162 /* SDL_cocoaopengl.m */; };
|
||||
A7D8AE8E23E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; };
|
||||
A7D8AE9423E2514100DCD162 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A68123E2513E00DCD162 /* SDL_cocoamodes.m */; };
|
||||
@ -142,7 +146,6 @@
|
||||
A7D8AED023E2514100DCD162 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A68B23E2513E00DCD162 /* SDL_cocoamessagebox.m */; };
|
||||
A7D8AED623E2514100DCD162 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A68C23E2513E00DCD162 /* SDL_cocoakeyboard.m */; };
|
||||
A7D8AEDC23E2514100DCD162 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68D23E2513E00DCD162 /* SDL_cocoaopengl.h */; };
|
||||
A7D8AEE223E2514100DCD162 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A68E23E2513E00DCD162 /* SDL_cocoashape.m */; };
|
||||
A7D8AEE823E2514100DCD162 /* SDL_cocoavulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68F23E2513E00DCD162 /* SDL_cocoavulkan.h */; };
|
||||
A7D8AEEE23E2514100DCD162 /* SDL_cocoaopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A69023E2513E00DCD162 /* SDL_cocoaopengles.h */; };
|
||||
A7D8AEF423E2514100DCD162 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A69123E2513E00DCD162 /* SDL_cocoamodes.h */; };
|
||||
@ -185,7 +188,6 @@
|
||||
A7D8B39823E2514200DCD162 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76623E2513E00DCD162 /* SDL_blit_copy.h */; };
|
||||
A7D8B39E23E2514200DCD162 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76723E2513E00DCD162 /* SDL_RLEaccel_c.h */; };
|
||||
A7D8B3A423E2514200DCD162 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76823E2513E00DCD162 /* SDL_fillrect.c */; };
|
||||
A7D8B3AA23E2514200DCD162 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76923E2513E00DCD162 /* SDL_shape.c */; };
|
||||
A7D8B3B023E2514200DCD162 /* SDL_yuv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76A23E2513E00DCD162 /* SDL_yuv_c.h */; };
|
||||
A7D8B3B623E2514200DCD162 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76B23E2513E00DCD162 /* SDL_blit.h */; };
|
||||
A7D8B3BF23E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; };
|
||||
@ -366,6 +368,11 @@
|
||||
A7D8BBE923E2574800DCD162 /* SDL_uikitvulkan.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A62523E2513D00DCD162 /* SDL_uikitvulkan.m */; };
|
||||
A7D8BBEA23E2574800DCD162 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; };
|
||||
A7D8BBEB23E2574800DCD162 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A61A23E2513D00DCD162 /* SDL_uikitwindow.m */; };
|
||||
E4A568B62AF763940062EEC4 /* SDL_sysmain_callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = E4A568B52AF763940062EEC4 /* SDL_sysmain_callbacks.c */; };
|
||||
E4F7981A2AD8D84800669F54 /* SDL_core_unsupported.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F798192AD8D84800669F54 /* SDL_core_unsupported.c */; };
|
||||
E4F7981C2AD8D85500669F54 /* SDL_dynapi_unsupported.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F7981B2AD8D85500669F54 /* SDL_dynapi_unsupported.h */; };
|
||||
E4F7981E2AD8D86A00669F54 /* SDL_render_unsupported.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */; };
|
||||
E4F798202AD8D87F00669F54 /* SDL_video_unsupported.c in Sources */ = {isa = PBXBuildFile; fileRef = E4F7981F2AD8D87F00669F54 /* SDL_video_unsupported.c */; };
|
||||
F31A92C828D4CB39003BFD6A /* SDL_offscreenopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */; };
|
||||
F31A92D228D4CB39003BFD6A /* SDL_offscreenopengles.c in Sources */ = {isa = PBXBuildFile; fileRef = F31A92C728D4CB39003BFD6A /* SDL_offscreenopengles.c */; };
|
||||
F32305FF28939F6400E66D30 /* SDL_hidapi_combined.c in Sources */ = {isa = PBXBuildFile; fileRef = F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */; };
|
||||
@ -376,6 +383,10 @@
|
||||
F32DDAD32AB795A30041EAA5 /* SDL_audioqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DDACD2AB795A30041EAA5 /* SDL_audioqueue.h */; };
|
||||
F32DDAD42AB795A30041EAA5 /* SDL_audioresample.c in Sources */ = {isa = PBXBuildFile; fileRef = F32DDACE2AB795A30041EAA5 /* SDL_audioresample.c */; };
|
||||
F34B9895291DEFF500AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; };
|
||||
F362B9192B3349E200D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9152B3349E200D30B94 /* controller_list.h */; };
|
||||
F362B91A2B3349E200D30B94 /* SDL_gamepad_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9162B3349E200D30B94 /* SDL_gamepad_c.h */; };
|
||||
F362B91B2B3349E200D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9172B3349E200D30B94 /* SDL_steam_virtual_gamepad.h */; };
|
||||
F362B91C2B3349E200D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9182B3349E200D30B94 /* SDL_steam_virtual_gamepad.c */; };
|
||||
F36C7AD1294BA009004D61C3 /* SDL_runapp.c in Sources */ = {isa = PBXBuildFile; fileRef = F36C7AD0294BA009004D61C3 /* SDL_runapp.c */; };
|
||||
F376F6552559B4E300CFC0BC /* SDL_hidapi.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A81423E2513F00DCD162 /* SDL_hidapi.c */; };
|
||||
F37A8E1A28405AA100C38E95 /* CMake in Resources */ = {isa = PBXBuildFile; fileRef = F37A8E1928405AA100C38E95 /* CMake */; };
|
||||
@ -405,6 +416,18 @@
|
||||
F3B38CDB296E2E52005DA6D3 /* SDL_oldnames.h in Headers */ = {isa = PBXBuildFile; fileRef = F3B38CCD296E2E52005DA6D3 /* SDL_oldnames.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3B38CDF296E2E52005DA6D3 /* SDL_intrin.h in Headers */ = {isa = PBXBuildFile; fileRef = F3B38CCE296E2E52005DA6D3 /* SDL_intrin.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3D60A8328C16A1900788A3A /* SDL_hidapi_wii.c in Sources */ = {isa = PBXBuildFile; fileRef = F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */; };
|
||||
F3DDCC562AFD42B600B0842B /* SDL_clipboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */; };
|
||||
F3DDCC572AFD42B600B0842B /* SDL_surface_pixel_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC4E2AFD42B500B0842B /* SDL_surface_pixel_impl.h */; };
|
||||
F3DDCC582AFD42B600B0842B /* SDL_video_capture.c in Sources */ = {isa = PBXBuildFile; fileRef = F3DDCC4F2AFD42B500B0842B /* SDL_video_capture.c */; };
|
||||
F3DDCC592AFD42B600B0842B /* SDL_video_capture_apple.m in Sources */ = {isa = PBXBuildFile; fileRef = F3DDCC502AFD42B500B0842B /* SDL_video_capture_apple.m */; };
|
||||
F3DDCC5A2AFD42B600B0842B /* SDL_video_capture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC512AFD42B500B0842B /* SDL_video_capture_c.h */; };
|
||||
F3DDCC5B2AFD42B600B0842B /* SDL_video_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC522AFD42B600B0842B /* SDL_video_c.h */; };
|
||||
F3DDCC5C2AFD42B600B0842B /* SDL_sysvideocapture.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC532AFD42B600B0842B /* SDL_sysvideocapture.h */; };
|
||||
F3DDCC5D2AFD42B600B0842B /* SDL_rect_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */; };
|
||||
F3DDCC5E2AFD42B600B0842B /* SDL_video_capture_v4l2.c in Sources */ = {isa = PBXBuildFile; fileRef = F3DDCC552AFD42B600B0842B /* SDL_video_capture_v4l2.c */; };
|
||||
F3DDCC602AFD432500B0842B /* SDL_video_capture.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC5F2AFD432500B0842B /* SDL_video_capture.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3E5A6EB2AD5E0E600293D83 /* SDL_properties.c in Sources */ = {isa = PBXBuildFile; fileRef = F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */; };
|
||||
F3E5A6ED2AD5E10800293D83 /* SDL_properties.h in Headers */ = {isa = PBXBuildFile; fileRef = F3E5A6EC2AD5E10800293D83 /* SDL_properties.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F07D5A269640160074468B /* SDL_hidapi_luna.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F07D59269640160074468B /* SDL_hidapi_luna.c */; };
|
||||
F3F7D8ED2933074E00816151 /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8AA2933074900816151 /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D8F12933074E00816151 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8AB2933074900816151 /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -422,12 +445,10 @@
|
||||
F3F7D9212933074E00816151 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8B72933074A00816151 /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9252933074E00816151 /* SDL_egl.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8B82933074A00816151 /* SDL_egl.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9292933074E00816151 /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8B92933074A00816151 /* SDL_atomic.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D92D2933074E00816151 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8BA2933074A00816151 /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9312933074E00816151 /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8BB2933074A00816151 /* SDL_surface.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9352933074E00816151 /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8BC2933074A00816151 /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9392933074E00816151 /* SDL_opengles2_gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8BD2933074A00816151 /* SDL_opengles2_gl2ext.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D93D2933074E00816151 /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8BE2933074A00816151 /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9412933074E00816151 /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8BF2933074A00816151 /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9452933074E00816151 /* SDL_opengl_glext.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8C02933074A00816151 /* SDL_opengl_glext.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D9492933074E00816151 /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8C12933074B00816151 /* SDL_scancode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F3F7D94D2933074E00816151 /* SDL_sensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8C22933074B00816151 /* SDL_sensor.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -495,6 +516,11 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
00003260407E1002EAC10000 /* SDL_main_callbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main_callbacks.h; sourceTree = "<group>"; };
|
||||
000078E1881E857EBB6C0000 /* SDL_hashtable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hashtable.c; sourceTree = "<group>"; };
|
||||
00009366FB9FBBD54C390000 /* SDL_main_callbacks.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_main_callbacks.c; sourceTree = "<group>"; };
|
||||
0000B6ADCD88CAD6610F0000 /* SDL_hashtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hashtable.h; sourceTree = "<group>"; };
|
||||
0000BB287BA0A0178C1A0000 /* SDL_sysmain_callbacks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_sysmain_callbacks.m; sourceTree = "<group>"; };
|
||||
0073179D0858DECD00B2BC32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
0073179F0858DECD00B2BC32 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
007317C10858E15000B2BC32 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
|
||||
@ -510,6 +536,9 @@
|
||||
566E26CD246274CB00718109 /* SDL_locale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_locale.c; path = locale/SDL_locale.c; sourceTree = "<group>"; };
|
||||
566E26CE246274CC00718109 /* SDL_syslocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_syslocale.h; path = locale/SDL_syslocale.h; sourceTree = "<group>"; };
|
||||
56A2373229F9C113003CCA5F /* SDL_sysrwlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysrwlock.c; sourceTree = "<group>"; };
|
||||
63134A212A7902CF0021E9A6 /* SDL_pen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_pen.h; path = SDL3/SDL_pen.h; sourceTree = "<group>"; };
|
||||
63134A232A7902FD0021E9A6 /* SDL_pen_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pen_c.h; sourceTree = "<group>"; };
|
||||
63134A242A7902FD0021E9A6 /* SDL_pen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pen.c; sourceTree = "<group>"; };
|
||||
75E09158241EA924004729E1 /* SDL_virtualjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_virtualjoystick.c; sourceTree = "<group>"; };
|
||||
75E09159241EA924004729E1 /* SDL_virtualjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_virtualjoystick_c.h; sourceTree = "<group>"; };
|
||||
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_shield.c; sourceTree = "<group>"; };
|
||||
@ -535,6 +564,7 @@
|
||||
A75FDBA723E4CB6F00529352 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
|
||||
A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_rumble.h; sourceTree = "<group>"; };
|
||||
A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_rumble.c; sourceTree = "<group>"; };
|
||||
A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_steamdeck.c; sourceTree = "<group>"; };
|
||||
A7D8A57123E2513D00DCD162 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL.c; sourceTree = "<group>"; };
|
||||
A7D8A57323E2513D00DCD162 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
|
||||
A7D8A57423E2513D00DCD162 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
|
||||
@ -561,7 +591,6 @@
|
||||
A7D8A5DD23E2513D00DCD162 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_log.c; sourceTree = "<group>"; };
|
||||
A7D8A5DF23E2513D00DCD162 /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = "<group>"; };
|
||||
A7D8A5E023E2513D00DCD162 /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = "<group>"; };
|
||||
A7D8A5E223E2513D00DCD162 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = "<group>"; };
|
||||
A7D8A5E823E2513D00DCD162 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = "<group>"; };
|
||||
A7D8A5EE23E2513D00DCD162 /* SDL_offscreenevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_offscreenevents_c.h; sourceTree = "<group>"; };
|
||||
A7D8A5EF23E2513D00DCD162 /* SDL_offscreenwindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_offscreenwindow.c; sourceTree = "<group>"; };
|
||||
@ -581,7 +610,6 @@
|
||||
A7D8A60A23E2513D00DCD162 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = "<group>"; };
|
||||
A7D8A60B23E2513D00DCD162 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = "<group>"; };
|
||||
A7D8A60C23E2513D00DCD162 /* SDL_rect_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_c.h; sourceTree = "<group>"; };
|
||||
A7D8A60D23E2513D00DCD162 /* SDL_shape_internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape_internals.h; sourceTree = "<group>"; };
|
||||
A7D8A60E23E2513D00DCD162 /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = "<group>"; };
|
||||
A7D8A61423E2513D00DCD162 /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = "<group>"; };
|
||||
A7D8A61523E2513D00DCD162 /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = "<group>"; };
|
||||
@ -625,7 +653,6 @@
|
||||
A7D8A66423E2513E00DCD162 /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = "<group>"; };
|
||||
A7D8A67B23E2513E00DCD162 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
|
||||
A7D8A67C23E2513E00DCD162 /* SDL_yuv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv.c; sourceTree = "<group>"; };
|
||||
A7D8A67E23E2513E00DCD162 /* SDL_cocoashape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoashape.h; sourceTree = "<group>"; };
|
||||
A7D8A67F23E2513E00DCD162 /* SDL_cocoaopengl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaopengl.m; sourceTree = "<group>"; };
|
||||
A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoakeyboard.h; sourceTree = "<group>"; };
|
||||
A7D8A68123E2513E00DCD162 /* SDL_cocoamodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamodes.m; sourceTree = "<group>"; };
|
||||
@ -640,7 +667,6 @@
|
||||
A7D8A68B23E2513E00DCD162 /* SDL_cocoamessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamessagebox.m; sourceTree = "<group>"; };
|
||||
A7D8A68C23E2513E00DCD162 /* SDL_cocoakeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoakeyboard.m; sourceTree = "<group>"; };
|
||||
A7D8A68D23E2513E00DCD162 /* SDL_cocoaopengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaopengl.h; sourceTree = "<group>"; };
|
||||
A7D8A68E23E2513E00DCD162 /* SDL_cocoashape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoashape.m; sourceTree = "<group>"; };
|
||||
A7D8A68F23E2513E00DCD162 /* SDL_cocoavulkan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoavulkan.h; sourceTree = "<group>"; };
|
||||
A7D8A69023E2513E00DCD162 /* SDL_cocoaopengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaopengles.h; sourceTree = "<group>"; };
|
||||
A7D8A69123E2513E00DCD162 /* SDL_cocoamodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamodes.h; sourceTree = "<group>"; };
|
||||
@ -683,7 +709,6 @@
|
||||
A7D8A76623E2513E00DCD162 /* SDL_blit_copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_copy.h; sourceTree = "<group>"; };
|
||||
A7D8A76723E2513E00DCD162 /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = "<group>"; };
|
||||
A7D8A76823E2513E00DCD162 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = "<group>"; };
|
||||
A7D8A76923E2513E00DCD162 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = "<group>"; };
|
||||
A7D8A76A23E2513E00DCD162 /* SDL_yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_c.h; sourceTree = "<group>"; };
|
||||
A7D8A76B23E2513E00DCD162 /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = "<group>"; };
|
||||
A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb.c; sourceTree = "<group>"; };
|
||||
@ -842,6 +867,11 @@
|
||||
BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = "<group>"; };
|
||||
BECDF66C0761BA81005FE872 /* SDL3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E2D187D228A5673500D2B4F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
E4A568B52AF763940062EEC4 /* SDL_sysmain_callbacks.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmain_callbacks.c; sourceTree = "<group>"; };
|
||||
E4F798192AD8D84800669F54 /* SDL_core_unsupported.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_core_unsupported.c; sourceTree = "<group>"; };
|
||||
E4F7981B2AD8D85500669F54 /* SDL_dynapi_unsupported.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dynapi_unsupported.h; sourceTree = "<group>"; };
|
||||
E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_unsupported.c; sourceTree = "<group>"; };
|
||||
E4F7981F2AD8D87F00669F54 /* SDL_video_unsupported.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video_unsupported.c; sourceTree = "<group>"; };
|
||||
F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_offscreenopengles.h; sourceTree = "<group>"; };
|
||||
F31A92C728D4CB39003BFD6A /* SDL_offscreenopengles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_offscreenopengles.c; sourceTree = "<group>"; };
|
||||
F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_combined.c; sourceTree = "<group>"; };
|
||||
@ -851,6 +881,10 @@
|
||||
F32DDACC2AB795A30041EAA5 /* SDL_audio_resampler_filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_resampler_filter.h; sourceTree = "<group>"; };
|
||||
F32DDACD2AB795A30041EAA5 /* SDL_audioqueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audioqueue.h; sourceTree = "<group>"; };
|
||||
F32DDACE2AB795A30041EAA5 /* SDL_audioresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audioresample.c; sourceTree = "<group>"; };
|
||||
F362B9152B3349E200D30B94 /* controller_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_list.h; sourceTree = "<group>"; };
|
||||
F362B9162B3349E200D30B94 /* SDL_gamepad_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamepad_c.h; sourceTree = "<group>"; };
|
||||
F362B9172B3349E200D30B94 /* SDL_steam_virtual_gamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_steam_virtual_gamepad.h; sourceTree = "<group>"; };
|
||||
F362B9182B3349E200D30B94 /* SDL_steam_virtual_gamepad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_steam_virtual_gamepad.c; sourceTree = "<group>"; };
|
||||
F36C7AD0294BA009004D61C3 /* SDL_runapp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_runapp.c; sourceTree = "<group>"; };
|
||||
F376F6182559B29300CFC0BC /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
|
||||
F376F61A2559B2AF00CFC0BC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/iOSSupport/System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
@ -895,6 +929,18 @@
|
||||
F3B38CCD296E2E52005DA6D3 /* SDL_oldnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_oldnames.h; path = SDL3/SDL_oldnames.h; sourceTree = "<group>"; };
|
||||
F3B38CCE296E2E52005DA6D3 /* SDL_intrin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_intrin.h; path = SDL3/SDL_intrin.h; sourceTree = "<group>"; };
|
||||
F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_wii.c; sourceTree = "<group>"; };
|
||||
F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard_c.h; sourceTree = "<group>"; };
|
||||
F3DDCC4E2AFD42B500B0842B /* SDL_surface_pixel_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface_pixel_impl.h; sourceTree = "<group>"; };
|
||||
F3DDCC4F2AFD42B500B0842B /* SDL_video_capture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video_capture.c; sourceTree = "<group>"; };
|
||||
F3DDCC502AFD42B500B0842B /* SDL_video_capture_apple.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_video_capture_apple.m; sourceTree = "<group>"; };
|
||||
F3DDCC512AFD42B500B0842B /* SDL_video_capture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video_capture_c.h; sourceTree = "<group>"; };
|
||||
F3DDCC522AFD42B600B0842B /* SDL_video_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video_c.h; sourceTree = "<group>"; };
|
||||
F3DDCC532AFD42B600B0842B /* SDL_sysvideocapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysvideocapture.h; sourceTree = "<group>"; };
|
||||
F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_impl.h; sourceTree = "<group>"; };
|
||||
F3DDCC552AFD42B600B0842B /* SDL_video_capture_v4l2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video_capture_v4l2.c; sourceTree = "<group>"; };
|
||||
F3DDCC5F2AFD432500B0842B /* SDL_video_capture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_video_capture.h; path = SDL3/SDL_video_capture.h; sourceTree = "<group>"; };
|
||||
F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_properties.c; sourceTree = "<group>"; };
|
||||
F3E5A6EC2AD5E10800293D83 /* SDL_properties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_properties.h; path = SDL3/SDL_properties.h; sourceTree = "<group>"; };
|
||||
F3F07D59269640160074468B /* SDL_hidapi_luna.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_luna.c; sourceTree = "<group>"; };
|
||||
F3F7D8AA2933074900816151 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = SDL3/SDL_audio.h; sourceTree = "<group>"; };
|
||||
F3F7D8AB2933074900816151 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = SDL3/SDL_platform.h; sourceTree = "<group>"; };
|
||||
@ -912,12 +958,10 @@
|
||||
F3F7D8B72933074A00816151 /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_log.h; path = SDL3/SDL_log.h; sourceTree = "<group>"; };
|
||||
F3F7D8B82933074A00816151 /* SDL_egl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_egl.h; path = SDL3/SDL_egl.h; sourceTree = "<group>"; };
|
||||
F3F7D8B92933074A00816151 /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_atomic.h; path = SDL3/SDL_atomic.h; sourceTree = "<group>"; };
|
||||
F3F7D8BA2933074A00816151 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_shape.h; path = SDL3/SDL_shape.h; sourceTree = "<group>"; };
|
||||
F3F7D8BB2933074A00816151 /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_surface.h; path = SDL3/SDL_surface.h; sourceTree = "<group>"; };
|
||||
F3F7D8BC2933074A00816151 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error.h; path = SDL3/SDL_error.h; sourceTree = "<group>"; };
|
||||
F3F7D8BD2933074A00816151 /* SDL_opengles2_gl2ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_opengles2_gl2ext.h; path = SDL3/SDL_opengles2_gl2ext.h; sourceTree = "<group>"; };
|
||||
F3F7D8BE2933074A00816151 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_endian.h; path = SDL3/SDL_endian.h; sourceTree = "<group>"; };
|
||||
F3F7D8BF2933074A00816151 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_syswm.h; path = SDL3/SDL_syswm.h; sourceTree = "<group>"; };
|
||||
F3F7D8C02933074A00816151 /* SDL_opengl_glext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_opengl_glext.h; path = SDL3/SDL_opengl_glext.h; sourceTree = "<group>"; };
|
||||
F3F7D8C12933074B00816151 /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_scancode.h; path = SDL3/SDL_scancode.h; sourceTree = "<group>"; };
|
||||
F3F7D8C22933074B00816151 /* SDL_sensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_sensor.h; path = SDL3/SDL_sensor.h; sourceTree = "<group>"; };
|
||||
@ -987,10 +1031,28 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
000082EF09C89B62BD840000 /* main */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E4A568B42AF763940062EEC4 /* generic */,
|
||||
00008B5A0CB83D2069E80000 /* ios */,
|
||||
00009366FB9FBBD54C390000 /* SDL_main_callbacks.c */,
|
||||
00003260407E1002EAC10000 /* SDL_main_callbacks.h */,
|
||||
);
|
||||
path = main;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
00008B5A0CB83D2069E80000 /* ios */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0000BB287BA0A0178C1A0000 /* SDL_sysmain_callbacks.m */,
|
||||
);
|
||||
path = ios;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0153844A006D81B07F000001 /* Public Headers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3F7D8CF2933074C00816151 /* SDL.h */,
|
||||
F3F7D8E02933074D00816151 /* SDL_assert.h */,
|
||||
F3F7D8B92933074A00816151 /* SDL_atomic.h */,
|
||||
F3F7D8AA2933074900816151 /* SDL_audio.h */,
|
||||
@ -1019,26 +1081,28 @@
|
||||
F3F7D8D92933074C00816151 /* SDL_loadso.h */,
|
||||
F3F7D8C42933074B00816151 /* SDL_locale.h */,
|
||||
F3F7D8B72933074A00816151 /* SDL_log.h */,
|
||||
F3F7D8B02933074900816151 /* SDL_main.h */,
|
||||
F3B38CCA296E2E52005DA6D3 /* SDL_main_impl.h */,
|
||||
F3F7D8B02933074900816151 /* SDL_main.h */,
|
||||
F3F7D8B62933074A00816151 /* SDL_messagebox.h */,
|
||||
F3F7D8D22933074C00816151 /* SDL_metal.h */,
|
||||
F3F7D8D52933074C00816151 /* SDL_misc.h */,
|
||||
F3F7D8DA2933074D00816151 /* SDL_mouse.h */,
|
||||
F3F7D8E62933074E00816151 /* SDL_mutex.h */,
|
||||
F3B38CCD296E2E52005DA6D3 /* SDL_oldnames.h */,
|
||||
F3F7D8E12933074D00816151 /* SDL_opengl.h */,
|
||||
F3F7D8C02933074A00816151 /* SDL_opengl_glext.h */,
|
||||
F3F7D8E12933074D00816151 /* SDL_opengl.h */,
|
||||
F3F7D8C62933074B00816151 /* SDL_opengles.h */,
|
||||
F3F7D8C72933074B00816151 /* SDL_opengles2.h */,
|
||||
F3F7D8AE2933074900816151 /* SDL_opengles2_gl2.h */,
|
||||
F3F7D8BD2933074A00816151 /* SDL_opengles2_gl2ext.h */,
|
||||
F3F7D8C92933074B00816151 /* SDL_opengles2_gl2platform.h */,
|
||||
F3F7D8B12933074900816151 /* SDL_opengles2_khrplatform.h */,
|
||||
F3F7D8C72933074B00816151 /* SDL_opengles2.h */,
|
||||
63134A212A7902CF0021E9A6 /* SDL_pen.h */,
|
||||
F3F7D8B52933074A00816151 /* SDL_pixels.h */,
|
||||
F3F7D8AB2933074900816151 /* SDL_platform.h */,
|
||||
F3B38CCB296E2E52005DA6D3 /* SDL_platform_defines.h */,
|
||||
F3F7D8AB2933074900816151 /* SDL_platform.h */,
|
||||
F3F7D8DB2933074D00816151 /* SDL_power.h */,
|
||||
F3E5A6EC2AD5E10800293D83 /* SDL_properties.h */,
|
||||
F3F7D8DF2933074D00816151 /* SDL_quit.h */,
|
||||
F3F7D8E22933074D00816151 /* SDL_rect.h */,
|
||||
F3F7D8DE2933074D00816151 /* SDL_render.h */,
|
||||
@ -1046,17 +1110,17 @@
|
||||
F3F7D8C82933074B00816151 /* SDL_rwops.h */,
|
||||
F3F7D8C12933074B00816151 /* SDL_scancode.h */,
|
||||
F3F7D8C22933074B00816151 /* SDL_sensor.h */,
|
||||
F3F7D8BA2933074A00816151 /* SDL_shape.h */,
|
||||
F3F7D8AC2933074900816151 /* SDL_stdinc.h */,
|
||||
F3F7D8BB2933074A00816151 /* SDL_surface.h */,
|
||||
F3F7D8E82933074E00816151 /* SDL_system.h */,
|
||||
F3F7D8BF2933074A00816151 /* SDL_syswm.h */,
|
||||
F3F7D8CD2933074C00816151 /* SDL_thread.h */,
|
||||
F3F7D8B22933074900816151 /* SDL_timer.h */,
|
||||
F3F7D8AF2933074900816151 /* SDL_touch.h */,
|
||||
F3F7D8E42933074D00816151 /* SDL_version.h */,
|
||||
F3DDCC5F2AFD432500B0842B /* SDL_video_capture.h */,
|
||||
F3F7D8C52933074B00816151 /* SDL_video.h */,
|
||||
F3F7D8D42933074C00816151 /* SDL_vulkan.h */,
|
||||
F3F7D8CF2933074C00816151 /* SDL.h */,
|
||||
);
|
||||
name = "Public Headers";
|
||||
path = ../../include;
|
||||
@ -1106,6 +1170,7 @@
|
||||
A7D8A91123E2514000DCD162 /* libm */,
|
||||
A7D8A85D23E2513F00DCD162 /* loadso */,
|
||||
566E26CB246274AE00718109 /* locale */,
|
||||
000082EF09C89B62BD840000 /* main */,
|
||||
5616CA47252BB278005D5928 /* misc */,
|
||||
A7D8A7DF23E2513F00DCD162 /* power */,
|
||||
A7D8A8DA23E2514000DCD162 /* render */,
|
||||
@ -1119,6 +1184,8 @@
|
||||
A7D8A57523E2513D00DCD162 /* SDL_error_c.h */,
|
||||
A7D8A8BF23E2513F00DCD162 /* SDL_error.c */,
|
||||
F382071C284F362F004DD584 /* SDL_guid.c */,
|
||||
000078E1881E857EBB6C0000 /* SDL_hashtable.c */,
|
||||
0000B6ADCD88CAD6610F0000 /* SDL_hashtable.h */,
|
||||
A7D8A8D123E2514000DCD162 /* SDL_hints_c.h */,
|
||||
A7D8A5AB23E2513D00DCD162 /* SDL_hints.c */,
|
||||
A7D8A58323E2513D00DCD162 /* SDL_internal.h */,
|
||||
@ -1126,6 +1193,7 @@
|
||||
A1BB8B6227F6CF330057CFA8 /* SDL_list.h */,
|
||||
F386F6E42884663E001840AA /* SDL_log_c.h */,
|
||||
A7D8A5DD23E2513D00DCD162 /* SDL_log.c */,
|
||||
F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */,
|
||||
F386F6E52884663E001840AA /* SDL_utils_c.h */,
|
||||
F386F6E62884663E001840AA /* SDL_utils.c */,
|
||||
A7D8A57123E2513D00DCD162 /* SDL.c */,
|
||||
@ -1310,6 +1378,7 @@
|
||||
A7D8A5DB23E2513D00DCD162 /* SDL_dynapi_procs.h */,
|
||||
A7D8A5DA23E2513D00DCD162 /* SDL_dynapi.c */,
|
||||
A7D8A5D823E2513D00DCD162 /* SDL_dynapi.h */,
|
||||
E4F7981B2AD8D85500669F54 /* SDL_dynapi_unsupported.h */,
|
||||
);
|
||||
path = dynapi;
|
||||
sourceTree = "<group>";
|
||||
@ -1317,7 +1386,6 @@
|
||||
A7D8A5DE23E2513D00DCD162 /* timer */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A7D8A5E123E2513D00DCD162 /* dummy */,
|
||||
A7D8A5E723E2513D00DCD162 /* unix */,
|
||||
A7D8A5E023E2513D00DCD162 /* SDL_timer_c.h */,
|
||||
A7D8A5DF23E2513D00DCD162 /* SDL_timer.c */,
|
||||
@ -1325,14 +1393,6 @@
|
||||
path = timer;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A7D8A5E123E2513D00DCD162 /* dummy */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A7D8A5E223E2513D00DCD162 /* SDL_systimer.c */,
|
||||
);
|
||||
path = dummy;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A7D8A5E723E2513D00DCD162 /* unix */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -1363,6 +1423,7 @@
|
||||
A7D8A64C23E2513D00DCD162 /* SDL_blit.c */,
|
||||
A7D8A76B23E2513E00DCD162 /* SDL_blit.h */,
|
||||
A7D8A77323E2513E00DCD162 /* SDL_bmp.c */,
|
||||
F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */,
|
||||
A7D8A67B23E2513E00DCD162 /* SDL_clipboard.c */,
|
||||
A7D8A60423E2513D00DCD162 /* SDL_egl_c.h */,
|
||||
A7D8A6B623E2513E00DCD162 /* SDL_egl.c */,
|
||||
@ -1370,14 +1431,21 @@
|
||||
A7D8A74023E2513E00DCD162 /* SDL_pixels_c.h */,
|
||||
A7D8A64D23E2513D00DCD162 /* SDL_pixels.c */,
|
||||
A7D8A60C23E2513D00DCD162 /* SDL_rect_c.h */,
|
||||
F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */,
|
||||
A7D8A63423E2513D00DCD162 /* SDL_rect.c */,
|
||||
A7D8A76723E2513E00DCD162 /* SDL_RLEaccel_c.h */,
|
||||
A7D8A61523E2513D00DCD162 /* SDL_RLEaccel.c */,
|
||||
A7D8A60D23E2513D00DCD162 /* SDL_shape_internals.h */,
|
||||
A7D8A76923E2513E00DCD162 /* SDL_shape.c */,
|
||||
A7D8A60323E2513D00DCD162 /* SDL_stretch.c */,
|
||||
F3DDCC4E2AFD42B500B0842B /* SDL_surface_pixel_impl.h */,
|
||||
A7D8A61423E2513D00DCD162 /* SDL_surface.c */,
|
||||
A7D8A61723E2513D00DCD162 /* SDL_sysvideo.h */,
|
||||
F3DDCC532AFD42B600B0842B /* SDL_sysvideocapture.h */,
|
||||
F3DDCC522AFD42B600B0842B /* SDL_video_c.h */,
|
||||
F3DDCC502AFD42B500B0842B /* SDL_video_capture_apple.m */,
|
||||
F3DDCC512AFD42B500B0842B /* SDL_video_capture_c.h */,
|
||||
F3DDCC552AFD42B600B0842B /* SDL_video_capture_v4l2.c */,
|
||||
F3DDCC4F2AFD42B500B0842B /* SDL_video_capture.c */,
|
||||
E4F7981F2AD8D87F00669F54 /* SDL_video_unsupported.c */,
|
||||
A7D8A60E23E2513D00DCD162 /* SDL_video.c */,
|
||||
A7D8A63E23E2513D00DCD162 /* SDL_vulkan_internal.h */,
|
||||
A7D8A64023E2513D00DCD162 /* SDL_vulkan_utils.c */,
|
||||
@ -1471,8 +1539,6 @@
|
||||
A7D8A67F23E2513E00DCD162 /* SDL_cocoaopengl.m */,
|
||||
A7D8A69023E2513E00DCD162 /* SDL_cocoaopengles.h */,
|
||||
A7D8A68223E2513E00DCD162 /* SDL_cocoaopengles.m */,
|
||||
A7D8A67E23E2513E00DCD162 /* SDL_cocoashape.h */,
|
||||
A7D8A68E23E2513E00DCD162 /* SDL_cocoashape.m */,
|
||||
A7D8A69323E2513E00DCD162 /* SDL_cocoavideo.h */,
|
||||
A7D8A68523E2513E00DCD162 /* SDL_cocoavideo.m */,
|
||||
A7D8A68F23E2513E00DCD162 /* SDL_cocoavulkan.h */,
|
||||
@ -1601,12 +1667,16 @@
|
||||
A7D8A7BE23E2513E00DCD162 /* hidapi */,
|
||||
A7D8A7A123E2513E00DCD162 /* steam */,
|
||||
75E09157241EA924004729E1 /* virtual */,
|
||||
A7D8A7AD23E2513E00DCD162 /* SDL_gamepad.c */,
|
||||
A7D8A7A923E2513E00DCD162 /* SDL_joystick.c */,
|
||||
F362B9152B3349E200D30B94 /* controller_list.h */,
|
||||
F3820712284F3609004DD584 /* controller_type.c */,
|
||||
A7D8A7D923E2513E00DCD162 /* controller_type.h */,
|
||||
F362B9162B3349E200D30B94 /* SDL_gamepad_c.h */,
|
||||
A7D8A79E23E2513E00DCD162 /* SDL_gamepad_db.h */,
|
||||
A7D8A7AD23E2513E00DCD162 /* SDL_gamepad.c */,
|
||||
A7D8A7D023E2513E00DCD162 /* SDL_joystick_c.h */,
|
||||
A7D8A7A923E2513E00DCD162 /* SDL_joystick.c */,
|
||||
F362B9182B3349E200D30B94 /* SDL_steam_virtual_gamepad.c */,
|
||||
F362B9172B3349E200D30B94 /* SDL_steam_virtual_gamepad.h */,
|
||||
A7D8A7CF23E2513E00DCD162 /* SDL_sysjoystick.h */,
|
||||
A7D8A7CB23E2513E00DCD162 /* usb_ids.h */,
|
||||
);
|
||||
@ -1642,6 +1712,7 @@
|
||||
A7D8A7BE23E2513E00DCD162 /* hidapi */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */,
|
||||
F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */,
|
||||
A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */,
|
||||
F3F07D59269640160074468B /* SDL_hidapi_luna.c */,
|
||||
@ -1868,6 +1939,7 @@
|
||||
A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */,
|
||||
A7D8A8DC23E2514000DCD162 /* SDL_d3dmath.h */,
|
||||
A7D8A8DB23E2514000DCD162 /* SDL_render.c */,
|
||||
E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */,
|
||||
A7D8A8EE23E2514000DCD162 /* SDL_sysrender.h */,
|
||||
A7D8A8EC23E2514000DCD162 /* SDL_yuv_sw_c.h */,
|
||||
A7D8A8ED23E2514000DCD162 /* SDL_yuv_sw.c */,
|
||||
@ -1983,6 +2055,8 @@
|
||||
A7D8A93823E2514000DCD162 /* SDL_keyboard.c */,
|
||||
A7D8A92B23E2514000DCD162 /* SDL_mouse_c.h */,
|
||||
A7D8A92A23E2514000DCD162 /* SDL_mouse.c */,
|
||||
63134A232A7902FD0021E9A6 /* SDL_pen_c.h */,
|
||||
63134A242A7902FD0021E9A6 /* SDL_pen.c */,
|
||||
A7D8A93C23E2514000DCD162 /* SDL_quit.c */,
|
||||
A7D8A93723E2514000DCD162 /* SDL_touch_c.h */,
|
||||
A7D8A93E23E2514000DCD162 /* SDL_touch.c */,
|
||||
@ -2000,9 +2074,18 @@
|
||||
path = SDL3;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E4A568B42AF763940062EEC4 /* generic */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E4A568B52AF763940062EEC4 /* SDL_sysmain_callbacks.c */,
|
||||
);
|
||||
path = generic;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F36C7ACF294B9F5E004D61C3 /* core */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E4F798192AD8D84800669F54 /* SDL_core_unsupported.c */,
|
||||
F36C7AD0294BA009004D61C3 /* SDL_runapp.c */,
|
||||
);
|
||||
path = core;
|
||||
@ -2048,7 +2131,9 @@
|
||||
A7D8B61723E2514300DCD162 /* SDL_assert_c.h in Headers */,
|
||||
F3F7D9292933074E00816151 /* SDL_atomic.h in Headers */,
|
||||
F3F7D8ED2933074E00816151 /* SDL_audio.h in Headers */,
|
||||
F3DDCC602AFD432500B0842B /* SDL_video_capture.h in Headers */,
|
||||
A7D8B7A023E2514400DCD162 /* SDL_audio_c.h in Headers */,
|
||||
F3DDCC5A2AFD42B600B0842B /* SDL_video_capture_c.h in Headers */,
|
||||
A7D8B7B223E2514400DCD162 /* SDL_audiodev_c.h in Headers */,
|
||||
F3F7D9E12933074E00816151 /* SDL_begin_code.h in Headers */,
|
||||
F3F7D9A52933074E00816151 /* SDL_bits.h in Headers */,
|
||||
@ -2064,6 +2149,7 @@
|
||||
A7D8BB6F23E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */,
|
||||
F3F7D9D92933074E00816151 /* SDL_close_code.h in Headers */,
|
||||
A7D8AECA23E2514100DCD162 /* SDL_cocoaclipboard.h in Headers */,
|
||||
F3DDCC5C2AFD42B600B0842B /* SDL_sysvideocapture.h in Headers */,
|
||||
A7D8AF1223E2514100DCD162 /* SDL_cocoaevents.h in Headers */,
|
||||
A7D8AE8E23E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */,
|
||||
A7D8AF0623E2514100DCD162 /* SDL_cocoamessagebox.h in Headers */,
|
||||
@ -2072,7 +2158,6 @@
|
||||
A7D8AF1E23E2514100DCD162 /* SDL_cocoamouse.h in Headers */,
|
||||
A7D8AEDC23E2514100DCD162 /* SDL_cocoaopengl.h in Headers */,
|
||||
A7D8AEEE23E2514100DCD162 /* SDL_cocoaopengles.h in Headers */,
|
||||
A7D8AE8223E2514100DCD162 /* SDL_cocoashape.h in Headers */,
|
||||
A7D8AF0023E2514100DCD162 /* SDL_cocoavideo.h in Headers */,
|
||||
A7D8AEE823E2514100DCD162 /* SDL_cocoavulkan.h in Headers */,
|
||||
A7D8AEFA23E2514100DCD162 /* SDL_cocoawindow.h in Headers */,
|
||||
@ -2083,6 +2168,7 @@
|
||||
F3F7D9B92933074E00816151 /* SDL_cpuinfo.h in Headers */,
|
||||
F3990E062A788303000D8759 /* SDL_hidapi_ios.h in Headers */,
|
||||
A7D8B98023E2514400DCD162 /* SDL_d3dmath.h in Headers */,
|
||||
F362B91A2B3349E200D30B94 /* SDL_gamepad_c.h in Headers */,
|
||||
A7D8B8A223E2514400DCD162 /* SDL_diskaudio.h in Headers */,
|
||||
A7D8BB3F23E2514500DCD162 /* SDL_displayevents_c.h in Headers */,
|
||||
A7D8BA1923E2514400DCD162 /* SDL_draw.h in Headers */,
|
||||
@ -2096,6 +2182,7 @@
|
||||
A7D8AB1023E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */,
|
||||
A7D8AB1C23E2514100DCD162 /* SDL_dynapi_procs.h in Headers */,
|
||||
F3F7D9252933074E00816151 /* SDL_egl.h in Headers */,
|
||||
F362B9192B3349E200D30B94 /* controller_list.h in Headers */,
|
||||
A7D8ABD923E2514100DCD162 /* SDL_egl_c.h in Headers */,
|
||||
F3F7D93D2933074E00816151 /* SDL_endian.h in Headers */,
|
||||
F3F7D9352933074E00816151 /* SDL_error.h in Headers */,
|
||||
@ -2135,6 +2222,7 @@
|
||||
F3F7D91D2933074E00816151 /* SDL_messagebox.h in Headers */,
|
||||
F3F7D98D2933074E00816151 /* SDL_metal.h in Headers */,
|
||||
F395C1BA2569C6A000942BFF /* SDL_mfijoystick_c.h in Headers */,
|
||||
F362B91B2B3349E200D30B94 /* SDL_steam_virtual_gamepad.h in Headers */,
|
||||
F3F7D9992933074E00816151 /* SDL_misc.h in Headers */,
|
||||
F3F7D9AD2933074E00816151 /* SDL_mouse.h in Headers */,
|
||||
A7D8BB1B23E2514500DCD162 /* SDL_mouse_c.h in Headers */,
|
||||
@ -2150,6 +2238,8 @@
|
||||
F3B38CDB296E2E52005DA6D3 /* SDL_oldnames.h in Headers */,
|
||||
F3F7D9C92933074E00816151 /* SDL_opengl.h in Headers */,
|
||||
F3F7D9452933074E00816151 /* SDL_opengl_glext.h in Headers */,
|
||||
F3E5A6ED2AD5E10800293D83 /* SDL_properties.h in Headers */,
|
||||
E4F7981C2AD8D85500669F54 /* SDL_dynapi_unsupported.h in Headers */,
|
||||
F3F7D95D2933074E00816151 /* SDL_opengles.h in Headers */,
|
||||
F3F7D9612933074E00816151 /* SDL_opengles2.h in Headers */,
|
||||
F3F7D8FD2933074E00816151 /* SDL_opengles2_gl2.h in Headers */,
|
||||
@ -2179,8 +2269,6 @@
|
||||
A7D8B98C23E2514400DCD162 /* SDL_shaders_metal_ios.h in Headers */,
|
||||
A7D8B99B23E2514400DCD162 /* SDL_shaders_metal_macos.h in Headers */,
|
||||
A7D8B9A123E2514400DCD162 /* SDL_shaders_metal_tvos.h in Headers */,
|
||||
F3F7D92D2933074E00816151 /* SDL_shape.h in Headers */,
|
||||
A7D8AC0923E2514100DCD162 /* SDL_shape_internals.h in Headers */,
|
||||
F3F7D8F52933074E00816151 /* SDL_stdinc.h in Headers */,
|
||||
A7D8BBC723E2561500DCD162 /* SDL_steamcontroller.h in Headers */,
|
||||
F3F7D9312933074E00816151 /* SDL_surface.h in Headers */,
|
||||
@ -2199,7 +2287,6 @@
|
||||
A7D8B42823E2514300DCD162 /* SDL_systhread_c.h in Headers */,
|
||||
5616CA4D252BB2A6005D5928 /* SDL_sysurl.h in Headers */,
|
||||
A7D8AC3F23E2514100DCD162 /* SDL_sysvideo.h in Headers */,
|
||||
F3F7D9412933074E00816151 /* SDL_syswm.h in Headers */,
|
||||
F3F7D9792933074E00816151 /* SDL_thread.h in Headers */,
|
||||
A7D8B3EC23E2514300DCD162 /* SDL_thread_c.h in Headers */,
|
||||
F3F7D90D2933074E00816151 /* SDL_timer.h in Headers */,
|
||||
@ -2207,6 +2294,7 @@
|
||||
F3F7D9012933074E00816151 /* SDL_touch.h in Headers */,
|
||||
A7D8BB6323E2514500DCD162 /* SDL_touch_c.h in Headers */,
|
||||
A1626A522617008D003F1973 /* SDL_triangle.h in Headers */,
|
||||
F3DDCC5D2AFD42B600B0842B /* SDL_rect_impl.h in Headers */,
|
||||
A7D8BBD223E2574800DCD162 /* SDL_uikitappdelegate.h in Headers */,
|
||||
A7D8BBD423E2574800DCD162 /* SDL_uikitclipboard.h in Headers */,
|
||||
A7D8BBD623E2574800DCD162 /* SDL_uikitevents.h in Headers */,
|
||||
@ -2221,6 +2309,7 @@
|
||||
A7D8BBE623E2574800DCD162 /* SDL_uikitviewcontroller.h in Headers */,
|
||||
A7D8BBE823E2574800DCD162 /* SDL_uikitvulkan.h in Headers */,
|
||||
A7D8BBEA23E2574800DCD162 /* SDL_uikitwindow.h in Headers */,
|
||||
F3DDCC5B2AFD42B600B0842B /* SDL_video_c.h in Headers */,
|
||||
F386F6F02884663E001840AA /* SDL_utils_c.h in Headers */,
|
||||
F3973FA228A59BDD00B84553 /* SDL_vacopy.h in Headers */,
|
||||
F3F7D9D52933074E00816151 /* SDL_version.h in Headers */,
|
||||
@ -2252,6 +2341,7 @@
|
||||
A7D8B56F23E2514300DCD162 /* usb_ids.h in Headers */,
|
||||
A7D8B25423E2514200DCD162 /* vk_icd.h in Headers */,
|
||||
A7D8B24E23E2514200DCD162 /* vk_layer.h in Headers */,
|
||||
F3DDCC562AFD42B600B0842B /* SDL_clipboard_c.h in Headers */,
|
||||
A7D8B26623E2514200DCD162 /* vk_platform.h in Headers */,
|
||||
A7D8B2AE23E2514200DCD162 /* vk_sdk_platform.h in Headers */,
|
||||
A7D8B26023E2514200DCD162 /* vulkan.h in Headers */,
|
||||
@ -2267,11 +2357,14 @@
|
||||
A7D8B27823E2514200DCD162 /* vulkan_wayland.h in Headers */,
|
||||
A7D8B27E23E2514200DCD162 /* vulkan_win32.h in Headers */,
|
||||
A7D8B29023E2514200DCD162 /* vulkan_xcb.h in Headers */,
|
||||
F3DDCC572AFD42B600B0842B /* SDL_surface_pixel_impl.h in Headers */,
|
||||
A7D8B29C23E2514200DCD162 /* vulkan_xlib.h in Headers */,
|
||||
A7D8B28A23E2514200DCD162 /* vulkan_xlib_xrandr.h in Headers */,
|
||||
A7D8B3D423E2514300DCD162 /* yuv_rgb.h in Headers */,
|
||||
A7D8B3C823E2514200DCD162 /* yuv_rgb_sse_func.h in Headers */,
|
||||
A7D8B3CE23E2514300DCD162 /* yuv_rgb_std_func.h in Headers */,
|
||||
63134A222A7902CF0021E9A6 /* SDL_pen.h in Headers */,
|
||||
63134A252A7902FD0021E9A6 /* SDL_pen_c.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -2407,12 +2500,13 @@
|
||||
A7D8BAAF23E2514400DCD162 /* s_atan.c in Sources */,
|
||||
A7D8B75223E2514300DCD162 /* SDL_sysloadso.c in Sources */,
|
||||
A7D8BBE123E2574800DCD162 /* SDL_uikitopenglview.m in Sources */,
|
||||
A79745702B2E9D39009D224A /* SDL_hidapi_steamdeck.c in Sources */,
|
||||
A7D8B98623E2514400DCD162 /* SDL_render_metal.m in Sources */,
|
||||
A7D8AE7623E2514100DCD162 /* SDL_clipboard.c in Sources */,
|
||||
A7D8AEC423E2514100DCD162 /* SDL_cocoaevents.m in Sources */,
|
||||
A7D8B86623E2514400DCD162 /* SDL_audiocvt.c in Sources */,
|
||||
A7D8B3AA23E2514200DCD162 /* SDL_shape.c in Sources */,
|
||||
A7D8B9F523E2514400DCD162 /* SDL_rotate.c in Sources */,
|
||||
F3DDCC5E2AFD42B600B0842B /* SDL_video_capture_v4l2.c in Sources */,
|
||||
A7D8BBE323E2574800DCD162 /* SDL_uikitvideo.m in Sources */,
|
||||
5616CA4E252BB2A6005D5928 /* SDL_sysurl.m in Sources */,
|
||||
A7D8A97523E2514000DCD162 /* SDL_coremotionsensor.m in Sources */,
|
||||
@ -2430,6 +2524,7 @@
|
||||
A7D8AB7323E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */,
|
||||
A7D8B3BF23E2514200DCD162 /* yuv_rgb.c in Sources */,
|
||||
A7D8B43423E2514300DCD162 /* SDL_systhread.c in Sources */,
|
||||
F3DDCC592AFD42B600B0842B /* SDL_video_capture_apple.m in Sources */,
|
||||
A7D8BB3323E2514500DCD162 /* SDL_windowevents.c in Sources */,
|
||||
A7D8BABB23E2514400DCD162 /* s_scalbn.c in Sources */,
|
||||
F3973FAB28A59BDD00B84553 /* SDL_crc16.c in Sources */,
|
||||
@ -2437,7 +2532,7 @@
|
||||
F3D60A8328C16A1900788A3A /* SDL_hidapi_wii.c in Sources */,
|
||||
A7D8B9DD23E2514400DCD162 /* SDL_blendpoint.c in Sources */,
|
||||
A7D8B4EE23E2514300DCD162 /* SDL_gamepad.c in Sources */,
|
||||
A7D8AB3723E2514100DCD162 /* SDL_systimer.c in Sources */,
|
||||
E4A568B62AF763940062EEC4 /* SDL_sysmain_callbacks.c in Sources */,
|
||||
A7D8BA1323E2514400DCD162 /* SDL_render_sw.c in Sources */,
|
||||
A7D8B42223E2514300DCD162 /* SDL_syssem.c in Sources */,
|
||||
A7D8B53923E2514300DCD162 /* SDL_hidapi_xbox360.c in Sources */,
|
||||
@ -2464,6 +2559,7 @@
|
||||
A7D8B86023E2514400DCD162 /* SDL_audiotypecvt.c in Sources */,
|
||||
A7D8BBC523E2561500DCD162 /* SDL_steamcontroller.c in Sources */,
|
||||
A7D8AD3223E2514100DCD162 /* SDL_blit_N.c in Sources */,
|
||||
F3DDCC582AFD42B600B0842B /* SDL_video_capture.c in Sources */,
|
||||
A7D8BB7B23E2514500DCD162 /* SDL_dropevents.c in Sources */,
|
||||
A7D8BACD23E2514500DCD162 /* e_atan2.c in Sources */,
|
||||
A7D8BA8B23E2514400DCD162 /* s_sin.c in Sources */,
|
||||
@ -2477,7 +2573,6 @@
|
||||
A7D8AED023E2514100DCD162 /* SDL_cocoamessagebox.m in Sources */,
|
||||
F376F6552559B4E300CFC0BC /* SDL_hidapi.c in Sources */,
|
||||
A7D8BA2B23E2514400DCD162 /* SDL_blendfillrect.c in Sources */,
|
||||
A7D8AEE223E2514100DCD162 /* SDL_cocoashape.m in Sources */,
|
||||
A7D8BBD323E2574800DCD162 /* SDL_uikitappdelegate.m in Sources */,
|
||||
A7D8AEB823E2514100DCD162 /* SDL_cocoamouse.m in Sources */,
|
||||
F32DDAD12AB795A30041EAA5 /* SDL_audioqueue.c in Sources */,
|
||||
@ -2491,11 +2586,13 @@
|
||||
A7D8BAD323E2514500DCD162 /* s_tan.c in Sources */,
|
||||
A7D8AA6523E2514000DCD162 /* SDL_hints.c in Sources */,
|
||||
A7D8B53F23E2514300DCD162 /* SDL_hidapi_ps4.c in Sources */,
|
||||
F362B91C2B3349E200D30B94 /* SDL_steam_virtual_gamepad.c in Sources */,
|
||||
A7D8AD6E23E2514100DCD162 /* SDL_pixels.c in Sources */,
|
||||
A7D8B75E23E2514300DCD162 /* SDL_sysloadso.c in Sources */,
|
||||
A7D8BBD723E2574800DCD162 /* SDL_uikitevents.m in Sources */,
|
||||
A7D8B5F323E2514300DCD162 /* SDL_syspower.c in Sources */,
|
||||
A7D8B95023E2514400DCD162 /* SDL_iconv.c in Sources */,
|
||||
F3E5A6EB2AD5E0E600293D83 /* SDL_properties.c in Sources */,
|
||||
A7D8BA9D23E2514400DCD162 /* s_fabs.c in Sources */,
|
||||
F395C1B12569C6A000942BFF /* SDL_mfijoystick.m in Sources */,
|
||||
A7D8B99223E2514400DCD162 /* SDL_shaders_metal.metal in Sources */,
|
||||
@ -2524,6 +2621,7 @@
|
||||
A7D8B79A23E2514400DCD162 /* SDL_dummyaudio.c in Sources */,
|
||||
A7D8B3A423E2514200DCD162 /* SDL_fillrect.c in Sources */,
|
||||
A7D8ABDF23E2514100DCD162 /* SDL_nullframebuffer.c in Sources */,
|
||||
E4F7981A2AD8D84800669F54 /* SDL_core_unsupported.c in Sources */,
|
||||
A7D8A96923E2514000DCD162 /* SDL_dummysensor.c in Sources */,
|
||||
A7D8B95C23E2514400DCD162 /* SDL_string.c in Sources */,
|
||||
A7D8BA7F23E2514400DCD162 /* SDL_render_gl.c in Sources */,
|
||||
@ -2544,6 +2642,7 @@
|
||||
A7D8B55123E2514300DCD162 /* SDL_hidapi_switch.c in Sources */,
|
||||
A7D8B96223E2514400DCD162 /* SDL_strtokr.c in Sources */,
|
||||
A7D8BB7523E2514500DCD162 /* SDL_clipboardevents.c in Sources */,
|
||||
E4F798202AD8D87F00669F54 /* SDL_video_unsupported.c in Sources */,
|
||||
A1BB8B6327F6CF330057CFA8 /* SDL_list.c in Sources */,
|
||||
A7D8BAB523E2514400DCD162 /* k_cos.c in Sources */,
|
||||
A7D8B54523E2514300DCD162 /* SDL_hidapijoystick.c in Sources */,
|
||||
@ -2563,6 +2662,7 @@
|
||||
A7D8BBD523E2574800DCD162 /* SDL_uikitclipboard.m in Sources */,
|
||||
A7D8B5C923E2514300DCD162 /* SDL_rwopsbundlesupport.m in Sources */,
|
||||
F386F6F92884663E001840AA /* SDL_utils.c in Sources */,
|
||||
E4F7981E2AD8D86A00669F54 /* SDL_render_unsupported.c in Sources */,
|
||||
A7D8AC0F23E2514100DCD162 /* SDL_video.c in Sources */,
|
||||
A7D8BA5B23E2514400DCD162 /* SDL_shaders_gles2.c in Sources */,
|
||||
A7D8B14023E2514200DCD162 /* SDL_blit_1.c in Sources */,
|
||||
@ -2584,6 +2684,10 @@
|
||||
A7D8AEA023E2514100DCD162 /* SDL_cocoavulkan.m in Sources */,
|
||||
A7D8AB6123E2514100DCD162 /* SDL_offscreenwindow.c in Sources */,
|
||||
566E26D8246274CC00718109 /* SDL_locale.c in Sources */,
|
||||
63134A262A7902FD0021E9A6 /* SDL_pen.c in Sources */,
|
||||
000040E76FDC6AE48CBF0000 /* SDL_hashtable.c in Sources */,
|
||||
0000A4DA2F45A31DC4F00000 /* SDL_sysmain_callbacks.m in Sources */,
|
||||
000028F8113A53F4333E0000 /* SDL_main_callbacks.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 52;
|
||||
objectVersion = 55;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXAggregateTarget section */
|
||||
@ -153,7 +153,6 @@
|
||||
F35E56DF2983130F00A43A5F /* testautomation_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56C72983130E00A43A5F /* testautomation_keyboard.c */; };
|
||||
F35E56E02983130F00A43A5F /* testautomation_sdltest.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56C82983130E00A43A5F /* testautomation_sdltest.c */; };
|
||||
F35E56E12983130F00A43A5F /* testautomation_guid.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56C92983130E00A43A5F /* testautomation_guid.c */; };
|
||||
F35E56E22983130F00A43A5F /* testautomation_syswm.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56CA2983130E00A43A5F /* testautomation_syswm.c */; };
|
||||
F35E56E32983130F00A43A5F /* testautomation_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56CB2983130F00A43A5F /* testautomation_surface.c */; };
|
||||
F35E56E42983130F00A43A5F /* testautomation.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56CC2983130F00A43A5F /* testautomation.c */; };
|
||||
F35E56E52983130F00A43A5F /* testautomation_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = F35E56CD2983130F00A43A5F /* testautomation_mouse.c */; };
|
||||
@ -1329,7 +1328,6 @@
|
||||
F35E56C72983130E00A43A5F /* testautomation_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_keyboard.c; sourceTree = "<group>"; };
|
||||
F35E56C82983130E00A43A5F /* testautomation_sdltest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_sdltest.c; sourceTree = "<group>"; };
|
||||
F35E56C92983130E00A43A5F /* testautomation_guid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_guid.c; sourceTree = "<group>"; };
|
||||
F35E56CA2983130E00A43A5F /* testautomation_syswm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_syswm.c; sourceTree = "<group>"; };
|
||||
F35E56CB2983130F00A43A5F /* testautomation_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_surface.c; sourceTree = "<group>"; };
|
||||
F35E56CC2983130F00A43A5F /* testautomation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation.c; sourceTree = "<group>"; };
|
||||
F35E56CD2983130F00A43A5F /* testautomation_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_mouse.c; sourceTree = "<group>"; };
|
||||
@ -1780,7 +1778,6 @@
|
||||
F35E56C82983130E00A43A5F /* testautomation_sdltest.c */,
|
||||
F35E56BE2983130C00A43A5F /* testautomation_stdlib.c */,
|
||||
F35E56CB2983130F00A43A5F /* testautomation_surface.c */,
|
||||
F35E56CA2983130E00A43A5F /* testautomation_syswm.c */,
|
||||
F35E56BD2983130B00A43A5F /* testautomation_timer.c */,
|
||||
F35E56C12983130C00A43A5F /* testautomation_video.c */,
|
||||
F35E56CC2983130F00A43A5F /* testautomation.c */,
|
||||
@ -3357,7 +3354,6 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F35E56D12983130F00A43A5F /* testautomation_render.c in Sources */,
|
||||
F35E56E22983130F00A43A5F /* testautomation_syswm.c in Sources */,
|
||||
F399C6512A7892D800C86979 /* testautomation_intrinsics.c in Sources */,
|
||||
F35E56D22983130F00A43A5F /* testautomation_rwops.c in Sources */,
|
||||
F35E56E32983130F00A43A5F /* testautomation_surface.c in Sources */,
|
||||
|
@ -273,6 +273,7 @@ public class HIDDeviceManager {
|
||||
final int XB1_IFACE_SUBCLASS = 71;
|
||||
final int XB1_IFACE_PROTOCOL = 208;
|
||||
final int[] SUPPORTED_VENDORS = {
|
||||
0x03f0, // HP
|
||||
0x044f, // Thrustmaster
|
||||
0x045e, // Microsoft
|
||||
0x0738, // Mad Catz
|
||||
@ -358,6 +359,12 @@ public class HIDDeviceManager {
|
||||
private void initializeBluetooth() {
|
||||
Log.d(TAG, "Initializing Bluetooth");
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 31 /* Android 12 */ &&
|
||||
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH_CONNECT, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
||||
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH_CONNECT");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT <= 30 /* Android 11.0 (R) */ &&
|
||||
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
||||
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
|
||||
|
@ -23,9 +23,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.Selection;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
@ -39,12 +36,9 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.BaseInputConnection;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@ -186,6 +180,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
private static final int SDL_SYSTEM_CURSOR_SIZEALL = 9;
|
||||
private static final int SDL_SYSTEM_CURSOR_NO = 10;
|
||||
private static final int SDL_SYSTEM_CURSOR_HAND = 11;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT = 12;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_TOP = 13;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT = 14;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_RIGHT = 15;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT = 16;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_BOTTOM = 17;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT = 18;
|
||||
private static final int SDL_SYSTEM_CURSOR_WINDOW_LEFT = 19;
|
||||
|
||||
protected static final int SDL_ORIENTATION_UNKNOWN = 0;
|
||||
protected static final int SDL_ORIENTATION_LANDSCAPE = 1;
|
||||
@ -210,7 +212,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
// Main components
|
||||
protected static SDLActivity mSingleton;
|
||||
protected static SDLSurface mSurface;
|
||||
protected static DummyEdit mTextEdit;
|
||||
protected static SDLDummyEdit mTextEdit;
|
||||
protected static boolean mScreenKeyboardShown;
|
||||
protected static ViewGroup mLayout;
|
||||
protected static SDLClipboardHandler mClipboardHandler;
|
||||
@ -238,6 +240,15 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
return mMotionListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates a Runnable which invokes SDL_main. The default implementation
|
||||
* uses the getMainSharedObject() and getMainFunction() methods to invoke native
|
||||
* code from the specified shared library.
|
||||
*/
|
||||
protected Runnable createSDLMainRunnable() {
|
||||
return new SDLMain();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the name of the shared object with the application entry point
|
||||
* It can be overridden by derived classes.
|
||||
@ -672,11 +683,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
|
||||
// Wait for "SDLThread" thread to end
|
||||
try {
|
||||
// 500ms timeout, because:
|
||||
// Use a timeout because:
|
||||
// C SDLmain() thread might have started (mSDLThread.start() called)
|
||||
// while the SDL_Init() might not have been called yet,
|
||||
// and so the previous QUIT event will be discarded by SDL_Init() and app is running, not exiting.
|
||||
SDLActivity.mSDLThread.join(500);
|
||||
SDLActivity.mSDLThread.join(1000);
|
||||
} catch(Exception e) {
|
||||
Log.v(TAG, "Problem stopping SDLThread: " + e);
|
||||
}
|
||||
@ -777,13 +788,13 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
|
||||
// Try a transition to resumed state
|
||||
if (mNextNativeState == NativeState.RESUMED) {
|
||||
if (mSurface.mIsSurfaceReady && mHasFocus && mIsResumedCalled) {
|
||||
if (mSurface.mIsSurfaceReady && (mHasFocus || mHasMultiWindow) && mIsResumedCalled) {
|
||||
if (mSDLThread == null) {
|
||||
// This is the entry point to the C app.
|
||||
// Start up the C app thread and enable sensor input for the first time
|
||||
// FIXME: Why aren't we enabling sensor input at start?
|
||||
|
||||
mSDLThread = new Thread(new SDLMain(), "SDLThread");
|
||||
mSDLThread = new Thread(SDLActivity.mSingleton.createSDLMainRunnable(), "SDLThread");
|
||||
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||
mSDLThread.start();
|
||||
|
||||
@ -799,11 +810,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
}
|
||||
|
||||
// Messages from the SDLMain thread
|
||||
static final int COMMAND_CHANGE_TITLE = 1;
|
||||
static final int COMMAND_CHANGE_WINDOW_STYLE = 2;
|
||||
static final int COMMAND_TEXTEDIT_HIDE = 3;
|
||||
static final int COMMAND_SET_KEEP_SCREEN_ON = 5;
|
||||
|
||||
protected static final int COMMAND_CHANGE_TITLE = 1;
|
||||
protected static final int COMMAND_CHANGE_WINDOW_STYLE = 2;
|
||||
protected static final int COMMAND_TEXTEDIT_HIDE = 3;
|
||||
protected static final int COMMAND_SET_KEEP_SCREEN_ON = 5;
|
||||
protected static final int COMMAND_USER = 0x8000;
|
||||
|
||||
protected static boolean mFullscreenModeActive;
|
||||
@ -911,7 +921,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
Handler commandHandler = new SDLCommandHandler();
|
||||
|
||||
// Send a message from the SDLMain thread
|
||||
boolean sendCommand(int command, Object data) {
|
||||
protected boolean sendCommand(int command, Object data) {
|
||||
Message msg = commandHandler.obtainMessage();
|
||||
msg.arg1 = command;
|
||||
msg.obj = data;
|
||||
@ -1123,23 +1133,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static boolean shouldMinimizeOnFocusLoss() {
|
||||
/*
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
if (mSingleton == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mSingleton.isInMultiWindowMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mSingleton.isInPictureInPictureMode()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1344,7 +1337,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
params.topMargin = y;
|
||||
|
||||
if (mTextEdit == null) {
|
||||
mTextEdit = new DummyEdit(SDL.getContext());
|
||||
mTextEdit = new SDLDummyEdit(SDL.getContext());
|
||||
|
||||
mLayout.addView(mTextEdit, params);
|
||||
} else {
|
||||
@ -1828,6 +1821,30 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
case SDL_SYSTEM_CURSOR_HAND:
|
||||
cursor_type = 1002; //PointerIcon.TYPE_HAND;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT:
|
||||
cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_TOP:
|
||||
cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT:
|
||||
cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_RIGHT:
|
||||
cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT:
|
||||
cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_BOTTOM:
|
||||
cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT:
|
||||
cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WINDOW_LEFT:
|
||||
cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;
|
||||
break;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||
try {
|
||||
@ -1898,11 +1915,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
try
|
||||
{
|
||||
class OneShotTask implements Runnable {
|
||||
String mMessage;
|
||||
int mDuration;
|
||||
int mGravity;
|
||||
int mXOffset;
|
||||
int mYOffset;
|
||||
private final String mMessage;
|
||||
private final int mDuration;
|
||||
private final int mGravity;
|
||||
private final int mXOffset;
|
||||
private final int mYOffset;
|
||||
|
||||
OneShotTask(String message, int duration, int gravity, int xOffset, int yOffset) {
|
||||
mMessage = message;
|
||||
@ -1966,186 +1983,6 @@ class SDLMain implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/* This is a fake invisible editor view that receives the input and defines the
|
||||
* pan&scan region
|
||||
*/
|
||||
class DummyEdit extends View implements View.OnKeyListener {
|
||||
InputConnection ic;
|
||||
|
||||
public DummyEdit(Context context) {
|
||||
super(context);
|
||||
setFocusableInTouchMode(true);
|
||||
setFocusable(true);
|
||||
setOnKeyListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIsTextEditor() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
return SDLActivity.handleKeyEvent(v, keyCode, event, ic);
|
||||
}
|
||||
|
||||
//
|
||||
@Override
|
||||
public boolean onKeyPreIme (int keyCode, KeyEvent event) {
|
||||
// As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
|
||||
// FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
|
||||
// FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
|
||||
// FIXME: A more effective solution would be to assume our Layout to be RelativeLayout or LinearLayout
|
||||
// FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
|
||||
// FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
|
||||
if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
|
||||
SDLActivity.onNativeKeyboardFocusLost();
|
||||
}
|
||||
}
|
||||
return super.onKeyPreIme(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||
ic = new SDLInputConnection(this, true);
|
||||
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
|
||||
InputType.TYPE_TEXT_FLAG_MULTI_LINE;
|
||||
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
|
||||
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
|
||||
|
||||
return ic;
|
||||
}
|
||||
}
|
||||
|
||||
class SDLInputConnection extends BaseInputConnection {
|
||||
|
||||
protected EditText mEditText;
|
||||
protected String mCommittedText = "";
|
||||
|
||||
public SDLInputConnection(View targetView, boolean fullEditor) {
|
||||
super(targetView, fullEditor);
|
||||
mEditText = new EditText(SDL.getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Editable getEditable() {
|
||||
return mEditText.getEditableText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendKeyEvent(KeyEvent event) {
|
||||
/*
|
||||
* This used to handle the keycodes from soft keyboard (and IME-translated input from hardkeyboard)
|
||||
* However, as of Ice Cream Sandwich and later, almost all soft keyboard doesn't generate key presses
|
||||
* and so we need to generate them ourselves in commitText. To avoid duplicates on the handful of keys
|
||||
* that still do, we empty this out.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return DOES still generate a key event, however. So rather than using it as the 'click a button' key
|
||||
* as we do with physical keyboards, let's just use it to hide the keyboard.
|
||||
*/
|
||||
|
||||
if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
|
||||
if (SDLActivity.onNativeSoftReturnKey()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.sendKeyEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||
if (!super.commitText(text, newCursorPosition)) {
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setComposingText(CharSequence text, int newCursorPosition) {
|
||||
if (!super.setComposingText(text, newCursorPosition)) {
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
|
||||
if (Build.VERSION.SDK_INT <= 29 /* Android 10.0 (Q) */) {
|
||||
// Workaround to capture backspace key. Ref: http://stackoverflow.com/questions>/14560344/android-backspace-in-webview-baseinputconnection
|
||||
// and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
|
||||
if (beforeLength > 0 && afterLength == 0) {
|
||||
// backspace(s)
|
||||
while (beforeLength-- > 0) {
|
||||
nativeGenerateScancodeForUnichar('\b');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void updateText() {
|
||||
final Editable content = getEditable();
|
||||
if (content == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String text = content.toString();
|
||||
int compareLength = Math.min(text.length(), mCommittedText.length());
|
||||
int matchLength, offset;
|
||||
|
||||
/* Backspace over characters that are no longer in the string */
|
||||
for (matchLength = 0; matchLength < compareLength; ) {
|
||||
int codePoint = mCommittedText.codePointAt(matchLength);
|
||||
if (codePoint != text.codePointAt(matchLength)) {
|
||||
break;
|
||||
}
|
||||
matchLength += Character.charCount(codePoint);
|
||||
}
|
||||
/* FIXME: This doesn't handle graphemes, like '🌬️' */
|
||||
for (offset = matchLength; offset < mCommittedText.length(); ) {
|
||||
int codePoint = mCommittedText.codePointAt(offset);
|
||||
nativeGenerateScancodeForUnichar('\b');
|
||||
offset += Character.charCount(codePoint);
|
||||
}
|
||||
|
||||
if (matchLength < text.length()) {
|
||||
String pendingText = text.subSequence(matchLength, text.length()).toString();
|
||||
for (offset = 0; offset < pendingText.length(); ) {
|
||||
int codePoint = pendingText.codePointAt(offset);
|
||||
if (codePoint == '\n') {
|
||||
if (SDLActivity.onNativeSoftReturnKey()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Higher code points don't generate simulated scancodes */
|
||||
if (codePoint < 128) {
|
||||
nativeGenerateScancodeForUnichar((char)codePoint);
|
||||
}
|
||||
offset += Character.charCount(codePoint);
|
||||
}
|
||||
SDLInputConnection.nativeCommitText(pendingText, 0);
|
||||
}
|
||||
mCommittedText = text;
|
||||
}
|
||||
|
||||
public static native void nativeCommitText(String text, int newCursorPosition);
|
||||
|
||||
public static native void nativeGenerateScancodeForUnichar(char c);
|
||||
}
|
||||
|
||||
class SDLClipboardHandler implements
|
||||
ClipboardManager.OnPrimaryClipChangedListener {
|
||||
|
||||
|
@ -0,0 +1,62 @@
|
||||
package org.libsdl.app;
|
||||
|
||||
import android.content.*;
|
||||
import android.text.InputType;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
|
||||
/* This is a fake invisible editor view that receives the input and defines the
|
||||
* pan&scan region
|
||||
*/
|
||||
public class SDLDummyEdit extends View implements View.OnKeyListener
|
||||
{
|
||||
InputConnection ic;
|
||||
|
||||
public SDLDummyEdit(Context context) {
|
||||
super(context);
|
||||
setFocusableInTouchMode(true);
|
||||
setFocusable(true);
|
||||
setOnKeyListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIsTextEditor() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
return SDLActivity.handleKeyEvent(v, keyCode, event, ic);
|
||||
}
|
||||
|
||||
//
|
||||
@Override
|
||||
public boolean onKeyPreIme (int keyCode, KeyEvent event) {
|
||||
// As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
|
||||
// FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
|
||||
// FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
|
||||
// FIXME: A more effective solution would be to assume our Layout to be RelativeLayout or LinearLayout
|
||||
// FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
|
||||
// FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
|
||||
if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
|
||||
SDLActivity.onNativeKeyboardFocusLost();
|
||||
}
|
||||
}
|
||||
return super.onKeyPreIme(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||
ic = new SDLInputConnection(this, true);
|
||||
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
|
||||
InputType.TYPE_TEXT_FLAG_MULTI_LINE;
|
||||
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
|
||||
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
|
||||
|
||||
return ic;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,136 @@
|
||||
package org.libsdl.app;
|
||||
|
||||
import android.content.*;
|
||||
import android.os.Build;
|
||||
import android.text.Editable;
|
||||
import android.view.*;
|
||||
import android.view.inputmethod.BaseInputConnection;
|
||||
import android.widget.EditText;
|
||||
|
||||
public class SDLInputConnection extends BaseInputConnection
|
||||
{
|
||||
protected EditText mEditText;
|
||||
protected String mCommittedText = "";
|
||||
|
||||
public SDLInputConnection(View targetView, boolean fullEditor) {
|
||||
super(targetView, fullEditor);
|
||||
mEditText = new EditText(SDL.getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Editable getEditable() {
|
||||
return mEditText.getEditableText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendKeyEvent(KeyEvent event) {
|
||||
/*
|
||||
* This used to handle the keycodes from soft keyboard (and IME-translated input from hardkeyboard)
|
||||
* However, as of Ice Cream Sandwich and later, almost all soft keyboard doesn't generate key presses
|
||||
* and so we need to generate them ourselves in commitText. To avoid duplicates on the handful of keys
|
||||
* that still do, we empty this out.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return DOES still generate a key event, however. So rather than using it as the 'click a button' key
|
||||
* as we do with physical keyboards, let's just use it to hide the keyboard.
|
||||
*/
|
||||
|
||||
if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
|
||||
if (SDLActivity.onNativeSoftReturnKey()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.sendKeyEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||
if (!super.commitText(text, newCursorPosition)) {
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setComposingText(CharSequence text, int newCursorPosition) {
|
||||
if (!super.setComposingText(text, newCursorPosition)) {
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
|
||||
if (Build.VERSION.SDK_INT <= 29 /* Android 10.0 (Q) */) {
|
||||
// Workaround to capture backspace key. Ref: http://stackoverflow.com/questions>/14560344/android-backspace-in-webview-baseinputconnection
|
||||
// and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
|
||||
if (beforeLength > 0 && afterLength == 0) {
|
||||
// backspace(s)
|
||||
while (beforeLength-- > 0) {
|
||||
nativeGenerateScancodeForUnichar('\b');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void updateText() {
|
||||
final Editable content = getEditable();
|
||||
if (content == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String text = content.toString();
|
||||
int compareLength = Math.min(text.length(), mCommittedText.length());
|
||||
int matchLength, offset;
|
||||
|
||||
/* Backspace over characters that are no longer in the string */
|
||||
for (matchLength = 0; matchLength < compareLength; ) {
|
||||
int codePoint = mCommittedText.codePointAt(matchLength);
|
||||
if (codePoint != text.codePointAt(matchLength)) {
|
||||
break;
|
||||
}
|
||||
matchLength += Character.charCount(codePoint);
|
||||
}
|
||||
/* FIXME: This doesn't handle graphemes, like '🌬️' */
|
||||
for (offset = matchLength; offset < mCommittedText.length(); ) {
|
||||
int codePoint = mCommittedText.codePointAt(offset);
|
||||
nativeGenerateScancodeForUnichar('\b');
|
||||
offset += Character.charCount(codePoint);
|
||||
}
|
||||
|
||||
if (matchLength < text.length()) {
|
||||
String pendingText = text.subSequence(matchLength, text.length()).toString();
|
||||
for (offset = 0; offset < pendingText.length(); ) {
|
||||
int codePoint = pendingText.codePointAt(offset);
|
||||
if (codePoint == '\n') {
|
||||
if (SDLActivity.onNativeSoftReturnKey()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Higher code points don't generate simulated scancodes */
|
||||
if (codePoint < 128) {
|
||||
nativeGenerateScancodeForUnichar((char)codePoint);
|
||||
}
|
||||
offset += Character.charCount(codePoint);
|
||||
}
|
||||
SDLInputConnection.nativeCommitText(pendingText, 0);
|
||||
}
|
||||
mCommittedText = text;
|
||||
}
|
||||
|
||||
public static native void nativeCommitText(String text, int newCursorPosition);
|
||||
|
||||
public static native void nativeGenerateScancodeForUnichar(char c);
|
||||
}
|
||||
|
@ -164,13 +164,10 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
}
|
||||
}
|
||||
|
||||
// Don't skip in MultiWindow.
|
||||
// Don't skip if we might be multi-window or have popup dialogs
|
||||
if (skip) {
|
||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
||||
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
|
||||
Log.v("SDL", "Don't skip in Multi-Window");
|
||||
skip = false;
|
||||
}
|
||||
skip = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,6 +193,24 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
return SDLActivity.handleKeyEvent(v, keyCode, event, null);
|
||||
}
|
||||
|
||||
private float getNormalizedX(float x)
|
||||
{
|
||||
if (mWidth <= 1) {
|
||||
return 0.5f;
|
||||
} else {
|
||||
return (x / (mWidth - 1));
|
||||
}
|
||||
}
|
||||
|
||||
private float getNormalizedY(float y)
|
||||
{
|
||||
if (mHeight <= 1) {
|
||||
return 0.5f;
|
||||
} else {
|
||||
return (y / (mHeight - 1));
|
||||
}
|
||||
}
|
||||
|
||||
// Touch events
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
@ -242,8 +257,8 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
for (i = 0; i < pointerCount; i++) {
|
||||
pointerFingerId = event.getPointerId(i);
|
||||
x = event.getX(i) / mWidth;
|
||||
y = event.getY(i) / mHeight;
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
@ -267,8 +282,8 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
pointerFingerId = event.getPointerId(i);
|
||||
x = event.getX(i) / mWidth;
|
||||
y = event.getY(i) / mHeight;
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
@ -281,8 +296,8 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
for (i = 0; i < pointerCount; i++) {
|
||||
pointerFingerId = event.getPointerId(i);
|
||||
x = event.getX(i) / mWidth;
|
||||
y = event.getY(i) / mHeight;
|
||||
x = getNormalizedX(event.getX(i));
|
||||
y = getNormalizedY(event.getY(i));
|
||||
p = event.getPressure(i);
|
||||
if (p > 1.0f) {
|
||||
// may be larger than 1.0f on some devices
|
||||
|
@ -1240,21 +1240,11 @@ typedef SDL_GameControllerButton, SDL_GamepadButton;
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_GameControllerMappingForIndex
|
||||
+ SDL_GetGamepadMappingForIndex
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_GameControllerName
|
||||
+ SDL_GetGamepadName
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_GameControllerNumMappings
|
||||
+ SDL_GetNumGamepadMappings
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_GameControllerOpen
|
||||
+ SDL_OpenGamepad
|
||||
(...)
|
||||
@ -1934,10 +1924,10 @@ expression e2;
|
||||
+ SDL_BlitSurfaceUnchecked
|
||||
(...)
|
||||
@@
|
||||
expression e1, e2, e3, e4;
|
||||
@@
|
||||
- SDL_LowerBlitScaled
|
||||
+ SDL_BlitSurfaceUncheckedScaled
|
||||
(...)
|
||||
- SDL_LowerBlitScaled(e1, e2, e3, e4)
|
||||
+ SDL_BlitSurfaceUncheckedScaled(e1, e2, e3, e4, SDL_SCALEMODE_NEAREST)
|
||||
@@
|
||||
@@
|
||||
- SDL_SetClipRect
|
||||
@ -1954,10 +1944,10 @@ expression e2;
|
||||
+ SDL_BlitSurface
|
||||
(...)
|
||||
@@
|
||||
expression e1, e2, e3, e4;
|
||||
@@
|
||||
- SDL_UpperBlitScaled
|
||||
+ SDL_BlitSurfaceScaled
|
||||
(...)
|
||||
- SDL_UpperBlitScaled(e1, e2, e3, e4)
|
||||
+ SDL_BlitSurfaceScaled(e1, e2, e3, e4, SDL_SCALEMODE_NEAREST)
|
||||
@@
|
||||
@@
|
||||
- SDL_RenderGetD3D11Device
|
||||
@ -2735,3 +2725,42 @@ typedef SDL_cond, SDL_Condition;
|
||||
- SDL_WriteBE64
|
||||
+ SDL_WriteU64BE
|
||||
(...)
|
||||
@@
|
||||
expression e, n;
|
||||
@@
|
||||
- SDL_GetWindowData(e, n)
|
||||
+ SDL_GetProperty(SDL_GetWindowProperties(e), n)
|
||||
@@
|
||||
expression e, n, v;
|
||||
@@
|
||||
- SDL_SetWindowData(e, n, v)
|
||||
+ SDL_SetProperty(SDL_GetWindowProperties(e), n, v, NULL, NULL)
|
||||
@@
|
||||
expression w, i, s;
|
||||
@@
|
||||
- SDL_Vulkan_CreateSurface(w, i, s)
|
||||
+ SDL_Vulkan_CreateSurface(w, i, NULL, s)
|
||||
@@
|
||||
@@
|
||||
- SDL_RenderFlush
|
||||
+ SDL_FlushRenderer
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_CONTROLLERSTEAMHANDLEUPDATED
|
||||
+ SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED
|
||||
@@
|
||||
@@
|
||||
- SDL_GameControllerGetSteamHandle
|
||||
+ SDL_GetGamepadSteamHandle
|
||||
(...)
|
||||
@@
|
||||
expression e1, e2, e3, e4;
|
||||
@@
|
||||
- SDL_SoftStretch(e1, e2, e3, e4)
|
||||
+ SDL_SoftStretch(e1, e2, e3, e4, SDL_SCALEMODE_NEAREST)
|
||||
@@
|
||||
expression e1, e2, e3, e4;
|
||||
@@
|
||||
- SDL_SoftStretchLinear(e1, e2, e3, e4)
|
||||
+ SDL_SoftStretch(e1, e2, e3, e4, SDL_SCALEMODE_LINEAR)
|
||||
|
@ -438,6 +438,7 @@ sub process_visualstudio {
|
||||
$filter = lc(dirname($addpath));
|
||||
$filter =~ s/\Asrc\///; # there's no filter for the base "src/" dir, where SDL.c and friends live.
|
||||
$filter =~ s/\//\\/g;
|
||||
$filter = '' if $filter eq 'src';
|
||||
|
||||
if ($filter ne '') {
|
||||
# see if the filter already exists, otherwise add it.
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Simple DirectMedia Layer
|
||||
# Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
# Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@ -269,7 +269,7 @@ static void write_converter(const int fromchans, const int tochans)
|
||||
"\n", lowercase(fromstr), lowercase(tostr));
|
||||
|
||||
if (convert_backwards) { /* must convert backwards when growing the output in-place. */
|
||||
printf(" /* convert backwards, since output is growing in-place. */\n");
|
||||
printf(" // convert backwards, since output is growing in-place.\n");
|
||||
printf(" src += (num_frames-1)");
|
||||
if (fromchans != 1) {
|
||||
printf(" * %d", fromchans);
|
||||
@ -406,7 +406,7 @@ int main(void)
|
||||
printf(
|
||||
"/*\n"
|
||||
" Simple DirectMedia Layer\n"
|
||||
" Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
"\n"
|
||||
" This software is provided 'as-is', without any express or implied\n"
|
||||
" warranty. In no event will the authors be held liable for any damages\n"
|
||||
@ -425,7 +425,7 @@ int main(void)
|
||||
" 3. This notice may not be removed or altered from any source distribution.\n"
|
||||
"*/\n"
|
||||
"\n"
|
||||
"/* DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_channel_conversion.c */\n"
|
||||
"// DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_channel_conversion.c\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"typedef void (*SDL_AudioChannelConverter)(float *dst, const float *src, int num_frames);\n"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@ -25,7 +25,7 @@ Built with:
|
||||
|
||||
gcc -o genfilter build-scripts/gen_audio_resampler_filter.c -lm && ./genfilter > src/audio/SDL_audio_resampler_filter.h
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
SDL's resampler uses a "bandlimited interpolation" algorithm:
|
||||
@ -109,7 +109,7 @@ int main(void)
|
||||
printf(
|
||||
"/*\n"
|
||||
" Simple DirectMedia Layer\n"
|
||||
" Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
" Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>\n"
|
||||
"\n"
|
||||
" This software is provided 'as-is', without any express or implied\n"
|
||||
" warranty. In no event will the authors be held liable for any damages\n"
|
||||
@ -128,7 +128,7 @@ int main(void)
|
||||
" 3. This notice may not be removed or altered from any source distribution.\n"
|
||||
"*/\n"
|
||||
"\n"
|
||||
"/* DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_resampler_filter.c */\n"
|
||||
"// DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_resampler_filter.c\n"
|
||||
"\n"
|
||||
"#define RESAMPLER_ZERO_CROSSINGS %d\n"
|
||||
"#define RESAMPLER_BITS_PER_SAMPLE %d\n"
|
||||
|
@ -36,6 +36,10 @@ def main():
|
||||
if not header.exists():
|
||||
raise Exception("Couldn't find header %s" % header)
|
||||
|
||||
header_name = header.name
|
||||
if (header.name == "SDL_gamepad.h"):
|
||||
header_name = "SDL_gamecontroller.h"
|
||||
|
||||
header_text = header.read_text()
|
||||
|
||||
# Replace the symbols in source code
|
||||
@ -62,8 +66,8 @@ def main():
|
||||
oldname = args.args[i + 0]
|
||||
newname = args.args[i + 1]
|
||||
|
||||
add_symbol_to_oldnames(header.name, oldname, newname)
|
||||
add_symbol_to_migration(header.name, args.type, oldname, newname)
|
||||
add_symbol_to_oldnames(header_name, oldname, newname)
|
||||
add_symbol_to_migration(header_name, args.type, oldname, newname)
|
||||
add_symbol_to_coccinelle(args.type, oldname, newname)
|
||||
i += 2
|
||||
|
||||
|
@ -25,7 +25,7 @@ def main():
|
||||
|
||||
else:
|
||||
if len(args.args) < 3:
|
||||
print("Usage: %s oldname newname files_or_directories ..." % sys.argv[0])
|
||||
print("Usage: %s [--substring] oldname newname files_or_directories ..." % sys.argv[0])
|
||||
exit(1)
|
||||
|
||||
replacements = { args.args[0]: args.args[1] }
|
||||
|
@ -1090,7 +1090,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
||||
my $dent = $_;
|
||||
if ($dent =~ /\A(.*?)\.md\Z/) { # we only bridge Markdown files here.
|
||||
next if $1 eq 'FrontPage';
|
||||
filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\r\n");
|
||||
filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\n");
|
||||
}
|
||||
}
|
||||
closedir(DH);
|
||||
|
138
cmake/FindFFmpeg.cmake
Normal file
138
cmake/FindFFmpeg.cmake
Normal file
@ -0,0 +1,138 @@
|
||||
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
#
|
||||
# Once done this will define
|
||||
# FFMPEG_FOUND - System has the all required components.
|
||||
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
|
||||
#
|
||||
# For each of the components it will additionally set.
|
||||
# - AVCODEC
|
||||
# - AVDEVICE
|
||||
# - AVFORMAT
|
||||
# - AVFILTER
|
||||
# - AVUTIL
|
||||
# - POSTPROC
|
||||
# - SWSCALE
|
||||
# the following target will be defined
|
||||
# FFmpeg::SDL::<component> - link to this target to
|
||||
# the following variables will be defined
|
||||
# FFmpeg_<component>_FOUND - System has <component>
|
||||
# FFmpeg_<component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
|
||||
# FFmpeg_<component>_LIBRARIES - Link these to use <component>
|
||||
# FFmpeg_<component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# FFmpeg_<component>_VERSION - The components version
|
||||
#
|
||||
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
|
||||
# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
|
||||
# Copyright (c) 2023, Sam lantinga, <slouken@libsdl.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/PkgConfigHelper.cmake")
|
||||
|
||||
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
||||
if(NOT FFmpeg_FIND_COMPONENTS)
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
foreach(_component IN LISTS FFmpeg_FIND_COMPONENTS)
|
||||
set(FFmpeg_FIND_REQUIRED_${_component} TRUE)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
#
|
||||
### Macro: find_component
|
||||
#
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
|
||||
# include directories.
|
||||
#
|
||||
macro(find_component _component _pkgconfig _library _header)
|
||||
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_${_component} QUIET ${_pkgconfig})
|
||||
endif()
|
||||
|
||||
find_path(FFmpeg_${_component}_INCLUDE_DIRS
|
||||
NAMES ${_header}
|
||||
HINTS
|
||||
${PC_${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
ffmpeg
|
||||
)
|
||||
|
||||
find_library(FFmpeg_${_component}_LIBRARY
|
||||
NAMES ${_library}
|
||||
HINTS
|
||||
${PC_${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if(FFmpeg_${_component}_INCLUDE_DIRS AND FFmpeg_${_component}_LIBRARY)
|
||||
set(FFmpeg_${_component}_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(PC_${_component}_FOUND)
|
||||
get_flags_from_pkg_config("${FFmpeg_${_component}_LIBRARY}" "PC_${_component}" "${_component}")
|
||||
endif()
|
||||
|
||||
set(FFmpeg_${_component}_VERSION "${PC_${_component}_VERSION}")
|
||||
|
||||
set(FFmpeg_${_component}_COMPILE_OPTIONS "${${_component}_options}" CACHE STRING "Extra compile options of FFmpeg ${_component}")
|
||||
|
||||
set(FFmpeg_${_component}_LIBRARIES "${${_component}_link_libraries}" CACHE STRING "Extra link libraries of FFmpeg ${_component}")
|
||||
|
||||
set(FFmpeg_${_component}_LINK_OPTIONS "${${_component}_link_options}" CACHE STRING "Extra link flags of FFmpeg ${_component}")
|
||||
|
||||
set(FFmpeg_${_component}_LINK_DIRECTORIES "${${_component}_link_directories}" CACHE PATH "Extra link directories of FFmpeg ${_component}")
|
||||
|
||||
mark_as_advanced(
|
||||
FFmpeg_${_component}_INCLUDE_DIRS
|
||||
FFmpeg_${_component}_LIBRARY
|
||||
FFmpeg_${_component}_COMPILE_OPTIONS
|
||||
FFmpeg_${_component}_LIBRARIES
|
||||
FFmpeg_${_component}_LINK_OPTIONS
|
||||
FFmpeg_${_component}_LINK_DIRECTORIES
|
||||
)
|
||||
endmacro()
|
||||
|
||||
# Check for all possible component.
|
||||
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
|
||||
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
|
||||
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
|
||||
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
|
||||
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
|
||||
|
||||
# Compile the list of required vars
|
||||
set(_FFmpeg_REQUIRED_VARS)
|
||||
foreach(_component ${FFmpeg_FIND_COMPONENTS})
|
||||
list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_${_component}_INCLUDE_DIRS FFmpeg_${_component}_LIBRARY)
|
||||
endforeach ()
|
||||
|
||||
# Give a nice error message if some of the required vars are missing.
|
||||
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
|
||||
|
||||
set(FFMPEG_LIBRARIES)
|
||||
if(FFmpeg_FOUND)
|
||||
foreach(_component IN LISTS FFmpeg_FIND_COMPONENTS)
|
||||
if(FFmpeg_${_component}_FOUND)
|
||||
list(APPEND FFMPEG_LIBRARIES FFmpeg::SDL::${_component})
|
||||
if(NOT TARGET FFmpeg::SDL::${_component})
|
||||
add_library(FFmpeg::SDL::${_component} UNKNOWN IMPORTED)
|
||||
set_target_properties(FFmpeg::SDL::${_component} PROPERTIES
|
||||
IMPORTED_LOCATION "${FFmpeg_${_component}_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FFmpeg_${_component}_INCLUDE_DIRS}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FFmpeg_${_component}_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFmpeg_${_component}_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${FFmpeg_${_component}_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${FFmpeg_${_component}_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
@ -2,13 +2,11 @@
|
||||
|
||||
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
|
||||
set(_include_dirs ${_pc_prefix}_STATIC_INCLUDE_DIRS)
|
||||
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
||||
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
||||
else()
|
||||
set(_include_dirs ${_pc_prefix}_INCLUDE_DIRS)
|
||||
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
||||
@ -21,9 +19,6 @@ function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||
# Work around CMake's flag deduplication when pc files use `-framework A` instead of `-Wl,-framework,A`
|
||||
string(REPLACE "-framework;" "-Wl,-framework," "_filtered_link_options" "${${_link_options}}")
|
||||
|
||||
set(${_out_prefix}_include_dirs
|
||||
"${${_include_dirs}}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_compile_options
|
||||
"${${_cflags}}"
|
||||
PARENT_SCOPE)
|
||||
|
@ -48,6 +48,11 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ANDROID AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3jarTargets.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SDL3jarTargets.cmake")
|
||||
set(SDL3_Jar_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(SDL3_SDL3-shared_FOUND OR SDL3_SDL3-static_FOUND)
|
||||
set(SDL3_SDL3_FOUND TRUE)
|
||||
endif()
|
||||
|
10
cmake/SDL3jarTargets.cmake.in
Normal file
10
cmake/SDL3jarTargets.cmake.in
Normal file
@ -0,0 +1,10 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set_and_check(SDL3_JAR "@PACKAGE_SDL_INSTALL_JAVADIR@/SDL3/SDL3-@SDL3_VERSION@.jar")
|
||||
|
||||
if(NOT TARGET SDL3::Jar)
|
||||
add_library(SDL3::Jar INTERFACE IMPORTED)
|
||||
set_property(TARGET SDL3::Jar PROPERTY JAR_FILE "${SDL3_JAR}")
|
||||
endif()
|
||||
|
||||
unset(SDL3_JAR)
|
@ -82,16 +82,48 @@ if(APPLE)
|
||||
enable_language(OBJC)
|
||||
endif()
|
||||
|
||||
function(SDL_detect_linker)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.29)
|
||||
if(NOT DEFINED SDL_CMAKE_C_COMPILER_LINKER_ID)
|
||||
execute_process(COMMAND ${CMAKE_LINKER} -v OUTPUT_VARIABLE LINKER_OUTPUT ERROR_VARIABLE LINKER_OUTPUT)
|
||||
string(REGEX REPLACE "[\r\n]" " " LINKER_OUTPUT "${LINKER_OUTPUT}")
|
||||
if(LINKER_OUTPUT MATCHES ".*Microsoft.*")
|
||||
set(linker MSVC)
|
||||
else()
|
||||
set(linker GNUlike)
|
||||
endif()
|
||||
message(STATUS "Linker identification: ${linker}")
|
||||
set(SDL_CMAKE_C_COMPILER_LINKER_ID "${linker}" CACHE STRING "Linker identification")
|
||||
mark_as_advanced(SDL_CMAKE_C_COMPILER_LINKER_ID)
|
||||
endif()
|
||||
set(CMAKE_C_COMPILER_LINKER_ID "${SDL_CMAKE_C_COMPILER_LINKER_ID}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(check_linker_supports_version_file VAR)
|
||||
SDL_detect_linker()
|
||||
if(CMAKE_C_COMPILER_LINKER_ID MATCHES "^(MSVC)$")
|
||||
set(LINKER_SUPPORTS_VERSION_SCRIPT FALSE)
|
||||
else()
|
||||
cmake_push_check_state(RESET)
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.sym" "n_0 {\n global:\n func;\n local: *;\n};\n")
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/dummy.sym")
|
||||
check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" LINKER_SUPPORTS_VERSION_SCRIPT FAIL_REGEX "(unsupported|syntax error|unrecognized option)")
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
set(${VAR} "${LINKER_SUPPORTS_VERSION_SCRIPT}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.18)
|
||||
function(check_linker_flag LANG FLAG VAR)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS ${FLAG} )
|
||||
cmake_push_check_state(RESET)
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS ${FLAG})
|
||||
if(LANG STREQUAL "C")
|
||||
include(CheckCSourceCompiles)
|
||||
check_c_source_compiles("int main(int argc,char*argv[]){(void)argc;(void)argv;return 0;}" ${VAR} FAIL_REGEX "warning")
|
||||
check_c_source_compiles("int main(int argc,char*argv[]){(void)argc;(void)argv;return 0;}" ${VAR} FAIL_REGEX "(unsupported|syntax error)")
|
||||
elseif(LANG STREQUAL "CXX")
|
||||
include(CheckCXXSourceCompiles)
|
||||
check_cxx_source_compiles("int main(int argc,char*argv[]){(void)argc;(void)argv;return 0;}" ${VAR} FAIL_REGEX "warning")
|
||||
check_cxx_source_compiles("int main(int argc,char*argv[]){(void)argc;(void)argv;return 0;}" ${VAR} FAIL_REGEX "(unsupported|syntax error)")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported language: ${LANG}")
|
||||
endif()
|
||||
@ -169,3 +201,17 @@ function(SDL_PrintSummary)
|
||||
message(STATUS "")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(SDL_install_pdb TARGET DIRECTORY)
|
||||
get_property(type TARGET ${TARGET} PROPERTY TYPE)
|
||||
if(type MATCHES "^(SHARED_LIBRARY|EXECUTABLE)$")
|
||||
install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION "${DIRECTORY}" OPTIONAL)
|
||||
elseif(type STREQUAL "STATIC_LIBRARY")
|
||||
# FIXME: Use $<TARGET_COMPILE_PDB_FILE:${TARGET} once it becomes available (https://gitlab.kitware.com/cmake/cmake/-/issues/25244)
|
||||
if(CMAKE_GENERATOR MATCHES "^Visual Studio.*")
|
||||
install(CODE "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${DIRECTORY}\" TYPE FILE OPTIONAL FILES \"${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/${TARGET}.pdb\")")
|
||||
else()
|
||||
install(CODE "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${DIRECTORY}\" TYPE FILE OPTIONAL FILES \"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET}.dir/${TARGET}.pdb\")")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -162,7 +162,7 @@ endmacro()
|
||||
# - HAVE_SDL_LOADSO opt
|
||||
macro(CheckPulseAudio)
|
||||
if(SDL_PULSEAUDIO)
|
||||
set(PulseAudio_PKG_CONFIG_SPEC "libpulse>=5.0")
|
||||
set(PulseAudio_PKG_CONFIG_SPEC "libpulse>=0.9.15")
|
||||
pkg_check_modules(PC_PULSEAUDIO IMPORTED_TARGET ${PulseAudio_PKG_CONFIG_SPEC})
|
||||
if(PC_PULSEAUDIO_FOUND)
|
||||
set(HAVE_PULSEAUDIO TRUE)
|
||||
@ -307,7 +307,9 @@ macro(CheckX11)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/x11/*.c")
|
||||
set(SDL_VIDEO_DRIVER_X11 1)
|
||||
|
||||
# !!! FIXME: why is this disabled for Apple?
|
||||
# Note: Disabled on Apple because the dynamic mode backend for X11 doesn't
|
||||
# work properly on Apple during several issues like inconsistent paths
|
||||
# among platforms. See #6778 (https://github.com/libsdl-org/SDL/issues/6778)
|
||||
if(APPLE)
|
||||
set(SDL_X11_SHARED OFF)
|
||||
endif()
|
||||
@ -533,11 +535,6 @@ macro(CheckWayland)
|
||||
WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_SCANNER_CODE_MODE}" "${SDL3_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}")
|
||||
endforeach()
|
||||
|
||||
if(SDL_WAYLAND_QT_TOUCH)
|
||||
set(HAVE_WAYLAND_QT_TOUCH TRUE)
|
||||
set(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 1)
|
||||
endif()
|
||||
|
||||
if(SDL_WAYLAND_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||
message(WARNING "You must have SDL_LoadObject() support for dynamic Wayland loading")
|
||||
endif()
|
||||
@ -560,10 +557,10 @@ macro(CheckWayland)
|
||||
set(LibDecor_PKG_CONFIG_SPEC libdecor-0)
|
||||
pkg_check_modules(PC_LIBDECOR IMPORTED_TARGET ${LibDecor_PKG_CONFIG_SPEC})
|
||||
if(PC_LIBDECOR_FOUND)
|
||||
# Version 0.1.2 or higher is needed for suspended window state and statically linked min/max getters.
|
||||
if(PC_LIBDECOR_VERSION VERSION_GREATER_EQUAL "0.1.2")
|
||||
set(SDL_HAVE_LIBDECOR_VER_0_1_2 1)
|
||||
set(LibDecor_PKG_CONFIG_SPEC "libdecor-0>=0.1.2")
|
||||
# Version 0.2.0 or higher is needed for suspended window state and statically linked min/max getters.
|
||||
if(PC_LIBDECOR_VERSION VERSION_GREATER_EQUAL "0.2.0")
|
||||
set(SDL_HAVE_LIBDECOR_VER_0_2_0 1)
|
||||
set(LibDecor_PKG_CONFIG_SPEC "libdecor-0>=0.2.0")
|
||||
endif()
|
||||
set(HAVE_WAYLAND_LIBDECOR TRUE)
|
||||
set(HAVE_LIBDECOR_H 1)
|
||||
@ -1024,7 +1021,7 @@ macro(CheckHIDAPI)
|
||||
if(SDL_HIDAPI_LIBUSB)
|
||||
set(HAVE_LIBUSB FALSE)
|
||||
|
||||
set(LibUSB_PKG_CONFIG_SPEC libusb-1.0)
|
||||
set(LibUSB_PKG_CONFIG_SPEC libusb-1.0>=1.0.16)
|
||||
pkg_check_modules(PC_LIBUSB IMPORTED_TARGET ${LibUSB_PKG_CONFIG_SPEC})
|
||||
if(PC_LIBUSB_FOUND)
|
||||
cmake_push_check_state()
|
||||
|
@ -49,12 +49,12 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
|
||||
check_c_compiler_flag(-Wundef HAVE_GCC_WUNDEF)
|
||||
if(HAVE_GCC_WUNDEF)
|
||||
target_compile_options(${TARGET} PRIVATE "-Wundef")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wundef>")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-fno-strict-aliasing HAVE_GCC_NO_STRICT_ALIASING)
|
||||
if(HAVE_GCC_NO_STRICT_ALIASING)
|
||||
target_compile_options(${TARGET} PRIVATE "-fno-strict-aliasing")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-fno-strict-aliasing>")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wdocumentation HAVE_GCC_WDOCUMENTATION)
|
||||
@ -62,10 +62,10 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
if(SDL_WERROR)
|
||||
check_c_compiler_flag(-Werror=documentation HAVE_GCC_WERROR_DOCUMENTATION)
|
||||
if(HAVE_GCC_WERROR_DOCUMENTATION)
|
||||
target_compile_options(${TARGET} PRIVATE "-Werror=documentation")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Werror=documentation>")
|
||||
endif()
|
||||
endif()
|
||||
target_compile_options(${TARGET} PRIVATE "-Wdocumentation")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wdocumentation>")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wdocumentation-unknown-command HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND)
|
||||
@ -73,30 +73,30 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
if(SDL_WERROR)
|
||||
check_c_compiler_flag(-Werror=documentation-unknown-command HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
|
||||
if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
|
||||
target_compile_options(${TARGET} PRIVATE "-Werror=documentation-unknown-command")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Werror=documentation-unknown-command>")
|
||||
endif()
|
||||
endif()
|
||||
target_compile_options(${TARGET} PRIVATE "-Wdocumentation-unknown-command")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wdocumentation-unknown-command>")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-fcomment-block-commands=threadsafety HAVE_GCC_COMMENT_BLOCK_COMMANDS)
|
||||
if(HAVE_GCC_COMMENT_BLOCK_COMMANDS)
|
||||
target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=threadsafety")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-fcomment-block-commands=threadsafety>")
|
||||
else()
|
||||
check_c_compiler_flag(/clang:-fcomment-block-commands=threadsafety HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
|
||||
if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
|
||||
target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=threadsafety")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:/clang:-fcomment-block-commands=threadsafety>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW)
|
||||
if(HAVE_GCC_WSHADOW)
|
||||
target_compile_options(${TARGET} PRIVATE "-Wshadow")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wshadow>")
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wunused-local-typedefs HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
||||
if(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
||||
target_compile_options(${TARGET} PRIVATE "-Wno-unused-local-typedefs")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-unused-local-typedefs>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -109,7 +109,7 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
elseif(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QNX)
|
||||
check_c_compiler_flag(-Werror HAVE_WERROR)
|
||||
if(HAVE_WERROR)
|
||||
target_compile_options(${TARGET} PRIVATE "-Werror")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Werror>")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -117,12 +117,12 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
if(USE_CLANG)
|
||||
check_c_compiler_flag("-fcolor-diagnostics" COMPILER_SUPPORTS_FCOLOR_DIAGNOSTICS)
|
||||
if(COMPILER_SUPPORTS_FCOLOR_DIAGNOSTICS)
|
||||
target_compile_options(${TARGET} PRIVATE "-fcolor-diagnostics")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-fcolor-diagnostics>")
|
||||
endif()
|
||||
else()
|
||||
check_c_compiler_flag("-fdiagnostics-color=always" COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS)
|
||||
if(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS)
|
||||
target_compile_options(${TARGET} PRIVATE "-fdiagnostics-color=always")
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-fdiagnostics-color=always>")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -19,7 +19,7 @@ function(SDL_generate_manpages)
|
||||
endif()
|
||||
|
||||
if(NOT ARG_HEADERS_DIR)
|
||||
set(ARG_HEADERS_DIR "${PROJECT_SOURCE_DIR}/include/SDL3")
|
||||
message(FATAL_ERROR "Missing required HEADERS_DIR argument")
|
||||
endif()
|
||||
|
||||
# FIXME: get rid of SYMBOL and let the perl script figure out the dependencies
|
||||
|
@ -332,6 +332,9 @@ function(configure_sdl3_pc)
|
||||
endif()
|
||||
|
||||
# Calculate prefix relative to location of sdl3.pc
|
||||
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
file(RELATIVE_PATH SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/${SDL_PKGCONFIG_INSTALLDIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||
string(REGEX REPLACE "[/]+$" "" SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
set(SDL_PKGCONFIG_PREFIX "\${pcfiledir}/${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
|
@ -93,4 +93,8 @@ find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3)
|
||||
add_executable(gui-whatever WIN32 main_gui.c)
|
||||
target_link_libraries(gui-whatever PRIVATE SDL3::SDL3)
|
||||
|
||||
if(ANDROID)
|
||||
find_package(SDL3 REQUIRED CONFIG COMPONENTS Jar)
|
||||
endif()
|
||||
|
||||
feature_summary(WHAT ALL)
|
||||
|
@ -10,7 +10,7 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
|
||||
if (window == NULL) {
|
||||
if (!window) {
|
||||
SDL_Log("could not create window: %s\n", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,328 +1,328 @@
|
||||
# CMake
|
||||
|
||||
[www.cmake.org](https://www.cmake.org/)
|
||||
|
||||
The CMake build system is supported on the following platforms:
|
||||
|
||||
* FreeBSD
|
||||
* Linux
|
||||
* Microsoft Visual C
|
||||
* MinGW and Msys
|
||||
* macOS, iOS, and tvOS, with support for XCode
|
||||
* Android
|
||||
* Emscripten
|
||||
* FreeBSD
|
||||
* Haiku
|
||||
* Nintendo 3DS
|
||||
* Playstation 2
|
||||
* Playstation Vita
|
||||
* QNX 7.x/8.x
|
||||
* RiscOS
|
||||
|
||||
## Building SDL
|
||||
|
||||
Assuming the source tree of SDL is located at `~/sdl`,
|
||||
this will configure and build SDL in the `~/build` directory:
|
||||
```sh
|
||||
cmake -S ~/sdl -B ~/build
|
||||
cmake --build ~/build
|
||||
```
|
||||
|
||||
Installation can be done using:
|
||||
```sh
|
||||
cmake --install ~/build --prefix /usr/local # '--install' requires CMake 3.15, or newer
|
||||
```
|
||||
|
||||
This will install SDL to /usr/local.
|
||||
|
||||
### Building SDL tests
|
||||
|
||||
You can build the SDL test programs by adding `-DSDL_TESTS=ON` to the first cmake command above:
|
||||
```sh
|
||||
cmake -S ~/sdl -B ~/build -DSDL_TEST_LIBRARY=ON -DSDL_TESTS=ON
|
||||
```
|
||||
and then building normally. In this example, the test programs will be built and can be run from `~/build/tests/`.
|
||||
|
||||
## Including SDL in your project
|
||||
|
||||
SDL can be included in your project in 2 major ways:
|
||||
- using a system SDL library, provided by your (*nix) distribution or a package manager
|
||||
- using a vendored SDL library: this is SDL copied or symlinked in a subfolder.
|
||||
|
||||
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(mygame)
|
||||
|
||||
# Create an option to switch between a system sdl library and a vendored SDL library
|
||||
option(MYGAME_VENDORED "Use vendored libraries" OFF)
|
||||
|
||||
if(MYGAME_VENDORED)
|
||||
# This assumes you have added SDL as a submodule in vendored/SDL
|
||||
add_subdirectory(vendored/SDL EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
# 1. Look for a SDL3 package,
|
||||
# 2. look for the SDL3-shared component, and
|
||||
# 3. fail if the shared component cannot be found.
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
|
||||
endif()
|
||||
|
||||
# Create your game executable target as usual
|
||||
add_executable(mygame WIN32 mygame.c)
|
||||
|
||||
# Link to the actual SDL3 library.
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3)
|
||||
```
|
||||
|
||||
### A system SDL library
|
||||
|
||||
For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
|
||||
|
||||
The following components are available, to be used as an argument of `find_package`.
|
||||
|
||||
| Component name | Description |
|
||||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| SDL3-shared | The SDL3 shared library, available through the `SDL3::SDL3-shared` target |
|
||||
| SDL3-static | The SDL3 static library, available through the `SDL3::SDL3-static` target |
|
||||
| SDL3_test | The SDL3_test static library, available through the `SDL3::SDL3_test` target |
|
||||
| SDL3 | The SDL3 library, available through the `SDL3::SDL3` target. This is an alias of `SDL3::SDL3-shared` or `SDL3::SDL3-static`. This component is always available. |
|
||||
| Headers | The SDL3 headers, available through the `SDL3::Headers` target. This component is always available. |
|
||||
|
||||
|
||||
### Using a vendored SDL
|
||||
|
||||
This only requires a copy of SDL in a subdirectory + `add_subdirectory`.
|
||||
Alternatively, use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html).
|
||||
Depending on the configuration, the same targets as a system SDL package are available.
|
||||
|
||||
## CMake configuration options
|
||||
|
||||
### Build optimized library
|
||||
|
||||
By default, CMake provides 4 build types: `Debug`, `Release`, `RelWithDebInfo` and `MinSizeRel`.
|
||||
The main difference(s) between these are the optimization options and the generation of debug info.
|
||||
To configure SDL as an optimized `Release` library, configure SDL with:
|
||||
```sh
|
||||
cmake ~/SDL -DCMAKE_BUILD_TYPE=Release
|
||||
```
|
||||
To build it, run:
|
||||
```sh
|
||||
cmake --build . --config Release
|
||||
```
|
||||
|
||||
### Shared or static
|
||||
|
||||
By default, only a shared SDL library is built and installed.
|
||||
The options `-DSDL_SHARED=` and `-DSDL_STATIC=` accept boolean values to change this.
|
||||
|
||||
### Pass custom compile options to the compiler
|
||||
|
||||
- Use [`CMAKE_<LANG>_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html) to pass extra
|
||||
flags to the compiler.
|
||||
- Use [`CMAKE_EXE_LINKER_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_EXE_LINKER_FLAGS.html) to pass extra option to the linker for executables.
|
||||
- Use [`CMAKE_SHARED_LINKER_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_SHARED_LINKER_FLAGS.html) to pass extra options to the linker for shared libraries.
|
||||
|
||||
#### Examples
|
||||
|
||||
- build a SDL library optimized for (more) modern x64 microprocessor architectures.
|
||||
|
||||
With gcc or clang:
|
||||
```sh
|
||||
cmake ~/sdl -DCMAKE_C_FLAGS="-march=x86-64-v3" -DCMAKE_CXX_FLAGS="-march=x86-64-v3"
|
||||
```
|
||||
With Visual C:
|
||||
```sh
|
||||
cmake .. -DCMAKE_C_FLAGS="/ARCH:AVX2" -DCMAKE_CXX_FLAGS="/ARCH:AVX2"
|
||||
```
|
||||
|
||||
### iOS/tvOS
|
||||
|
||||
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
|
||||
using Xcode or Make, possibly among other build-systems.
|
||||
|
||||
When using a recent version of CMake (3.14+), it should be possible to:
|
||||
|
||||
- build SDL for iOS, both static and dynamic
|
||||
- build SDL test apps (as iOS/tvOS .app bundles)
|
||||
- generate a working SDL_build_config.h for iOS (using SDL_build_config.h.cmake as a basis)
|
||||
|
||||
To use, set the following CMake variables when running CMake's configuration stage:
|
||||
|
||||
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
|
||||
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
|
||||
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
|
||||
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
|
||||
|
||||
|
||||
#### Examples
|
||||
|
||||
- for iOS-Simulator, using the latest, installed SDK:
|
||||
|
||||
```bash
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
```
|
||||
|
||||
- for iOS-Device, using the latest, installed SDK, 64-bit only
|
||||
|
||||
```bash
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
```
|
||||
|
||||
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"
|
||||
```
|
||||
|
||||
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
```
|
||||
|
||||
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
```
|
||||
|
||||
- for tvOS-Simulator, using the latest, installed SDK:
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
```
|
||||
|
||||
- for tvOS-Device, using the latest, installed SDK:
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`
|
||||
```
|
||||
|
||||
- for QNX/aarch64, using the latest, installed SDK:
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_TOOLCHAIN_FILE=~/sdl/build-scripts/cmake-toolchain-qnx-aarch64le.cmake -DSDL_X11=0
|
||||
```
|
||||
|
||||
## SDL-specific CMake options
|
||||
|
||||
SDL can be customized through (platform-specific) CMake options.
|
||||
The following table shows generic options that are available for most platforms.
|
||||
At the end of SDL CMake configuration, a table shows all CMake options along with its detected value.
|
||||
|
||||
| CMake option | Valid values | Description |
|
||||
|-------------------------------|--------------|-----------------------------------------------------------------------------------------------------|
|
||||
| `-DSDL_SHARED=` | `ON`/`OFF` | Build SDL shared library (not all platforms support this) (`libSDL3.so`/`libSDL3.dylib`/`SDL3.dll`) |
|
||||
| `-DSDL_STATIC=` | `ON`/`OFF` | Build SDL static library (`libSDL3.a`/`SDL3-static.lib`) |
|
||||
| `-DSDL_TEST_LIBRARY=` | `ON`/`OFF` | Build SDL test library (`libSDL3_test.a`/`SDL3_test.lib`) |
|
||||
| `-DSDL_TESTS=` | `ON`/`OFF` | Build SDL test programs (**requires `-DSDL_TEST_LIBRARY=ON`**) |
|
||||
| `-DSDL_DISABLE_INSTALL=` | `ON`/`OFF` | Don't create a SDL install target |
|
||||
| `-DSDL_DISABLE_INSTALL_DOCS=` | `ON`/`OFF` | Don't install the SDL documentation |
|
||||
| `-DSDL_INSTALL_TESTS=` | `ON`/`OFF` | Install the SDL test programs |
|
||||
|
||||
## Help, it doesn't work!
|
||||
|
||||
Below, a SDL3 CMake project can be found that builds 99.9% of time (assuming you have internet connectivity).
|
||||
When you have a problem with building or using SDL, please modify it until it reproduces your issue.
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(sdl_issue)
|
||||
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# !!!!!! !!!!!!
|
||||
# !!!!!! This CMake script is not using "CMake best practices". !!!!!!
|
||||
# !!!!!! Don't use it in your project. !!!!!!
|
||||
# !!!!!! !!!!!!
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
# 1. Try system SDL3 package first
|
||||
find_package(SDL3 QUIET)
|
||||
if(SDL3_FOUND)
|
||||
message(STATUS "Using SDL3 via find_package")
|
||||
endif()
|
||||
|
||||
# 2. Try using a vendored SDL library
|
||||
if(NOT SDL3_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL/CMakeLists.txt")
|
||||
add_subdirectory(SDL)
|
||||
message(STATUS "Using SDL3 via add_subdirectory")
|
||||
set(SDL3_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
# 3. Download SDL, and use that.
|
||||
if(NOT SDL3_FOUND)
|
||||
include(FetchContent)
|
||||
set(SDL_SHARED TRUE CACHE BOOL "Build a SDL shared library (if available)")
|
||||
set(SDL_STATIC TRUE CACHE BOOL "Build a SDL static library (if available)")
|
||||
FetchContent_Declare(
|
||||
SDL
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG main # Replace this with a particular git tag or git hash
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
message(STATUS "Using SDL3 via FetchContent")
|
||||
FetchContent_MakeAvailable(SDL)
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_deps/sdl-src" PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||||
endif()
|
||||
|
||||
file(WRITE main.c [===========================================[
|
||||
/**
|
||||
* Modify this source such that it reproduces your problem.
|
||||
*/
|
||||
|
||||
/* START of source modifications */
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
|
||||
SDL_Log("SDL_Init failed (%s)", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDL_Window *window = NULL;
|
||||
SDL_Renderer *renderer = NULL;
|
||||
|
||||
if (SDL_CreateWindowAndRenderer(640, 480, 0, &window, &renderer) < 0) {
|
||||
SDL_Log("SDL_CreateWindowAndRenderer failed (%s)", SDL_GetError());
|
||||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
SDL_SetWindowTitle(window, "SDL issue");
|
||||
|
||||
while (1) {
|
||||
int finished = 0;
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_EVENT_QUIT) {
|
||||
finished = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (finished) {
|
||||
break;
|
||||
}
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 80, 80, 80, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(renderer);
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
SDL_DestroyRenderer(renderer);
|
||||
SDL_DestroyWindow(window);
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
/* END of source modifications */
|
||||
|
||||
]===========================================])
|
||||
|
||||
add_executable(sdl_issue main.c)
|
||||
|
||||
target_link_libraries(sdl_issue PRIVATE SDL3::SDL3)
|
||||
# target_link_libraries(sdl_issue PRIVATE SDL3::SDL3-shared)
|
||||
# target_link_libraries(sdl_issue PRIVATE SDL3::SDL3-static)
|
||||
```
|
||||
# CMake
|
||||
|
||||
[www.cmake.org](https://www.cmake.org/)
|
||||
|
||||
The CMake build system is supported on the following platforms:
|
||||
|
||||
* FreeBSD
|
||||
* Linux
|
||||
* Microsoft Visual C
|
||||
* MinGW and Msys
|
||||
* macOS, iOS, and tvOS, with support for XCode
|
||||
* Android
|
||||
* Emscripten
|
||||
* FreeBSD
|
||||
* Haiku
|
||||
* Nintendo 3DS
|
||||
* Playstation 2
|
||||
* Playstation Vita
|
||||
* QNX 7.x/8.x
|
||||
* RiscOS
|
||||
|
||||
## Building SDL
|
||||
|
||||
Assuming the source tree of SDL is located at `~/sdl`,
|
||||
this will configure and build SDL in the `~/build` directory:
|
||||
```sh
|
||||
cmake -S ~/sdl -B ~/build
|
||||
cmake --build ~/build
|
||||
```
|
||||
|
||||
Installation can be done using:
|
||||
```sh
|
||||
cmake --install ~/build --prefix /usr/local # '--install' requires CMake 3.15, or newer
|
||||
```
|
||||
|
||||
This will install SDL to /usr/local.
|
||||
|
||||
### Building SDL tests
|
||||
|
||||
You can build the SDL test programs by adding `-DSDL_TESTS=ON` to the first cmake command above:
|
||||
```sh
|
||||
cmake -S ~/sdl -B ~/build -DSDL_TEST_LIBRARY=ON -DSDL_TESTS=ON
|
||||
```
|
||||
and then building normally. In this example, the test programs will be built and can be run from `~/build/tests/`.
|
||||
|
||||
## Including SDL in your project
|
||||
|
||||
SDL can be included in your project in 2 major ways:
|
||||
- using a system SDL library, provided by your (*nix) distribution or a package manager
|
||||
- using a vendored SDL library: this is SDL copied or symlinked in a subfolder.
|
||||
|
||||
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(mygame)
|
||||
|
||||
# Create an option to switch between a system sdl library and a vendored SDL library
|
||||
option(MYGAME_VENDORED "Use vendored libraries" OFF)
|
||||
|
||||
if(MYGAME_VENDORED)
|
||||
# This assumes you have added SDL as a submodule in vendored/SDL
|
||||
add_subdirectory(vendored/SDL EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
# 1. Look for a SDL3 package,
|
||||
# 2. look for the SDL3-shared component, and
|
||||
# 3. fail if the shared component cannot be found.
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
|
||||
endif()
|
||||
|
||||
# Create your game executable target as usual
|
||||
add_executable(mygame WIN32 mygame.c)
|
||||
|
||||
# Link to the actual SDL3 library.
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3)
|
||||
```
|
||||
|
||||
### A system SDL library
|
||||
|
||||
For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
|
||||
|
||||
The following components are available, to be used as an argument of `find_package`.
|
||||
|
||||
| Component name | Description |
|
||||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| SDL3-shared | The SDL3 shared library, available through the `SDL3::SDL3-shared` target |
|
||||
| SDL3-static | The SDL3 static library, available through the `SDL3::SDL3-static` target |
|
||||
| SDL3_test | The SDL3_test static library, available through the `SDL3::SDL3_test` target |
|
||||
| SDL3 | The SDL3 library, available through the `SDL3::SDL3` target. This is an alias of `SDL3::SDL3-shared` or `SDL3::SDL3-static`. This component is always available. |
|
||||
| Headers | The SDL3 headers, available through the `SDL3::Headers` target. This component is always available. |
|
||||
|
||||
|
||||
### Using a vendored SDL
|
||||
|
||||
This only requires a copy of SDL in a subdirectory + `add_subdirectory`.
|
||||
Alternatively, use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html).
|
||||
Depending on the configuration, the same targets as a system SDL package are available.
|
||||
|
||||
## CMake configuration options
|
||||
|
||||
### Build optimized library
|
||||
|
||||
By default, CMake provides 4 build types: `Debug`, `Release`, `RelWithDebInfo` and `MinSizeRel`.
|
||||
The main difference(s) between these are the optimization options and the generation of debug info.
|
||||
To configure SDL as an optimized `Release` library, configure SDL with:
|
||||
```sh
|
||||
cmake ~/SDL -DCMAKE_BUILD_TYPE=Release
|
||||
```
|
||||
To build it, run:
|
||||
```sh
|
||||
cmake --build . --config Release
|
||||
```
|
||||
|
||||
### Shared or static
|
||||
|
||||
By default, only a shared SDL library is built and installed.
|
||||
The options `-DSDL_SHARED=` and `-DSDL_STATIC=` accept boolean values to change this.
|
||||
|
||||
### Pass custom compile options to the compiler
|
||||
|
||||
- Use [`CMAKE_<LANG>_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html) to pass extra
|
||||
flags to the compiler.
|
||||
- Use [`CMAKE_EXE_LINKER_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_EXE_LINKER_FLAGS.html) to pass extra option to the linker for executables.
|
||||
- Use [`CMAKE_SHARED_LINKER_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_SHARED_LINKER_FLAGS.html) to pass extra options to the linker for shared libraries.
|
||||
|
||||
#### Examples
|
||||
|
||||
- build a SDL library optimized for (more) modern x64 microprocessor architectures.
|
||||
|
||||
With gcc or clang:
|
||||
```sh
|
||||
cmake ~/sdl -DCMAKE_C_FLAGS="-march=x86-64-v3" -DCMAKE_CXX_FLAGS="-march=x86-64-v3"
|
||||
```
|
||||
With Visual C:
|
||||
```sh
|
||||
cmake .. -DCMAKE_C_FLAGS="/ARCH:AVX2" -DCMAKE_CXX_FLAGS="/ARCH:AVX2"
|
||||
```
|
||||
|
||||
### iOS/tvOS
|
||||
|
||||
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
|
||||
using Xcode or Make, possibly among other build-systems.
|
||||
|
||||
When using a recent version of CMake (3.14+), it should be possible to:
|
||||
|
||||
- build SDL for iOS, both static and dynamic
|
||||
- build SDL test apps (as iOS/tvOS .app bundles)
|
||||
- generate a working SDL_build_config.h for iOS (using SDL_build_config.h.cmake as a basis)
|
||||
|
||||
To use, set the following CMake variables when running CMake's configuration stage:
|
||||
|
||||
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
|
||||
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
|
||||
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
|
||||
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
|
||||
|
||||
|
||||
#### Examples
|
||||
|
||||
- for iOS-Simulator, using the latest, installed SDK:
|
||||
|
||||
```bash
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
```
|
||||
|
||||
- for iOS-Device, using the latest, installed SDK, 64-bit only
|
||||
|
||||
```bash
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
```
|
||||
|
||||
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"
|
||||
```
|
||||
|
||||
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
```
|
||||
|
||||
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
```
|
||||
|
||||
- for tvOS-Simulator, using the latest, installed SDK:
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
```
|
||||
|
||||
- for tvOS-Device, using the latest, installed SDK:
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`
|
||||
```
|
||||
|
||||
- for QNX/aarch64, using the latest, installed SDK:
|
||||
|
||||
```cmake
|
||||
cmake ~/sdl -DCMAKE_TOOLCHAIN_FILE=~/sdl/build-scripts/cmake-toolchain-qnx-aarch64le.cmake -DSDL_X11=0
|
||||
```
|
||||
|
||||
## SDL-specific CMake options
|
||||
|
||||
SDL can be customized through (platform-specific) CMake options.
|
||||
The following table shows generic options that are available for most platforms.
|
||||
At the end of SDL CMake configuration, a table shows all CMake options along with its detected value.
|
||||
|
||||
| CMake option | Valid values | Description |
|
||||
|-------------------------------|--------------|-----------------------------------------------------------------------------------------------------|
|
||||
| `-DSDL_SHARED=` | `ON`/`OFF` | Build SDL shared library (not all platforms support this) (`libSDL3.so`/`libSDL3.dylib`/`SDL3.dll`) |
|
||||
| `-DSDL_STATIC=` | `ON`/`OFF` | Build SDL static library (`libSDL3.a`/`SDL3-static.lib`) |
|
||||
| `-DSDL_TEST_LIBRARY=` | `ON`/`OFF` | Build SDL test library (`libSDL3_test.a`/`SDL3_test.lib`) |
|
||||
| `-DSDL_TESTS=` | `ON`/`OFF` | Build SDL test programs (**requires `-DSDL_TEST_LIBRARY=ON`**) |
|
||||
| `-DSDL_DISABLE_INSTALL=` | `ON`/`OFF` | Don't create a SDL install target |
|
||||
| `-DSDL_DISABLE_INSTALL_DOCS=` | `ON`/`OFF` | Don't install the SDL documentation |
|
||||
| `-DSDL_INSTALL_TESTS=` | `ON`/`OFF` | Install the SDL test programs |
|
||||
|
||||
## Help, it doesn't work!
|
||||
|
||||
Below, a SDL3 CMake project can be found that builds 99.9% of time (assuming you have internet connectivity).
|
||||
When you have a problem with building or using SDL, please modify it until it reproduces your issue.
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(sdl_issue)
|
||||
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# !!!!!! !!!!!!
|
||||
# !!!!!! This CMake script is not using "CMake best practices". !!!!!!
|
||||
# !!!!!! Don't use it in your project. !!!!!!
|
||||
# !!!!!! !!!!!!
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
# 1. Try system SDL3 package first
|
||||
find_package(SDL3 QUIET)
|
||||
if(SDL3_FOUND)
|
||||
message(STATUS "Using SDL3 via find_package")
|
||||
endif()
|
||||
|
||||
# 2. Try using a vendored SDL library
|
||||
if(NOT SDL3_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL/CMakeLists.txt")
|
||||
add_subdirectory(SDL)
|
||||
message(STATUS "Using SDL3 via add_subdirectory")
|
||||
set(SDL3_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
# 3. Download SDL, and use that.
|
||||
if(NOT SDL3_FOUND)
|
||||
include(FetchContent)
|
||||
set(SDL_SHARED TRUE CACHE BOOL "Build a SDL shared library (if available)")
|
||||
set(SDL_STATIC TRUE CACHE BOOL "Build a SDL static library (if available)")
|
||||
FetchContent_Declare(
|
||||
SDL
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG main # Replace this with a particular git tag or git hash
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
message(STATUS "Using SDL3 via FetchContent")
|
||||
FetchContent_MakeAvailable(SDL)
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_deps/sdl-src" PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||||
endif()
|
||||
|
||||
file(WRITE main.c [===========================================[
|
||||
/**
|
||||
* Modify this source such that it reproduces your problem.
|
||||
*/
|
||||
|
||||
/* START of source modifications */
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
|
||||
SDL_Log("SDL_Init failed (%s)", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDL_Window *window = NULL;
|
||||
SDL_Renderer *renderer = NULL;
|
||||
|
||||
if (SDL_CreateWindowAndRenderer(640, 480, 0, &window, &renderer) < 0) {
|
||||
SDL_Log("SDL_CreateWindowAndRenderer failed (%s)", SDL_GetError());
|
||||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
SDL_SetWindowTitle(window, "SDL issue");
|
||||
|
||||
while (1) {
|
||||
int finished = 0;
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_EVENT_QUIT) {
|
||||
finished = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (finished) {
|
||||
break;
|
||||
}
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 80, 80, 80, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(renderer);
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
SDL_DestroyRenderer(renderer);
|
||||
SDL_DestroyWindow(window);
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
/* END of source modifications */
|
||||
|
||||
]===========================================])
|
||||
|
||||
add_executable(sdl_issue main.c)
|
||||
|
||||
target_link_libraries(sdl_issue PRIVATE SDL3::SDL3)
|
||||
# target_link_libraries(sdl_issue PRIVATE SDL3::SDL3-shared)
|
||||
# target_link_libraries(sdl_issue PRIVATE SDL3::SDL3-static)
|
||||
```
|
||||
|
@ -1,97 +1,97 @@
|
||||
# Contributing to SDL
|
||||
|
||||
We appreciate your interest in contributing to SDL, this document will describe how to report bugs, contribute code or ideas or edit documentation.
|
||||
|
||||
**Table Of Contents**
|
||||
|
||||
- [Filing a GitHub issue](#filing-a-github-issue)
|
||||
- [Reporting a bug](#reporting-a-bug)
|
||||
- [Suggesting enhancements](#suggesting-enhancements)
|
||||
- [Contributing code](#contributing-code)
|
||||
- [Forking the project](#forking-the-project)
|
||||
- [Following the style guide](#following-the-style-guide)
|
||||
- [Running the tests](#running-the-tests)
|
||||
- [Opening a pull request](#opening-a-pull-request)
|
||||
- [Contributing to the documentation](#contributing-to-the-documentation)
|
||||
- [Editing a function documentation](#editing-a-function-documentation)
|
||||
- [Editing the wiki](#editing-the-wiki)
|
||||
|
||||
## Filing a GitHub issue
|
||||
|
||||
### Reporting a bug
|
||||
|
||||
If you think you have found a bug and would like to report it, here are the steps you should take:
|
||||
|
||||
- Before opening a new issue, ensure your bug has not already been reported on the [GitHub Issues page](https://github.com/libsdl-org/SDL/issues).
|
||||
- On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
|
||||
- Include details about your environment, such as your Operating System and SDL version.
|
||||
- If possible, provide a small example that reproduces your bug.
|
||||
|
||||
### Suggesting enhancements
|
||||
|
||||
If you want to suggest changes for the project, here are the steps you should take:
|
||||
|
||||
- Check if the suggestion has already been made on:
|
||||
- the [issue tracker](https://github.com/libsdl-org/SDL/issues);
|
||||
- the [discourse forum](https://discourse.libsdl.org/);
|
||||
- or if a [pull request](https://github.com/libsdl-org/SDL/pulls) already exists.
|
||||
- On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
|
||||
- Describe what change you would like to happen.
|
||||
|
||||
## Contributing code
|
||||
|
||||
This section will cover how the process of forking the project, making a change and opening a pull request.
|
||||
|
||||
### Forking the project
|
||||
|
||||
The first step consists in making a fork of the project, this is only necessary for the first contribution.
|
||||
|
||||
Head over to https://github.com/libsdl-org/SDL and click on the `Fork` button in the top right corner of your screen, you may leave the fields unchanged and click `Create Fork`.
|
||||
|
||||
You will be redirected to your fork of the repository, click the green `Code` button and copy the git clone link.
|
||||
|
||||
If you had already forked the repository, you may update it from the web page using the `Fetch upstream` button.
|
||||
|
||||
### Following the style guide
|
||||
|
||||
Code formatting is done using a custom `.clang-format` file, you can learn more about how to run it [here](https://clang.llvm.org/docs/ClangFormat.html).
|
||||
|
||||
Some legacy code may not be formatted, as such avoid formatting the whole file at once and only format around your changes.
|
||||
|
||||
For your commit message to be properly displayed on GitHub, it should contain:
|
||||
|
||||
- A short description of the commit of 50 characters or less on the first line.
|
||||
- If necessary, add a blank line followed by a long description, each line should be 72 characters or less.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
Fix crash in SDL_FooBar.
|
||||
|
||||
This addresses the issue #123456 by making sure Foo was successful
|
||||
before calling Bar.
|
||||
```
|
||||
|
||||
### Running the tests
|
||||
|
||||
Tests allow you to verify if your changes did not break any behaviour, here are the steps to follow:
|
||||
|
||||
- Before pushing, run the `testautomation` suite on your machine, there should be no more failing tests after your change than before.
|
||||
- After pushing to your fork, Continuous Integration (GitHub Actions) will ensure compilation and tests still pass on other systems.
|
||||
|
||||
### Opening a pull request
|
||||
|
||||
- Head over to your fork's GitHub page.
|
||||
- Click on the `Contribute` button and `Open Pull Request`.
|
||||
- Fill out the pull request template.
|
||||
- If any changes are requested, you can add new commits to your fork and they will be automatically added to the pull request.
|
||||
|
||||
## Contributing to the documentation
|
||||
|
||||
### Editing a function documentation
|
||||
|
||||
The wiki documentation for API functions is synchronised from the headers' doxygen comments. As such, all modifications to syntax; function parameters; return value; version; related functions should be done in the header directly.
|
||||
|
||||
### Editing the wiki
|
||||
|
||||
Other changes to the wiki should done directly from https://wiki.libsdl.org/ ... Just click the "edit" link at the bottom of any page!
|
||||
# Contributing to SDL
|
||||
|
||||
We appreciate your interest in contributing to SDL, this document will describe how to report bugs, contribute code or ideas or edit documentation.
|
||||
|
||||
**Table Of Contents**
|
||||
|
||||
- [Filing a GitHub issue](#filing-a-github-issue)
|
||||
- [Reporting a bug](#reporting-a-bug)
|
||||
- [Suggesting enhancements](#suggesting-enhancements)
|
||||
- [Contributing code](#contributing-code)
|
||||
- [Forking the project](#forking-the-project)
|
||||
- [Following the style guide](#following-the-style-guide)
|
||||
- [Running the tests](#running-the-tests)
|
||||
- [Opening a pull request](#opening-a-pull-request)
|
||||
- [Contributing to the documentation](#contributing-to-the-documentation)
|
||||
- [Editing a function documentation](#editing-a-function-documentation)
|
||||
- [Editing the wiki](#editing-the-wiki)
|
||||
|
||||
## Filing a GitHub issue
|
||||
|
||||
### Reporting a bug
|
||||
|
||||
If you think you have found a bug and would like to report it, here are the steps you should take:
|
||||
|
||||
- Before opening a new issue, ensure your bug has not already been reported on the [GitHub Issues page](https://github.com/libsdl-org/SDL/issues).
|
||||
- On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
|
||||
- Include details about your environment, such as your Operating System and SDL version.
|
||||
- If possible, provide a small example that reproduces your bug.
|
||||
|
||||
### Suggesting enhancements
|
||||
|
||||
If you want to suggest changes for the project, here are the steps you should take:
|
||||
|
||||
- Check if the suggestion has already been made on:
|
||||
- the [issue tracker](https://github.com/libsdl-org/SDL/issues);
|
||||
- the [discourse forum](https://discourse.libsdl.org/);
|
||||
- or if a [pull request](https://github.com/libsdl-org/SDL/pulls) already exists.
|
||||
- On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
|
||||
- Describe what change you would like to happen.
|
||||
|
||||
## Contributing code
|
||||
|
||||
This section will cover how the process of forking the project, making a change and opening a pull request.
|
||||
|
||||
### Forking the project
|
||||
|
||||
The first step consists in making a fork of the project, this is only necessary for the first contribution.
|
||||
|
||||
Head over to https://github.com/libsdl-org/SDL and click on the `Fork` button in the top right corner of your screen, you may leave the fields unchanged and click `Create Fork`.
|
||||
|
||||
You will be redirected to your fork of the repository, click the green `Code` button and copy the git clone link.
|
||||
|
||||
If you had already forked the repository, you may update it from the web page using the `Fetch upstream` button.
|
||||
|
||||
### Following the style guide
|
||||
|
||||
Code formatting is done using a custom `.clang-format` file, you can learn more about how to run it [here](https://clang.llvm.org/docs/ClangFormat.html).
|
||||
|
||||
Some legacy code may not be formatted, as such avoid formatting the whole file at once and only format around your changes.
|
||||
|
||||
For your commit message to be properly displayed on GitHub, it should contain:
|
||||
|
||||
- A short description of the commit of 50 characters or less on the first line.
|
||||
- If necessary, add a blank line followed by a long description, each line should be 72 characters or less.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
Fix crash in SDL_FooBar.
|
||||
|
||||
This addresses the issue #123456 by making sure Foo was successful
|
||||
before calling Bar.
|
||||
```
|
||||
|
||||
### Running the tests
|
||||
|
||||
Tests allow you to verify if your changes did not break any behaviour, here are the steps to follow:
|
||||
|
||||
- Before pushing, run the `testautomation` suite on your machine, there should be no more failing tests after your change than before.
|
||||
- After pushing to your fork, Continuous Integration (GitHub Actions) will ensure compilation and tests still pass on other systems.
|
||||
|
||||
### Opening a pull request
|
||||
|
||||
- Head over to your fork's GitHub page.
|
||||
- Click on the `Contribute` button and `Open Pull Request`.
|
||||
- Fill out the pull request template.
|
||||
- If any changes are requested, you can add new commits to your fork and they will be automatically added to the pull request.
|
||||
|
||||
## Contributing to the documentation
|
||||
|
||||
### Editing a function documentation
|
||||
|
||||
The wiki documentation for API functions is synchronised from the headers' doxygen comments. As such, all modifications to syntax; function parameters; return value; version; related functions should be done in the header directly.
|
||||
|
||||
### Editing the wiki
|
||||
|
||||
Other changes to the wiki should done directly from https://wiki.libsdl.org/ ... Just click the "edit" link at the bottom of any page!
|
||||
|
@ -1,138 +1,138 @@
|
||||
# Dynamic API
|
||||
|
||||
Originally posted on Ryan's Google+ account.
|
||||
|
||||
Background:
|
||||
|
||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL,
|
||||
but developers are shipping their own SDL with individual Steam games.
|
||||
These games might stop getting updates, but a newer SDL might be needed later.
|
||||
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
||||
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
||||
- Even if we replace the SDL in those games with a compatible one, that is to
|
||||
say, edit a developer's Steam depot (yuck!), there are developers that are
|
||||
statically linking SDL that we can't do this for. We can't even force the
|
||||
dynamic loader to ignore their SDL in this case, of course.
|
||||
- If you don't ship an SDL with the game in some form, people that disabled the
|
||||
Steam Runtime, or just tried to run the game from the command line instead of
|
||||
Steam might find themselves unable to run the game, due to a missing dependency.
|
||||
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
||||
generic Linux boxes that may or may not have SDL installed, you have to ship
|
||||
the library or risk a total failure to launch. So now, you might have to have
|
||||
a non-Steam build plus a Steam build (that is, one with and one without SDL
|
||||
included), which is inconvenient if you could have had one universal build
|
||||
that works everywhere.
|
||||
- We like the zlib license, but the biggest complaint from the open source
|
||||
community about the license change is the static linking. The LGPL forced this
|
||||
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
|
||||
concerned about the GNU freedoms found themselves solving the same problems:
|
||||
swapping in a newer SDL to an older game often times can save the day.
|
||||
Static linking stops this dead.
|
||||
|
||||
So here's what we did:
|
||||
|
||||
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
|
||||
now looks like:
|
||||
|
||||
```c
|
||||
UInt32 SDL_Init(Uint32 flags)
|
||||
{
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
```
|
||||
|
||||
Except that is all done with a bunch of macro magic so we don't have to maintain
|
||||
every one of these.
|
||||
|
||||
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
|
||||
SDL_Init() that you've been calling all this time. But at startup, it looks more
|
||||
like this:
|
||||
|
||||
```c
|
||||
Uint32 SDL_Init_DEFAULT(Uint32 flags)
|
||||
{
|
||||
SDL_InitDynamicAPI();
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
```
|
||||
|
||||
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
|
||||
pointers, which means that this `_DEFAULT` function never gets called again.
|
||||
First call to any SDL function sets the whole thing up.
|
||||
|
||||
So you might be asking, what was the value in that? Isn't this what the operating
|
||||
system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
||||
level of indirection, we can do things like this:
|
||||
|
||||
```bash
|
||||
export SDL3_DYNAMIC_API=/my/actual/libSDL3.so.0
|
||||
./MyGameThatIsStaticallyLinkedToSDL
|
||||
```
|
||||
|
||||
And now, this game that is statically linked to SDL, can still be overridden
|
||||
with a newer, or better, SDL. The statically linked one will only be used as
|
||||
far as calling into the jump table in this case. But in cases where no override
|
||||
is desired, the statically linked version will provide its own jump table,
|
||||
and everyone is happy.
|
||||
|
||||
So now:
|
||||
- Developers can statically link SDL, and users can still replace it.
|
||||
(We'd still rather you ship a shared library, though!)
|
||||
- Developers can ship an SDL with their game, Valve can override it for, say,
|
||||
new features on SteamOS, or distros can override it for their own needs,
|
||||
but it'll also just work in the default case.
|
||||
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
|
||||
and it'll do the right thing.
|
||||
- End users (and Valve) can update a game's SDL in almost any case,
|
||||
to keep abandoned games running on newer platforms.
|
||||
- Everyone develops with SDL exactly as they have been doing all along.
|
||||
Same headers, same ABI. Just get the latest version to enable this magic.
|
||||
|
||||
|
||||
A little more about SDL_InitDynamicAPI():
|
||||
|
||||
Internally, InitAPI does some locking to make sure everything waits until a
|
||||
single thread initializes everything (although even SDL_CreateThread() goes
|
||||
through here before spinning a thread, too), and then decides if it should use
|
||||
an external SDL library. If not, it sets up the jump table using the current
|
||||
SDL's function pointers (which might be statically linked into a program, or in
|
||||
a shared library of its own). If so, it loads that library and looks for and
|
||||
calls a single function:
|
||||
|
||||
```c
|
||||
SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
|
||||
```
|
||||
|
||||
That function takes a version number (more on that in a moment), the address of
|
||||
the jump table, and the size, in bytes, of the table.
|
||||
Now, we've got policy here: this table's layout never changes; new stuff gets
|
||||
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
||||
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
||||
bigger (say, SDL 3.0.4 is trying to load SDL 3.0.3), then we know to abort, but
|
||||
if it's smaller, we know we can provide the entire API that the caller needs.
|
||||
|
||||
The version variable is a failsafe switch.
|
||||
Right now it's always 1. This number changes when there are major API changes
|
||||
(so we know if the tablesize might be smaller, or entries in it have changed).
|
||||
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
|
||||
inconceivable to have a small dispatch library that only supplies this one
|
||||
function and loads different, otherwise-incompatible SDL libraries and has the
|
||||
right one initialize the jump table based on the version. For something that
|
||||
must generically catch lots of different versions of SDL over time, like the
|
||||
Steam Client, this isn't a bad option.
|
||||
|
||||
Finally, I'm sure some people are reading this and thinking,
|
||||
"I don't want that overhead in my project!"
|
||||
|
||||
To which I would point out that the extra function call through the jump table
|
||||
probably wouldn't even show up in a profile, but lucky you: this can all be
|
||||
disabled. You can build SDL without this if you absolutely must, but we would
|
||||
encourage you not to do that. However, on heavily locked down platforms like
|
||||
iOS, or maybe when debugging, it makes sense to disable it. The way this is
|
||||
designed in SDL, you just have to change one #define, and the entire system
|
||||
vaporizes out, and SDL functions exactly like it always did. Most of it is
|
||||
macro magic, so the system is contained to one C file and a few headers.
|
||||
However, this is on by default and you have to edit a header file to turn it
|
||||
off. Our hopes is that if we make it easy to disable, but not too easy,
|
||||
everyone will ultimately be able to get what they want, but we've gently
|
||||
nudged everyone towards what we think is the best solution.
|
||||
# Dynamic API
|
||||
|
||||
Originally posted on Ryan's Google+ account.
|
||||
|
||||
Background:
|
||||
|
||||
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL,
|
||||
but developers are shipping their own SDL with individual Steam games.
|
||||
These games might stop getting updates, but a newer SDL might be needed later.
|
||||
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
|
||||
ever needed, and these fixes won't make it to a game shipping its own SDL.
|
||||
- Even if we replace the SDL in those games with a compatible one, that is to
|
||||
say, edit a developer's Steam depot (yuck!), there are developers that are
|
||||
statically linking SDL that we can't do this for. We can't even force the
|
||||
dynamic loader to ignore their SDL in this case, of course.
|
||||
- If you don't ship an SDL with the game in some form, people that disabled the
|
||||
Steam Runtime, or just tried to run the game from the command line instead of
|
||||
Steam might find themselves unable to run the game, due to a missing dependency.
|
||||
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
|
||||
generic Linux boxes that may or may not have SDL installed, you have to ship
|
||||
the library or risk a total failure to launch. So now, you might have to have
|
||||
a non-Steam build plus a Steam build (that is, one with and one without SDL
|
||||
included), which is inconvenient if you could have had one universal build
|
||||
that works everywhere.
|
||||
- We like the zlib license, but the biggest complaint from the open source
|
||||
community about the license change is the static linking. The LGPL forced this
|
||||
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
|
||||
concerned about the GNU freedoms found themselves solving the same problems:
|
||||
swapping in a newer SDL to an older game often times can save the day.
|
||||
Static linking stops this dead.
|
||||
|
||||
So here's what we did:
|
||||
|
||||
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
|
||||
now looks like:
|
||||
|
||||
```c
|
||||
UInt32 SDL_Init(Uint32 flags)
|
||||
{
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
```
|
||||
|
||||
Except that is all done with a bunch of macro magic so we don't have to maintain
|
||||
every one of these.
|
||||
|
||||
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
|
||||
SDL_Init() that you've been calling all this time. But at startup, it looks more
|
||||
like this:
|
||||
|
||||
```c
|
||||
Uint32 SDL_Init_DEFAULT(Uint32 flags)
|
||||
{
|
||||
SDL_InitDynamicAPI();
|
||||
return jump_table.SDL_Init(flags);
|
||||
}
|
||||
```
|
||||
|
||||
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
|
||||
pointers, which means that this `_DEFAULT` function never gets called again.
|
||||
First call to any SDL function sets the whole thing up.
|
||||
|
||||
So you might be asking, what was the value in that? Isn't this what the operating
|
||||
system's dynamic loader was supposed to do for us? Yes, but now we've got this
|
||||
level of indirection, we can do things like this:
|
||||
|
||||
```bash
|
||||
export SDL3_DYNAMIC_API=/my/actual/libSDL3.so.0
|
||||
./MyGameThatIsStaticallyLinkedToSDL
|
||||
```
|
||||
|
||||
And now, this game that is statically linked to SDL, can still be overridden
|
||||
with a newer, or better, SDL. The statically linked one will only be used as
|
||||
far as calling into the jump table in this case. But in cases where no override
|
||||
is desired, the statically linked version will provide its own jump table,
|
||||
and everyone is happy.
|
||||
|
||||
So now:
|
||||
- Developers can statically link SDL, and users can still replace it.
|
||||
(We'd still rather you ship a shared library, though!)
|
||||
- Developers can ship an SDL with their game, Valve can override it for, say,
|
||||
new features on SteamOS, or distros can override it for their own needs,
|
||||
but it'll also just work in the default case.
|
||||
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
|
||||
and it'll do the right thing.
|
||||
- End users (and Valve) can update a game's SDL in almost any case,
|
||||
to keep abandoned games running on newer platforms.
|
||||
- Everyone develops with SDL exactly as they have been doing all along.
|
||||
Same headers, same ABI. Just get the latest version to enable this magic.
|
||||
|
||||
|
||||
A little more about SDL_InitDynamicAPI():
|
||||
|
||||
Internally, InitAPI does some locking to make sure everything waits until a
|
||||
single thread initializes everything (although even SDL_CreateThread() goes
|
||||
through here before spinning a thread, too), and then decides if it should use
|
||||
an external SDL library. If not, it sets up the jump table using the current
|
||||
SDL's function pointers (which might be statically linked into a program, or in
|
||||
a shared library of its own). If so, it loads that library and looks for and
|
||||
calls a single function:
|
||||
|
||||
```c
|
||||
SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
|
||||
```
|
||||
|
||||
That function takes a version number (more on that in a moment), the address of
|
||||
the jump table, and the size, in bytes, of the table.
|
||||
Now, we've got policy here: this table's layout never changes; new stuff gets
|
||||
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
|
||||
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
|
||||
bigger (say, SDL 3.0.4 is trying to load SDL 3.0.3), then we know to abort, but
|
||||
if it's smaller, we know we can provide the entire API that the caller needs.
|
||||
|
||||
The version variable is a failsafe switch.
|
||||
Right now it's always 1. This number changes when there are major API changes
|
||||
(so we know if the tablesize might be smaller, or entries in it have changed).
|
||||
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
|
||||
inconceivable to have a small dispatch library that only supplies this one
|
||||
function and loads different, otherwise-incompatible SDL libraries and has the
|
||||
right one initialize the jump table based on the version. For something that
|
||||
must generically catch lots of different versions of SDL over time, like the
|
||||
Steam Client, this isn't a bad option.
|
||||
|
||||
Finally, I'm sure some people are reading this and thinking,
|
||||
"I don't want that overhead in my project!"
|
||||
|
||||
To which I would point out that the extra function call through the jump table
|
||||
probably wouldn't even show up in a profile, but lucky you: this can all be
|
||||
disabled. You can build SDL without this if you absolutely must, but we would
|
||||
encourage you not to do that. However, on heavily locked down platforms like
|
||||
iOS, or maybe when debugging, it makes sense to disable it. The way this is
|
||||
designed in SDL, you just have to change one #define, and the entire system
|
||||
vaporizes out, and SDL functions exactly like it always did. Most of it is
|
||||
macro magic, so the system is contained to one C file and a few headers.
|
||||
However, this is on by default and you have to edit a header file to turn it
|
||||
off. Our hopes is that if we make it easy to disable, but not too easy,
|
||||
everyone will ultimately be able to get what they want, but we've gently
|
||||
nudged everyone towards what we think is the best solution.
|
||||
|
@ -1,365 +1,365 @@
|
||||
# Emscripten
|
||||
|
||||
## The state of things
|
||||
|
||||
(As of September 2023, but things move quickly and we don't update this
|
||||
document often.)
|
||||
|
||||
In modern times, all the browsers you probably care about (Chrome, Firefox,
|
||||
Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some
|
||||
reasonable base configurations:
|
||||
|
||||
- WebAssembly (don't bother with asm.js any more)
|
||||
- WebGL (which will look like OpenGL ES 2 or 3 to your app).
|
||||
- Threads (see caveats, though!)
|
||||
- Game controllers
|
||||
- Autoupdating (so you can assume they have a recent version of the browser)
|
||||
|
||||
All this to say we're at the point where you don't have to make a lot of
|
||||
concessions to get even a fairly complex SDL-based game up and running.
|
||||
|
||||
|
||||
## RTFM
|
||||
|
||||
This document is a quick rundown of some high-level details. The
|
||||
documentation at [emscripten.org](https://emscripten.org/) is vast
|
||||
and extremely detailed for a wide variety of topics, and you should at
|
||||
least skim through it at some point.
|
||||
|
||||
|
||||
## Porting your app to Emscripten
|
||||
|
||||
Many many things just need some simple adjustments and they'll compile
|
||||
like any other C/C++ code, as long as SDL was handling the platform-specific
|
||||
work for your program.
|
||||
|
||||
First, you probably need this in at least one of your source files:
|
||||
|
||||
```c
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
```
|
||||
|
||||
Second: assembly language code has to go. Replace it with C. You can even use
|
||||
[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)!
|
||||
|
||||
Third: Middleware has to go. If you have a third-party library you link
|
||||
against, you either need an Emscripten port of it, or the source code to it
|
||||
to compile yourself, or you need to remove it.
|
||||
|
||||
Fourth: You still start in a function called main(), but you need to get out of
|
||||
it and into a function that gets called repeatedly, and returns quickly,
|
||||
called a mainloop.
|
||||
|
||||
Somewhere in your program, you probably have something that looks like a more
|
||||
complicated version of this:
|
||||
|
||||
```c
|
||||
void main(void)
|
||||
{
|
||||
initialize_the_game();
|
||||
while (game_is_still_running) {
|
||||
check_for_new_input();
|
||||
think_about_stuff();
|
||||
draw_the_next_frame();
|
||||
}
|
||||
deinitialize_the_game();
|
||||
}
|
||||
```
|
||||
|
||||
This will not work on Emscripten, because the main thread needs to be free
|
||||
to do stuff and can't sit in this loop forever. So Emscripten lets you set up
|
||||
a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop).
|
||||
|
||||
```c
|
||||
static void mainloop(void) /* this will run often, possibly at the monitor's refresh rate */
|
||||
{
|
||||
if (!game_is_still_running) {
|
||||
deinitialize_the_game();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
check_for_new_input();
|
||||
think_about_stuff();
|
||||
draw_the_next_frame();
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
initialize_the_game();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_set_main_loop(mainloop, 0, 1);
|
||||
#else
|
||||
while (1) { mainloop(); }
|
||||
#endif
|
||||
}
|
||||
```
|
||||
|
||||
Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run
|
||||
`mainloop` over and over until I end the program." The function will
|
||||
run, and return, freeing the main thread for other tasks, and then
|
||||
run again when it's time. The `1` parameter does some magic to make
|
||||
your main() function end immediately; this is useful because you
|
||||
don't want any shutdown code that might be sitting below this code
|
||||
to actually run if main() were to continue on, since we're just
|
||||
getting started.
|
||||
|
||||
There's a lot of little details that are beyond the scope of this
|
||||
document, but that's the biggest intial set of hurdles to porting
|
||||
your app to the web.
|
||||
|
||||
|
||||
## Do you need threads?
|
||||
|
||||
If you plan to use threads, they work on all major browsers now. HOWEVER,
|
||||
they bring with them a lot of careful considerations. Rendering _must_
|
||||
be done on the main thread. This is a general guideline for many
|
||||
platforms, but a hard requirement on the web.
|
||||
|
||||
Many other things also must happen on the main thread; often times SDL
|
||||
and Emscripten make efforts to "proxy" work to the main thread that
|
||||
must be there, but you have to be careful (and read more detailed
|
||||
documentation than this for the finer points).
|
||||
|
||||
Even when using threads, your main thread needs to set an Emscripten
|
||||
mainloop that runs quickly and returns, or things will fail to work
|
||||
correctly.
|
||||
|
||||
You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html)
|
||||
for all the finer points. Mostly SDL's thread API will work as expected,
|
||||
but is built on pthreads, so it shares the same little incompatibilities
|
||||
that are documented there, such as where you can use a mutex, and when
|
||||
a thread will start running, etc.
|
||||
|
||||
|
||||
IMPORTANT: You have to decide to either build something that uses
|
||||
threads or something that doesn't; you can't have one build
|
||||
that works everywhere. This is an Emscripten (or maybe WebAssembly?
|
||||
Or just web browsers in general?) limitation. If you aren't using
|
||||
threads, it's easier to not enable them at all, at build time.
|
||||
|
||||
If you use threads, you _have to_ run from a web server that has
|
||||
[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/)
|
||||
or your program will fail to start at all.
|
||||
|
||||
If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined
|
||||
for checking with the C preprocessor, so you can build something
|
||||
different depending on what sort of build you're compiling.
|
||||
|
||||
|
||||
## Audio
|
||||
|
||||
Audio works as expected at the API level, but not exactly like other
|
||||
platforms.
|
||||
|
||||
You'll only see a single default audio device. Audio capture also works;
|
||||
if the browser pops up a prompt to ask for permission to access the
|
||||
microphone, the SDL_OpenAudioDevice call will succeed and start producing
|
||||
silence at a regular interval. Once the user approves the request, real
|
||||
audio data will flow. If the user denies it, the app is not informed and
|
||||
will just continue to receive silence.
|
||||
|
||||
Modern web browsers will not permit web pages to produce sound before the
|
||||
user has interacted with them (clicked or tapped on them, usually); this is
|
||||
for several reasons, not the least of which being that no one likes when a
|
||||
random browser tab suddenly starts making noise and the user has to scramble
|
||||
to figure out which and silence it.
|
||||
|
||||
SDL will allow you to open the audio device for playback in this
|
||||
circumstance, and your audio callback will fire, but SDL will throw the audio
|
||||
data away until the user interacts with the page. This helps apps that depend
|
||||
on the audio callback to make progress, and also keeps audio playback in sync
|
||||
once the app is finally allowed to make noise.
|
||||
|
||||
There are two reasonable ways to deal with the silence at the app level:
|
||||
if you are writing some sort of media player thing, where the user expects
|
||||
there to be a volume control when you mouseover the canvas, just default
|
||||
that control to a muted state; if the user clicks on the control to unmute
|
||||
it, on this first click, open the audio device. This allows the media to
|
||||
play at start, and the user can reasonably opt-in to listening.
|
||||
|
||||
Many games do not have this sort of UI, and are more rigid about starting
|
||||
audio along with everything else at the start of the process. For these, your
|
||||
best bet is to write a little Javascript that puts up a "Click here to play!"
|
||||
UI, and upon the user clicking, remove that UI and then call the Emscripten
|
||||
app's main() function. As far as the application knows, the audio device was
|
||||
available to be opened as soon as the program started, and since this magic
|
||||
happens in a little Javascript, you don't have to change your C/C++ code at
|
||||
all to make it happen.
|
||||
|
||||
Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385
|
||||
for some Javascript code to steal for this approach.
|
||||
|
||||
|
||||
## Rendering
|
||||
|
||||
If you use SDL's 2D render API, it will use GLES2 internally, which
|
||||
Emscripten will turn into WebGL calls. You can also use OpenGL ES 2
|
||||
directly by creating a GL context and drawing into it.
|
||||
|
||||
Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
|
||||
present anything on the screen until your return from your mainloop
|
||||
function.
|
||||
|
||||
|
||||
## Building SDL/emscripten
|
||||
|
||||
First: do you _really_ need to build SDL from source?
|
||||
|
||||
If you aren't developing SDL itself, have a desire to mess with its source
|
||||
code, or need something on the bleeding edge, don't build SDL. Just use
|
||||
Emscripten's packaged version!
|
||||
|
||||
Compile and link your app with `-sUSE_SDL=2` and it'll use a build of
|
||||
SDL packaged with Emscripten. This comes from the same source code and
|
||||
fixes the Emscripten project makes to SDL are generally merged into SDL's
|
||||
revision control, so often this is much easier for app developers.
|
||||
|
||||
`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL
|
||||
1.2 instead; if you need SDL 1.2, this might be fine, but we generally
|
||||
recommend you don't use SDL 1.2 in modern times.
|
||||
|
||||
|
||||
If you want to build SDL, though...
|
||||
|
||||
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
|
||||
are likely to work, as well.
|
||||
|
||||
|
||||
Build:
|
||||
|
||||
This works on Linux/Unix and macOS. Please send comments about Windows.
|
||||
|
||||
Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html)
|
||||
first, and run `source emsdk_env.sh` at the command line so it finds the
|
||||
tools.
|
||||
|
||||
(These cmake options might be overkill, but this has worked for me.)
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake ..
|
||||
# you can also do `emcmake cmake -G Ninja ..` and then use `ninja` instead of this command.
|
||||
emmake make -j4
|
||||
```
|
||||
|
||||
If you want to build with thread support, something like this works:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake -DSDL_THREADS=On ..
|
||||
# you can also do `emcmake cmake -G Ninja ..` and then use `ninja` instead of this command.
|
||||
emmake make -j4
|
||||
```
|
||||
|
||||
To build the tests, add `-DSDL_TESTS=On` to the `emcmake cmake` command line.
|
||||
|
||||
|
||||
## Building your app
|
||||
|
||||
You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but
|
||||
mostly it uses the same command line arguments as Clang.
|
||||
|
||||
Link against the SDL/build/libSDL3.a file you generated by building SDL,
|
||||
link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build.
|
||||
|
||||
Usually you would produce a binary like this:
|
||||
|
||||
```bash
|
||||
gcc -o mygame mygame.c # or whatever
|
||||
```
|
||||
|
||||
But for Emscripten, you want to output something else:
|
||||
|
||||
```bash
|
||||
emcc -o index.html mygame.c
|
||||
```
|
||||
|
||||
This will produce several files...support Javascript and WebAssembly (.wasm)
|
||||
files. The `-o index.html` will produce a simple HTML page that loads and
|
||||
runs your app. You will (probably) eventually want to replace or customize
|
||||
that file and do `-o index.js` instead to just build the code pieces.
|
||||
|
||||
If you're working on a program of any serious size, you'll likely need to
|
||||
link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access
|
||||
to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb`
|
||||
or the app will fail to start on iOS browsers, but this might be a bug that
|
||||
goes away in the future.
|
||||
|
||||
|
||||
## Data files
|
||||
|
||||
Your game probably has data files. Here's how to access them.
|
||||
|
||||
Filesystem access works like a Unix filesystem; you have a single directory
|
||||
tree, possibly interpolated from several mounted locations, no drive letters,
|
||||
'/' for a path separator. You can access them with standard file APIs like
|
||||
open() or fopen() or SDL_RWops. You can read or write from the filesystem.
|
||||
|
||||
By default, you probably have a "MEMFS" filesystem (all files are stored in
|
||||
memory, but access to them is immediate and doesn't need to block). There are
|
||||
other options, like "IDBFS" (files are stored in a local database, so they
|
||||
don't need to be in RAM all the time and they can persist between runs of the
|
||||
program, but access is not synchronous). You can mix and match these file
|
||||
systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc,
|
||||
but that's beyond the scope of this document. Please refer to Emscripten's
|
||||
[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html)
|
||||
for more info.
|
||||
|
||||
The _easiest_ (but not the best) way to get at your data files is to embed
|
||||
them in the app itself. Emscripten's linker has support for automating this.
|
||||
|
||||
```bash
|
||||
emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav
|
||||
```
|
||||
|
||||
This will pack ../test/sample.wav in your app, and make it available at
|
||||
"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available
|
||||
before your main() function runs, and since it's in MEMFS, you can just
|
||||
read it like you do on other platforms. `--embed-file` can also accept a
|
||||
directory to pack an entire tree, and you can specify the argument multiple
|
||||
times to pack unrelated things into the final installation.
|
||||
|
||||
Note that this is absolutely the best approach if you have a few small
|
||||
files to include and shouldn't worry about the issue further. However, if you
|
||||
have hundreds of megabytes and/or thousands of files, this is not so great,
|
||||
since the user will download it all every time they load your page, and it
|
||||
all has to live in memory at runtime.
|
||||
|
||||
[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
|
||||
gives other options and details, and is worth a read.
|
||||
|
||||
|
||||
## Debugging
|
||||
|
||||
Debugging web apps is a mixed bag. You should compile and link with
|
||||
`-gsource-map`, which embeds a ton of source-level debugging information into
|
||||
the build, and make sure _the app source code is available on the web server_,
|
||||
which is often a scary proposition for various reasons.
|
||||
|
||||
When you debug from the browser's tools and hit a breakpoint, you can step
|
||||
through the actual C/C++ source code, though, which can be nice.
|
||||
|
||||
If you try debugging in Firefox and it doesn't work well for no apparent
|
||||
reason, try Chrome, and vice-versa. These tools are still relatively new,
|
||||
and improving all the time.
|
||||
|
||||
SDL_Log() (or even plain old printf) will write to the Javascript console,
|
||||
and honestly I find printf-style debugging to be easier than setting up a build
|
||||
for proper debugging, so use whatever tools work best for you.
|
||||
|
||||
|
||||
## Questions?
|
||||
|
||||
Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues).
|
||||
If something is wrong or unclear, we want to know!
|
||||
|
||||
|
||||
|
||||
# Emscripten
|
||||
|
||||
## The state of things
|
||||
|
||||
(As of September 2023, but things move quickly and we don't update this
|
||||
document often.)
|
||||
|
||||
In modern times, all the browsers you probably care about (Chrome, Firefox,
|
||||
Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some
|
||||
reasonable base configurations:
|
||||
|
||||
- WebAssembly (don't bother with asm.js any more)
|
||||
- WebGL (which will look like OpenGL ES 2 or 3 to your app).
|
||||
- Threads (see caveats, though!)
|
||||
- Game controllers
|
||||
- Autoupdating (so you can assume they have a recent version of the browser)
|
||||
|
||||
All this to say we're at the point where you don't have to make a lot of
|
||||
concessions to get even a fairly complex SDL-based game up and running.
|
||||
|
||||
|
||||
## RTFM
|
||||
|
||||
This document is a quick rundown of some high-level details. The
|
||||
documentation at [emscripten.org](https://emscripten.org/) is vast
|
||||
and extremely detailed for a wide variety of topics, and you should at
|
||||
least skim through it at some point.
|
||||
|
||||
|
||||
## Porting your app to Emscripten
|
||||
|
||||
Many many things just need some simple adjustments and they'll compile
|
||||
like any other C/C++ code, as long as SDL was handling the platform-specific
|
||||
work for your program.
|
||||
|
||||
First, you probably need this in at least one of your source files:
|
||||
|
||||
```c
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
```
|
||||
|
||||
Second: assembly language code has to go. Replace it with C. You can even use
|
||||
[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)!
|
||||
|
||||
Third: Middleware has to go. If you have a third-party library you link
|
||||
against, you either need an Emscripten port of it, or the source code to it
|
||||
to compile yourself, or you need to remove it.
|
||||
|
||||
Fourth: You still start in a function called main(), but you need to get out of
|
||||
it and into a function that gets called repeatedly, and returns quickly,
|
||||
called a mainloop.
|
||||
|
||||
Somewhere in your program, you probably have something that looks like a more
|
||||
complicated version of this:
|
||||
|
||||
```c
|
||||
void main(void)
|
||||
{
|
||||
initialize_the_game();
|
||||
while (game_is_still_running) {
|
||||
check_for_new_input();
|
||||
think_about_stuff();
|
||||
draw_the_next_frame();
|
||||
}
|
||||
deinitialize_the_game();
|
||||
}
|
||||
```
|
||||
|
||||
This will not work on Emscripten, because the main thread needs to be free
|
||||
to do stuff and can't sit in this loop forever. So Emscripten lets you set up
|
||||
a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop).
|
||||
|
||||
```c
|
||||
static void mainloop(void) /* this will run often, possibly at the monitor's refresh rate */
|
||||
{
|
||||
if (!game_is_still_running) {
|
||||
deinitialize_the_game();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
check_for_new_input();
|
||||
think_about_stuff();
|
||||
draw_the_next_frame();
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
initialize_the_game();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_set_main_loop(mainloop, 0, 1);
|
||||
#else
|
||||
while (1) { mainloop(); }
|
||||
#endif
|
||||
}
|
||||
```
|
||||
|
||||
Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run
|
||||
`mainloop` over and over until I end the program." The function will
|
||||
run, and return, freeing the main thread for other tasks, and then
|
||||
run again when it's time. The `1` parameter does some magic to make
|
||||
your main() function end immediately; this is useful because you
|
||||
don't want any shutdown code that might be sitting below this code
|
||||
to actually run if main() were to continue on, since we're just
|
||||
getting started.
|
||||
|
||||
There's a lot of little details that are beyond the scope of this
|
||||
document, but that's the biggest intial set of hurdles to porting
|
||||
your app to the web.
|
||||
|
||||
|
||||
## Do you need threads?
|
||||
|
||||
If you plan to use threads, they work on all major browsers now. HOWEVER,
|
||||
they bring with them a lot of careful considerations. Rendering _must_
|
||||
be done on the main thread. This is a general guideline for many
|
||||
platforms, but a hard requirement on the web.
|
||||
|
||||
Many other things also must happen on the main thread; often times SDL
|
||||
and Emscripten make efforts to "proxy" work to the main thread that
|
||||
must be there, but you have to be careful (and read more detailed
|
||||
documentation than this for the finer points).
|
||||
|
||||
Even when using threads, your main thread needs to set an Emscripten
|
||||
mainloop that runs quickly and returns, or things will fail to work
|
||||
correctly.
|
||||
|
||||
You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html)
|
||||
for all the finer points. Mostly SDL's thread API will work as expected,
|
||||
but is built on pthreads, so it shares the same little incompatibilities
|
||||
that are documented there, such as where you can use a mutex, and when
|
||||
a thread will start running, etc.
|
||||
|
||||
|
||||
IMPORTANT: You have to decide to either build something that uses
|
||||
threads or something that doesn't; you can't have one build
|
||||
that works everywhere. This is an Emscripten (or maybe WebAssembly?
|
||||
Or just web browsers in general?) limitation. If you aren't using
|
||||
threads, it's easier to not enable them at all, at build time.
|
||||
|
||||
If you use threads, you _have to_ run from a web server that has
|
||||
[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/)
|
||||
or your program will fail to start at all.
|
||||
|
||||
If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined
|
||||
for checking with the C preprocessor, so you can build something
|
||||
different depending on what sort of build you're compiling.
|
||||
|
||||
|
||||
## Audio
|
||||
|
||||
Audio works as expected at the API level, but not exactly like other
|
||||
platforms.
|
||||
|
||||
You'll only see a single default audio device. Audio capture also works;
|
||||
if the browser pops up a prompt to ask for permission to access the
|
||||
microphone, the SDL_OpenAudioDevice call will succeed and start producing
|
||||
silence at a regular interval. Once the user approves the request, real
|
||||
audio data will flow. If the user denies it, the app is not informed and
|
||||
will just continue to receive silence.
|
||||
|
||||
Modern web browsers will not permit web pages to produce sound before the
|
||||
user has interacted with them (clicked or tapped on them, usually); this is
|
||||
for several reasons, not the least of which being that no one likes when a
|
||||
random browser tab suddenly starts making noise and the user has to scramble
|
||||
to figure out which and silence it.
|
||||
|
||||
SDL will allow you to open the audio device for playback in this
|
||||
circumstance, and your audio callback will fire, but SDL will throw the audio
|
||||
data away until the user interacts with the page. This helps apps that depend
|
||||
on the audio callback to make progress, and also keeps audio playback in sync
|
||||
once the app is finally allowed to make noise.
|
||||
|
||||
There are two reasonable ways to deal with the silence at the app level:
|
||||
if you are writing some sort of media player thing, where the user expects
|
||||
there to be a volume control when you mouseover the canvas, just default
|
||||
that control to a muted state; if the user clicks on the control to unmute
|
||||
it, on this first click, open the audio device. This allows the media to
|
||||
play at start, and the user can reasonably opt-in to listening.
|
||||
|
||||
Many games do not have this sort of UI, and are more rigid about starting
|
||||
audio along with everything else at the start of the process. For these, your
|
||||
best bet is to write a little Javascript that puts up a "Click here to play!"
|
||||
UI, and upon the user clicking, remove that UI and then call the Emscripten
|
||||
app's main() function. As far as the application knows, the audio device was
|
||||
available to be opened as soon as the program started, and since this magic
|
||||
happens in a little Javascript, you don't have to change your C/C++ code at
|
||||
all to make it happen.
|
||||
|
||||
Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385
|
||||
for some Javascript code to steal for this approach.
|
||||
|
||||
|
||||
## Rendering
|
||||
|
||||
If you use SDL's 2D render API, it will use GLES2 internally, which
|
||||
Emscripten will turn into WebGL calls. You can also use OpenGL ES 2
|
||||
directly by creating a GL context and drawing into it.
|
||||
|
||||
Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
|
||||
present anything on the screen until your return from your mainloop
|
||||
function.
|
||||
|
||||
|
||||
## Building SDL/emscripten
|
||||
|
||||
First: do you _really_ need to build SDL from source?
|
||||
|
||||
If you aren't developing SDL itself, have a desire to mess with its source
|
||||
code, or need something on the bleeding edge, don't build SDL. Just use
|
||||
Emscripten's packaged version!
|
||||
|
||||
Compile and link your app with `-sUSE_SDL=2` and it'll use a build of
|
||||
SDL packaged with Emscripten. This comes from the same source code and
|
||||
fixes the Emscripten project makes to SDL are generally merged into SDL's
|
||||
revision control, so often this is much easier for app developers.
|
||||
|
||||
`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL
|
||||
1.2 instead; if you need SDL 1.2, this might be fine, but we generally
|
||||
recommend you don't use SDL 1.2 in modern times.
|
||||
|
||||
|
||||
If you want to build SDL, though...
|
||||
|
||||
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
|
||||
are likely to work, as well.
|
||||
|
||||
|
||||
Build:
|
||||
|
||||
This works on Linux/Unix and macOS. Please send comments about Windows.
|
||||
|
||||
Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html)
|
||||
first, and run `source emsdk_env.sh` at the command line so it finds the
|
||||
tools.
|
||||
|
||||
(These cmake options might be overkill, but this has worked for me.)
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake ..
|
||||
# you can also do `emcmake cmake -G Ninja ..` and then use `ninja` instead of this command.
|
||||
emmake make -j4
|
||||
```
|
||||
|
||||
If you want to build with thread support, something like this works:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake -DSDL_THREADS=On ..
|
||||
# you can also do `emcmake cmake -G Ninja ..` and then use `ninja` instead of this command.
|
||||
emmake make -j4
|
||||
```
|
||||
|
||||
To build the tests, add `-DSDL_TESTS=On` to the `emcmake cmake` command line.
|
||||
|
||||
|
||||
## Building your app
|
||||
|
||||
You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but
|
||||
mostly it uses the same command line arguments as Clang.
|
||||
|
||||
Link against the SDL/build/libSDL3.a file you generated by building SDL,
|
||||
link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build.
|
||||
|
||||
Usually you would produce a binary like this:
|
||||
|
||||
```bash
|
||||
gcc -o mygame mygame.c # or whatever
|
||||
```
|
||||
|
||||
But for Emscripten, you want to output something else:
|
||||
|
||||
```bash
|
||||
emcc -o index.html mygame.c
|
||||
```
|
||||
|
||||
This will produce several files...support Javascript and WebAssembly (.wasm)
|
||||
files. The `-o index.html` will produce a simple HTML page that loads and
|
||||
runs your app. You will (probably) eventually want to replace or customize
|
||||
that file and do `-o index.js` instead to just build the code pieces.
|
||||
|
||||
If you're working on a program of any serious size, you'll likely need to
|
||||
link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access
|
||||
to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb`
|
||||
or the app will fail to start on iOS browsers, but this might be a bug that
|
||||
goes away in the future.
|
||||
|
||||
|
||||
## Data files
|
||||
|
||||
Your game probably has data files. Here's how to access them.
|
||||
|
||||
Filesystem access works like a Unix filesystem; you have a single directory
|
||||
tree, possibly interpolated from several mounted locations, no drive letters,
|
||||
'/' for a path separator. You can access them with standard file APIs like
|
||||
open() or fopen() or SDL_RWops. You can read or write from the filesystem.
|
||||
|
||||
By default, you probably have a "MEMFS" filesystem (all files are stored in
|
||||
memory, but access to them is immediate and doesn't need to block). There are
|
||||
other options, like "IDBFS" (files are stored in a local database, so they
|
||||
don't need to be in RAM all the time and they can persist between runs of the
|
||||
program, but access is not synchronous). You can mix and match these file
|
||||
systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc,
|
||||
but that's beyond the scope of this document. Please refer to Emscripten's
|
||||
[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html)
|
||||
for more info.
|
||||
|
||||
The _easiest_ (but not the best) way to get at your data files is to embed
|
||||
them in the app itself. Emscripten's linker has support for automating this.
|
||||
|
||||
```bash
|
||||
emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav
|
||||
```
|
||||
|
||||
This will pack ../test/sample.wav in your app, and make it available at
|
||||
"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available
|
||||
before your main() function runs, and since it's in MEMFS, you can just
|
||||
read it like you do on other platforms. `--embed-file` can also accept a
|
||||
directory to pack an entire tree, and you can specify the argument multiple
|
||||
times to pack unrelated things into the final installation.
|
||||
|
||||
Note that this is absolutely the best approach if you have a few small
|
||||
files to include and shouldn't worry about the issue further. However, if you
|
||||
have hundreds of megabytes and/or thousands of files, this is not so great,
|
||||
since the user will download it all every time they load your page, and it
|
||||
all has to live in memory at runtime.
|
||||
|
||||
[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
|
||||
gives other options and details, and is worth a read.
|
||||
|
||||
|
||||
## Debugging
|
||||
|
||||
Debugging web apps is a mixed bag. You should compile and link with
|
||||
`-gsource-map`, which embeds a ton of source-level debugging information into
|
||||
the build, and make sure _the app source code is available on the web server_,
|
||||
which is often a scary proposition for various reasons.
|
||||
|
||||
When you debug from the browser's tools and hit a breakpoint, you can step
|
||||
through the actual C/C++ source code, though, which can be nice.
|
||||
|
||||
If you try debugging in Firefox and it doesn't work well for no apparent
|
||||
reason, try Chrome, and vice-versa. These tools are still relatively new,
|
||||
and improving all the time.
|
||||
|
||||
SDL_Log() (or even plain old printf) will write to the Javascript console,
|
||||
and honestly I find printf-style debugging to be easier than setting up a build
|
||||
for proper debugging, so use whatever tools work best for you.
|
||||
|
||||
|
||||
## Questions?
|
||||
|
||||
Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues).
|
||||
If something is wrong or unclear, we want to know!
|
||||
|
||||
|
||||
|
||||
|
@ -1,159 +1,174 @@
|
||||
GDK
|
||||
=====
|
||||
|
||||
This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
|
||||
|
||||
Windows (GDK) and Xbox One/Xbox Series (GDKX) are supported. Although most of the Xbox code is included in the public SDL source code, NDA access is required for a small number of source files. If you have access to GDKX, these required Xbox files are posted on the GDK forums [here](https://forums.xboxlive.com/questions/130003/).
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested)
|
||||
* Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022))
|
||||
* To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work.
|
||||
|
||||
|
||||
Windows GDK Status
|
||||
------
|
||||
|
||||
The Windows GDK port supports the full set of Win32 APIs, renderers, controllers, input devices, etc., as the normal Windows x64 build of SDL.
|
||||
|
||||
* Additionally, the GDK port adds the following:
|
||||
* Compile-time platform detection for SDL programs. The `__GDK__` is `#define`d on every GDK platform, and the `__WINGDK__` is `#define`d on Windows GDK, specifically. (This distinction exists because other GDK platforms support a smaller subset of functionality. This allows you to mark code for "any" GDK separate from Windows GDK.)
|
||||
* GDK-specific setup:
|
||||
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
|
||||
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
|
||||
|
||||
* An implementation on `WinMain` that performs the above GDK setup that you can use by #include'ing SDL_main.h in the source file that includes your standard main() function. If you are unable to do this, you can instead manually call `SDL_RunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. To use `SDL_RunApp`, `#define SDL_MAIN_HANDLED` before `#include <SDL3/SDL_main.h>`.
|
||||
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
|
||||
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
|
||||
|
||||
* Single-player games have some additional features available:
|
||||
* Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
|
||||
* `SDL_GetPrefPath` still works, but only for single-player titles.
|
||||
|
||||
These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!
|
||||
|
||||
* What doesn't work:
|
||||
* Compilation with anything other than through the included Visual C++ solution file
|
||||
|
||||
## VisualC-GDK Solution
|
||||
|
||||
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
|
||||
|
||||
* SDL3 (DLL) - This is the typical SDL3.dll, but for Gaming.Desktop.x64.
|
||||
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
|
||||
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
|
||||
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
|
||||
* tests/testsprite - Standard SDL test program demonstrating sprite drawing functionality.
|
||||
|
||||
If you set one of the test programs as a startup project, you can run it directly from Visual Studio.
|
||||
|
||||
Windows GDK Setup, Detailed Steps
|
||||
---------------------
|
||||
|
||||
These steps assume you already have a game using SDL that runs on Windows x64 along with a corresponding Visual Studio solution file for the x64 version. If you don't have this, it's easiest to use one of the test program vcxproj files in the `VisualC-GDK` directory as a starting point, though you will still need to do most of the steps below.
|
||||
|
||||
### 1. Add a Gaming.Desktop.x64 Configuration ###
|
||||
|
||||
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
|
||||
|
||||
### 2. Build SDL3 for GDK ###
|
||||
|
||||
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL3 target for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL3.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), and `SDL3.lib` output files for your game project.
|
||||
|
||||
*Alternatively*, you could setup your solution file to instead reference the SDL3 project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL3 would be built when your game is built.
|
||||
|
||||
### 3. Configuring Project Settings ###
|
||||
|
||||
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
|
||||
|
||||
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
|
||||
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL3.lib are
|
||||
* Under Linker > Input > Additional Dependencies, you need the following:
|
||||
* `SDL3.lib`
|
||||
* `xgameruntime.lib`
|
||||
* `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib`
|
||||
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
|
||||
|
||||
### 4. Setting up SDL_main ###
|
||||
|
||||
Rather than using your own implementation of `WinMain`, it's recommended that you instead `#include <SDL3/SDL_main.h>` and declare a standard main function. If you are unable to do this, you can instead manually call `SDL_RunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters; in that case `#define SDL_MAIN_HANDLED` before including SDL_main.h
|
||||
|
||||
### 5. Required DLLs ###
|
||||
|
||||
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
|
||||
|
||||
* Your SDL3.dll
|
||||
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll"
|
||||
* XCurl.dll
|
||||
|
||||
You can either copy these in a post-build step, or you can add the dlls into the project and set its Configuration Properties > General > Item type to "Copy file," which will also copy them into the output directory.
|
||||
|
||||
### 6. Setting up MicrosoftGame.config ###
|
||||
|
||||
You can copy `VisualC-GDK/tests/testgdk/MicrosoftGame.config` and use that as a starting point in your project. Minimally, you will want to change the Executable Name attribute, the DefaultDisplayName, and the Description.
|
||||
|
||||
This file must be copied into the same directory as the game's .exe file. As with the DLLs, you can either use a post-build step or the "Copy file" item type.
|
||||
|
||||
For basic testing, you do not need to change anything else in `MicrosoftGame.config`. However, if you want to test any Xbox Live services (such as logging in users) _or_ publish a package, you will need to setup a Game app on Partner Center.
|
||||
|
||||
Then, you need to set the following values to the values from Partner Center:
|
||||
|
||||
* Identity tag - Name and Publisher attributes
|
||||
* TitleId
|
||||
* MSAAppId
|
||||
|
||||
### 7. Adding Required Logos
|
||||
|
||||
Several logo PNG files are required to be able to launch the game, even from the debugger. You can use the sample logos provided in `VisualC-GDK/logos`. As with the other files, they must be copied into the same directory as the game's .exe file.
|
||||
|
||||
|
||||
### 8. Copying any Data Files ###
|
||||
|
||||
When debugging GDK games, there is no way to specify a working directory. Therefore, any required game data must also be copied into the output directory, likely in a post-build step.
|
||||
|
||||
|
||||
### 9. Build and Run from Visual Studio ###
|
||||
|
||||
At this point, you should be able to build and run your game from the Visual Studio Debugger. If you get any linker errors, make sure you double-check that you referenced all the required libs.
|
||||
|
||||
If you are testing Xbox Live functionality, it's likely you will need to change to the Sandbox for your title. To do this:
|
||||
|
||||
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
||||
2. Switch the sandbox name with:
|
||||
`XblPCSandbox SANDBOX.#`
|
||||
3. (To switch back to the retail sandbox):
|
||||
`XblPCSandbox RETAIL`
|
||||
|
||||
### 10. Packaging and Installing Locally
|
||||
|
||||
You can use one of the test program's `PackageLayout.xml` as a starting point. Minimally, you will need to change the exe to the correct name and also reference any required game data. As with the other data files, it's easiest if you have this copy to the output directory, although it's not a requirement as you can specify relative paths to files.
|
||||
|
||||
To create the package:
|
||||
|
||||
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
||||
2. `cd` to the directory containing the `PackageLayout.xml` with the correct paths (if you use the local path as in the sample package layout, this would be from your .exe output directory)
|
||||
3. `mkdir Package` to create an output directory
|
||||
4. To package the file into the `Package` directory, use:
|
||||
`makepkg pack /f PackageLayout.xml /lt /d . /nogameos /pc /pd Package`
|
||||
5. To install the package, use:
|
||||
`wdapp install PACKAGENAME.msixvc`
|
||||
6. Once the package is installed, you can run it from the start menu.
|
||||
7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox.
|
||||
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
#### Xbox Live Login does not work
|
||||
|
||||
As of June 2022 GDK, you must have a valid Title Id and MSAAppId in order to test Xbox Live functionality such as user login. Make sure these are set correctly in the `MicrosoftGame.config`. This means that even testgdk will not let you login without setting these properties to valid values.
|
||||
|
||||
Furthermore, confirm that your PC is set to the correct sandbox.
|
||||
|
||||
|
||||
#### "The current user has already installed an unpackaged version of this app. A packaged version cannot replace this." error when installing
|
||||
|
||||
Prior to June 2022 GDK, running from the Visual Studio debugger would still locally register the app (and it would appear on the start menu). To fix this, you have to uninstall it (it's simplest to right click on it from the start menu to uninstall it).
|
||||
GDK
|
||||
=====
|
||||
|
||||
This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
|
||||
|
||||
Windows (GDK) and Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested)
|
||||
* Microsoft GDK October 2023 Update 1 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/October_2023_Update_1))
|
||||
* For Xbox, you will need the corresponding GDKX version (licensed developers only)
|
||||
* To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the test identifiers used by the GDK test programs in the included solution work.
|
||||
|
||||
|
||||
Windows GDK Status
|
||||
------
|
||||
|
||||
The Windows GDK port supports the full set of Win32 APIs, renderers, controllers, input devices, etc., as the normal Windows x64 build of SDL.
|
||||
|
||||
* Additionally, the GDK port adds the following:
|
||||
* Compile-time platform detection for SDL programs. The `__GDK__` is `#define`d on every GDK platform, and the `__WINGDK__` is `#define`d on Windows GDK, specifically. (This distinction exists because other GDK platforms support a smaller subset of functionality. This allows you to mark code for "any" GDK separate from Windows GDK.)
|
||||
* GDK-specific setup:
|
||||
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
|
||||
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
|
||||
|
||||
* An implementation on `WinMain` that performs the above GDK setup that you can use by #include'ing SDL_main.h in the source file that includes your standard main() function. If you are unable to do this, you can instead manually call `SDL_RunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. To use `SDL_RunApp`, `#define SDL_MAIN_HANDLED` before `#include <SDL3/SDL_main.h>`.
|
||||
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
|
||||
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
|
||||
|
||||
* Single-player games have some additional features available:
|
||||
* Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
|
||||
* `SDL_GetPrefPath` still works, but only for single-player titles.
|
||||
|
||||
These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!
|
||||
|
||||
* What doesn't work:
|
||||
* Compilation with anything other than through the included Visual C++ solution file
|
||||
|
||||
## VisualC-GDK Solution
|
||||
|
||||
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
|
||||
|
||||
* SDL3 (DLL) - This is the typical SDL3.dll, but for Gaming.Desktop.x64.
|
||||
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
|
||||
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
|
||||
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
|
||||
* tests/testsprite - Standard SDL test program demonstrating sprite drawing functionality.
|
||||
|
||||
If you set one of the test programs as a startup project, you can run it directly from Visual Studio.
|
||||
|
||||
Windows GDK Setup, Detailed Steps
|
||||
---------------------
|
||||
|
||||
These steps assume you already have a game using SDL that runs on Windows x64 along with a corresponding Visual Studio solution file for the x64 version. If you don't have this, it's easiest to use one of the test program vcxproj files in the `VisualC-GDK` directory as a starting point, though you will still need to do most of the steps below.
|
||||
|
||||
### 1. Add a Gaming.Desktop.x64 Configuration ###
|
||||
|
||||
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
|
||||
|
||||
### 2. Build SDL3 for GDK ###
|
||||
|
||||
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL3 target for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL3.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), and `SDL3.lib` output files for your game project.
|
||||
|
||||
*Alternatively*, you could setup your solution file to instead reference the SDL3 project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL3 would be built when your game is built.
|
||||
|
||||
### 3. Configuring Project Settings ###
|
||||
|
||||
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
|
||||
|
||||
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
|
||||
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL3.lib are
|
||||
* Under Linker > Input > Additional Dependencies, you need the following:
|
||||
* `SDL3.lib`
|
||||
* `xgameruntime.lib`
|
||||
* `../Microsoft.Xbox.Services.GDK.C.Thunks.lib`
|
||||
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
|
||||
|
||||
### 4. Setting up SDL_main ###
|
||||
|
||||
Rather than using your own implementation of `WinMain`, it's recommended that you instead `#include <SDL3/SDL_main.h>` and declare a standard main function. If you are unable to do this, you can instead manually call `SDL_RunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters; in that case `#define SDL_MAIN_HANDLED` before including SDL_main.h
|
||||
|
||||
### 5. Required DLLs ###
|
||||
|
||||
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
|
||||
|
||||
* Your SDL3.dll
|
||||
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll"
|
||||
* XCurl.dll
|
||||
|
||||
You can either copy these in a post-build step, or you can add the dlls into the project and set its Configuration Properties > General > Item type to "Copy file," which will also copy them into the output directory.
|
||||
|
||||
### 6. Setting up MicrosoftGame.config ###
|
||||
|
||||
You can copy `VisualC-GDK/tests/testgdk/MicrosoftGame.config` and use that as a starting point in your project. Minimally, you will want to change the Executable Name attribute, the DefaultDisplayName, and the Description.
|
||||
|
||||
This file must be copied into the same directory as the game's .exe file. As with the DLLs, you can either use a post-build step or the "Copy file" item type.
|
||||
|
||||
For basic testing, you do not need to change anything else in `MicrosoftGame.config`. However, if you want to test any Xbox Live services (such as logging in users) _or_ publish a package, you will need to setup a Game app on Partner Center.
|
||||
|
||||
Then, you need to set the following values to the values from Partner Center:
|
||||
|
||||
* Identity tag - Name and Publisher attributes
|
||||
* TitleId
|
||||
* MSAAppId
|
||||
|
||||
### 7. Adding Required Logos
|
||||
|
||||
Several logo PNG files are required to be able to launch the game, even from the debugger. You can use the sample logos provided in `VisualC-GDK/logos`. As with the other files, they must be copied into the same directory as the game's .exe file.
|
||||
|
||||
|
||||
### 8. Copying any Data Files ###
|
||||
|
||||
When debugging GDK games, there is no way to specify a working directory. Therefore, any required game data must also be copied into the output directory, likely in a post-build step.
|
||||
|
||||
|
||||
### 9. Build and Run from Visual Studio ###
|
||||
|
||||
At this point, you should be able to build and run your game from the Visual Studio Debugger. If you get any linker errors, make sure you double-check that you referenced all the required libs.
|
||||
|
||||
If you are testing Xbox Live functionality, it's likely you will need to change to the Sandbox for your title. To do this:
|
||||
|
||||
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
||||
2. Switch the sandbox name with:
|
||||
`XblPCSandbox SANDBOX.#`
|
||||
3. (To switch back to the retail sandbox):
|
||||
`XblPCSandbox RETAIL`
|
||||
|
||||
### 10. Packaging and Installing Locally
|
||||
|
||||
You can use one of the test program's `PackageLayout.xml` as a starting point. Minimally, you will need to change the exe to the correct name and also reference any required game data. As with the other data files, it's easiest if you have this copy to the output directory, although it's not a requirement as you can specify relative paths to files.
|
||||
|
||||
To create the package:
|
||||
|
||||
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
|
||||
2. `cd` to the directory containing the `PackageLayout.xml` with the correct paths (if you use the local path as in the sample package layout, this would be from your .exe output directory)
|
||||
3. `mkdir Package` to create an output directory
|
||||
4. To package the file into the `Package` directory, use:
|
||||
`makepkg pack /f PackageLayout.xml /lt /d . /nogameos /pc /pd Package`
|
||||
5. To install the package, use:
|
||||
`wdapp install PACKAGENAME.msixvc`
|
||||
6. Once the package is installed, you can run it from the start menu.
|
||||
7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox.
|
||||
|
||||
Xbox GDKX Setup
|
||||
---------------------
|
||||
In general, the same process in the Windows GDK instructions work. There are just a few additional notes:
|
||||
* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target
|
||||
* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target
|
||||
* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define
|
||||
* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox)
|
||||
* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons)
|
||||
* To create a package, use:
|
||||
`makepkg pack /f PackageLayout.xml /lt /d . /pd Package`
|
||||
* To install the package, use:
|
||||
`xbapp install [PACKAGE].xvc`
|
||||
* For some reason, if you make changes that require SDL3.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again
|
||||
* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
#### Xbox Live Login does not work
|
||||
|
||||
As of June 2022 GDK, you must have a valid Title Id and MSAAppId in order to test Xbox Live functionality such as user login. Make sure these are set correctly in the `MicrosoftGame.config`. This means that even testgdk will not let you login without setting these properties to valid values.
|
||||
|
||||
Furthermore, confirm that your PC is set to the correct sandbox.
|
||||
|
||||
|
||||
#### "The current user has already installed an unpackaged version of this app. A packaged version cannot replace this." error when installing
|
||||
|
||||
Prior to June 2022 GDK, running from the Visual Studio debugger would still locally register the app (and it would appear on the start menu). To fix this, you have to uninstall it (it's simplest to right click on it from the start menu to uninstall it).
|
||||
|
@ -1,19 +1,19 @@
|
||||
git
|
||||
=========
|
||||
|
||||
The latest development version of SDL is available via git.
|
||||
Git allows you to get up-to-the-minute fixes and enhancements;
|
||||
as a developer works on a source tree, you can use "git" to mirror that
|
||||
source tree instead of waiting for an official release. Please look
|
||||
at the Git website ( https://git-scm.com/ ) for more
|
||||
information on using git, where you can also download software for
|
||||
macOS, Windows, and Unix systems.
|
||||
|
||||
git clone https://github.com/libsdl-org/SDL
|
||||
|
||||
If you are building SDL via configure, you will need to run autogen.sh
|
||||
before running configure.
|
||||
|
||||
There is a web interface to the Git repository at:
|
||||
http://github.com/libsdl-org/SDL/
|
||||
|
||||
git
|
||||
=========
|
||||
|
||||
The latest development version of SDL is available via git.
|
||||
Git allows you to get up-to-the-minute fixes and enhancements;
|
||||
as a developer works on a source tree, you can use "git" to mirror that
|
||||
source tree instead of waiting for an official release. Please look
|
||||
at the Git website ( https://git-scm.com/ ) for more
|
||||
information on using git, where you can also download software for
|
||||
macOS, Windows, and Unix systems.
|
||||
|
||||
git clone https://github.com/libsdl-org/SDL
|
||||
|
||||
If you are building SDL via configure, you will need to run autogen.sh
|
||||
before running configure.
|
||||
|
||||
There is a web interface to the Git repository at:
|
||||
http://github.com/libsdl-org/SDL/
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Mercurial
|
||||
======
|
||||
|
||||
We are no longer hosted in Mercurial. Please see README-git.md for details.
|
||||
|
||||
Thanks!
|
||||
|
||||
Mercurial
|
||||
======
|
||||
|
||||
We are no longer hosted in Mercurial. Please see README-git.md for details.
|
||||
|
||||
Thanks!
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
SDL 3.0 has new support for high DPI displays
|
||||
|
||||
Displays now have a content display scale, which is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability. You can query the display content scale using `SDL_GetDisplayContentScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
||||
|
||||
The window size is now distinct from the window pixel size, and the ratio between the two is the window pixel density. If the window is created with the `SDL_WINDOW_HIGH_PIXEL_DENSITY` flag, SDL will try to match the native pixel density for the display, otherwise it will try to have the pixel size match the window size. You can query the window pixel density using `SDL_GetWindowPixelDensity()`. You can query the window pixel size using `SDL_GetWindowSizeInPixels()`, and when this changes you get an `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event. You are guaranteed to get a `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event when a window is created and resized, and you can use this event to create and resize your graphics context for the window.
|
||||
|
||||
The window has a display scale, which is the scale from the pixel resolution to the desired content size, e.g. the combination of the pixel density and the content scale. For example, a 3840x2160 window displayed at 200% on Windows, and a 1920x1080 window with the high density flag on a 2x display on macOS will both have a pixel size of 3840x2160 and a display scale of 2.0. You can query the window display scale using `SDL_GetWindowDisplayScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
||||
|
||||
SDL 3.0 has new support for high DPI displays
|
||||
|
||||
Displays now have a content display scale, which is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability. You can query the display content scale using `SDL_GetDisplayContentScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
||||
|
||||
The window size is now distinct from the window pixel size, and the ratio between the two is the window pixel density. If the window is created with the `SDL_WINDOW_HIGH_PIXEL_DENSITY` flag, SDL will try to match the native pixel density for the display, otherwise it will try to have the pixel size match the window size. You can query the window pixel density using `SDL_GetWindowPixelDensity()`. You can query the window pixel size using `SDL_GetWindowSizeInPixels()`, and when this changes you get an `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event. You are guaranteed to get a `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` event when a window is created and resized, and you can use this event to create and resize your graphics context for the window.
|
||||
|
||||
The window has a display scale, which is the scale from the pixel resolution to the desired content size, e.g. the combination of the pixel density and the content scale. For example, a 3840x2160 window displayed at 200% on Windows, and a 1920x1080 window with the high density flag on a 2x display on macOS will both have a pixel size of 3840x2160 and a display scale of 2.0. You can query the window display scale using `SDL_GetWindowDisplayScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
|
||||
|
@ -1,292 +1,272 @@
|
||||
iOS
|
||||
======
|
||||
|
||||
Building the Simple DirectMedia Layer for iOS 9.0+
|
||||
==============================================================================
|
||||
|
||||
Requirements: macOS 10.9 or later and the iOS 9.0 or newer SDK.
|
||||
|
||||
Instructions:
|
||||
|
||||
1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode.
|
||||
2. Select your desired target, and hit build.
|
||||
|
||||
|
||||
Using the Simple DirectMedia Layer for iOS
|
||||
==============================================================================
|
||||
|
||||
1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology.
|
||||
2. In the main view, delete all files except for Assets and LaunchScreen
|
||||
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
|
||||
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
|
||||
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
|
||||
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL3.framework from "Framework-iOS"
|
||||
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
|
||||
8. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
|
||||
9. Add any assets that your application needs.
|
||||
10. Enjoy!
|
||||
|
||||
|
||||
TODO: Add information regarding App Store requirements such as icons, etc.
|
||||
|
||||
|
||||
Notes -- Retina / High-DPI and window sizes
|
||||
==============================================================================
|
||||
|
||||
Window and display mode sizes in SDL are in points rather than in pixels.
|
||||
On iOS this means that a window created on an iPhone 6 will have a size in
|
||||
points of 375 x 667, rather than a size in pixels of 750 x 1334. All iOS apps
|
||||
are expected to size their content based on points rather than pixels,
|
||||
as this allows different iOS devices to have different pixel densities
|
||||
(Retina versus non-Retina screens, etc.) without apps caring too much.
|
||||
|
||||
SDL_GetWindowSize() and mouse coordinates are in points rather than pixels,
|
||||
but the window will have a much greater pixel density when the device supports
|
||||
it, and the SDL_GetWindowSizeInPixels() can be called to determine the size
|
||||
in pixels of the drawable screen framebuffer.
|
||||
|
||||
The SDL 2D rendering API will automatically handle this for you, by default
|
||||
providing a rendering area in points, and you can call SDL_SetRenderLogicalPresentation()
|
||||
to gain access to the higher density resolution.
|
||||
|
||||
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
||||
sizes in points. When doing 2D rendering with OpenGL ES, an orthographic projection
|
||||
matrix using the size in points (SDL_GetWindowSize()) can be used in order to
|
||||
display content at the same scale no matter whether a Retina device is used or not.
|
||||
|
||||
|
||||
Notes -- Application events
|
||||
==============================================================================
|
||||
|
||||
On iOS the application goes through a fixed life cycle and you will get
|
||||
notifications of state changes via application events. When these events
|
||||
are delivered you must handle them in an event callback because the OS may
|
||||
not give you any processing time after the events are delivered.
|
||||
|
||||
e.g.
|
||||
|
||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case SDL_EVENT_TERMINATING:
|
||||
/* Terminate the app.
|
||||
Shut everything down before returning from this function.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_LOW_MEMORY:
|
||||
/* You will get this when your app is paused and iOS wants more memory.
|
||||
Release as much memory as possible.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_WILL_ENTER_BACKGROUND:
|
||||
/* Prepare your app to go into the background. Stop loops, etc.
|
||||
This gets called when the user hits the home button, or gets a call.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_DID_ENTER_BACKGROUND:
|
||||
/* This will get called if the user accepted whatever sent your app to the background.
|
||||
If the user got a phone call and canceled it, you'll instead get an SDL_EVENT_DID_ENTER_FOREGROUND event and restart your loops.
|
||||
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
||||
Your app is NOT active at this point.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_WILL_ENTER_FOREGROUND:
|
||||
/* This call happens when your app is coming back to the foreground.
|
||||
Restore all your state here.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_DID_ENTER_FOREGROUND:
|
||||
/* Restart your loops here.
|
||||
Your app is interactive and getting CPU again.
|
||||
*/
|
||||
return 0;
|
||||
default:
|
||||
/* No special processing, add it to the event queue */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_SetEventFilter(HandleAppEvents, NULL);
|
||||
|
||||
... run your main loop
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Notes -- Accelerometer as Joystick
|
||||
==============================================================================
|
||||
|
||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||
|
||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_GetJoystickAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_GetJoystickAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||
|
||||
|
||||
Notes -- OpenGL ES
|
||||
==============================================================================
|
||||
|
||||
Your SDL application for iOS uses OpenGL ES for video by default.
|
||||
|
||||
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute().
|
||||
|
||||
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
|
||||
|
||||
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0.
|
||||
|
||||
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
|
||||
|
||||
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called.
|
||||
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called.
|
||||
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
|
||||
|
||||
The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h).
|
||||
|
||||
|
||||
Notes -- Keyboard
|
||||
==============================================================================
|
||||
|
||||
The SDL keyboard API has been extended to support on-screen keyboards:
|
||||
|
||||
void SDL_StartTextInput()
|
||||
-- enables text events and reveals the onscreen keyboard.
|
||||
|
||||
void SDL_StopTextInput()
|
||||
-- disables text events and hides the onscreen keyboard.
|
||||
|
||||
SDL_bool SDL_TextInputActive()
|
||||
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
|
||||
|
||||
|
||||
Notes -- Mouse
|
||||
==============================================================================
|
||||
|
||||
iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist
|
||||
|
||||
|
||||
Notes -- Reading and Writing files
|
||||
==============================================================================
|
||||
|
||||
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
||||
|
||||
Once your application is installed its directory tree looks like:
|
||||
|
||||
MySDLApp Home/
|
||||
MySDLApp.app
|
||||
Documents/
|
||||
Library/
|
||||
Preferences/
|
||||
tmp/
|
||||
|
||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
||||
|
||||
More information on this subject is available here:
|
||||
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
||||
|
||||
|
||||
Notes -- xcFramework
|
||||
==============================================================================
|
||||
|
||||
The SDL.xcodeproj file now includes a target to build SDL3.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
|
||||
|
||||
In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package.
|
||||
|
||||
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL3.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
|
||||
|
||||
This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes.
|
||||
|
||||
In addition, on Apple platforms, main() cannot be in a dynamically loaded library.
|
||||
However, unlike in SDL2, in SDL3 SDL_main is implemented inline in SDL_main.h, so you don't need to link against a static libSDL3main.lib, and you don't need to copy a .c file from the SDL3 source either.
|
||||
This means that iOS apps which used the statically-linked libSDL3.lib and now link with the xcframwork can just `#include <SDL3/SDL_main.h>` in the source file that contains their standard `int main(int argc; char *argv[])` function to get a header-only SDL_main implementation that calls the `SDL_RunApp()` with your standard main function.
|
||||
|
||||
Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected:
|
||||
|
||||
#include "SDL_main.h"
|
||||
#include <SDL.h>
|
||||
#include <SDL_main.h>
|
||||
|
||||
|
||||
Notes -- iPhone SDL limitations
|
||||
==============================================================================
|
||||
|
||||
Windows:
|
||||
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
|
||||
|
||||
Textures:
|
||||
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
||||
|
||||
Loading Shared Objects:
|
||||
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_ios.h.
|
||||
|
||||
|
||||
Notes -- CoreBluetooth.framework
|
||||
==============================================================================
|
||||
|
||||
SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot
|
||||
more game controller devices, but it requires permission from the user before
|
||||
your app will be able to talk to the Bluetooth hardware. "Made For iOS"
|
||||
branded controllers do not need this as we don't have to speak to them
|
||||
directly with raw bluetooth, so many apps can live without this.
|
||||
|
||||
You'll need to link with CoreBluetooth.framework and add something like this
|
||||
to your Info.plist:
|
||||
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
|
||||
|
||||
|
||||
Game Center
|
||||
==============================================================================
|
||||
|
||||
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
|
||||
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
|
||||
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
|
||||
|
||||
e.g.
|
||||
|
||||
extern "C"
|
||||
void ShowFrame(void*)
|
||||
{
|
||||
... do event handling, frame logic and rendering ...
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
... initialize game ...
|
||||
|
||||
#ifdef __IOS__
|
||||
// Initialize the Game Center for scoring and matchmaking
|
||||
InitGameCenter();
|
||||
|
||||
// Set up the game to run in the window animation callback on iOS
|
||||
// so that Game Center and so forth works correctly.
|
||||
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
|
||||
#else
|
||||
while ( running ) {
|
||||
ShowFrame(0);
|
||||
DelayFrame();
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Deploying to older versions of iOS
|
||||
==============================================================================
|
||||
|
||||
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0
|
||||
|
||||
In order to do that you need to download an older version of Xcode:
|
||||
https://developer.apple.com/download/more/?name=Xcode
|
||||
|
||||
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
|
||||
|
||||
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
|
||||
|
||||
Open your project and set your deployment target to the desired version of iOS
|
||||
|
||||
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
|
||||
iOS
|
||||
======
|
||||
|
||||
Building the Simple DirectMedia Layer for iOS 9.0+
|
||||
==============================================================================
|
||||
|
||||
Requirements: macOS 10.9 or later and the iOS 9.0 or newer SDK.
|
||||
|
||||
Instructions:
|
||||
|
||||
1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode.
|
||||
2. Select your desired target, and hit build.
|
||||
|
||||
|
||||
Using the Simple DirectMedia Layer for iOS
|
||||
==============================================================================
|
||||
|
||||
1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology.
|
||||
2. In the main view, delete all files except for Assets and LaunchScreen
|
||||
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
|
||||
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
|
||||
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
|
||||
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL3.framework from "Framework-iOS"
|
||||
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
|
||||
8. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
|
||||
9. Add any assets that your application needs.
|
||||
10. Enjoy!
|
||||
|
||||
|
||||
TODO: Add information regarding App Store requirements such as icons, etc.
|
||||
|
||||
|
||||
Notes -- Retina / High-DPI and window sizes
|
||||
==============================================================================
|
||||
|
||||
Window and display mode sizes in SDL are in points rather than in pixels.
|
||||
On iOS this means that a window created on an iPhone 6 will have a size in
|
||||
points of 375 x 667, rather than a size in pixels of 750 x 1334. All iOS apps
|
||||
are expected to size their content based on points rather than pixels,
|
||||
as this allows different iOS devices to have different pixel densities
|
||||
(Retina versus non-Retina screens, etc.) without apps caring too much.
|
||||
|
||||
SDL_GetWindowSize() and mouse coordinates are in points rather than pixels,
|
||||
but the window will have a much greater pixel density when the device supports
|
||||
it, and the SDL_GetWindowSizeInPixels() can be called to determine the size
|
||||
in pixels of the drawable screen framebuffer.
|
||||
|
||||
The SDL 2D rendering API will automatically handle this for you, by default
|
||||
providing a rendering area in points, and you can call SDL_SetRenderLogicalPresentation()
|
||||
to gain access to the higher density resolution.
|
||||
|
||||
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
|
||||
sizes in points. When doing 2D rendering with OpenGL ES, an orthographic projection
|
||||
matrix using the size in points (SDL_GetWindowSize()) can be used in order to
|
||||
display content at the same scale no matter whether a Retina device is used or not.
|
||||
|
||||
|
||||
Notes -- Application events
|
||||
==============================================================================
|
||||
|
||||
On iOS the application goes through a fixed life cycle and you will get
|
||||
notifications of state changes via application events. When these events
|
||||
are delivered you must handle them in an event callback because the OS may
|
||||
not give you any processing time after the events are delivered.
|
||||
|
||||
e.g.
|
||||
|
||||
int HandleAppEvents(void *userdata, SDL_Event *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case SDL_EVENT_TERMINATING:
|
||||
/* Terminate the app.
|
||||
Shut everything down before returning from this function.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_LOW_MEMORY:
|
||||
/* You will get this when your app is paused and iOS wants more memory.
|
||||
Release as much memory as possible.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_WILL_ENTER_BACKGROUND:
|
||||
/* Prepare your app to go into the background. Stop loops, etc.
|
||||
This gets called when the user hits the home button, or gets a call.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_DID_ENTER_BACKGROUND:
|
||||
/* This will get called if the user accepted whatever sent your app to the background.
|
||||
If the user got a phone call and canceled it, you'll instead get an SDL_EVENT_DID_ENTER_FOREGROUND event and restart your loops.
|
||||
When you get this, you have 5 seconds to save all your state or the app will be terminated.
|
||||
Your app is NOT active at this point.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_WILL_ENTER_FOREGROUND:
|
||||
/* This call happens when your app is coming back to the foreground.
|
||||
Restore all your state here.
|
||||
*/
|
||||
return 0;
|
||||
case SDL_EVENT_DID_ENTER_FOREGROUND:
|
||||
/* Restart your loops here.
|
||||
Your app is interactive and getting CPU again.
|
||||
*/
|
||||
return 0;
|
||||
default:
|
||||
/* No special processing, add it to the event queue */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_SetEventFilter(HandleAppEvents, NULL);
|
||||
|
||||
... run your main loop
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Notes -- Accelerometer as Joystick
|
||||
==============================================================================
|
||||
|
||||
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
|
||||
|
||||
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_GetJoystickAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_GetJoystickAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
|
||||
|
||||
|
||||
Notes -- Keyboard
|
||||
==============================================================================
|
||||
|
||||
The SDL keyboard API has been extended to support on-screen keyboards:
|
||||
|
||||
void SDL_StartTextInput()
|
||||
-- enables text events and reveals the onscreen keyboard.
|
||||
|
||||
void SDL_StopTextInput()
|
||||
-- disables text events and hides the onscreen keyboard.
|
||||
|
||||
SDL_bool SDL_TextInputActive()
|
||||
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
|
||||
|
||||
|
||||
Notes -- Mouse
|
||||
==============================================================================
|
||||
|
||||
iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist
|
||||
|
||||
|
||||
Notes -- Reading and Writing files
|
||||
==============================================================================
|
||||
|
||||
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
|
||||
|
||||
Once your application is installed its directory tree looks like:
|
||||
|
||||
MySDLApp Home/
|
||||
MySDLApp.app
|
||||
Documents/
|
||||
Library/
|
||||
Preferences/
|
||||
tmp/
|
||||
|
||||
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
|
||||
|
||||
More information on this subject is available here:
|
||||
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
|
||||
|
||||
|
||||
Notes -- xcFramework
|
||||
==============================================================================
|
||||
|
||||
The SDL.xcodeproj file now includes a target to build SDL3.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
|
||||
|
||||
In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package.
|
||||
|
||||
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL3.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
|
||||
|
||||
This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes.
|
||||
|
||||
In addition, on Apple platforms, main() cannot be in a dynamically loaded library.
|
||||
However, unlike in SDL2, in SDL3 SDL_main is implemented inline in SDL_main.h, so you don't need to link against a static libSDL3main.lib, and you don't need to copy a .c file from the SDL3 source either.
|
||||
This means that iOS apps which used the statically-linked libSDL3.lib and now link with the xcframwork can just `#include <SDL3/SDL_main.h>` in the source file that contains their standard `int main(int argc; char *argv[])` function to get a header-only SDL_main implementation that calls the `SDL_RunApp()` with your standard main function.
|
||||
|
||||
Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected:
|
||||
|
||||
#include "SDL_main.h"
|
||||
#include <SDL.h>
|
||||
#include <SDL_main.h>
|
||||
|
||||
|
||||
Notes -- iPhone SDL limitations
|
||||
==============================================================================
|
||||
|
||||
Windows:
|
||||
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
|
||||
|
||||
Textures:
|
||||
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, and SDL_PIXELFORMAT_RGB24 pixel formats.
|
||||
|
||||
Loading Shared Objects:
|
||||
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_ios.h.
|
||||
|
||||
|
||||
Notes -- CoreBluetooth.framework
|
||||
==============================================================================
|
||||
|
||||
SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot
|
||||
more game controller devices, but it requires permission from the user before
|
||||
your app will be able to talk to the Bluetooth hardware. "Made For iOS"
|
||||
branded controllers do not need this as we don't have to speak to them
|
||||
directly with raw bluetooth, so many apps can live without this.
|
||||
|
||||
You'll need to link with CoreBluetooth.framework and add something like this
|
||||
to your Info.plist:
|
||||
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
|
||||
|
||||
|
||||
Game Center
|
||||
==============================================================================
|
||||
|
||||
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
|
||||
|
||||
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
|
||||
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
|
||||
|
||||
e.g.
|
||||
|
||||
extern "C"
|
||||
void ShowFrame(void*)
|
||||
{
|
||||
... do event handling, frame logic and rendering ...
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
... initialize game ...
|
||||
|
||||
#ifdef __IOS__
|
||||
// Initialize the Game Center for scoring and matchmaking
|
||||
InitGameCenter();
|
||||
|
||||
// Set up the game to run in the window animation callback on iOS
|
||||
// so that Game Center and so forth works correctly.
|
||||
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
|
||||
#else
|
||||
while ( running ) {
|
||||
ShowFrame(0);
|
||||
DelayFrame();
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Deploying to older versions of iOS
|
||||
==============================================================================
|
||||
|
||||
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0
|
||||
|
||||
In order to do that you need to download an older version of Xcode:
|
||||
https://developer.apple.com/download/more/?name=Xcode
|
||||
|
||||
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
|
||||
|
||||
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
|
||||
|
||||
Open your project and set your deployment target to the desired version of iOS
|
||||
|
||||
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
|
||||
|
@ -1,27 +1,27 @@
|
||||
KMSDRM on *BSD
|
||||
==================================================
|
||||
|
||||
KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen.
|
||||
|
||||
WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance.
|
||||
|
||||
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
|
||||
|
||||
|
||||
SDL WSCONS input backend features
|
||||
===================================================
|
||||
1. It is keymap-aware; it will work properly with different keymaps.
|
||||
2. It has mouse support.
|
||||
3. Accent input is supported.
|
||||
4. Compose keys are supported.
|
||||
5. AltGr and Meta Shift keys work as intended.
|
||||
|
||||
Partially working or no input on OpenBSD/NetBSD.
|
||||
==================================================
|
||||
|
||||
The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work.
|
||||
|
||||
Partially working or no input on FreeBSD.
|
||||
==================================================
|
||||
|
||||
The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices.
|
||||
KMSDRM on *BSD
|
||||
==================================================
|
||||
|
||||
KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen.
|
||||
|
||||
WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance.
|
||||
|
||||
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
|
||||
|
||||
|
||||
SDL WSCONS input backend features
|
||||
===================================================
|
||||
1. It is keymap-aware; it will work properly with different keymaps.
|
||||
2. It has mouse support.
|
||||
3. Accent input is supported.
|
||||
4. Compose keys are supported.
|
||||
5. AltGr and Meta Shift keys work as intended.
|
||||
|
||||
Partially working or no input on OpenBSD/NetBSD.
|
||||
==================================================
|
||||
|
||||
The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work.
|
||||
|
||||
Partially working or no input on FreeBSD.
|
||||
==================================================
|
||||
|
||||
The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices.
|
||||
|
@ -1,88 +1,88 @@
|
||||
Linux
|
||||
================================================================================
|
||||
|
||||
By default SDL will only link against glibc, the rest of the features will be
|
||||
enabled dynamically at runtime depending on the available features on the target
|
||||
system. So, for example if you built SDL with XRandR support and the target
|
||||
system does not have the XRandR libraries installed, it will be disabled
|
||||
at runtime, and you won't get a missing library error, at least with the
|
||||
default configuration parameters.
|
||||
|
||||
|
||||
Build Dependencies
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Ubuntu 18.04, all available features enabled:
|
||||
|
||||
sudo apt-get install build-essential git make \
|
||||
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
|
||||
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \
|
||||
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
|
||||
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
||||
|
||||
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libwayland-dev libdecor-0-dev` to that command line.
|
||||
|
||||
Fedora 35, all available features enabled:
|
||||
|
||||
sudo yum install gcc git-core make cmake \
|
||||
alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \
|
||||
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
|
||||
libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \
|
||||
systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \
|
||||
mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \
|
||||
libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \
|
||||
pipewire-jack-audio-connection-kit-devel \
|
||||
|
||||
NOTES:
|
||||
- The sndio audio target is unavailable on Fedora (but probably not what you
|
||||
should want to use anyhow).
|
||||
|
||||
|
||||
Joystick does not work
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
If you compiled or are using a version of SDL with udev support (and you should!)
|
||||
there's a few issues that may cause SDL to fail to detect your joystick. To
|
||||
debug this, start by installing the evtest utility. On Ubuntu/Debian:
|
||||
|
||||
sudo apt-get install evtest
|
||||
|
||||
Then run:
|
||||
|
||||
sudo evtest
|
||||
|
||||
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
|
||||
Now run:
|
||||
|
||||
cat /dev/input/event/XX
|
||||
|
||||
If you get a permission error, you need to set a udev rule to change the mode of
|
||||
your device (see below)
|
||||
|
||||
Also, try:
|
||||
|
||||
sudo udevadm info --query=all --name=input/eventXX
|
||||
|
||||
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
|
||||
you need to set up an udev rule to force this variable.
|
||||
|
||||
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
|
||||
like:
|
||||
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
You can set up similar rules for your device by changing the values listed in
|
||||
idProduct and idVendor. To obtain these values, try:
|
||||
|
||||
sudo udevadm info -a --name=input/eventXX | grep idVendor
|
||||
sudo udevadm info -a --name=input/eventXX | grep idProduct
|
||||
|
||||
If multiple values come up for each of these, the one you want is the first one of each.
|
||||
|
||||
On other systems which ship with an older udev (such as CentOS), you may need
|
||||
to set up a rule such as:
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
Linux
|
||||
================================================================================
|
||||
|
||||
By default SDL will only link against glibc, the rest of the features will be
|
||||
enabled dynamically at runtime depending on the available features on the target
|
||||
system. So, for example if you built SDL with XRandR support and the target
|
||||
system does not have the XRandR libraries installed, it will be disabled
|
||||
at runtime, and you won't get a missing library error, at least with the
|
||||
default configuration parameters.
|
||||
|
||||
|
||||
Build Dependencies
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Ubuntu 18.04, all available features enabled:
|
||||
|
||||
sudo apt-get install build-essential git make \
|
||||
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
|
||||
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \
|
||||
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
|
||||
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
||||
|
||||
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libwayland-dev libdecor-0-dev` to that command line.
|
||||
|
||||
Fedora 35, all available features enabled:
|
||||
|
||||
sudo yum install gcc git-core make cmake \
|
||||
alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \
|
||||
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
|
||||
libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \
|
||||
systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \
|
||||
mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \
|
||||
libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \
|
||||
pipewire-jack-audio-connection-kit-devel \
|
||||
|
||||
NOTES:
|
||||
- The sndio audio target is unavailable on Fedora (but probably not what you
|
||||
should want to use anyhow).
|
||||
|
||||
|
||||
Joystick does not work
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
If you compiled or are using a version of SDL with udev support (and you should!)
|
||||
there's a few issues that may cause SDL to fail to detect your joystick. To
|
||||
debug this, start by installing the evtest utility. On Ubuntu/Debian:
|
||||
|
||||
sudo apt-get install evtest
|
||||
|
||||
Then run:
|
||||
|
||||
sudo evtest
|
||||
|
||||
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
|
||||
Now run:
|
||||
|
||||
cat /dev/input/event/XX
|
||||
|
||||
If you get a permission error, you need to set a udev rule to change the mode of
|
||||
your device (see below)
|
||||
|
||||
Also, try:
|
||||
|
||||
sudo udevadm info --query=all --name=input/eventXX
|
||||
|
||||
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
|
||||
you need to set up an udev rule to force this variable.
|
||||
|
||||
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
|
||||
like:
|
||||
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
You can set up similar rules for your device by changing the values listed in
|
||||
idProduct and idVendor. To obtain these values, try:
|
||||
|
||||
sudo udevadm info -a --name=input/eventXX | grep idVendor
|
||||
sudo udevadm info -a --name=input/eventXX | grep idProduct
|
||||
|
||||
If multiple values come up for each of these, the one you want is the first one of each.
|
||||
|
||||
On other systems which ship with an older udev (such as CentOS), you may need
|
||||
to set up a rule such as:
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
|
||||
|
||||
|
@ -1,252 +1,252 @@
|
||||
# macOS
|
||||
|
||||
These instructions are for people using Apple's macOS.
|
||||
|
||||
From the developer's point of view, macOS is a sort of hybrid Mac and
|
||||
Unix system, and you have the option of using either traditional
|
||||
command line tools or Apple's IDE Xcode.
|
||||
|
||||
# Command Line Build
|
||||
|
||||
To build SDL using the command line, use the CMake build script:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
```
|
||||
|
||||
|
||||
You can also build SDL as a Universal library (a single binary for both
|
||||
64-bit Intel and ARM architectures):
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
```
|
||||
|
||||
Please note that building SDL requires at least Xcode 6 and the 10.9 SDK.
|
||||
PowerPC support for macOS has been officially dropped as of SDL 2.0.2.
|
||||
32-bit Intel and macOS 10.8 runtime support has been officially dropped as
|
||||
of SDL 2.24.0.
|
||||
|
||||
To use the library once it's built, you essential have two possibilities:
|
||||
use the traditional autoconf/automake/make method, or use Xcode.
|
||||
|
||||
|
||||
# Caveats for using SDL with macOS
|
||||
|
||||
If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
|
||||
SDL will not register its own. This means that SDL will not terminate using
|
||||
SDL_Quit if it receives a termination request, it will terminate like a
|
||||
normal app, and it will not send a SDL_EVENT_DROP_FILE when you request to open a
|
||||
file with the app. To solve these issues, put the following code in your
|
||||
NSApplicationDelegate implementation:
|
||||
|
||||
|
||||
```objc
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
if (SDL_GetEventState(SDL_EVENT_QUIT) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
{
|
||||
if (SDL_GetEventState(SDL_EVENT_DROP_FILE) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_DROP_FILE;
|
||||
event.drop.file = SDL_strdup([filename UTF8String]);
|
||||
return (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
```
|
||||
|
||||
# Using the Simple DirectMedia Layer with a traditional Makefile
|
||||
|
||||
An existing build system for your SDL app has good chances to work almost
|
||||
unchanged on macOS, as long as you link with the SDL framework. However,
|
||||
to produce a "real" Mac binary that you can distribute to users, you need
|
||||
to put the generated binary into a so called "bundle", which is basically
|
||||
a fancy folder with a name like "MyCoolGame.app".
|
||||
|
||||
To get this build automatically, add something like the following rule to
|
||||
your Makefile.am:
|
||||
|
||||
```make
|
||||
bundle_contents = APP_NAME.app/Contents
|
||||
APP_NAME_bundle: EXE_NAME
|
||||
mkdir -p $(bundle_contents)/MacOS
|
||||
mkdir -p $(bundle_contents)/Resources
|
||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
||||
```
|
||||
|
||||
You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is
|
||||
what will be visible to the user in the Finder. Usually it will be the same
|
||||
as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME`
|
||||
usually is "TestGame". You might also want to use `@PACKAGE@` to use the
|
||||
package name as specified in your configure.ac file.
|
||||
|
||||
If your project builds more than one application, you will have to do a bit
|
||||
more. For each of your target applications, you need a separate rule.
|
||||
|
||||
If you want the created bundles to be installed, you may want to add this
|
||||
rule to your Makefile.am:
|
||||
|
||||
```make
|
||||
install-exec-hook: APP_NAME_bundle
|
||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||
```
|
||||
|
||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||
into "$(DESTDIR)$(prefix)/Applications/".
|
||||
|
||||
Again, if you want to install multiple applications, you will have to augment
|
||||
the make rule accordingly.
|
||||
|
||||
But beware! That is only part of the story! With the above, you end up with
|
||||
a barebones .app bundle, which is double-clickable from the Finder. But
|
||||
there are some more things you should do before shipping your product...
|
||||
|
||||
1. You'll need to copy the SDL framework into the Contents/Frameworks
|
||||
folder in your bundle, so it is included along with your application.
|
||||
|
||||
2. Add an 'Info.plist' to your application. That is a special XML file which
|
||||
contains some meta-information about your application (like some copyright
|
||||
information, the version of your app, the name of an optional icon file,
|
||||
and other things). Part of that information is displayed by the Finder
|
||||
when you click on the .app, or if you look at the "Get Info" window.
|
||||
More information about Info.plist files can be found on Apple's homepage.
|
||||
|
||||
|
||||
As a final remark, let me add that I use some of the techniques (and some
|
||||
variations of them) in [Exult](https://github.com/exult/exult) and
|
||||
[ScummVM](https://github.com/scummvm/scummvm); both are available in source on
|
||||
the net, so feel free to take a peek at them for inspiration!
|
||||
|
||||
|
||||
# Using the Simple DirectMedia Layer with Xcode
|
||||
|
||||
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
||||
|
||||
## First steps
|
||||
|
||||
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||
you should unpack the archive manually from the command line:
|
||||
|
||||
```bash
|
||||
cd [path_to_SDL_source]
|
||||
tar zxf Xcode.tar.gz
|
||||
```
|
||||
|
||||
This will create a new folder called Xcode, which you can browse
|
||||
normally from the Finder.
|
||||
|
||||
## Building the Framework
|
||||
|
||||
The SDL Library is packaged as a framework bundle, an organized
|
||||
relocatable folder hierarchy of executable code, interface headers,
|
||||
and additional resources. For practical purposes, you can think of a
|
||||
framework as a more user and system-friendly shared library, whose library
|
||||
file behaves more or less like a standard UNIX shared library.
|
||||
|
||||
To build the framework, simply open the framework project and build it.
|
||||
By default, the framework bundle "SDL.framework" is installed in
|
||||
/Library/Frameworks. Therefore, the testers and project stationary expect
|
||||
it to be located there. However, it will function the same in any of the
|
||||
following locations:
|
||||
|
||||
* ~/Library/Frameworks
|
||||
* /Local/Library/Frameworks
|
||||
* /System/Library/Frameworks
|
||||
|
||||
## Build Options
|
||||
|
||||
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
||||
"Deployment" should be used if you aren't tweaking the SDL library.
|
||||
"Development" should be used to debug SDL apps or the library itself.
|
||||
|
||||
## Building the Testers
|
||||
|
||||
Open the SDLTest project and build away!
|
||||
|
||||
## Using the Project Stationary
|
||||
|
||||
Copy the stationary to the indicated folders to access it from
|
||||
the "New Project" and "Add target" menus. What could be easier?
|
||||
|
||||
## Setting up a new project by hand
|
||||
|
||||
Some of you won't want to use the Stationary so I'll give some tips:
|
||||
|
||||
(this is accurate as of Xcode 12.5.)
|
||||
|
||||
* Click "File" -> "New" -> "Project...
|
||||
* Choose "macOS" and then "App" from the "Application" section.
|
||||
* Fill out the options in the next window. User interface is "XIB" and
|
||||
Language is "Objective-C".
|
||||
* Remove "main.m" from your project
|
||||
* Remove "MainMenu.xib" from your project
|
||||
* Remove "AppDelegates.*" from your project
|
||||
* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
||||
* Add "\$(HOME)/Library/Frameworks" to the frameworks search path
|
||||
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
||||
* Add your files
|
||||
* Clean and build
|
||||
|
||||
## Building from command line
|
||||
|
||||
Use `xcode-build` in the same directory as your .pbxproj file
|
||||
|
||||
## Running your app
|
||||
|
||||
You can send command line args to your app by either invoking it from
|
||||
the command line (in *.app/Contents/MacOS) or by entering them in the
|
||||
Executables" panel of the target settings.
|
||||
|
||||
# Implementation Notes
|
||||
|
||||
Some things that may be of interest about how it all works...
|
||||
|
||||
## Working directory
|
||||
|
||||
In SDL 1.2, the working directory of your SDL app is by default set to its
|
||||
parent, but this is no longer the case in SDL 2.0. SDL2 does change the
|
||||
working directory, which means it'll be whatever the command line prompt
|
||||
that launched the program was using, or if launched by double-clicking in
|
||||
the finger, it will be "/", the _root of the filesystem_. Plan accordingly!
|
||||
You can use SDL_GetBasePath() to find where the program is running from and
|
||||
chdir() there directly.
|
||||
|
||||
|
||||
## You have a Cocoa App!
|
||||
|
||||
Your SDL app is essentially a Cocoa application. When your app
|
||||
starts up and the libraries finish loading, a Cocoa procedure is called,
|
||||
which sets up the working directory and calls your main() method.
|
||||
You are free to modify your Cocoa app with generally no consequence
|
||||
to SDL. You cannot, however, easily change the SDL window itself.
|
||||
Functionality may be added in the future to help this.
|
||||
|
||||
# Bug reports
|
||||
|
||||
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).
|
||||
Please feel free to report bugs there!
|
||||
|
||||
# macOS
|
||||
|
||||
These instructions are for people using Apple's macOS.
|
||||
|
||||
From the developer's point of view, macOS is a sort of hybrid Mac and
|
||||
Unix system, and you have the option of using either traditional
|
||||
command line tools or Apple's IDE Xcode.
|
||||
|
||||
# Command Line Build
|
||||
|
||||
To build SDL using the command line, use the CMake build script:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
```
|
||||
|
||||
|
||||
You can also build SDL as a Universal library (a single binary for both
|
||||
64-bit Intel and ARM architectures):
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
```
|
||||
|
||||
Please note that building SDL requires at least Xcode 6 and the 10.9 SDK.
|
||||
PowerPC support for macOS has been officially dropped as of SDL 2.0.2.
|
||||
32-bit Intel and macOS 10.8 runtime support has been officially dropped as
|
||||
of SDL 2.24.0.
|
||||
|
||||
To use the library once it's built, you essential have two possibilities:
|
||||
use the traditional autoconf/automake/make method, or use Xcode.
|
||||
|
||||
|
||||
# Caveats for using SDL with macOS
|
||||
|
||||
If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
|
||||
SDL will not register its own. This means that SDL will not terminate using
|
||||
SDL_Quit if it receives a termination request, it will terminate like a
|
||||
normal app, and it will not send a SDL_EVENT_DROP_FILE when you request to open a
|
||||
file with the app. To solve these issues, put the following code in your
|
||||
NSApplicationDelegate implementation:
|
||||
|
||||
|
||||
```objc
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
if (SDL_GetEventState(SDL_EVENT_QUIT) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
{
|
||||
if (SDL_GetEventState(SDL_EVENT_DROP_FILE) == SDL_ENABLE) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_DROP_FILE;
|
||||
event.drop.file = SDL_strdup([filename UTF8String]);
|
||||
return (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
```
|
||||
|
||||
# Using the Simple DirectMedia Layer with a traditional Makefile
|
||||
|
||||
An existing build system for your SDL app has good chances to work almost
|
||||
unchanged on macOS, as long as you link with the SDL framework. However,
|
||||
to produce a "real" Mac binary that you can distribute to users, you need
|
||||
to put the generated binary into a so called "bundle", which is basically
|
||||
a fancy folder with a name like "MyCoolGame.app".
|
||||
|
||||
To get this build automatically, add something like the following rule to
|
||||
your Makefile.am:
|
||||
|
||||
```make
|
||||
bundle_contents = APP_NAME.app/Contents
|
||||
APP_NAME_bundle: EXE_NAME
|
||||
mkdir -p $(bundle_contents)/MacOS
|
||||
mkdir -p $(bundle_contents)/Resources
|
||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
||||
```
|
||||
|
||||
You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is
|
||||
what will be visible to the user in the Finder. Usually it will be the same
|
||||
as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME`
|
||||
usually is "TestGame". You might also want to use `@PACKAGE@` to use the
|
||||
package name as specified in your configure.ac file.
|
||||
|
||||
If your project builds more than one application, you will have to do a bit
|
||||
more. For each of your target applications, you need a separate rule.
|
||||
|
||||
If you want the created bundles to be installed, you may want to add this
|
||||
rule to your Makefile.am:
|
||||
|
||||
```make
|
||||
install-exec-hook: APP_NAME_bundle
|
||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||
```
|
||||
|
||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||
into "$(DESTDIR)$(prefix)/Applications/".
|
||||
|
||||
Again, if you want to install multiple applications, you will have to augment
|
||||
the make rule accordingly.
|
||||
|
||||
But beware! That is only part of the story! With the above, you end up with
|
||||
a barebones .app bundle, which is double-clickable from the Finder. But
|
||||
there are some more things you should do before shipping your product...
|
||||
|
||||
1. You'll need to copy the SDL framework into the Contents/Frameworks
|
||||
folder in your bundle, so it is included along with your application.
|
||||
|
||||
2. Add an 'Info.plist' to your application. That is a special XML file which
|
||||
contains some meta-information about your application (like some copyright
|
||||
information, the version of your app, the name of an optional icon file,
|
||||
and other things). Part of that information is displayed by the Finder
|
||||
when you click on the .app, or if you look at the "Get Info" window.
|
||||
More information about Info.plist files can be found on Apple's homepage.
|
||||
|
||||
|
||||
As a final remark, let me add that I use some of the techniques (and some
|
||||
variations of them) in [Exult](https://github.com/exult/exult) and
|
||||
[ScummVM](https://github.com/scummvm/scummvm); both are available in source on
|
||||
the net, so feel free to take a peek at them for inspiration!
|
||||
|
||||
|
||||
# Using the Simple DirectMedia Layer with Xcode
|
||||
|
||||
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
||||
|
||||
## First steps
|
||||
|
||||
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||
you should unpack the archive manually from the command line:
|
||||
|
||||
```bash
|
||||
cd [path_to_SDL_source]
|
||||
tar zxf Xcode.tar.gz
|
||||
```
|
||||
|
||||
This will create a new folder called Xcode, which you can browse
|
||||
normally from the Finder.
|
||||
|
||||
## Building the Framework
|
||||
|
||||
The SDL Library is packaged as a framework bundle, an organized
|
||||
relocatable folder hierarchy of executable code, interface headers,
|
||||
and additional resources. For practical purposes, you can think of a
|
||||
framework as a more user and system-friendly shared library, whose library
|
||||
file behaves more or less like a standard UNIX shared library.
|
||||
|
||||
To build the framework, simply open the framework project and build it.
|
||||
By default, the framework bundle "SDL.framework" is installed in
|
||||
/Library/Frameworks. Therefore, the testers and project stationary expect
|
||||
it to be located there. However, it will function the same in any of the
|
||||
following locations:
|
||||
|
||||
* ~/Library/Frameworks
|
||||
* /Local/Library/Frameworks
|
||||
* /System/Library/Frameworks
|
||||
|
||||
## Build Options
|
||||
|
||||
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
||||
"Deployment" should be used if you aren't tweaking the SDL library.
|
||||
"Development" should be used to debug SDL apps or the library itself.
|
||||
|
||||
## Building the Testers
|
||||
|
||||
Open the SDLTest project and build away!
|
||||
|
||||
## Using the Project Stationary
|
||||
|
||||
Copy the stationary to the indicated folders to access it from
|
||||
the "New Project" and "Add target" menus. What could be easier?
|
||||
|
||||
## Setting up a new project by hand
|
||||
|
||||
Some of you won't want to use the Stationary so I'll give some tips:
|
||||
|
||||
(this is accurate as of Xcode 12.5.)
|
||||
|
||||
* Click "File" -> "New" -> "Project...
|
||||
* Choose "macOS" and then "App" from the "Application" section.
|
||||
* Fill out the options in the next window. User interface is "XIB" and
|
||||
Language is "Objective-C".
|
||||
* Remove "main.m" from your project
|
||||
* Remove "MainMenu.xib" from your project
|
||||
* Remove "AppDelegates.*" from your project
|
||||
* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
||||
* Add "\$(HOME)/Library/Frameworks" to the frameworks search path
|
||||
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
||||
* Add your files
|
||||
* Clean and build
|
||||
|
||||
## Building from command line
|
||||
|
||||
Use `xcode-build` in the same directory as your .pbxproj file
|
||||
|
||||
## Running your app
|
||||
|
||||
You can send command line args to your app by either invoking it from
|
||||
the command line (in *.app/Contents/MacOS) or by entering them in the
|
||||
Executables" panel of the target settings.
|
||||
|
||||
# Implementation Notes
|
||||
|
||||
Some things that may be of interest about how it all works...
|
||||
|
||||
## Working directory
|
||||
|
||||
In SDL 1.2, the working directory of your SDL app is by default set to its
|
||||
parent, but this is no longer the case in SDL 2.0. SDL2 does change the
|
||||
working directory, which means it'll be whatever the command line prompt
|
||||
that launched the program was using, or if launched by double-clicking in
|
||||
the finger, it will be "/", the _root of the filesystem_. Plan accordingly!
|
||||
You can use SDL_GetBasePath() to find where the program is running from and
|
||||
chdir() there directly.
|
||||
|
||||
|
||||
## You have a Cocoa App!
|
||||
|
||||
Your SDL app is essentially a Cocoa application. When your app
|
||||
starts up and the libraries finish loading, a Cocoa procedure is called,
|
||||
which sets up the working directory and calls your main() method.
|
||||
You are free to modify your Cocoa app with generally no consequence
|
||||
to SDL. You cannot, however, easily change the SDL window itself.
|
||||
Functionality may be added in the future to help this.
|
||||
|
||||
# Bug reports
|
||||
|
||||
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).
|
||||
Please feel free to report bugs there!
|
||||
|
||||
|
194
docs/README-main-functions.md
Normal file
194
docs/README-main-functions.md
Normal file
@ -0,0 +1,194 @@
|
||||
# Where an SDL program starts running.
|
||||
|
||||
## History
|
||||
|
||||
SDL has a long, complicated history with starting a program.
|
||||
|
||||
In most of the civilized world, an application starts in a C-callable
|
||||
function named "main". You probably learned it a long time ago:
|
||||
|
||||
```c
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("Hello world!\n");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
But not all platforms work like this. Windows apps might want a different
|
||||
function named "WinMain", for example, so SDL set out to paper over this
|
||||
difference.
|
||||
|
||||
Generally how this would work is: your app would always use the "standard"
|
||||
`main(argc, argv)` function as its entry point, and `#include` the proper
|
||||
SDL header before that, which did some macro magic. On platforms that used
|
||||
a standard `main`, it would do nothing and what you saw was what you got.
|
||||
|
||||
But those other platforms! If they needed something that _wasn't_ `main`,
|
||||
SDL's macro magic would quietly rename your function to `SDL_main`, and
|
||||
provide its own entry point that called it. Your app was none the wiser and
|
||||
your code worked everywhere without changes.
|
||||
|
||||
|
||||
## The main entry point in SDL3
|
||||
|
||||
Previous versions of SDL had a static library, SDLmain, that you would link
|
||||
your app against. SDL3 still has the same macro tricks, but the static library
|
||||
is gone. Now it's supplied by a "single-header library," which means you
|
||||
`#include <SDL3/SDL_main.h>` and that header will insert a small amount of
|
||||
code into the source file that included it, so you no longer have to worry
|
||||
about linking against an extra library that you might need on some platforms.
|
||||
You just build your app and it works.
|
||||
|
||||
You should _only_ include SDL_main.h from one file (the umbrella header,
|
||||
SDL.h, does _not_ include it), and know that it will `#define main` to
|
||||
something else, so if you use this symbol elsewhere as a variable name, etc,
|
||||
it can cause you unexpected problems.
|
||||
|
||||
SDL_main.h will also include platform-specific code (WinMain or whatnot) that
|
||||
calls your _actual_ main function. This is compiled directly into your
|
||||
program.
|
||||
|
||||
If for some reason you need to include SDL_main.h in a file but also _don't_
|
||||
want it to generate this platform-specific code, you should define a special
|
||||
macro before including the header:
|
||||
|
||||
|
||||
```c
|
||||
#define SDL_MAIN_NOIMPL
|
||||
```
|
||||
|
||||
If you are moving from SDL2, remove any references to the SDLmain static
|
||||
library from your build system, and you should be done. Things should work as
|
||||
they always have.
|
||||
|
||||
If you have never controlled your process's entry point (you are using SDL
|
||||
as a module from a general-purpose scripting language interpreter, or you're
|
||||
using SDL in a plugin for some otherwise-unrelated app), then there is nothing
|
||||
required of you here; there is no startup code in SDL's entry point code that
|
||||
is required, so using SDL_main.h is completely optional. Just start using
|
||||
the SDL API when you are ready.
|
||||
|
||||
|
||||
## Main callbacks in SDL3
|
||||
|
||||
There is a second option in SDL3 for how to structure your program. This is
|
||||
completely optional and you can ignore it if you're happy using a standard
|
||||
"main" function.
|
||||
|
||||
Some platforms would rather your program operate in chunks. Most of the time,
|
||||
games tend to look like this at the highest level:
|
||||
|
||||
```c
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
initialize();
|
||||
while (keep_running()) {
|
||||
handle_new_events();
|
||||
do_one_frame_of_stuff();
|
||||
}
|
||||
deinitialize();
|
||||
}
|
||||
```
|
||||
|
||||
There are platforms that would rather be in charge of that `while` loop:
|
||||
iOS would rather you return from main() immediately and then it will let you
|
||||
know that it's time to update and draw the next frame of video. Emscripten
|
||||
(programs that run on a web page) absolutely requires this to function at all.
|
||||
Video targets like Wayland can notify the app when to draw a new frame, to
|
||||
save battery life and cooperate with the compositor more closely.
|
||||
|
||||
In most cases, you can add special-case code to your program to deal with this
|
||||
on different platforms, but SDL3 offers a system to handle this transparently on
|
||||
the app's behalf.
|
||||
|
||||
To use this, you have to redesign the highest level of your app a little. Once
|
||||
you do, it'll work on all supported SDL platforms without problems and
|
||||
`#ifdef`s in your code.
|
||||
|
||||
Instead of providing a "main" function, under this system, you would provide
|
||||
several functions that SDL will call as appropriate.
|
||||
|
||||
Using the callback entry points works on every platform, because on platforms
|
||||
that don't require them, we can fake them with a simple loop in an internal
|
||||
implementation of the usual SDL_main.
|
||||
|
||||
The primary way we expect people to write SDL apps is still with SDL_main, and
|
||||
this is not intended to replace it. If the app chooses to use this, it just
|
||||
removes some platform-specific details they might have to otherwise manage,
|
||||
and maybe removes a barrier to entry on some future platform. And you might
|
||||
find you enjoy structuring your program like this more!
|
||||
|
||||
|
||||
## How to use main callbacks in SDL3
|
||||
|
||||
To enable the callback entry points, you include SDL_main.h with an extra define,
|
||||
from a single source file in your project:
|
||||
|
||||
```c
|
||||
#define SDL_MAIN_USE_CALLBACKS
|
||||
#include <SDL3/SDL_main.h>
|
||||
```
|
||||
|
||||
Once you do this, you do not write a "main" function at all (and if you do,
|
||||
the app will likely fail to link). Instead, you provide the following
|
||||
functions:
|
||||
|
||||
First:
|
||||
|
||||
```c
|
||||
int SDL_AppInit(int argc, char **argv);
|
||||
```
|
||||
|
||||
This will be called _once_ before anything else. argc/argv work like they
|
||||
always do. If this returns 0, the app runs. If it returns < 0, the app calls
|
||||
SDL_AppQuit and terminates with an exit code that reports an error to the
|
||||
platform. If it returns > 0, the app calls SDL_AppQuit and terminates with
|
||||
an exit code that reports success to the platform. This function should not
|
||||
go into an infinite mainloop; it should do any one-time startup it requires
|
||||
and then return.
|
||||
|
||||
Then:
|
||||
|
||||
```c
|
||||
int SDL_AppIterate(void);
|
||||
```
|
||||
|
||||
This is called over and over, possibly at the refresh rate of the display or
|
||||
some other metric that the platform dictates. This is where the heart of your
|
||||
app runs. It should return as quickly as reasonably possible, but it's not a
|
||||
"run one memcpy and that's all the time you have" sort of thing. The app
|
||||
should do any game updates, and render a frame of video. If it returns < 0,
|
||||
SDL will call SDL_AppQuit and terminate the process with an exit code that
|
||||
reports an error to the platform. If it returns > 0, the app calls
|
||||
SDL_AppQuit and terminates with an exit code that reports success to the
|
||||
platform. If it returns 0, then SDL_AppIterate will be called again at some
|
||||
regular frequency. The platform may choose to run this more or less (perhaps
|
||||
less in the background, etc), or it might just call this function in a loop
|
||||
as fast as possible. You do not check the event queue in this function
|
||||
(SDL_AppEvent exists for that).
|
||||
|
||||
Next:
|
||||
|
||||
```c
|
||||
int SDL_AppEvent(const SDL_Event *event);
|
||||
```
|
||||
|
||||
This will be called whenever an SDL event arrives, on the thread that runs
|
||||
SDL_AppIterate. Your app should also not call SDL_PollEvent, SDL_PumpEvent,
|
||||
etc, as SDL will manage all this for you. Return values are the same as from
|
||||
SDL_AppIterate(), so you can terminate in response to SDL_EVENT_QUIT, etc.
|
||||
|
||||
|
||||
Finally:
|
||||
|
||||
```c
|
||||
void SDL_AppQuit(void);
|
||||
```
|
||||
|
||||
This is called once before terminating the app--assuming the app isn't being
|
||||
forcibly killed or crashed--as a last chance to clean up. After this returns,
|
||||
SDL will call SDL_Quit so the app doesn't have to (but it's safe for the app
|
||||
to call it, too). Process termination proceeds as if the app returned normally
|
||||
from main(), so atexit handles will run, if your platform supports that.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,28 @@
|
||||
# Nintendo 3DS
|
||||
|
||||
SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by:
|
||||
|
||||
- [Pierre Wendling](https://github.com/FtZPetruska)
|
||||
|
||||
Credits to:
|
||||
|
||||
- The awesome people who ported SDL to other homebrew platforms.
|
||||
- The Devkitpro team for making all the tools necessary to achieve this.
|
||||
|
||||
## Building
|
||||
|
||||
To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run:
|
||||
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Currently only software rendering is supported.
|
||||
- SDL3_main should be used to ensure ROMFS is enabled - this is done with `#include <SDL3/SDL_main.h>` in the source file that contains your main function.
|
||||
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
||||
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
||||
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_WaitSemaphore`, `SDL_WaitCondition`, `SDL_WaitThread`). To avoid starving other threads, `SDL_TryWaitSemaphore` and `SDL_WaitSemaphoreTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
|
||||
# Nintendo 3DS
|
||||
|
||||
SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by:
|
||||
|
||||
- [Pierre Wendling](https://github.com/FtZPetruska)
|
||||
|
||||
Credits to:
|
||||
|
||||
- The awesome people who ported SDL to other homebrew platforms.
|
||||
- The Devkitpro team for making all the tools necessary to achieve this.
|
||||
|
||||
## Building
|
||||
|
||||
To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run:
|
||||
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Currently only software rendering is supported.
|
||||
- SDL3_main should be used to ensure ROMFS is enabled - this is done with `#include <SDL3/SDL_main.h>` in the source file that contains your main function.
|
||||
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
|
||||
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
|
||||
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_WaitSemaphore`, `SDL_WaitCondition`, `SDL_WaitThread`). To avoid starving other threads, `SDL_TryWaitSemaphore` and `SDL_WaitSemaphoreTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
|
||||
|
@ -1,44 +1,44 @@
|
||||
Nokia N-Gage
|
||||
============
|
||||
|
||||
SDL port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
|
||||
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
|
||||
|
||||
Compiling
|
||||
---------
|
||||
|
||||
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
|
||||
The library is included in the
|
||||
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
|
||||
sub-module.
|
||||
|
||||
A complete example project based on SDL can be found in the GitHub
|
||||
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
|
||||
|
||||
Current level of implementation
|
||||
-------------------------------
|
||||
|
||||
The video driver currently provides full screen video support with
|
||||
keyboard input.
|
||||
|
||||
At the moment only the software renderer works.
|
||||
|
||||
Audio is not yet implemented.
|
||||
|
||||
Acknowledgements
|
||||
----------------
|
||||
|
||||
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
|
||||
valuable insight into Symbian programming. Without the SDL 1.2 port
|
||||
which was specially developed for CDoom (Doom for the Nokia 9210), this
|
||||
adaptation would not have been possible.
|
||||
|
||||
I would like to thank my friends
|
||||
[Razvan](https://twitter.com/bewarerazvan) and [Dan
|
||||
Whelan](https://danwhelan.ie/), for their continuous support. Without
|
||||
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
|
||||
have lost my patience long ago.
|
||||
|
||||
Last but not least, I would like to thank the development team of
|
||||
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
|
||||
patience and support in troubleshooting helped me a lot.
|
||||
Nokia N-Gage
|
||||
============
|
||||
|
||||
SDL port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
|
||||
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
|
||||
|
||||
Compiling
|
||||
---------
|
||||
|
||||
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
|
||||
The library is included in the
|
||||
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
|
||||
sub-module.
|
||||
|
||||
A complete example project based on SDL can be found in the GitHub
|
||||
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
|
||||
|
||||
Current level of implementation
|
||||
-------------------------------
|
||||
|
||||
The video driver currently provides full screen video support with
|
||||
keyboard input.
|
||||
|
||||
At the moment only the software renderer works.
|
||||
|
||||
Audio is not yet implemented.
|
||||
|
||||
Acknowledgements
|
||||
----------------
|
||||
|
||||
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
|
||||
valuable insight into Symbian programming. Without the SDL 1.2 port
|
||||
which was specially developed for CDoom (Doom for the Nokia 9210), this
|
||||
adaptation would not have been possible.
|
||||
|
||||
I would like to thank my friends
|
||||
[Razvan](https://twitter.com/bewarerazvan) and [Dan
|
||||
Whelan](https://danwhelan.ie/), for their continuous support. Without
|
||||
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
|
||||
have lost my patience long ago.
|
||||
|
||||
Last but not least, I would like to thank the development team of
|
||||
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
|
||||
patience and support in troubleshooting helped me a lot.
|
||||
|
@ -1,8 +1,8 @@
|
||||
Platforms
|
||||
=========
|
||||
|
||||
We maintain the list of supported platforms on our wiki now, and how to
|
||||
build and install SDL for those platforms:
|
||||
|
||||
https://wiki.libsdl.org/Installation
|
||||
|
||||
Platforms
|
||||
=========
|
||||
|
||||
We maintain the list of supported platforms on our wiki now, and how to
|
||||
build and install SDL for those platforms:
|
||||
|
||||
https://wiki.libsdl.org/Installation
|
||||
|
||||
|
@ -1,65 +1,65 @@
|
||||
Porting
|
||||
=======
|
||||
|
||||
* Porting To A New Platform
|
||||
|
||||
The first thing you have to do when porting to a new platform, is look at
|
||||
include/SDL_platform.h and create an entry there for your operating system.
|
||||
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
|
||||
Ideally SDL_platform_defines.h will be able to auto-detect the system it's building
|
||||
on based on C preprocessor symbols.
|
||||
|
||||
There are two basic ways of building SDL at the moment:
|
||||
|
||||
1. CMake: cmake -S . -B build && cmake --build build && cmake --install install
|
||||
|
||||
If you have a system that supports CMake, then you might try this. Edit CMakeLists.txt,
|
||||
|
||||
take a look at the large section labelled:
|
||||
|
||||
"Platform-specific options and settings!"
|
||||
|
||||
Add a section for your platform, and then re-run 'cmake -S . -B build' and build!
|
||||
|
||||
2. Using an IDE:
|
||||
|
||||
If you're using an IDE or other non-configure build system, you'll probably want to create a custom `SDL_build_config.h` for your platform. Edit `include/build_config/SDL_build_config.h`, add a section for your platform, and create a custom `SDL_build_config_{platform}.h`, based on `SDL_build_config_minimal.h` and `SDL_build_config.h.cmake`
|
||||
|
||||
Add the top level include directory to the header search path, and then add
|
||||
the following sources to the project:
|
||||
|
||||
src/*.c
|
||||
src/atomic/*.c
|
||||
src/audio/*.c
|
||||
src/cpuinfo/*.c
|
||||
src/events/*.c
|
||||
src/file/*.c
|
||||
src/haptic/*.c
|
||||
src/joystick/*.c
|
||||
src/power/*.c
|
||||
src/render/*.c
|
||||
src/render/software/*.c
|
||||
src/stdlib/*.c
|
||||
src/thread/*.c
|
||||
src/timer/*.c
|
||||
src/video/*.c
|
||||
src/audio/disk/*.c
|
||||
src/audio/dummy/*.c
|
||||
src/filesystem/dummy/*.c
|
||||
src/video/dummy/*.c
|
||||
src/haptic/dummy/*.c
|
||||
src/joystick/dummy/*.c
|
||||
src/thread/generic/*.c
|
||||
src/timer/dummy/*.c
|
||||
src/loadso/dummy/*.c
|
||||
|
||||
|
||||
Once you have a working library without any drivers, you can go back to each
|
||||
of the major subsystems and start implementing drivers for your platform.
|
||||
|
||||
If you have any questions, don't hesitate to ask on the SDL mailing list:
|
||||
http://www.libsdl.org/mailing-list.php
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
||||
Porting
|
||||
=======
|
||||
|
||||
* Porting To A New Platform
|
||||
|
||||
The first thing you have to do when porting to a new platform, is look at
|
||||
include/SDL_platform.h and create an entry there for your operating system.
|
||||
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
|
||||
Ideally SDL_platform_defines.h will be able to auto-detect the system it's building
|
||||
on based on C preprocessor symbols.
|
||||
|
||||
There are two basic ways of building SDL at the moment:
|
||||
|
||||
1. CMake: cmake -S . -B build && cmake --build build && cmake --install install
|
||||
|
||||
If you have a system that supports CMake, then you might try this. Edit CMakeLists.txt,
|
||||
|
||||
take a look at the large section labelled:
|
||||
|
||||
"Platform-specific options and settings!"
|
||||
|
||||
Add a section for your platform, and then re-run 'cmake -S . -B build' and build!
|
||||
|
||||
2. Using an IDE:
|
||||
|
||||
If you're using an IDE or other non-configure build system, you'll probably want to create a custom `SDL_build_config.h` for your platform. Edit `include/build_config/SDL_build_config.h`, add a section for your platform, and create a custom `SDL_build_config_{platform}.h`, based on `SDL_build_config_minimal.h` and `SDL_build_config.h.cmake`
|
||||
|
||||
Add the top level include directory to the header search path, and then add
|
||||
the following sources to the project:
|
||||
|
||||
src/*.c
|
||||
src/atomic/*.c
|
||||
src/audio/*.c
|
||||
src/cpuinfo/*.c
|
||||
src/events/*.c
|
||||
src/file/*.c
|
||||
src/haptic/*.c
|
||||
src/joystick/*.c
|
||||
src/power/*.c
|
||||
src/render/*.c
|
||||
src/render/software/*.c
|
||||
src/stdlib/*.c
|
||||
src/thread/*.c
|
||||
src/timer/*.c
|
||||
src/video/*.c
|
||||
src/audio/disk/*.c
|
||||
src/audio/dummy/*.c
|
||||
src/filesystem/dummy/*.c
|
||||
src/video/dummy/*.c
|
||||
src/haptic/dummy/*.c
|
||||
src/joystick/dummy/*.c
|
||||
src/thread/generic/*.c
|
||||
src/timer/dummy/*.c
|
||||
src/loadso/dummy/*.c
|
||||
|
||||
|
||||
Once you have a working library without any drivers, you can go back to each
|
||||
of the major subsystems and start implementing drivers for your platform.
|
||||
|
||||
If you have any questions, don't hesitate to ask on the SDL mailing list:
|
||||
http://www.libsdl.org/mailing-list.php
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
||||
|
@ -1,51 +1,51 @@
|
||||
PS2
|
||||
======
|
||||
SDL port for the Sony Playstation 2 contributed by:
|
||||
- Francisco Javier Trujillo Mata
|
||||
|
||||
|
||||
Credit to
|
||||
- The guys that ported SDL to PSP & Vita because I'm taking them as reference.
|
||||
- David G. F. for helping me with several issues and tests.
|
||||
|
||||
## Building
|
||||
To build SDL library for the PS2, make sure you have the latest PS2Dev status and run:
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
```
|
||||
|
||||
## Hints
|
||||
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`.
|
||||
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of dropping FPS to 30.
|
||||
|
||||
## Notes
|
||||
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the connection with your computer.
|
||||
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
|
||||
It could be something similar as:
|
||||
```c
|
||||
.....
|
||||
|
||||
SDL_PS2_SKIP_IOP_RESET();
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
.....
|
||||
```
|
||||
For a release binary is recommendable to reset the IOP always.
|
||||
|
||||
Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected.
|
||||
|
||||
## Getting PS2 Dev
|
||||
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
|
||||
|
||||
## Running on PCSX2 Emulator
|
||||
[PCSX2](https://github.com/PCSX2/pcsx2)
|
||||
|
||||
[More PCSX2 information](https://pcsx2.net/)
|
||||
|
||||
## To Do
|
||||
- PS2 Screen Keyboard
|
||||
- Dialogs
|
||||
- Others
|
||||
PS2
|
||||
======
|
||||
SDL port for the Sony Playstation 2 contributed by:
|
||||
- Francisco Javier Trujillo Mata
|
||||
|
||||
|
||||
Credit to
|
||||
- The guys that ported SDL to PSP & Vita because I'm taking them as reference.
|
||||
- David G. F. for helping me with several issues and tests.
|
||||
|
||||
## Building
|
||||
To build SDL library for the PS2, make sure you have the latest PS2Dev status and run:
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
```
|
||||
|
||||
## Hints
|
||||
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`.
|
||||
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of dropping FPS to 30.
|
||||
|
||||
## Notes
|
||||
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the connection with your computer.
|
||||
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
|
||||
It could be something similar as:
|
||||
```c
|
||||
.....
|
||||
|
||||
SDL_PS2_SKIP_IOP_RESET();
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
.....
|
||||
```
|
||||
For a release binary is recommendable to reset the IOP always.
|
||||
|
||||
Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected.
|
||||
|
||||
## Getting PS2 Dev
|
||||
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
|
||||
|
||||
## Running on PCSX2 Emulator
|
||||
[PCSX2](https://github.com/PCSX2/pcsx2)
|
||||
|
||||
[More PCSX2 information](https://pcsx2.net/)
|
||||
|
||||
## To Do
|
||||
- PS2 Screen Keyboard
|
||||
- Dialogs
|
||||
- Others
|
||||
|
@ -1,36 +1,36 @@
|
||||
PSP
|
||||
======
|
||||
SDL port for the Sony PSP contributed by:
|
||||
- Captian Lex
|
||||
- Francisco Javier Trujillo Mata
|
||||
- Wouter Wijsman
|
||||
|
||||
|
||||
Credit to
|
||||
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
|
||||
Geecko for his PSP GU lib "Glib2d"
|
||||
|
||||
## Building
|
||||
To build SDL library for the PSP, make sure you have the latest PSPDev status and run:
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
```
|
||||
|
||||
|
||||
## Getting PSP Dev
|
||||
[Installing PSP Dev](https://github.com/pspdev/pspdev)
|
||||
|
||||
## Running on PPSSPP Emulator
|
||||
[PPSSPP](https://github.com/hrydgard/ppsspp)
|
||||
|
||||
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
|
||||
|
||||
|
||||
## Compiling a HelloWorld
|
||||
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
|
||||
|
||||
## To Do
|
||||
- PSP Screen Keyboard
|
||||
- Dialogs
|
||||
PSP
|
||||
======
|
||||
SDL port for the Sony PSP contributed by:
|
||||
- Captian Lex
|
||||
- Francisco Javier Trujillo Mata
|
||||
- Wouter Wijsman
|
||||
|
||||
|
||||
Credit to
|
||||
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
|
||||
Geecko for his PSP GU lib "Glib2d"
|
||||
|
||||
## Building
|
||||
To build SDL library for the PSP, make sure you have the latest PSPDev status and run:
|
||||
```bash
|
||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
```
|
||||
|
||||
|
||||
## Getting PSP Dev
|
||||
[Installing PSP Dev](https://github.com/pspdev/pspdev)
|
||||
|
||||
## Running on PPSSPP Emulator
|
||||
[PPSSPP](https://github.com/hrydgard/ppsspp)
|
||||
|
||||
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
|
||||
|
||||
|
||||
## Compiling a HelloWorld
|
||||
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
|
||||
|
||||
## To Do
|
||||
- PSP Screen Keyboard
|
||||
- Dialogs
|
||||
|
@ -1,180 +1,180 @@
|
||||
Raspberry Pi
|
||||
============
|
||||
|
||||
Requirements:
|
||||
|
||||
Raspbian (other Linux distros may work as well).
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* Works without X11
|
||||
* Hardware accelerated OpenGL ES 2.x
|
||||
* Sound via ALSA
|
||||
* Input (mouse/keyboard/joystick) via EVDEV
|
||||
* Hotplugging of input devices via UDEV
|
||||
|
||||
|
||||
Raspbian Build Dependencies
|
||||
---------------------------
|
||||
|
||||
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
||||
|
||||
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
||||
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
|
||||
|
||||
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
||||
|
||||
|
||||
NEON
|
||||
----
|
||||
|
||||
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
|
||||
that SDL will select some otherwise-disabled highly-optimized code. The
|
||||
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
|
||||
definitely does.
|
||||
|
||||
|
||||
Cross compiling from x86 Linux
|
||||
------------------------------
|
||||
|
||||
To cross compile SDL for Raspbian from your desktop machine, you'll need a
|
||||
Raspbian system root and the cross compilation tools. We'll assume these tools
|
||||
will be placed in /opt/rpi-tools
|
||||
|
||||
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
||||
|
||||
You'll also need a Raspbian binary image.
|
||||
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
||||
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
|
||||
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
||||
|
||||
export SYSROOT=/opt/rpi-sysroot
|
||||
sudo kpartx -a -v <path_to_raspbian_image>.img
|
||||
sudo mount -o loop /dev/mapper/loop0p2 /mnt
|
||||
sudo cp -r /mnt $SYSROOT
|
||||
sudo apt-get install qemu binfmt-support qemu-user-static
|
||||
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
|
||||
sudo mount --bind /dev $SYSROOT/dev
|
||||
sudo mount --bind /proc $SYSROOT/proc
|
||||
sudo mount --bind /sys $SYSROOT/sys
|
||||
|
||||
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
|
||||
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
|
||||
|
||||
sudo chroot $SYSROOT
|
||||
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev
|
||||
exit
|
||||
sudo umount $SYSROOT/dev
|
||||
sudo umount $SYSROOT/proc
|
||||
sudo umount $SYSROOT/sys
|
||||
sudo umount /mnt
|
||||
|
||||
There's one more fix required, as the libdl.so symlink uses an absolute path
|
||||
which doesn't quite work in our setup.
|
||||
|
||||
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||
|
||||
The final step is compiling SDL itself.
|
||||
|
||||
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
|
||||
cd <SDL SOURCE>
|
||||
mkdir -p build;cd build
|
||||
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl3-installed --disable-pulseaudio --disable-esd
|
||||
make
|
||||
make install
|
||||
|
||||
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
||||
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc
|
||||
|
||||
Apps don't work or poor video/audio performance
|
||||
-----------------------------------------------
|
||||
|
||||
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
|
||||
update the RPi's firmware. Note that doing so will fix these problems, but it
|
||||
will also render the CMA - Dynamic Memory Split functionality useless.
|
||||
|
||||
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
|
||||
low in general, specially if a 1080p TV is hooked up.
|
||||
|
||||
See here how to configure this setting: http://elinux.org/RPiconfig
|
||||
|
||||
Using a fixed gpu_mem=128 is the best option (specially if you updated the
|
||||
firmware, using CMA probably won't work, at least it's the current case).
|
||||
|
||||
No input
|
||||
--------
|
||||
|
||||
Make sure you belong to the "input" group.
|
||||
|
||||
sudo usermod -aG input `whoami`
|
||||
|
||||
No HDMI Audio
|
||||
-------------
|
||||
|
||||
If you notice that ALSA works but there's no audio over HDMI, try adding:
|
||||
|
||||
hdmi_drive=2
|
||||
|
||||
to your config.txt file and reboot.
|
||||
|
||||
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
|
||||
|
||||
Text Input API support
|
||||
----------------------
|
||||
|
||||
The Text Input API is supported, with translation of scan codes done via the
|
||||
kernel symbol tables. For this to work, SDL needs access to a valid console.
|
||||
If you notice there's no SDL_EVENT_TEXT_INPUT message being emitted, double check that
|
||||
your app has read access to one of the following:
|
||||
|
||||
* /proc/self/fd/0
|
||||
* /dev/tty
|
||||
* /dev/tty[0...6]
|
||||
* /dev/vc/0
|
||||
* /dev/console
|
||||
|
||||
This is usually not a problem if you run from the physical terminal (as opposed
|
||||
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
||||
quick workaround is to run your app as root or add yourself to the tty group,
|
||||
then re-login to the system.
|
||||
|
||||
sudo usermod -aG tty `whoami`
|
||||
|
||||
The keyboard layout used by SDL is the same as the one the kernel uses.
|
||||
To configure the layout on Raspbian:
|
||||
|
||||
sudo dpkg-reconfigure keyboard-configuration
|
||||
|
||||
To configure the locale, which controls which keys are interpreted as letters,
|
||||
this determining the CAPS LOCK behavior:
|
||||
|
||||
sudo dpkg-reconfigure locales
|
||||
|
||||
|
||||
OpenGL problems
|
||||
---------------
|
||||
|
||||
If you have desktop OpenGL headers installed at build time in your RPi or cross
|
||||
compilation environment, support for it will be built in. However, the chipset
|
||||
does not actually have support for it, which causes issues in certain SDL apps
|
||||
since the presence of OpenGL support supersedes the ES/ES2 variants.
|
||||
The workaround is to disable OpenGL at configuration time:
|
||||
|
||||
./configure --disable-video-opengl
|
||||
|
||||
Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER
|
||||
environment variable:
|
||||
|
||||
export SDL_RENDER_DRIVER=opengles2
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
|
||||
leaking into the console only if it has root privileges. Launching apps locally
|
||||
does not suffer from this issue.
|
||||
|
||||
|
||||
Raspberry Pi
|
||||
============
|
||||
|
||||
Requirements:
|
||||
|
||||
Raspbian (other Linux distros may work as well).
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* Works without X11
|
||||
* Hardware accelerated OpenGL ES 2.x
|
||||
* Sound via ALSA
|
||||
* Input (mouse/keyboard/joystick) via EVDEV
|
||||
* Hotplugging of input devices via UDEV
|
||||
|
||||
|
||||
Raspbian Build Dependencies
|
||||
---------------------------
|
||||
|
||||
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
|
||||
|
||||
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
|
||||
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
|
||||
|
||||
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
|
||||
|
||||
|
||||
NEON
|
||||
----
|
||||
|
||||
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
|
||||
that SDL will select some otherwise-disabled highly-optimized code. The
|
||||
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
|
||||
definitely does.
|
||||
|
||||
|
||||
Cross compiling from x86 Linux
|
||||
------------------------------
|
||||
|
||||
To cross compile SDL for Raspbian from your desktop machine, you'll need a
|
||||
Raspbian system root and the cross compilation tools. We'll assume these tools
|
||||
will be placed in /opt/rpi-tools
|
||||
|
||||
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
|
||||
|
||||
You'll also need a Raspbian binary image.
|
||||
Get it from: http://downloads.raspberrypi.org/raspbian_latest
|
||||
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
|
||||
Let's assume the sysroot will be built in /opt/rpi-sysroot.
|
||||
|
||||
export SYSROOT=/opt/rpi-sysroot
|
||||
sudo kpartx -a -v <path_to_raspbian_image>.img
|
||||
sudo mount -o loop /dev/mapper/loop0p2 /mnt
|
||||
sudo cp -r /mnt $SYSROOT
|
||||
sudo apt-get install qemu binfmt-support qemu-user-static
|
||||
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
|
||||
sudo mount --bind /dev $SYSROOT/dev
|
||||
sudo mount --bind /proc $SYSROOT/proc
|
||||
sudo mount --bind /sys $SYSROOT/sys
|
||||
|
||||
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
|
||||
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
|
||||
|
||||
sudo chroot $SYSROOT
|
||||
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev
|
||||
exit
|
||||
sudo umount $SYSROOT/dev
|
||||
sudo umount $SYSROOT/proc
|
||||
sudo umount $SYSROOT/sys
|
||||
sudo umount /mnt
|
||||
|
||||
There's one more fix required, as the libdl.so symlink uses an absolute path
|
||||
which doesn't quite work in our setup.
|
||||
|
||||
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
|
||||
|
||||
The final step is compiling SDL itself.
|
||||
|
||||
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
|
||||
cd <SDL SOURCE>
|
||||
mkdir -p build;cd build
|
||||
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl3-installed --disable-pulseaudio --disable-esd
|
||||
make
|
||||
make install
|
||||
|
||||
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
||||
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc
|
||||
|
||||
Apps don't work or poor video/audio performance
|
||||
-----------------------------------------------
|
||||
|
||||
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
|
||||
update the RPi's firmware. Note that doing so will fix these problems, but it
|
||||
will also render the CMA - Dynamic Memory Split functionality useless.
|
||||
|
||||
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
|
||||
low in general, specially if a 1080p TV is hooked up.
|
||||
|
||||
See here how to configure this setting: http://elinux.org/RPiconfig
|
||||
|
||||
Using a fixed gpu_mem=128 is the best option (specially if you updated the
|
||||
firmware, using CMA probably won't work, at least it's the current case).
|
||||
|
||||
No input
|
||||
--------
|
||||
|
||||
Make sure you belong to the "input" group.
|
||||
|
||||
sudo usermod -aG input `whoami`
|
||||
|
||||
No HDMI Audio
|
||||
-------------
|
||||
|
||||
If you notice that ALSA works but there's no audio over HDMI, try adding:
|
||||
|
||||
hdmi_drive=2
|
||||
|
||||
to your config.txt file and reboot.
|
||||
|
||||
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
|
||||
|
||||
Text Input API support
|
||||
----------------------
|
||||
|
||||
The Text Input API is supported, with translation of scan codes done via the
|
||||
kernel symbol tables. For this to work, SDL needs access to a valid console.
|
||||
If you notice there's no SDL_EVENT_TEXT_INPUT message being emitted, double check that
|
||||
your app has read access to one of the following:
|
||||
|
||||
* /proc/self/fd/0
|
||||
* /dev/tty
|
||||
* /dev/tty[0...6]
|
||||
* /dev/vc/0
|
||||
* /dev/console
|
||||
|
||||
This is usually not a problem if you run from the physical terminal (as opposed
|
||||
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
|
||||
quick workaround is to run your app as root or add yourself to the tty group,
|
||||
then re-login to the system.
|
||||
|
||||
sudo usermod -aG tty `whoami`
|
||||
|
||||
The keyboard layout used by SDL is the same as the one the kernel uses.
|
||||
To configure the layout on Raspbian:
|
||||
|
||||
sudo dpkg-reconfigure keyboard-configuration
|
||||
|
||||
To configure the locale, which controls which keys are interpreted as letters,
|
||||
this determining the CAPS LOCK behavior:
|
||||
|
||||
sudo dpkg-reconfigure locales
|
||||
|
||||
|
||||
OpenGL problems
|
||||
---------------
|
||||
|
||||
If you have desktop OpenGL headers installed at build time in your RPi or cross
|
||||
compilation environment, support for it will be built in. However, the chipset
|
||||
does not actually have support for it, which causes issues in certain SDL apps
|
||||
since the presence of OpenGL support supersedes the ES/ES2 variants.
|
||||
The workaround is to disable OpenGL at configuration time:
|
||||
|
||||
./configure --disable-video-opengl
|
||||
|
||||
Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER
|
||||
environment variable:
|
||||
|
||||
export SDL_RENDER_DRIVER=opengles2
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
|
||||
leaking into the console only if it has root privileges. Launching apps locally
|
||||
does not suffer from this issue.
|
||||
|
||||
|
||||
|
@ -1,35 +1,35 @@
|
||||
RISC OS
|
||||
=======
|
||||
|
||||
Requirements:
|
||||
|
||||
* RISC OS 3.5 or later.
|
||||
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
|
||||
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
|
||||
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
|
||||
|
||||
|
||||
Compiling:
|
||||
----------
|
||||
|
||||
Currently, SDL for RISC OS only supports compiling with GCCSDK under Linux.
|
||||
|
||||
The following commands can be used to build SDL for RISC OS using CMake:
|
||||
|
||||
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-riscos
|
||||
cmake --install build-riscos
|
||||
|
||||
When using GCCSDK 4.7.4 release 6 or earlier versions, the builtin atomic functions are broken, meaning it's currently necessary to compile with `-DSDL_GCC_ATOMICS=OFF` using CMake. Newer versions of GCCSDK don't have this problem.
|
||||
|
||||
|
||||
Current level of implementation
|
||||
-------------------------------
|
||||
|
||||
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
|
||||
|
||||
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
|
||||
|
||||
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
|
||||
|
||||
The joystick, locale and power APIs are not yet implemented.
|
||||
RISC OS
|
||||
=======
|
||||
|
||||
Requirements:
|
||||
|
||||
* RISC OS 3.5 or later.
|
||||
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
|
||||
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
|
||||
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
|
||||
|
||||
|
||||
Compiling:
|
||||
----------
|
||||
|
||||
Currently, SDL for RISC OS only supports compiling with GCCSDK under Linux.
|
||||
|
||||
The following commands can be used to build SDL for RISC OS using CMake:
|
||||
|
||||
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-riscos
|
||||
cmake --install build-riscos
|
||||
|
||||
When using GCCSDK 4.7.4 release 6 or earlier versions, the builtin atomic functions are broken, meaning it's currently necessary to compile with `-DSDL_GCC_ATOMICS=OFF` using CMake. Newer versions of GCCSDK don't have this problem.
|
||||
|
||||
|
||||
Current level of implementation
|
||||
-------------------------------
|
||||
|
||||
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
|
||||
|
||||
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
|
||||
|
||||
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
|
||||
|
||||
The joystick, locale and power APIs are not yet implemented.
|
||||
|
@ -1,81 +1,82 @@
|
||||
Touch
|
||||
===========================================================================
|
||||
System Specific Notes
|
||||
===========================================================================
|
||||
Linux:
|
||||
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
|
||||
|
||||
Mac:
|
||||
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
|
||||
|
||||
iPhone:
|
||||
Works out of box.
|
||||
|
||||
Windows:
|
||||
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
|
||||
|
||||
===========================================================================
|
||||
Events
|
||||
===========================================================================
|
||||
SDL_EVENT_FINGER_DOWN:
|
||||
Sent when a finger (or stylus) is placed on a touch device.
|
||||
Fields:
|
||||
* event.tfinger.touchId - the Id of the touch device.
|
||||
* event.tfinger.fingerId - the Id of the finger which just went down.
|
||||
* event.tfinger.x - the x coordinate of the touch (0..1)
|
||||
* event.tfinger.y - the y coordinate of the touch (0..1)
|
||||
* event.tfinger.pressure - the pressure of the touch (0..1)
|
||||
|
||||
SDL_EVENT_FINGER_MOTION:
|
||||
Sent when a finger (or stylus) is moved on the touch device.
|
||||
Fields:
|
||||
Same as SDL_EVENT_FINGER_DOWN but with additional:
|
||||
* event.tfinger.dx - change in x coordinate during this motion event.
|
||||
* event.tfinger.dy - change in y coordinate during this motion event.
|
||||
|
||||
SDL_EVENT_FINGER_UP:
|
||||
Sent when a finger (or stylus) is lifted from the touch device.
|
||||
Fields:
|
||||
Same as SDL_EVENT_FINGER_DOWN.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Functions
|
||||
===========================================================================
|
||||
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||
These structures should _never_ be modified.
|
||||
|
||||
The following functions are included from SDL_touch.h
|
||||
|
||||
To get a SDL_TouchID call SDL_GetTouchDevice(int index).
|
||||
This returns a SDL_TouchID.
|
||||
IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this!
|
||||
|
||||
The number of touch devices can be queried with SDL_GetNumTouchDevices().
|
||||
|
||||
A SDL_TouchID may be used to get pointers to SDL_Finger.
|
||||
|
||||
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
|
||||
|
||||
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
|
||||
|
||||
float x = event.tfinger.x;
|
||||
float y = event.tfinger.y;
|
||||
|
||||
|
||||
|
||||
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
|
||||
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
|
||||
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_EVENT_FINGER_UP event is _added_ to the event queue, and thus _before_ the SDL_EVENT_FINGER_UP event is polled.
|
||||
As a result, be very careful to check for NULL return values.
|
||||
|
||||
A SDL_Finger has the following fields:
|
||||
* x, y:
|
||||
The current coordinates of the touch.
|
||||
* pressure:
|
||||
The pressure of the touch.
|
||||
|
||||
|
||||
Please direct questions/comments to:
|
||||
jim.tla+sdl_touch@gmail.com
|
||||
(original author, API was changed since)
|
||||
Touch
|
||||
===========================================================================
|
||||
System Specific Notes
|
||||
===========================================================================
|
||||
Linux:
|
||||
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
|
||||
|
||||
Mac:
|
||||
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
|
||||
|
||||
iPhone:
|
||||
Works out of box.
|
||||
|
||||
Windows:
|
||||
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
|
||||
|
||||
===========================================================================
|
||||
Events
|
||||
===========================================================================
|
||||
SDL_EVENT_FINGER_DOWN:
|
||||
Sent when a finger (or stylus) is placed on a touch device.
|
||||
Fields:
|
||||
* event.tfinger.touchId - the Id of the touch device.
|
||||
* event.tfinger.fingerId - the Id of the finger which just went down.
|
||||
* event.tfinger.x - the x coordinate of the touch (0..1)
|
||||
* event.tfinger.y - the y coordinate of the touch (0..1)
|
||||
* event.tfinger.pressure - the pressure of the touch (0..1)
|
||||
|
||||
SDL_EVENT_FINGER_MOTION:
|
||||
Sent when a finger (or stylus) is moved on the touch device.
|
||||
Fields:
|
||||
Same as SDL_EVENT_FINGER_DOWN but with additional:
|
||||
* event.tfinger.dx - change in x coordinate during this motion event.
|
||||
* event.tfinger.dy - change in y coordinate during this motion event.
|
||||
|
||||
SDL_EVENT_FINGER_UP:
|
||||
Sent when a finger (or stylus) is lifted from the touch device.
|
||||
Fields:
|
||||
Same as SDL_EVENT_FINGER_DOWN.
|
||||
|
||||
|
||||
===========================================================================
|
||||
Functions
|
||||
===========================================================================
|
||||
SDL provides the ability to access the underlying SDL_Finger structures.
|
||||
These structures should _never_ be modified.
|
||||
|
||||
The following functions are included from SDL_touch.h
|
||||
|
||||
Devices are tracked by instance ID, of type SDL_TouchID.
|
||||
|
||||
To get a list of available device SDL_TouchID values, call SDL_GetTouchDevices().
|
||||
This returns an array of device IDs, terminated by a zero ID. Optionally, you can
|
||||
get a count of IDs by passing a non-NULL int* to SDL_GetTouchDevices() if you'd
|
||||
rather not iterate the whole array to get this number.
|
||||
|
||||
A SDL_TouchID may be used to get pointers to SDL_Finger.
|
||||
|
||||
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
|
||||
|
||||
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
|
||||
|
||||
float x = event.tfinger.x;
|
||||
float y = event.tfinger.y;
|
||||
|
||||
|
||||
|
||||
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
|
||||
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
|
||||
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_EVENT_FINGER_UP event is _added_ to the event queue, and thus _before_ the SDL_EVENT_FINGER_UP event is polled.
|
||||
As a result, be very careful to check for NULL return values.
|
||||
|
||||
A SDL_Finger has the following fields:
|
||||
* x, y:
|
||||
The current coordinates of the touch.
|
||||
* pressure:
|
||||
The pressure of the touch.
|
||||
|
||||
|
||||
Please direct questions/comments to:
|
||||
jim.tla+sdl_touch@gmail.com
|
||||
(original author, API was changed since)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user