Sam Lantinga
7c16fe6d69
Default to use the built-in EGL definitions
2023-01-12 16:17:00 -08:00
Ozkan Sezer
85924687fd
fix SDL_GetSensorInstanceID() return code upon failure.
...
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer
0621a67350
fix SDL_GetJoystickInstanceID() return code upon failure
...
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Sam Lantinga
0ead89747a
Fixed filename comment in SDL_intrin.h
2023-01-10 21:05:38 -08:00
Sam Lantinga
95faeab96c
SDL_GetNumJoysticks() and SDL_GetNumSensors() are no longer in the API
2023-01-10 18:07:40 -08:00
Sam Lantinga
dc280c17a0
Moved SDL_intrin.h back into the public headers for application use
2023-01-10 15:50:35 -08:00
Sam Lantinga
56522034db
Fixed building with Visual Studio 2010
2023-01-09 18:30:23 -08:00
Sam Lantinga
2aa9569b3e
Replaced SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() with SDL_aligned_alloc() and SDL_aligned_free()
...
Fixes https://github.com/libsdl-org/SDL/issues/5641
2023-01-09 18:01:59 -08:00
Sam Lantinga
5ed00d34aa
Document that condition variable mutexes can't be locked recursively.
...
Fixes https://github.com/libsdl-org/SDL/issues/5497
2023-01-09 15:59:39 -08:00
Sam Lantinga
e9b86eebf3
Functions which return function pointers now return SDL_FunctionPointer instead of void*
...
This fixes the clang warning "Cast between pointer-to-function and pointer-to-object is an extension"
You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior.
Fixes https://github.com/libsdl-org/SDL/issues/2866
2023-01-09 15:46:21 -08:00
Sylvain
7275b2b352
SDL_GetTicks64: entry added in SDL_ENABLE_OLD_NAMES
2023-01-09 21:59:50 +01:00
Sam Lantinga
5feebcdce0
SDL_AddHintCallback() now returns a standard int result instead of void
...
Fixes https://github.com/libsdl-org/SDL/issues/7035
2023-01-09 12:09:30 -08:00
Sam Lantinga
fde78d12f2
Updated copyright for 2023
2023-01-09 09:41:41 -08:00
Sam Lantinga
dbd4b88abc
Generally removed generally
2023-01-09 09:04:05 -08:00
Sam Lantinga
40833d2526
Documented thread starvation issue raised in https://github.com/libsdl-org/SDL/pull/7023
2023-01-09 09:01:41 -08:00
Sam Lantinga
59308cb3e9
SDL_platform_defines.h is already included in SDL_platform.h
2023-01-09 08:40:11 -08:00
Sylvain
4798c36197
Add oldname entry: GetTicks64() is renamed GetTicks()
2023-01-09 13:43:39 +01:00
Anonymous Maarten
f91a747549
include: SDL_dynapi.h depends on platform defines
2023-01-08 21:37:54 +01:00
Anonymous Maarten
f53d797cca
cmake: generate git hash using GetRevisionDescription CMake module
...
This allows the build system (ninja/make/VS) to detect whether the current
checkout git commit has changed. If so, SDL_revision.h will be updated.
2023-01-08 18:20:56 +01:00
Hunter Kvalevog
a2b2464b46
SDL_Vulkan_GetInstanceExtensions: Require Vulkan
...
Document that this function will fail if the user doesn't call
SDL_Vulkan_LoadLibrary (either explicitly or via SDL_CreateWindow)
beforehand.
2023-01-08 07:55:34 -08:00
Hunter Kvalevog
0953367967
SDL_Vulkan_GetInstanceExtensions: Remove window
...
Remove the unused `window` parameter from
SDL_Vulkan_GetInstanceExtensions, which is never used by any of the
backends.
2023-01-08 07:55:34 -08:00
Sam Lantinga
7f0801377b
Separate wmain() and main() implementations
...
Fixes https://github.com/libsdl-org/SDL/issues/7010
2023-01-07 08:28:07 -08:00
Sam Lantinga
5a2a91cb05
Fixed compile warnings with unused parameters
2023-01-06 16:24:20 -08:00
Sam Lantinga
5dd07a5773
The alloc_size attribute isn't supported in clang 3.x
2023-01-06 12:10:21 -08:00
Sam Lantinga
6b5855e990
Removed SDL_REVISION_NUMBER
2023-01-06 09:53:18 -08:00
Sylvain
93e2903ac5
Add SDL_PlayAudioDevice() to play audio. Remove pause_on param from SDL_PauseAudioDevice()
2023-01-06 09:15:39 -08:00
Sam Lantinga
26be384801
SDL_syswm.h provides the platform specific types by default again
...
You can enable and disable subsystems with SDL_ENABLE_SYSWM_*/SDL_DISABLE_SYSWM_* and you can disable the type forward declarations with SDL_DISABLE_SYSWM_*_TYPES
2023-01-05 23:50:37 -08:00
Sylvain
2d7f8d7d51
Remove legacy SDL_Audio functions that acts on device id == 1
2023-01-05 09:40:06 -05:00
Sam Lantinga
51a80d03ce
Be really explicit about needing to check for negative error codes with SDL_RWread()
2023-01-04 22:29:45 -08:00
Sam Lantinga
0bbf6cc379
Test text rendering APIs take floating point coordinates
2023-01-04 16:45:02 -08:00
Sam Lantinga
0901657278
Document renamed API functions in SDL_keyboard.h
2023-01-04 15:41:35 -08:00
Sam Lantinga
1dc119c316
Removed functions from SDL_oldnames.h that are no longer in the API
2023-01-04 14:53:29 -08:00
Sam Lantinga
4f978456a8
Renamed SDL_GAMEPADDEVICEREMAPPED to SDL_GAMEPADREMAPPED
2023-01-04 14:32:37 -08:00
Sam Lantinga
28b22e3f9b
Removed functions from SDL_oldnames.h that are no longer in the API
2023-01-04 14:03:33 -08:00
Sam Lantinga
c823f26f18
Revert "Removed public joystick locking API"
...
This reverts commit a515f51ac0
.
We still need joystick locking to protect the gamepad mappings
2023-01-04 13:51:40 -08:00
Sylvain
6863f0b2d8
Add SDL_WindowID type for SDL_Window id
2023-01-04 09:21:52 -08:00
Sam Lantinga
95e5417d2e
Fixed documentation warnings
2023-01-03 15:39:11 -08:00
Sam Lantinga
9c1a9ecb4b
Removed non-float versions of SDL render API drawing functions
...
This simplifies the API and removes a level of API translation between the int variants of the functions and the float implementation
Fixes https://github.com/libsdl-org/SDL/issues/6656
2023-01-03 08:16:58 -08:00
Sam Lantinga
e3c1749f5b
The refresh rate in SDL_DisplayMode is now a float
2023-01-03 06:35:25 -08:00
Sylvain Becker
851b0e16be
Add SDL_GetRenderVSync (see #6495 ) ( #6965 )
2023-01-02 11:21:02 -08:00
Sam Lantinga
d764de77d4
Include SDL_audio.h for SDL_AudioDeviceID definition
...
Fixes https://github.com/libsdl-org/SDL/issues/6971
2023-01-02 09:08:44 -08:00
Sylvain Becker
8a13533949
Handle error return value for SDL_GetSwapInterval
2023-01-01 08:20:41 -08:00
Sam Lantinga
a515f51ac0
Removed public joystick locking API
...
All joystick functions are thread-safe and you can now get an atomic list of joysticks with SDL_GetJoysticks()
Fixes https://github.com/libsdl-org/SDL/issues/6956
2022-12-31 09:24:14 -08:00
Sam Lantinga
324c0b76a0
Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()
...
Also cleaned up logic for whether we need to poll for events:
- We need to periodically poll for joysticks to handle hotplug.
- We need to frequently poll for joysticks and sensors when they're open so their state can be updated
2022-12-29 23:20:26 -08:00
Sam Lantinga
7f23d71b6a
Added SDL_modf() and SDL_modff()
...
This function is useful for accumulating relative mouse motion if you want to only handle whole pixel movement.
e.g.
static float dx_frac, dy_frac;
float dx, dy;
/* Accumulate new motion with previous sub-pixel motion */
dx = event.motion.xrel + dx_frac;
dy = event.motion.yrel + dy_frac;
/* Split the integral and fractional motion, dx and dy will contain whole pixel deltas */
dx_frac = SDL_modff(dx, &dx);
dy_frac = SDL_modff(dy, &dy);
if (dx != 0.0f || dy != 0.0f) {
...
}
2022-12-29 23:12:19 -08:00
Sam Lantinga
cefbeb582f
Mouse coordinates are floating point
...
You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling.
Fixes https://github.com/libsdl-org/SDL/issues/2999
2022-12-29 23:12:19 -08:00
Sam Lantinga
8c3239dee5
Fixed documentation warning
2022-12-29 22:10:35 -08:00
Daniel Gibson
ac8a041541
SDL_main for Win32: Get rid of console_*main, add wWinMain()
...
I don't think there's any point in console_*main() for non-MSVC - I think
it can't be called anyway now that SDL_main is header-only.
So I renamed those functions to main() and wmain() and made them MSVC-only
For reference, MinGW (at least the version I tested) supports both main()
and WinMain(), no matter if compiled with -mconsole or -mwindows (it seems
to prefer main() over WinMain() if both are available, in both cases).
But when building with -municode, it needs wmain() or wWinMain(), so
that case is now handled with wWinMain()
2022-12-29 21:50:58 -08:00
Sam Lantinga
98678b5d8d
SDL API renaming: SDL_Alloc*/SDL_Free* -> SDL_Create*/SDL_Destroy*
...
Fixes https://github.com/libsdl-org/SDL/issues/6945
2022-12-29 15:07:15 -08:00
Sam Lantinga
1b90107fdb
Spell out "Float" in function names
2022-12-29 14:50:31 -08:00
Sylvain Becker
d7d3c22dbf
Remove more reserved identifiers ( #6925 )
2022-12-29 13:58:16 -08:00
Ryan C. Gordon
138f632b59
include: Add a comment about reserving a bit for sdl2-compat.
2022-12-29 13:34:53 -05:00
Sylvain
88630b85f5
SDL_GL_SwapWindow() returns an error code
2022-12-29 08:40:51 -08:00
Sam Lantinga
80890f3aae
SDL API renaming: SDL_render.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6883
2022-12-28 19:40:25 -08:00
Sam Lantinga
ea0c2f55be
SDL API renaming: *Is* functions
...
Feedback from @icculus:
"IsTablet" uses "is" as a form of "to be" ...like, the actual question is of its nature.
The rest is just a superfluous word in the question and it flows as better English with if (RectEmpty) than if (IsRectEmpty)
Fixes https://github.com/libsdl-org/SDL/issues/6932
2022-12-28 19:40:25 -08:00
Sam Lantinga
66351fd4ba
Replace tri-state functions SDL_EventState(), SDL_GetJoystickEventState(), SDL_GetGamepadEventState(), SDL_ShowCursor()
...
`SDL_QUERY`, `SDL_IGNORE`, `SDL_ENABLE`, and `SDL_DISABLE` have been removed.
SDL_EventState() has been replaced with SDL_SetEventEnabled()
SDL_GetEventState() has been replaced with SDL_EventEnabled()
SDL_GameControllerEventState has been replaced with SDL_SetGamepadEventsEnabled() and SDL_GamepadEventsEnabled()
SDL_JoystickEventState has been replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled()
SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible()
Fixes https://github.com/libsdl-org/SDL/issues/6929
2022-12-28 17:49:34 -08:00
Sam Lantinga
16092f58bb
Updated gamepad, joystick, sensor APIs, removing device indices
...
Instead of indexing into an internal list of devices which requires locking, we return a list of device IDs which can then be queried individually.
Reference: https://github.com/libsdl-org/SDL/issues/6889
2022-12-28 13:10:27 -08:00
Sylvain
aa46ff8f4b
Remove SDL_WINDOW_SHOW flag, as redundant with SDL_WINDOW_HIDDEN
2022-12-28 12:16:57 -08:00
Zack Middleton
59a70d568d
Rename SDL_main_impl.h include guard to match the filename
2022-12-28 05:57:10 -08:00
Sylvain
25336d053a
Remove underscore for _SDL_iconv_t
...
And change the name, not to have the same for pointer and data
2022-12-27 12:41:09 -08:00
Sylvain Becker
07808d6a03
Remove underscore in guard header defines ( #6922 )
2022-12-27 12:31:12 -08:00
Sam Lantinga
cdbd1be8c6
Allow SDL_oldnames.h to be completely disabled
2022-12-27 12:30:37 -08:00
Sylvain
04f2820e07
Remove underscore for some SDL_ builtin function/macros
2022-12-27 11:34:58 -08:00
Sylvain
81cd84f456
Remove reserved underscore SDL_joystick
2022-12-27 11:34:13 -08:00
Sam Lantinga
ab2d007982
More gamepad renaming
2022-12-27 11:31:54 -08:00
Sam Lantinga
58aecf0a54
SDL API renaming: SDL_rect.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6887
2022-12-27 11:01:11 -08:00
Sam Lantinga
701e965235
Removed leading underscore in structure names
...
Fixes https://github.com/libsdl-org/SDL/issues/6856
Closes https://github.com/libsdl-org/SDL/pull/6914
Closes https://github.com/libsdl-org/SDL/pull/6915
Closes https://github.com/libsdl-org/SDL/pull/6916
Closes https://github.com/libsdl-org/SDL/pull/6917
Closes https://github.com/libsdl-org/SDL/pull/6918
Closes https://github.com/libsdl-org/SDL/pull/6919
2022-12-27 10:35:53 -08:00
Sam Lantinga
659abc721a
SDL API renaming: SDL_gamecontroller.h
...
SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.
Fixes https://github.com/libsdl-org/SDL/issues/6885
2022-12-27 09:47:24 -08:00
Sam Lantinga
c6969df4d7
SDL API renaming: SDL_video.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6880
2022-12-27 06:38:34 -08:00
Sam Lantinga
cc0296c934
SDL API renaming: SDL_surface.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6884
2022-12-27 06:36:39 -08:00
Sam Lantinga
2db699f48e
SDL API renaming: SDL_sensor.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6888
2022-12-27 06:23:39 -08:00
Sam Lantinga
0d54115235
SDL API renaming: SDL_render.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6883
2022-12-27 06:21:13 -08:00
Sam Lantinga
083e436a1a
SDL API renaming: SDL_pixels.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6886
2022-12-27 06:08:31 -08:00
Sam Lantinga
fc478c1bc0
SDL API renaming: SDL_joystick.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6881
2022-12-27 05:50:46 -08:00
Sylvain Becker
aa0053141b
Remove SDL_VideoInit / Quit. Prefer SDL_SubSytemInit / Quit ( #6913 )
2022-12-27 05:42:48 -08:00
Sam Lantinga
713ba2e31a
SDL API renaming: SDL_audio.h
...
Fixes https://github.com/libsdl-org/SDL/issues/6879
2022-12-27 05:32:55 -08:00
Sam Lantinga
9625fb2832
Documentation cleanup
2022-12-27 05:28:18 -08:00
Sylvain Becker
47170d288e
Don't export SDL_AudioInit/Quit, use SDL_InitSubsystem instead ( #6912 )
...
* Don't export SDL_AudioInit/Quit, use SDL_InitSubsystem instead
* Update README
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2022-12-27 05:22:22 -08:00
Sylvain
3fb0c8b54a
Remove/Rename SDL_FreeWAV() to SDL_free()
2022-12-27 05:14:52 -08:00
Ozkan Sezer
29ba5f5d64
SDL_thread.h: fix beginthread param of SDL_CreateThreadWithStackSize for win32
2022-12-27 00:10:00 +03:00
Vincent Hamm
5410d361f7
Fix SDL_CreateThreadWithStackSize not passing staacksize with win32 static api
...
(cherry picked from commit 68073c627684ba35c113d0e128af15b5191b42d6)
2022-12-26 11:24:17 -08:00
Sam Lantinga
63724c113b
Removed the vi format comments from the source
...
Vim users can use the [editorconfig plugin](https://github.com/editorconfig/editorconfig-vim ) to automatically set tab spacing for the SDL coding style.
Fixes https://github.com/libsdl-org/SDL/issues/6903
2022-12-26 11:17:23 -08:00
Sam Lantinga
a2dab02a31
Only define platform compatibility symbols on the platform they represent
...
Fixes https://github.com/libsdl-org/SDL/issues/6892
2022-12-24 08:27:26 -08:00
Frank Praznik
abdfa809db
Prepend key modifier enum values with 'SDL_'
2022-12-23 20:35:49 -08:00
Sam Lantinga
fd0631fd35
Added documentation for rename_symbols.py
2022-12-23 15:58:15 -08:00
Sam Lantinga
759f98085a
Used rename_api.py to add previously renamed symbols to SDL_oldnames.h
2022-12-23 15:08:30 -08:00
Sam Lantinga
b5a92406eb
Added infrastructure for renaming API functions
...
You can rename APIs using rename.py and all the code and documentation will be updated, and entries will be added to WhatsNew.txt and docs/README-migration.md.
e.g.
rename.py SDL_foo.h function SDL_CreateFoo SDL_FooCreate
SDL_oldnames.h is included in the SDL header, and if you define SDL_ENABLE_OLD_NAMES, will redefine the old API functions to call the new ones, and if not, will define them as a symbol letting you what the new API function is.
2022-12-23 11:00:11 -08:00
Ryan C. Gordon
1cf2b566af
cpu: Removed 3DNow! support and SDL_Has3DNow().
...
Reference Issue #6636 .
2022-12-23 09:30:56 -08:00
meyraud705
126c60cb45
Add "SDL_" prefix to RW_SEEK macros
2022-12-23 09:25:37 -08:00
Rudolf-Walter Kiss-Szakacs
cc7b6f9e49
Add SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS.
...
(cherry picked from commit 232ed540dbf3924543ab1a084a43f2e70f4b31a9)
2022-12-22 10:06:02 -08:00
Ryan C. Gordon
7a5a1b16ce
events: Make sure new display events don't overlap with sdl2-compat.
...
Reference PR #6867 .
2022-12-22 11:47:54 -05:00
Ryan C. Gordon
3197632347
include: Renamed begin_code.h and close_code.h to have SDL_ prefixes.
...
Fixes #6864 .
2022-12-22 11:39:26 -05:00
Sam Lantinga
909b513c33
Made SDL_WINDOWEVENT_* and SDL_DISPLAYEVENT_* first class event types
...
Fixes https://github.com/libsdl-org/SDL/issues/6772
2022-12-22 07:38:13 -08:00
Ryan C. Gordon
c9887c5c72
include: Split out functions in SDL.h to SDL_init.h.
...
SDL.h now exists solely as a header that includes everything else, instead
of one that forces you to include everything else when you just want the
declaration for SDL_Init().
Fixes #6840 .
2022-12-22 01:05:10 -05:00
Yevhen Babiichuk (DustDFG)
7fc8533b62
Use alias types for which members of event structs instead of plain types ( #6841 )
...
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2022-12-18 12:10:15 +01:00
Ryan C. Gordon
78725dc0cd
include: Fixed a C++-style single line comment.
...
Reference Issue #6838 .
2022-12-17 23:52:33 -05:00
Sylvain
dce2546534
Revert wrong comment in SDL_surface.h for SDL3 (see #6824 )
2022-12-16 16:42:06 +01:00
Maido
abf5cc5203
Android audio device selection ( #6824 )
...
Make it possible to select a specific audio device for Android
2022-12-16 16:40:02 +01:00
Daniel Gibson
63d3fb469d
Move src/main/haiku/ to src/core/
...
turns out that this wasn't even built as a static libSDLmain,
but as part of the (possibly dynamic) libSDL3
2022-12-15 08:01:01 -08:00
Daniel Gibson
989a8ca90e
Port PSP SDL_main to header-only + SDL_RunApp()
2022-12-15 08:01:01 -08:00