Commit Graph

519 Commits

Author SHA1 Message Date
Frank Praznik
c9ffa3f9e1
Remove vestiges of the TAKE_FOCUS window event
The event was removed, so remove the rename define and update the coccinelle script.
2024-10-06 10:02:53 -04:00
Ryan C. Gordon
ffe4e571d1
wikiheaders: regex hack to make a URL not confuse wikilink genertion. 2024-10-04 15:34:18 -04:00
Anonymous Maarten
bd4cd34a74 Add docs to mingw development archive 2024-10-04 18:19:07 +02:00
Sam Lantinga
6c64c62114 Rename SDL_BUTTON() to SDL_BUTTON_MASK()
Fixes https://github.com/libsdl-org/SDL/issues/11056
2024-10-04 09:13:59 -07:00
Sam Lantinga
fe2880fcda Rename SDL_SetThreadPriority() to SDL_SetCurrentThreadPriority()
Fixes https://github.com/libsdl-org/SDL/issues/11055
2024-10-04 08:57:03 -07:00
Ryan C. Gordon
1bb7e2b1a8
SDL_migration.cocci: Removed obsolete SDL_CreateWindowWithPosition code.
This won't handle conversion of SDL_CreateWindow calls with arbitrary
positions, but it still will handle the common UNDEFINED scenario.

Fixes #11035.
2024-10-03 01:01:34 -04:00
Ryan C. Gordon
d2b2a752ce
SDL_migration.cocci: A few fixes. 2024-10-02 00:56:21 -04:00
Anthony
5f5379dc99
Add SDL_IsTV() (#11004)
Moved SDL_IsAndroidTV() out of public API, to match SDL_IsAndroidTablet().

Added SDL_IsTV(), to mirror existing SDL_IsTablet().
2024-10-01 09:20:00 -07:00
Anonymous Maarten
80cf3f7c38 ci: Fix check_stdlib_usage.py and run on ci 2024-09-25 23:59:35 +02:00
Ryan C. Gordon
54459def69 render: Remove the logical presentation render target.
Now we render directly to the window, scaling as appropriate. This fixes some
concerns the render target introduced, like the quality of the final scaled
output, how to step outside of the logical size temporarily to draw some
things sharply at the native resolution, and loss of sub-pixel precision.

Fixes #8736.
2024-09-25 16:26:36 -04:00
Anonymous Maarten
1561d7c089 Fix warnings in build-scripts/check_stdlib_usage.py 2024-09-25 20:34:32 +02:00
Anonymous Maarten
2070adb262 android: add python script checking Android JNI bindings 2024-09-25 20:34:32 +02:00
Ryan C. Gordon
3bc2bd790c
build-web-examples.pl: Added a FIXME. 2024-09-22 10:35:59 -04:00
Sam Lantinga
46fb2c6f1b Added a script to help with the bool rename 2024-09-18 10:48:11 -07:00
Sam Lantinga
95f7e53233 Added the examples directory to the API renaming tool 2024-09-18 08:32:30 -07:00
Sam Lantinga
a90ad3b0e2 Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
2024-09-18 08:32:30 -07:00
Sam Lantinga
32cf23d392 Added video/x11/edid.h to third party code list 2024-09-18 08:18:26 -07:00
Sam Lantinga
8d223b3037 Renamed atomic functions to match SDL 3.0 naming convention
This will also allow us to cleanly add atomic operations for other types in the future.
2024-09-17 08:53:27 -07:00
Anonymous Maarten
1ffb9f22aa build-release.py fixes from SDL2 port 2024-09-17 16:24:02 +02:00
Carl Åstholm
1f3fd65c4c cpuinfo: Rename SDL_GetCPUCount to SDL_GetNumLogicalCPUCores
This was the only API that broke the "GetNumThings" convention
used elsewhere, so renaming it helps with consistency.
Adding "logical cores" to the name also makes it a bit
more immediately obvious what the count actually represents.
2024-09-14 19:33:30 -07:00
Sam Lantinga
37c9fb490e Changed enums to use XXX_COUNT for the count or number of values
Fixes https://github.com/libsdl-org/SDL/issues/10763
2024-09-11 09:32:17 -07:00
Sam Lantinga
6fc6e3dc7e Use SDL_bool where appropriate in SDL events
This involved changing button state from Uint8 to SDL_bool, and made SDL_PRESSED and SDL_RELEASED unnecessary.

Fixes https://github.com/libsdl-org/SDL/issues/10069
2024-09-09 14:00:19 -07:00
Ryan C. Gordon
154452a726 winrt: Removed WinRT/Windows Phone/UWP support.
Fixes #10724.
2024-09-06 13:28:39 -04:00
Sam Lantinga
8edb901724 Fixed crashes in Metal renderer due to ARC releasing references on random memory in newly allocated structs 2024-09-05 19:48:33 -07:00
Sylvain
defbf67306 SDL_migration.cocci: add SDL_TTF/mixer/image function names to be upgraded from int returned type to bool. 2024-09-05 05:24:19 -07:00
Sam Lantinga
eacf119923 Renamed SDL_size_add_overflow() and SDL_size_mul_overflow() 2024-09-02 17:17:48 -07:00
Sam Lantinga
f827c1322c Renamed SDL_Del* to SDL_Remove* 2024-08-31 07:46:28 -07:00
Sam Lantinga
cf1d8e2dfd Renamed SDL_AtomicSetPtr() and SDL_AtomicGetPtr()
Fixes https://github.com/libsdl-org/SDL/issues/10601
2024-08-31 07:46:28 -07:00
Sam Lantinga
b602c449e5 Remove SDL_SCALEMODE_BEST
Fixes https://github.com/libsdl-org/SDL/issues/10619
2024-08-30 10:30:14 -07:00
Anonymous Maarten
d6ad28a4cb Dynamically generate __main__.py of Android aar package 2024-08-29 13:57:29 +02:00
Sam Lantinga
9ff3446f03 Use SDL_bool instead an int return code in the SDL API
Most SDL functions used to indicate success or failure using an int return code. These functions have been changed to return SDL_bool.

Here is a coccinelle patch to change code that previously compared the return value to 0 and changes it to a boolean test:
@ bool_return_type  @
identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAlternateImage|SDL_AddVulkanRenderSemaphores|SDL_BindAudioStream|SDL_BindAudioStreams|SDL_BlitSurface|SDL_BlitSurface9Grid|SDL_BlitSurfaceScaled|SDL_BlitSurfaceTiled|SDL_BlitSurfaceTiledWithScale|SDL_BlitSurfaceUnchecked|SDL_BlitSurfaceUncheckedScaled|SDL_CaptureMouse|SDL_ClearAudioStream|SDL_ClearClipboardData|SDL_ClearComposition|SDL_ClearError|SDL_ClearProperty|SDL_ClearSurface|SDL_CloseIO|SDL_CloseStorage|SDL_ConvertAudioSamples|SDL_ConvertEventToRenderCoordinates|SDL_ConvertPixels|SDL_ConvertPixelsAndColorspace|SDL_CopyFile|SDL_CopyProperties|SDL_CopyStorageFile|SDL_CreateDirectory|SDL_CreateStorageDirectory|SDL_CreateWindowAndRenderer|SDL_DateTimeToTime|SDL_DestroyWindowSurface|SDL_DetachVirtualJoystick|SDL_DisableScreenSaver|SDL_EnableScreenSaver|SDL_EnumerateDirectory|SDL_EnumerateProperties|SDL_EnumerateStorageDirectory|SDL_FillSurfaceRect|SDL_FillSurfaceRects|SDL_FlashWindow|SDL_FlipSurface|SDL_FlushAudioStream|SDL_FlushRenderer|SDL_GL_DestroyContext|SDL_GL_GetAttribute|SDL_GL_GetSwapInterval|SDL_GL_LoadLibrary|SDL_GL_MakeCurrent|SDL_GL_SetAttribute|SDL_GL_SetSwapInterval|SDL_GL_SwapWindow|SDL_GetAudioDeviceFormat|SDL_GetAudioStreamFormat|SDL_GetCameraFormat|SDL_GetClosestFullscreenDisplayMode|SDL_GetCurrentRenderOutputSize|SDL_GetCurrentTime|SDL_GetDXGIOutputInfo|SDL_GetDateTimeLocalePreferences|SDL_GetDisplayBounds|SDL_GetDisplayUsableBounds|SDL_GetGDKDefaultUser|SDL_GetGDKTaskQueue|SDL_GetGamepadSensorData|SDL_GetGamepadTouchpadFinger|SDL_GetHapticEffectStatus|SDL_GetJoystickBall|SDL_GetMasksForPixelFormat|SDL_GetPathInfo|SDL_GetRectUnion|SDL_GetRectUnionFloat|SDL_GetRenderClipRect|SDL_GetRenderColorScale|SDL_GetRenderDrawBlendMode|SDL_GetRenderDrawColor|SDL_GetRenderDrawColorFloat|SDL_GetRenderLogicalPresentation|SDL_GetRenderLogicalPresentationRect|SDL_GetRenderOutputSize|SDL_GetRenderSafeArea|SDL_GetRenderScale|SDL_GetRenderVSync|SDL_GetRenderViewport|SDL_GetSensorData|SDL_GetStorageFileSize|SDL_GetStoragePathInfo|SDL_GetSurfaceAlphaMod|SDL_GetSurfaceBlendMode|SDL_GetSurfaceClipRect|SDL_GetSurfaceColorKey|SDL_GetSurfaceColorMod|SDL_GetTextInputArea|SDL_GetTextureAlphaMod|SDL_GetTextureAlphaModFloat|SDL_GetTextureBlendMode|SDL_GetTextureColorMod|SDL_GetTextureColorModFloat|SDL_GetTextureScaleMode|SDL_GetTextureSize|SDL_GetWindowAspectRatio|SDL_GetWindowBordersSize|SDL_GetWindowMaximumSize|SDL_GetWindowMinimumSize|SDL_GetWindowPosition|SDL_GetWindowRelativeMouseMode|SDL_GetWindowSafeArea|SDL_GetWindowSize|SDL_GetWindowSizeInPixels|SDL_GetWindowSurfaceVSync|SDL_HideCursor|SDL_HideWindow|SDL_Init|SDL_InitHapticRumble|SDL_InitSubSystem|SDL_LoadWAV|SDL_LoadWAV_IO|SDL_LockAudioStream|SDL_LockProperties|SDL_LockSurface|SDL_LockTexture|SDL_LockTextureToSurface|SDL_MaximizeWindow|SDL_MinimizeWindow|SDL_MixAudio|SDL_OpenURL|SDL_OutOfMemory|SDL_PauseAudioDevice|SDL_PauseAudioStreamDevice|SDL_PauseHaptic|SDL_PlayHapticRumble|SDL_PremultiplyAlpha|SDL_PremultiplySurfaceAlpha|SDL_PushEvent|SDL_PutAudioStreamData|SDL_RaiseWindow|SDL_ReadStorageFile|SDL_ReadSurfacePixel|SDL_ReadSurfacePixelFloat|SDL_RegisterApp|SDL_ReloadGamepadMappings|SDL_RemovePath|SDL_RemoveStoragePath|SDL_RemoveTimer|SDL_RenamePath|SDL_RenameStoragePath|SDL_RenderClear|SDL_RenderCoordinatesFromWindow|SDL_RenderCoordinatesToWindow|SDL_RenderFillRect|SDL_RenderFillRects|SDL_RenderGeometry|SDL_RenderGeometryRaw|SDL_RenderLine|SDL_RenderLines|SDL_RenderPoint|SDL_RenderPoints|SDL_RenderPresent|SDL_RenderRect|SDL_RenderRects|SDL_RenderTexture|SDL_RenderTexture9Grid|SDL_RenderTextureRotated|SDL_RenderTextureTiled|SDL_RequestAndroidPermission|SDL_RestoreWindow|SDL_ResumeAudioDevice|SDL_ResumeAudioStreamDevice|SDL_ResumeHaptic|SDL_RumbleGamepad|SDL_RumbleGamepadTriggers|SDL_RumbleJoystick|SDL_RumbleJoystickTriggers|SDL_RunHapticEffect|SDL_SaveBMP|SDL_SaveBMP_IO|SDL_SendAndroidMessage|SDL_SendGamepadEffect|SDL_SendJoystickEffect|SDL_SendJoystickVirtualSensorData|SDL_SetAppMetadata|SDL_SetAppMetadataProperty|SDL_SetAudioDeviceGain|SDL_SetAudioPostmixCallback|SDL_SetAudioStreamFormat|SDL_SetAudioStreamFrequencyRatio|SDL_SetAudioStreamGain|SDL_SetAudioStreamGetCallback|SDL_SetAudioStreamInputChannelMap|SDL_SetAudioStreamOutputChannelMap|SDL_SetAudioStreamPutCallback|SDL_SetBooleanProperty|SDL_SetClipboardData|SDL_SetClipboardText|SDL_SetCursor|SDL_SetFloatProperty|SDL_SetGamepadLED|SDL_SetGamepadMapping|SDL_SetGamepadPlayerIndex|SDL_SetGamepadSensorEnabled|SDL_SetHapticAutocenter|SDL_SetHapticGain|SDL_SetJoystickLED|SDL_SetJoystickPlayerIndex|SDL_SetJoystickVirtualAxis|SDL_SetJoystickVirtualBall|SDL_SetJoystickVirtualButton|SDL_SetJoystickVirtualHat|SDL_SetJoystickVirtualTouchpad|SDL_SetLinuxThreadPriority|SDL_SetLinuxThreadPriorityAndPolicy|SDL_SetLogPriorityPrefix|SDL_SetMemoryFunctions|SDL_SetNumberProperty|SDL_SetPaletteColors|SDL_SetPointerProperty|SDL_SetPointerPropertyWithCleanup|SDL_SetPrimarySelectionText|SDL_SetRenderClipRect|SDL_SetRenderColorScale|SDL_SetRenderDrawBlendMode|SDL_SetRenderDrawColor|SDL_SetRenderDrawColorFloat|SDL_SetRenderLogicalPresentation|SDL_SetRenderScale|SDL_SetRenderTarget|SDL_SetRenderVSync|SDL_SetRenderViewport|SDL_SetScancodeName|SDL_SetStringProperty|SDL_SetSurfaceAlphaMod|SDL_SetSurfaceBlendMode|SDL_SetSurfaceColorKey|SDL_SetSurfaceColorMod|SDL_SetSurfaceColorspace|SDL_SetSurfacePalette|SDL_SetSurfaceRLE|SDL_SetTLS|SDL_SetTextInputArea|SDL_SetTextureAlphaMod|SDL_SetTextureAlphaModFloat|SDL_SetTextureBlendMode|SDL_SetTextureColorMod|SDL_SetTextureColorModFloat|SDL_SetTextureScaleMode|SDL_SetThreadPriority|SDL_SetWindowAlwaysOnTop|SDL_SetWindowAspectRatio|SDL_SetWindowBordered|SDL_SetWindowFocusable|SDL_SetWindowFullscreen|SDL_SetWindowFullscreenMode|SDL_SetWindowHitTest|SDL_SetWindowIcon|SDL_SetWindowKeyboardGrab|SDL_SetWindowMaximumSize|SDL_SetWindowMinimumSize|SDL_SetWindowModalFor|SDL_SetWindowMouseGrab|SDL_SetWindowMouseRect|SDL_SetWindowOpacity|SDL_SetWindowPosition|SDL_SetWindowRelativeMouseMode|SDL_SetWindowResizable|SDL_SetWindowShape|SDL_SetWindowSize|SDL_SetWindowSurfaceVSync|SDL_SetWindowTitle|SDL_SetiOSAnimationCallback|SDL_ShowAndroidToast|SDL_ShowCursor|SDL_ShowMessageBox|SDL_ShowSimpleMessageBox|SDL_ShowWindow|SDL_ShowWindowSystemMenu|SDL_StartTextInput|SDL_StartTextInputWithProperties|SDL_StopHapticEffect|SDL_StopHapticEffects|SDL_StopHapticRumble|SDL_StopTextInput|SDL_SyncWindow|SDL_TimeToDateTime|SDL_TryLockMutex|SDL_TryLockRWLockForReading|SDL_TryLockRWLockForWriting|SDL_TryWaitSemaphore|SDL_UnlockAudioStream|SDL_UpdateHapticEffect|SDL_UpdateNVTexture|SDL_UpdateTexture|SDL_UpdateWindowSurface|SDL_UpdateWindowSurfaceRects|SDL_UpdateYUVTexture|SDL_Vulkan_CreateSurface|SDL_Vulkan_LoadLibrary|SDL_WaitConditionTimeout|SDL_WaitSemaphoreTimeout|SDL_WarpMouseGlobal|SDL_WriteStorageFile|SDL_WriteSurfacePixel|SDL_WriteSurfacePixelFloat)$";
@@
(
  func(
  ...
  )
- == 0
|
- func(
+ !func(
  ...
  )
- < 0
|
- func(
+ !func(
  ...
  )
- != 0
|
- func(
+ !func(
  ...
  )
- == -1
)
2024-08-27 10:31:46 -07:00
Sam Lantinga
658fc3db0f Updated list of third party code and generated files 2024-08-22 13:30:02 -07:00
Anonymous Maarten
46903e61e6 Fix typo in the Android archive's INSTALL.md documentation 2024-08-22 18:11:28 +02:00
Ryan C. Gordon
abdd8b4929
wikiheaders: generate wiki redirect pages for individual enumerators. 2024-08-16 23:45:14 -04:00
Anonymous Maarten
31b3f5ea79 ci: add GDK 2024-08-04 13:07:32 +00:00
Sam Lantinga
cea71fbfcc SDL_cocoakeyboard: Fix errant semicolons in sendPendingKey and clearPendingKey definitions
- These are ignored by Clang but produce a warning: "semicolon before method body is ignored"
2024-08-02 18:55:30 -07:00
Anonymous Maarten
349540f73f Document the new SDL3 Android archive artifact 2024-08-01 17:48:49 +00:00
Anonymous Maarten
a1c6f99877 android: add script in Android archive to create a SDK
Also,
- Move mingw's pkg-support into build-scripts
- Add type annotations to python scripts for mypy
- ci: use v4 tag of actions/cache
- cmake: use PYTHON3_EXECUTABLE for running xxd.py
  (Python3::Interpreter is not always recognized.)
2024-08-01 05:07:08 +02:00
Ryan C. Gordon
afabccd4d0
examples: Split up description text by line breaks. 2024-07-30 15:37:46 -04:00
Ryan C. Gordon
883576beb8
examples: Improve source code output when there are multiple files. 2024-07-30 13:40:09 -04:00
Ryan C. Gordon
69a2d7960c
examples: first shot at description text at top of page. Not working yet. 2024-07-30 13:18:58 -04:00
Ryan C. Gordon
6a25e94472
examples: Print a description of the program to the console on startup. 2024-07-30 12:23:07 -04:00
Sam Lantinga
5e513ecc7f Don't automatically free temporary memory, let the application call SDL_FreeTemporaryMemory() when it's ready.
Also mark up all functions that return temporary memory with SDL_DECLSPEC_TEMP, to help people implementing language bindings.

Fixes https://github.com/libsdl-org/SDL/issues/10378
2024-07-26 10:05:03 -07:00
Frank Praznik
66eb2ea443 mouse: Make pointer warp emulation via relative mode available to all platforms
Move the Wayland pointer warp emulation code up to the SDL mouse layer, and activate it when a client attempts to warp a hidden mouse cursor when the hint is set.

testrelative adds the ability to test the warp emulation activation/deactivation with the --warp parameter and 'c' key for toggling cursor visibility.
2024-07-25 19:57:39 -04:00
Ryan C. Gordon
53022aeb5e
examples: Use the existing CMake infrastructure instead of rolling our own. 2024-07-25 11:56:19 -04:00
Ryan C. Gordon
195c26a50a
examples: Add a way to add datafiles to an example, and add audio/load-wav 2024-07-24 17:30:55 -04:00
Sam Lantinga
a7c0192017 Renamed SDL_PostSemaphore() to SDL_SignalSemphore() 2024-07-24 13:37:40 -07:00
Sam Lantinga
fa0918a686 Renamed SDL life cycle functions
This maps better to how SDL delivers the events, and the iOS delegate methods are in the documentation for reference.
2024-07-24 05:11:13 -07:00
Sam Lantinga
57dcd7993f Update the package name in the app build.gradle
Also only change the name of the activity in AndroidManifest.xml, not all of the descriptive text saying to change the name of the activity.
2024-07-23 17:06:04 -07:00
Sam Lantinga
a432221db5 Specify that this script uses python3
Fixes running on macOS
2024-07-23 17:06:04 -07:00