Sam Lantinga
4f55271571
Removed temporary memory from the API
...
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this.
So, we're largely going back to the original system, where the API returns allocated results and you free them.
In addition, to solve the problems we originally wanted temporary memory for:
* Short strings with a finite count, like device names, get stored in a per-thread string pool.
* Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
2024-07-26 20:59:14 -07: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
Sam Lantinga
f562a6d9f7
Added Android API level 35 to the table
2024-07-24 14:09:54 -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
SDL Wiki Bot
975457cfb6
Sync SDL3 wiki -> header
2024-07-19 19:23:24 +00:00
Sam Lantinga
71a60d4c0e
Updated documentation for functions that return temporary memory
2024-07-19 12:22:03 -07:00
Sam Lantinga
637e9700dd
Standardize placement of '*' in function declarations
...
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-19 12:22:03 -07:00
Sam Lantinga
217330a7b3
Made return value descriptions more consistent across the API
2024-07-19 12:22:03 -07:00
Sam Lantinga
d73c7311d5
Clarify that the SDL_GetStringRule means that SDL will automatically free the memory later.
2024-07-19 12:22:03 -07:00
SDL Wiki Bot
b92ec25147
Sync SDL3 wiki -> header
2024-07-17 04:33:30 +00: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
58270ef3f2
Finished renaming functions in SDL_system.h
2024-07-16 09:35:49 -07:00
Sam Lantinga
54366181c3
Rename functions in SDL_system.h to match SDL 3.0 naming convention
...
Fixes https://github.com/libsdl-org/SDL/issues/10277
2024-07-15 16:27:48 -07:00
SDL Wiki Bot
3f446a12df
Sync SDL3 wiki -> header
2024-07-12 19:42:55 +00:00
Ryan C. Gordon
8779c95905
android: Added SDL_AndroidGetCachePath().
...
Fixes #8408 .
2024-07-12 15:41:54 -04:00
Ryan C. Gordon
51902d4ac5
Updated headers with latest wikiheaders tweaks.
2024-06-14 02:09:55 -04:00
SDL Wiki Bot
9e3e489012
Sync SDL3 wiki -> header
2024-06-12 19:10:53 +00:00
Ryan C. Gordon
5416bd5fdc
ios: Move animation callback to its own typedef.
2024-06-12 15:10:16 -04:00
Ryan C. Gordon
e23257307e
Introduce formal policy for APIs that return strings.
...
This declares that any `const char *` returned from SDL is owned by SDL, and
promises to be valid _at least_ until the next time the event queue runs, or
SDL_Quit() is called, even if the thing that owns the string gets destroyed
or changed before then.
This is noted in the headers as "the SDL_GetStringRule", so this will both be
greppable to find a detailed explaination in docs/README-strings.md and
wikiheaders will automatically turn it into a link we can point at the
appropriate documentation.
Fixes #9902 .
(and several FIXMEs, both known and yet-undocumented.)
2024-06-03 14:20:49 -04:00
SDL Wiki Bot
983544a53e
Sync SDL3 wiki -> header
2024-05-22 00:41:09 +00:00
Sam Lantinga
6f2621438a
Renamed DECLSPEC to SDL_DECLSPEC
2024-05-17 17:09:09 -07:00
Ryan C. Gordon
5e6d85b8f0
wikiheaders: bridge wiki Category docs to the headers!
...
Did an initial cleanup on the headers and wrote a few pieces of documentation,
but this needs more work to fill out the documentation.
2024-05-16 11:48:23 -04:00
SDL Wiki Bot
7856c8fb8f
Sync SDL3 wiki -> header
2024-05-03 19:40:33 +00:00
Ryan C. Gordon
cf0b5db9e1
SDL_system.h: Improve window message hook documentation.
2024-05-03 15:37:11 -04:00
Ryan C. Gordon
a790a67883
include: Filling in more documentation gaps.
2024-05-03 13:19:26 -04:00
Ryan C. Gordon
239b34d760
docs: Added some notes about iOS and the main callbacks.
2024-04-13 15:14:32 -04:00
SDL Wiki Bot
9c5ae7293f
Sync SDL3 wiki -> header
2024-04-13 18:59:10 +00:00
SDL Wiki Bot
cae90ef489
Sync SDL3 wiki -> header
2024-04-13 18:38:11 +00:00
Ryan C. Gordon
6e1ed94913
ios: Renamed APIs that referred to "iPhone" to refer to "iOS".
...
Macros that papered over this difference in SDL2 have been removed for SDL3.
Fixes #9527 .
2024-04-13 14:30:30 -04:00
Ryan C. Gordon
98e9f361a8
winrt: Remove SDL_WinRTGetFSPathUNICODE, rename SDL_WinRTGetFSPathUTF8.
...
Fixes #9470 .
2024-04-13 08:24:12 -04:00
SDL Wiki Bot
02da4acf0f
Sync SDL3 wiki -> header
2024-04-13 12:07:27 +00:00
SDL Wiki Bot
2f4f1f6923
Sync SDL3 wiki -> header
2024-04-11 17:35:27 +00:00
Ryan C. Gordon
0df988389c
include: Add \since
to all documentation that was missing it.
2024-04-11 13:34:29 -04:00
Ryan C. Gordon
e044318a8e
Sync SDL3 wiki -> headers
2024-04-09 00:50:03 -04:00
Ryan C. Gordon
ad090d2444
include: A ton of little documentation tweaks, fixes, and improvements.
...
This is just stuff I noticed while working on the wikiheaders updates. A
thorough pass over all the docs would not be terrible, and maybe a simple
script to check for consistency (does everything have a `\since` on it? etc)
might be nice, too.
2024-04-09 00:50:02 -04:00
Petar Popovic
3f8dba3713
Including SD_error.h into headers with error-returning functions
2024-04-04 11:12:58 -07:00
SDL Wiki Bot
4d4c24acdd
Sync SDL3 wiki -> header
2024-02-13 17:07:23 +00:00
Ryan C. Gordon
bc984f78bf
android: Remove blocking permission request code. Async only in SDL3!
...
(this actually still blocks at our internal points of usage, though, for
replacement at a later time.)
2024-02-13 12:06:51 -05:00
Ryan C. Gordon
af61cfd5e0
android: Added SDL_AndroidRequestPermissionAsync.
2024-02-13 12:06:51 -05:00
Anonymous Maarten
31d133db40
Define SDL_PLATFORM_* macros instead of underscored ones ( #8875 )
2024-01-24 01:40:51 +00:00
Sam Lantinga
5b3ee51c6c
Updated copyright for 2024
2024-01-01 13:15:26 -08:00
Ryan C. Gordon
aa7baf63aa
Sync wiki -> headers.
2023-11-09 20:11:23 -05:00
Sam Lantinga
fd4a2cce9e
SDL_syswm.h has been removed and replaced with window properties
2023-11-08 12:01:48 -08:00
Sam Lantinga
a1941fad6c
Replaced SDL_RenderGetD3D11Device(), SDL_RenderGetD3D12Device(), and SDL_RenderGetD3D9Device() with renderer properties.
2023-11-08 12:01:48 -08:00
Ryan C. Gordon
c53843a961
docs: Remove Doxygen \brief
tags.
...
Doxygen and the wiki bridge don't need them; they'll both just use the first
line/sentence instead.
Fixes #8446 .
2023-11-06 10:26:06 -05:00
SDL Wiki Bot
594fda4120
Sync SDL3 wiki -> header
2023-10-19 17:13:15 +00:00
Sam Lantinga
0d7c5a2c56
Updated Android API documentation
2023-10-19 10:12:34 -07:00
Ryan C. Gordon
31229fd47f
include: Added a note about SDL's iOS app delegate functions.
...
Fixes #8250 .
2023-09-15 09:50:24 -04:00
SDL Wiki Bot
e30e5c77e6
Sync SDL3 wiki -> header
2023-08-25 14:42:25 +00:00
Ethan Lee
c0cd8c8142
gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation
2023-08-25 10:40:16 -04:00