Sam Lantinga
198caa54a1
Added SDL_RenderTextureTiled()
2024-07-20 18:21:19 -07:00
Sam Lantinga
9e55ee9391
Added SDL_BlitSurfaceTiledWithScale()
2024-07-20 18:21:19 -07:00
Sam Lantinga
f47ddbf1ac
Added SDL_BlitSurfaceTiled()
...
Fixes https://gamedev.stackexchange.com/questions/136792/is-there-a-way-to-set-texture-wrap-mode-as-repeat-in-sdl-2
2024-07-20 18:21:19 -07:00
Sam Lantinga
03bb2c17ed
Enable texture wrapping for SDL_RenderGeometry()
...
Currently wrapping is based on whether texture coordinates are outside of [0,1], but the code is structured so it's easy to add an API to set it and add additional wrapping modes if we want.
Fixes https://github.com/libsdl-org/SDL/issues/9238
Closes https://github.com/libsdl-org/SDL/pull/5369
2024-07-20 09:51:05 -07:00
Sam Lantinga
a340de6196
The candidates in SDL_EVENT_TEXT_EDITING_CANDIDATES should be a single allocation
2024-07-19 12:22:03 -07:00
Sam Lantinga
fd9fe1bb7b
Renamed event memory to temporary memory, since it's not just used for events
2024-07-19 12:22:03 -07:00
Sam Lantinga
c4eac60000
SDL_GetClipboardData() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
61a7a0e579
SDL_GUIDToString() follows the SDL_GetStringRule
...
Also removed the distinction between SDL_GUID and SDL_JoystickGUID
2024-07-19 12:22:03 -07:00
Sam Lantinga
856d598d6e
SDL_GetSensors() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
4f8c348402
SDL_GetPreferredLocales() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
9be73ed7c5
SDL_GetMice() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
6ca18ed0e5
SDL_GetKeyboards() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
4961af4569
SDL_GetJoysticks() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
b32c9615a7
SDL_GetHaptics() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
9de8cb888a
SDL_GetFullscreenDisplayModes() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
9758e102bc
SDL_GetDisplays() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
01199469de
SDL_GetCameras() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
0fe6603747
SDL_GetCameraSupportedFormats() follows the SDL_GetStringRule
...
Also changed the function to return an array of pointers and added example usage to testcamera
2024-07-19 12:22:03 -07:00
Sam Lantinga
bdafc8e212
SDL_GetWindows() follows the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
8ca6caeda5
SDL_GetAudioPlaybackDevices() and SDL_GetAudioRecordingDevices() follow the SDL_GetStringRule
2024-07-19 12:22:03 -07:00
Sam Lantinga
ef884c8aa6
Transfer event memory between the local pool and the event queue
...
This allows threads to free memory from their local pool without affecting events that are queued, and to transfer memory ownership cleanly between threads that are queuing and dequeuing events.
2024-07-19 12:22:03 -07:00
Sam Lantinga
38a301a3f9
Added automated tests to verify SDL_ClearSurface() and SDL_PremultiplySurfaceAlpha()
2024-07-17 18:04:16 -07:00
Amir
5db08b86ca
Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]"
...
https://stackoverflow.com/questions/42125/warning-error-function-declaration-isnt-a-prototype
In C int foo() and int foo(void) are different functions. int foo() accepts an arbitrary number of arguments, while int foo(void) accepts 0 arguments. In C++ they mean the same thing.
2024-07-17 14:09:11 -07:00
Sam Lantinga
5f5e91eab6
Reverted 3d2e5a0b66
...
Applying these changes to external code doesn't actually improve anything, and within the context of the other Get* functions for renderers and surfaces, these stand out as outliers, so I'm going to back this change out.
2024-07-17 10:27:37 -07:00
Sam Lantinga
3d2e5a0b66
Fixed a few remaining functions to directly return their values instead of an error code.
2024-07-16 21:32:17 -07:00
Sam Lantinga
1e828eec57
Fixed warning C4244: '=': conversion from 'float' to 'int', possible loss of data
2024-07-16 21:32:17 -07:00
Sam Lantinga
7c0307060d
Textures with alpha format default to SDL_BLENDMODE_BLEND
...
Fixes https://github.com/libsdl-org/SDL/issues/9941
2024-07-16 18:50:22 -07:00
Sam Lantinga
b5292bdec9
Added blend mode testing for 8-bit surfaces
2024-07-16 17:57:12 -07:00
Ryan C. Gordon
4dda785c69
gamepad: Several gamepad mapping functions now follow the SDL_GetStringRule.
...
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
ed1f93cd11
filesystem: SDL_Glob*Directory()
functions now follow the SDL_GetStringRule.
...
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
52bf7ff42d
filesystem: SDL_GetPrefPath() now follows the SDL_GetStringRule.
...
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
2321726ff1
filesystem: SDL_GetUserFolder() now follows the SDL_GetStringRule.
...
It also now caches at the higher level, so the platform-specific bits don't
change their interface much.
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
d40b89dff6
clipboard: SDL_GetPrimarySelectionText() now follows the SDL_GetStringRule.
...
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
158fc459f1
clipboard: SDL_GetClipboardText() now follows the SDL_GetStringRule.
...
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
3bc81a81f5
filesystem: SDL_GetBasePath() now follows the SDL_GetStringRule.
...
It also now caches at the higher level, so the platform-specific bits don't
change their interface much.
A little code hygiene work was applied to some of the platform bits on top of
this.
Reference Issue #10229 .
2024-07-16 16:44:36 -04:00
Sam Lantinga
ec3bb4c029
Removed the need for SDL_CreateTLS()
...
This eliminates the tap dancing needed for allocating TLS slots, we'll automatically allocate them as needed, in a thread-safe way.
2024-07-16 12:01:51 -07:00
Sam Lantinga
033df70d4c
SDL_DelayNS() will attempt to sleep exactly the requested amount of time
...
This provides a highly accurate sleep function for your application, although you are still subject to being switched out occasionally.
Fixes https://github.com/libsdl-org/SDL/issues/10210
2024-07-15 18:38:09 -07:00
Sam Lantinga
a419e2c890
Updated and re-enabled surface and render blend mode tests
2024-07-15 14:12:33 -07:00
Sam Lantinga
df573391b1
Added SDL_BLENDMODE_BLEND_PREMULTIPLIED and SDL_BLENDMODE_ADD_PREMULTIPLIED
...
Fixes https://github.com/libsdl-org/SDL/issues/2485
2024-07-15 14:12:33 -07:00
Sam Lantinga
5c875e1183
Renamed *FromID() to *ForID()
...
While it makes sense to get an object pointer from an object ID, you want to get object attributes for an ID, otherwise e.g. GetNameFromID() sounds like it's a name ID, not an object ID. This is also consistent with the function naming convention in SDL2.
2024-07-14 15:56:50 -07:00
Sam Lantinga
9797c5d0c0
Renamed CameraDevice to Camera
...
This is consistent with the rest of the SDL API
2024-07-14 13:01:53 -07:00
Sam Lantinga
9358333286
Renamed SDL_GetKeyboardInstanceName() and SDL_GetMouseInstanceName()
...
For consistency with other device APIs
2024-07-14 13:01:53 -07:00
Sam Lantinga
d154b37b41
Renamed *FromInstanceID() to *FromID()
2024-07-14 13:01:53 -07:00
Sam Lantinga
1fecef5e4b
Assign numeric values to pixel format enums
...
This makes it easier to generate language bindings for these.
2024-07-14 11:02:56 -07:00
Sam Lantinga
e290e99d89
Fixed error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int'
2024-07-14 09:04:09 -07:00
Sam Lantinga
e90060d07f
Renamed functions to get information from device IDs
...
Fixes https://github.com/libsdl-org/SDL/issues/10237
2024-07-14 09:03:59 -07:00
Sam Lantinga
bfee544685
Changed SDL_GetWindowPixelFormat() to return SDL_PixelFormat
...
Fixes https://github.com/libsdl-org/SDL/issues/10257
Closes https://github.com/libsdl-org/SDL/pull/10258
2024-07-14 07:19:20 -07:00
Sam Lantinga
650271af46
Added SDL_CreateSurfacePalette()
2024-07-13 14:31:28 -07:00
Anonymous Maarten
f13be04980
testaudio: use SDL_APP_FAILURE macro to signal failure
2024-07-13 17:06:54 +02:00
Sam Lantinga
5bf6bc4d7d
Renamed SDL_Get/SetProperty() to SDL_Get/SetPointerProperty()
...
This is consistent with the naming for the functions that affect other data types
Fixes https://github.com/libsdl-org/SDL/issues/10241
2024-07-12 10:41:02 -07:00