Commit Graph

1662 Commits (b8adf90aa3aa03e9a32b281767746e9b8503dcea)

Author SHA1 Message Date
Sam Lantinga ed8637f437 Fixed typo 2022-11-22 08:28:56 -08:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Sam Lantinga 01d137592c Updated SDL_VERSIONNUM macro for new SDL version convention
Fixes https://github.com/libsdl-org/SDL/issues/6578
2022-11-22 07:58:03 -08:00
Ozkan Sezer 63243eb3a5 removed pandora support 2022-11-22 18:50:00 +03:00
SDL Wiki Bot 1b9c4c5ca1 Sync SDL wiki -> header 2022-11-22 04:30:16 +00:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Ozkan Sezer 3bc4bad8fb add missing strcasestr checks to cmake and autotools build systems,
and update config files.
2022-11-20 14:20:33 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Sam Lantinga 1f87e9e24e Updated patch notes for 2.26 release 2022-11-17 09:00:27 -08:00
SDL Wiki Bot 5e61f245ab Sync SDL wiki -> header 2022-11-15 05:25:16 +00:00
Pierre Wendling dcfa127fd4 N3DS: Document the SDL_GetBasePath behaviour. 2022-11-14 21:24:10 -08:00
Sam Lantinga 9f8b68a278 Fixed building without linux/input.h
https://github.com/libsdl-org/SDL/issues/6169
2022-11-11 10:25:52 -08:00
Sam Lantinga 0dfc829a6b Added simple BLE Steam Controller support on all platforms
This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM
2022-11-10 19:17:04 -08:00
Steven Noonan 085a276d6c
egl: implement callbacks for defining custom EGL attributes
Depending on the underlying EGL library, it may be desirable to
conditionally set some specific EGL attributes depending on available
extensions and other application state.

SDL's EGL usage makes this a little bit complicated because:

- there are multiple functions used to set up a working EGL context
- some of these functions take different types of EGL attributes
  (EGLAttrib vs EGLint)
- the EGL extension list before creating an EGLDisplay differs from the
  extension list after (i.e. display vs client extensions)
- all of the above happens in a single SDL_CreateWindow call

This leaves no place for the application to discover what EGL extensions
are available and provide custom attribute lists.

Until now, if a developer wants to add a custom EGL attribute for
eglGetPlatformDisplay, eglCreateWindowSurface or eglCreateContext, they
needed to patch SDL itself. This is very undesirable, since such
developers would have to disable the SDL dynapi in order to maintain
compatibility with their needs.

This patch implements some callbacks which developers can use to
dynamically generate custom EGL attributes for SDL to use during
SDL_CreateWindow.
2022-11-10 18:06:12 -08:00
Steven Noonan 0644042eb8
egl: implement public functions to obtain internal EGL handles
These functions allow applications to call EGL functions against the SDL
EGL context. For example, applications can use an EGL API loader via
SDL_EGL_GetCurrentDisplay and SDL_EGL_GetProcAddress, and can call
functions such as eglQuerySurface against the internal EGLSurface and
EGLDisplay.
2022-11-10 18:06:11 -08:00
Steven Noonan fb1a581209
egl: add hint to disable eglGetDisplay fallback when eglGetPlatformDisplay fails
This fallback is undesirable when using ANGLE, because it will end up
using some default configuration (e.g. on Windows it defaults to the
D3D11 backend).
2022-11-10 18:06:11 -08:00
Steven Noonan c608cf6222
egl: implement SDL_GL_EGL_PLATFORM attribute
This implements a new SDL_GL_EGL_PLATFORM attribute to set the
"platform" argument for SDL_EGL_LoadLibrary on Windows, macOS, and
Linux. I've limited it to those three operating systems because that's
what I've been able to test against.
2022-11-10 18:06:11 -08:00
Steven Noonan 5a7c20b945
hints: replace SDL_HINT_VIDEO_X11_FORCE_EGL with platform-agnostic SDL_HINT_VIDEO_FORCE_EGL
This adds support for forcing the use of EGL on Windows and MacOS. The
SDL_HINT_VIDEO_X11_FORCE_EGL hint is retained for backwards
compatibility but is now deprecated.
2022-11-10 18:06:10 -08:00
Sam Lantinga 15a9890919 Added SDL_HINT_HIDAPI_IGNORE_DEVICES to specify devices that should be ignored in SDL_hid_enumerate() 2022-11-05 16:44:52 -07:00
Sam Lantinga 297ecb706d Added SDL_strcasestr() for a case insensitive version of SDL_strstr() 2022-11-05 15:58:30 -07:00
Sam Lantinga 24cdebe464 Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the Xbox button LED on the Xbox One controller 2022-11-05 10:34:08 -07:00
Hubert Maier 57973cd379 SDL_HINTS.H: Correct spelling mistake
noticable -> noticeable
2022-10-30 11:24:42 -04:00
SDL Wiki Bot 11a24a34e3 Sync SDL wiki -> header 2022-10-26 22:30:06 +00:00
SDL Wiki Bot 393acf6362 Sync SDL wiki -> header 2022-10-25 18:07:13 +00:00
Steven Noonan b6e7c743db SDL_cpuinfo: define __ARM_ARCH=8 for _M_ARM64
Microsoft's compiler doesn't define __ARM_ARCH, but we have several
places that use it.
2022-10-24 10:39:14 -07:00
Simon McVittie 4ca5ea5b7e build: Add a mechanism to mark builds with vendor info
Downstream distributors can use this to mark a version with their
preferred version information, like a Linux distribution package version
or the Steam revision it was built to be bundled into, or just to mark
it with the vendor it was built by or the environment it's intended to
be used in.

For instance, in Debian I'd use this by configuring with:

    --enable-vendor-info="${DEB_VENDOR} ${DEB_VERSION}"

to get a SDL_REVISION like:

    release-2.24.1-0-ga1d1946dc (Debian 2.24.1+dfsg-2)

which gives a Debian user enough information to track down the patches
and build-time configuration that were used for package revision 2.

In Autotools and CMake, this is a configure-time option like any other,
and will go into both SDL_REVISION (via SDL_revision.h) and
SDL_GetRevision().

In other build systems (MSVC, Xcode, etc.), defining the
SDL_VENDOR_INFO macro will get it into the output of SDL_GetRevision(),
although not SDL_REVISION.

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Simon McVittie 2dc788cb9f build: Expand version info in SDL_REVISION and SDL_GetRevision()
Instead of using a URL and git sha1, this uses `git describe` to
describe the version relative to the nearest previous git tag, which
gives a better indication of whether this is a release, a prerelease,
a slightly patched prerelease, or a long way after the last release
during active development.

This serves two purposes: it makes those APIs more informative, and it
also puts this information into the binary in a form that is easy to
screen-scrape using strings(1). For instance, if the bundled version of
SDL in a game has this, we can see at a glance what version it is.

It's also shorter than using the web address of the origin git
repository and the full git commit sha1.

Also write the computed version into a file ./VERSION in `make dist`
tarballs, so that when we build from a tarball on a system that doesn't
have git available, we still get the version details.

For the Perforce code path in showrev.sh, output the version number
followed by the Perforce revision, in a format reminiscent of
`git describe` (with p instead of g to indicate Perforce).

For the code path with no VCS available at all, put a suffix on the
version number to indicate that this is just a guess (we can't know
whether this SDL version is actually a git snapshot or has been
patched locally or similar).

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Sam Lantinga c6e8961979 Define _USE_MATH_DEFINES for Visual Studio (thanks @pionere!)
Fixes https://github.com/libsdl-org/SDL/issues/3790
2022-10-19 08:05:47 -07:00
Sam Lantinga 0bc852ce53 Revert "Disable the RAWINPUT joystick driver by default"
Disabling RAWINPUT on Windows 10 causes these issues:
* All Xbox controllers are named "XInput Controller".
* Trigger rumble no longer works.
* "XInput Controllers" are now also listed as separate haptic devices
2022-10-17 17:43:06 -07:00
Sam Lantinga 47ba997f06 Disable the RAWINPUT joystick driver by default
It's only needed to support more than 4 Xbox controllers, and adds significant complexity to the joystick processing, and we regularly get bugs from people who aren't using an SDL window who need to turn on SDL_HINT_JOYSTICK_THREAD.
2022-10-17 07:39:52 -07:00
Brad Smith f4e3af15a1 Simplify OSS test by removing OpenBSD specific location of the soundcard.h header
OpenBSD has long since stopped using OSS. Remove checking for OpenBSD specific header.
2022-10-17 07:18:47 -07:00
Daniel Bomar 22461383c6 SDL_audiocvt: Respct the SDL_HINT_AUDIO_RESAMPLING_MODE hint
This implements using libsamplerate for the SDL_AudioCVT API.
This library was already being used for audio streams when this hint is
set.
2022-10-15 14:31:00 -07:00
Sam Lantinga 6bb0c2a5c2 Added documentation for some scancodes 2022-10-14 06:33:38 -07:00
Sam Lantinga 99f2a50394 X11 scancode mapping cleanup
* Consolidated scancode mapping tables into a single location for all backends
* Verified that the xfree86_scancode_table2 is largely identical to the Linux scancode table
* Updated the Linux scancode table with the latest kernel keycodes (still unmapped)
* Route X11 keysym -> scancode mapping through the linux scancode table (which a few hand-written exceptions), which will allow mappings to automatically get picked up as they are added in the Linux scancode table
* Disabled verbose reporting of missing keysym mappings, we have enough data for now
2022-10-13 22:41:47 -07:00
Pierre Wendling 392f3882d0 N3DS: Use SDL_Sensor instead of Joystick sensors. 2022-10-10 08:50:59 -07:00
Pierre Wendling f9785702a6 N3DS: Deduce screen from window's display.
This removes the need for a dedicated window creation flag.
2022-10-10 08:50:59 -07:00
Pierre Wendling 655275378d N3DS port (squashed)
A dedicated renderer using Citro3D would likely allow for better
much better graphical performances.
2022-10-10 08:50:59 -07:00
Sam Lantinga efdb390caa Disable the HIDAPI Wii driver by default as it doesn't work with the dolphinbar 2022-10-09 09:11:33 -07:00
SDL Wiki Bot 9df1af352f Sync SDL wiki -> header 2022-10-09 15:44:07 +00:00
Sam Lantinga b18c361b0f Updated variable name for mouse coordinates in mouse wheel events 2022-10-08 13:18:00 -07:00
Sam Lantinga 4f318c904a Add cursor position to mouse wheel event (thanks @meyraud705!)
Fixes https://github.com/libsdl-org/SDL/pull/6351
2022-10-08 12:01:42 -07:00
Kamil Ševeček 31991ab851 Fix \sa to a valid function in SDL_metal.h. 2022-10-07 07:15:53 -07:00
SDL Wiki Bot 4ca86dae2f Sync SDL wiki -> header 2022-10-05 23:26:14 +00:00
David Gow ad29875ee6 Wayland: Emulate mouse warp using relative mouse mode
Several games (including Source and GoldSrc games, and Bioshock
Infinite) attempt to "fake" relative mouse mode by repeatedly warping
the cursor to the centre of the screen. Since mouse warping is not
supported under Wayland, the viewport ends up "stuck" in a rectangular
area.

Detect this case (mouse warp while the cursor is not visible), and
enable relative mouse mode, which tracks the cursor position
independently, and so can Warp successfully.

This is behind the SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP hint, which
is enabled by default, unless the application enables relative mouse
mode itself using SDL_SetRelativeMouseMode(SDL_TRUE).

Note that there is a behavoural difference, in that relative mouse mode
typically doesn't take mouse accelleration into account, but the
repeated-warping technique does, so mouse movement can seem very slow
with this (unless the game has its own mouse accelleration option, such
as in Portal 2).
2022-10-03 19:11:18 -07:00
SDL Wiki Bot 34b28002d9 Sync SDL wiki -> header 2022-10-03 00:20:15 +00:00
Sam Lantinga 64ea6cefaf SDL_ResetHint() no longer clears the callbacks associated with a hint
Also added SDL_ResetHints() to reset all callbacks, and clarified that SDL_ClearHints() is just used for cleanup at shutdown.

Fixes https://github.com/libsdl-org/SDL/issues/6313
2022-10-02 17:17:31 -07:00
Happy Harry 6c8bf3af4c
Add vertical mode for Nintendo Joy-Con (#6303)
* Added support for vertical mode for Joy-Con controllers
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS for switching to this mode
* Added support for SL/SR buttons in combined/vertical mode and L/ZL/R/ZR buttons in mini-gamepad mode
2022-10-02 09:19:34 -07:00
SDL Wiki Bot 36e7670143 Sync SDL wiki -> header 2022-09-27 16:57:17 +00:00
Sam Lantinga 2c518747b9 Added microsecond timestamp to sensor values for PS4 and PS5 controllers using the HIDAPI driver 2022-09-27 09:56:49 -07:00
Sam Lantinga 61201e06ef Removed obsolete extension definitions
Fixes https://github.com/libsdl-org/SDL/issues/6231
2022-09-15 06:19:18 -07:00
Ozkan Sezer 6dec78ed11 fix permissions of SDL_opengl_glext.h 2022-09-15 11:55:04 +03:00
SDL Wiki Bot c49faabb6d Sync SDL wiki -> header 2022-09-14 16:29:16 +00:00
DS ac5b9bc4ee
Add support for X11 primary selection (#6132)
X11 has a so-called primary selection, which you can use by marking text and middle-clicking elsewhere to copy the marked text.

There are 3 new API functions in `SDL_clipboard.h`, which work exactly like their clipboard equivalents.

## Test Instructions

* Run the tests (just a copy of the clipboard tests): `$ ./test/testautomation --filter Clipboard`
* Build and run this small application:
<details>
```C
#include <SDL.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void print_error(const char *where)
{
	const char *errstr = SDL_GetError();
	if (errstr == NULL || errstr[0] == '\0')
		return;
	fprintf(stderr, "SDL Error after '%s': %s\n", where, errstr);
	SDL_ClearError();
}

int main()
{
	char text_buf[256];

	srand(time(NULL));

	SDL_Init(SDL_INIT_VIDEO);
	print_error("SDL_INIT()");
	SDL_Window *window = SDL_CreateWindow("Primary Selection Test", SDL_WINDOWPOS_UNDEFINED,
			SDL_WINDOWPOS_UNDEFINED, 400, 400, SDL_WINDOW_SHOWN);
	print_error("SDL_CreateWindow()");
	SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
	print_error("SDL_CreateRenderer()");

	bool quit = false;
	unsigned int do_render = 0;
	while (!quit) {
		SDL_Event event;
		while (SDL_PollEvent(&event)) {
			print_error("SDL_PollEvent()");
			switch (event.type) {
			case SDL_QUIT: {
				quit = true;
				break;
			} case SDL_KEYDOWN: {
				switch (event.key.keysym.sym) {
				case SDLK_ESCAPE:
				case SDLK_q:
					quit = true;
					break;
				case SDLK_c:
					snprintf(text_buf, sizeof(text_buf), "foo%d", rand());
					SDL_SetClipboardText(text_buf);
					print_error("SDL_SetClipboardText()");
					printf("clipboard: set_to=\"%s\"\n", text_buf);
					break;
				case SDLK_v: {
					printf("clipboard: has=%d, ", SDL_HasClipboardText());
					print_error("SDL_HasClipboardText()");
					char *text = SDL_GetClipboardText();
					print_error("SDL_GetClipboardText()");
					printf("text=\"%s\"\n", text);
					SDL_free(text);
					break;
				} case SDLK_d:
					snprintf(text_buf, sizeof(text_buf), "bar%d", rand());
					SDL_SetPrimarySelectionText(text_buf);
					print_error("SDL_SetPrimarySelectionText()");
					printf("primselec: set_to=\"%s\"\n", text_buf);
					break;
				case SDLK_f: {
					printf("primselec: has=%d, ", SDL_HasPrimarySelectionText());
					print_error("SDL_HasPrimarySelectionText()");
					char *text = SDL_GetPrimarySelectionText();
					print_error("SDL_GetPrimarySelectionText()");
					printf("text=\"%s\"\n", text);
					SDL_free(text);
					break;
				} default:
					break;
				}
				break;
			} default: {
				break;
			}}
		}
		// create less noise with WAYLAND_DEBUG=1
		if (do_render == 0) {
			SDL_RenderPresent(renderer);
			print_error("SDL_RenderPresent()");
		}
		do_render += 1;
		usleep(12000);
	}

	SDL_DestroyRenderer(renderer);
	SDL_DestroyWindow(window);
	SDL_Quit();
	print_error("quit");
	return 0;
}
```
</details>

* Use c,v,d,f to get and set the clipboard and primary selection.
* Mark text and middle-click also in other applications.
* For wayland under x:
  * `$ mutter --wayland --no-x11 --nested`
  * `$ XDG_SESSION_TYPE=wayland SDL_VIDEODRIVER=wayland ./<path_to_test_appl_binary>`
2022-09-14 09:28:35 -07:00
Sam Lantinga 72fe6cc8f1 Updated to the latest version of OpenGL and Vulkan headers from the Khronos registry
Fixes https://github.com/libsdl-org/SDL/issues/6193
2022-09-14 09:14:47 -07:00
Sam Lantinga 4018f35ef2 Added left and right sensors for Nintendo Joy-Con and Wii controllers 2022-09-07 00:00:27 -07:00
Cameron Cawley fd93f817ba Assume that stdint.h is available on Windows with compilers other than MSVC <= 2008 2022-09-05 09:01:31 -07:00
Sam Lantinga c887cb02af Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers
Also fixed the Y axes on the Wii U Pro controller, and various formatting cleanup
2022-09-01 16:30:55 -07:00
Sam Lantinga c72e14e8f4 Added initial support for Wii controllers (thanks @tellowkrinkle!) 2022-09-01 15:29:41 -07:00
Ozkan Sezer 4ebf34857a updated os2 config file after commit 3f89d1704d 2022-09-01 21:56:50 +03:00
Sam Lantinga 3f89d1704d Fixed building with libusb not dynamicaly loaded 2022-09-01 11:30:02 -07:00
Sam Lantinga 6c2c01e0d1 Fixed documentation to match function parameter 2022-08-31 15:04:12 -07:00
Sam Lantinga 0e4baf1c4e Don't crash if SDL functions are passed a closed joystick or gamecontroller 2022-08-30 12:39:23 -07:00
SDL Wiki Bot 3fe6768caf Sync SDL wiki -> header 2022-08-30 18:47:15 +00:00
Sam Lantinga 40bd4feedc Revamped joystick locking
This makes the joystick locking more robust by holding the lock while updating joysticks.

The lock should be held when calling any SDL joystick function on a different thread than the one calling SDL_PumpEvents() and SDL_JoystickUpdate().

It is now possible to hold the lock while reinitializing the joystick subsystem, however any open joysticks will become invalid and potentially cause crashes if used afterwards.

Fixes https://github.com/libsdl-org/SDL/issues/6063
2022-08-30 11:42:13 -07:00
Francisco Javier Trujillo Mata f1e4685806 Adding specific SDL_Hint for the dynamic VSYNC 2022-08-30 07:20:36 -04:00
SDL Wiki Bot 644a4e5b31 Sync SDL wiki -> header 2022-08-28 02:01:12 +00:00
Sam Lantinga 3cbfd75d0f Re-added the CRC to the joystick guid
This is now used as a crc field in the mapping rather than directly in mapping guids, for better mapping compatibility between versions of SDL.

Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID, so that mapping programs can clear the CRC from the GUID when generating mappings.

sort_controllers.py has been updated to extract the CRC from mappings created by older mapping programs and convert it into the new crc field. It will also take the CRC into account when checking for duplicate mappings.

Also regenerated the GUIDs for the PS2/PSP/Vita controller mappings, fixing https://github.com/libsdl-org/SDL/issues/6151
2022-08-27 19:00:31 -07:00
Charlie Birks d75fb0995d emscripten: Add a hint for specifying the canvas selector
Now that we're not going through EGL, this is easy
2022-08-26 15:20:24 +01:00
SDL Wiki Bot 111626f4cf Sync SDL wiki -> header 2022-08-25 17:17:12 +00:00
Sam Lantinga e4b85091fd Document the range of trigger axes for virtual joysticks
Fixes https://github.com/libsdl-org/SDL/issues/6130
2022-08-25 10:15:45 -07:00
Noel Berry 00452e47fa
Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112) 2022-08-24 11:25:13 -07:00
Sam Lantinga 1fc7f68118 Document that it's not possible to use the HIDAPI driver for PS3 controllers on Windows 2022-08-24 06:38:36 -07:00
Sam Lantinga b6f96b69aa Initial HIDAPI driver support for the PS3 controller 2022-08-23 22:45:37 -07:00
Sam Lantinga 92b3c53c92 Added a hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether to use system mouse acceleration on raw relative motion.
This is currently only implemented on Windows, and "Enhanced pointer
precision" mode is not quite correct.
2022-08-22 16:48:09 -07:00
SDL Wiki Bot a7066c527a Sync SDL wiki -> header 2022-08-21 14:05:04 +00:00
SDL Wiki Bot 8fb1b50a9e Sync SDL wiki -> header 2022-08-20 17:50:04 +00:00
Oleg Derevenetz a204ef50bb Use __ARM_ARCH instead of __ARM_ARCH__ 2022-08-19 13:15:28 -07:00
Sam Lantinga 5a3adbfdb2 Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED to control whether the player LED is set on Xbox 360 controllers 2022-08-19 11:11:25 -07:00
Sam Lantinga 52b6899a6b Added hints for more fine grained control over HIDAPI Xbox controller support 2022-08-19 11:11:23 -07:00
Sam Lantinga 6e9c14e550 Updated to version 2.25.0 for development 2022-08-19 09:38:42 -07:00
Sam Lantinga 8c9beb0c87 Updated to version Updated to version 2.24.0 for release 2022-08-19 08:44:09 -07:00
Sam Lantinga f6b81125b3 Always define SDL_COMPILE_TIME_ASSERT as static_assert() in C++
Apparently some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.

Fixes https://github.com/libsdl-org/SDL/issues/6078
2022-08-18 16:06:42 -07:00
Sam Lantinga f1416ef2ba Updated to version 2.23.2 for release candidate 2022-08-12 20:27:22 -07:00
SDL Wiki Bot f35bbe0c3f Sync SDL wiki -> header 2022-08-11 21:11:11 +00:00
Sam Lantinga 3861c557da Added the hint SDL_HINT_MOUSE_RELATIVE_WARP_MOTION
This hint controls whether mouse warping generates motion events in relative mode, and defaults off.

Fixes https://github.com/libsdl-org/SDL/issues/6034
Fixes https://github.com/libsdl-org/SDL/issues/5741
2022-08-11 14:02:03 -07:00
Sam Lantinga b4c4dd84c2 Added SDL_crc16() to be used in joystick GUIDs after 2.24.0 2022-08-11 09:53:25 -07:00
SDL Wiki Bot 6ecfc40697 Sync SDL wiki -> header 2022-08-10 15:02:11 +00:00
Sam Lantinga d4192850c1 Added SDL_ResetHint() to reset a hint to the default value
Resolves question of how to clear an override hint raised by @pionere in https://github.com/libsdl-org/SDL/pull/5309
2022-08-10 08:01:24 -07:00
Ryan C. Gordon 3119d58ff5
cocoa: Change the new sync_dispatch hint to async_dispatch.
This is so the default is safer.
2022-08-10 10:48:23 -04:00
Ryan C. Gordon bdc7f958fd cocoa: Added hint to treat MacBook trackpads as touch devices, not mice.
Fixes #5511.
2022-08-10 00:42:31 -04:00
Salman Ahmed b4660e9d8b
macOS: Add hint for blocking thread on OpenGL context update dispatch (#5708) 2022-08-09 20:40:00 -04:00
Sam Lantinga 824f2d4650 Added a second hint SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED to control the Home button LED on Nintendo Joy-Con controllers separately from Nintendo Switch Pro controllers 2022-08-09 13:41:58 -07:00
SDL Wiki Bot 523bedac1a Sync SDL wiki -> header 2022-08-09 15:48:12 +00:00
Sam Lantinga aad2df7f0d Document passing -1 to clear the player index for a controller 2022-08-09 08:47:49 -07:00
Ryan C. Gordon 07b0ec539f
SDL_video.h: Added \since info to new APIs. 2022-08-09 09:05:08 -04:00
Ryan C. Gordon a35cff634b
Sync wiki -> headers.
(bridge got stuck, I'm just kicking it to get it working again, idk.)
2022-08-08 16:07:31 -04:00
Sam Lantinga 98bac00dcc Add `SDL_GetPointDisplayIndex` and `SDL_GetRectDisplayIndex` and re-implement `SDL_GetWindowDisplayIndex` in terms of `SDL_GetRectDisplayIndex`
- This allows looking up the display index for an arbitrary location rather than requiring an active window to do so.

- This change also reimplements the fallback display lookup that found the display with center closest to the window's center to instead find the display rect edge
  closest to the window center (this was done in the almost identical display lookup used in SDL_windowsmodes.c, which now uses `SDL_GetPointDisplayIndex`). In
  practice this should almost never be hit as it requires the window's center to not be enclosed by any display rect.
2022-08-08 11:26:52 -07:00
Francisco Javier Trujillo Mata d355ea9981 Add a way to avoid IOP reset 2022-08-08 08:32:38 -07:00
Sam Lantinga 878259722f Added SDL_GameControllerType enumeration for Nintendo Switch Joy-Con controllers 2022-08-08 08:22:20 -07:00
Sam Lantinga 52bf5b1de9 Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED to control whether the player LED is set on Nintendo Switch controllers 2022-08-06 10:34:19 -07:00
SDL Wiki Bot bdaf9a92a6 Sync SDL wiki -> header 2022-08-06 13:25:12 +00:00
Ryan C. Gordon e2452ede66
include: Added documentation to SDL_CaptureMouse about auto-capture. 2022-08-06 09:19:10 -04:00
David Carlier 16e699a761 Proposing exposing as public api the various arch dependent
pause instructions so could be used in app infinite loops.
A handful of games do already so we unify it in one place.
2022-08-04 08:47:39 -07:00
Sam Lantinga bcdef4aaf9 Added separate hints for Nintendo Online classic controllers and Joy-Cons
This allows them to be enabled/disabled separately from Switch Pro HIDAPI support
2022-08-03 13:07:47 -07:00
Shootfast 60d1944e46 SDL_video: Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR 2022-08-02 15:45:30 -07:00
Daniel Santos 147a71b976 Finish dummy driver 2022-08-02 11:40:31 -07:00
Francisco Javier Trujillo Mata 46f95a7a5f Create dummy PS2 Video driver 2022-08-02 11:40:31 -07:00
SDL Wiki Bot 75f34fc5bf Sync SDL wiki -> header 2022-08-02 14:52:12 +00:00
Ryan C. Gordon 307b0b7813
video: Add a warning to the docs about using SDL_GetDisplayDPI.
Fixes #5647.
2022-08-02 10:51:31 -04:00
Sam Lantinga ce5a23bd57 Applied DragonFly BSD patch
https://raw.githubusercontent.com/DragonFlyBSD/DeltaPorts/master/ports/devel/sdl20/dragonfly/patch-include_SDL__endian.h
2022-07-30 16:32:21 -07:00
Sam Lantinga 2241bd669f Added a command line option `--info event_motion` to show mouse and finger motion events 2022-07-29 20:37:38 -07:00
SDL Wiki Bot 47265f377f Sync SDL wiki -> header 2022-07-29 13:24:05 +00:00
Anonymous Maarten f8aa00d198 cmake: add HAVE_STDDEF_H to SDL_config.h.cmake 2022-07-29 15:05:19 +02:00
Sam Lantinga 2fa2f9ff77 Greatly improved Nintendo Joy-Con support using the HIDAPI driver
* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
2022-07-28 19:22:27 -07:00
Ryan C. Gordon 5d85c7d300
kmsdrm: Added a hint to specify device index.
Fixes #2811.
2022-07-26 00:19:54 -04:00
Sam Lantinga cbb3f4ca37 Add SDL_guid.h to the global SDL header 2022-07-25 19:53:04 -07:00
Frank Praznik 41b89aec19 video: Improve the SDL_WINDOW_ALLOW_HIGHDPI flag documentation
Extend the SDL_WINDOW_ALLOW_HIGHDPI flag documentation to stress the importance of querying the window drawable size after every window event to avoid rendering issues in a mixed-DPI environment.
2022-07-22 13:01:57 -04:00
Ryan C. Gordon f73d07da5f audio: Headers said 5 channel is quad+center, but it's 4.1. 2022-07-20 18:41:53 -04:00
Ozkan Sezer b8f30c021b SDL_endian.h: check for __powerpc__ and __PPC__ in big endian decision.
Also remove the _M_PPC check from there.
Reference issue: https://github.com/libsdl-org/SDL/issues/5907
2022-07-12 00:55:00 +03:00
SDL Wiki Bot 5d09b63155 Sync SDL wiki -> header 2022-07-11 17:35:11 +00:00
Ethan Lee 2f0816adb7 Add SDL_GetDefaultAudioInfo.
This API is supported on pipewire, pulseaudio, wasapi, and directsound.

Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
2022-07-11 13:34:35 -04:00
Sam Lantinga 2373da5d94 Exposed SDL_ResetKeyboard() as a public function
This will be used by Source 2 titles to reset keyboard state before showing assertion dialogs
2022-07-11 09:49:00 -07:00
Sam Lantinga 2c22d7204c Fixed typo in description 2022-07-11 08:44:49 -07:00
Cameron Gutman 6e712d2440 joystick: Add HIDAPI driver for NVIDIA SHIELD 2017 controller
Basic input already works using the OS HID driver, but this enables
force feedback and battery state reporting.
2022-07-10 10:53:26 -07:00
SDL Wiki Bot 6187edd41e Sync SDL wiki -> header 2022-07-04 23:57:05 +00:00
rohlem b085c18251 make SDL_SetTextInputRect take a pointer to const
The documentation doesn't state that the argument is ever modified,
and no implementation does so currently.
This is a non-breaking change to guarantee as much to callers.
2022-07-04 09:38:01 -07:00
SDL Wiki Bot fcb99d7830 Sync SDL wiki -> header 2022-07-04 13:42:05 +00:00
Anthony Heathcoat 2a25b69ba5 Check if GNC is defined before checking its value to solve warns in msvc 2022-07-03 00:56:09 -07:00
Sam Lantinga cd79e9c4e2 Removed comment text that looks like doxygen commands 2022-07-01 14:04:07 -07:00
chalonverse f317d619cc
Xbox GDKX support (#5869)
* Xbox GDK support (14 squashed commits)

* Added basic keyboard testing

* Update readme

* Code review fixes

* Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
2022-07-01 13:59:14 -07:00
Sam Lantinga e9d5060c4c checkkeys will now render text that is input
Also added test functions for multi-line debug text display

Currently this only supports ASCII, as the font doesn't have the correct Latin-1 characters
2022-07-01 12:56:47 -07:00
Jade Macho 6a2e6c82a0 Add SDL_HINT_DIRECTINPUT_ENABLED (on by default) 2022-06-28 15:59:05 -07:00
Sam Lantinga cbd0187475 Removed the limit on the size of the SDL error message
Also added SDL_GetOriginalMemoryFunctions()

Fixes https://github.com/libsdl-org/SDL/issues/5795
2022-06-27 16:59:50 -07:00
Francisco Javier Trujillo Mata e4a8087551 Initial Audio driver 2022-06-27 15:18:48 -07:00
SDL Wiki Bot 0a9a0a79e0 Sync SDL wiki -> header 2022-06-27 17:20:12 +00:00
chalonverse 3b191580c3
Windows GDK Support (#5830)
* Added GDK

* Simplfied checks in SDL_config_wingdk.h

* Added testgdk sample

* Added GDK readme

* Fixed error in merge of SDL_windows.h

* Additional GDK fixes

* OpenWatcom should not export _SDL_GDKGetTaskQueue

* Formatting fixes

* Moved initialization code into SDL_GDKRunApp
2022-06-27 10:19:39 -07:00
Francisco Javier Trujillo Mata 7fd46ec581 Initial PS2_Joystick implementation 2022-06-27 00:32:43 -07:00
Francisco Javier Trujillo Mata 84d69da4e1 Initial SDL_ps2_main implementation 2022-06-27 00:32:43 -07:00
Ryan C. Gordon ff735b3c0f
SDL_Surface: don't implicitly declare struct SDL_BlitMap.
It's just an opaque type, but it's more clear to have it typedef'd outside
the containing struct.

Fixes #5828.
2022-06-20 18:31:39 -04:00
Ozkan Sezer a8d41b3b45 check for shellscalingapi.h presence instead of WINVER >= 0x0603 2022-06-18 13:00:44 -07:00
Alex Richardson d51a8f530e cmake: freebsd: Fix -Wformat warning during tests build
Without using <inttypes.h>, SDL_PRIx64 will expand to llx, but on 64-bit
FreeBSD platforms (u)int64_t is `(usigned) long`:
SDL_test_memory.c:261:77: error: format specifies type 'unsigned long long' but the argument has type 'Uint64' (aka 'unsigned long') [-Werror,-Wformat]

This commit updates config_minimal.h to also assume presence of inttypes.h
for everything except old MSVC.
2022-06-18 07:37:57 -07:00
Sam Lantinga adc6875870 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)
Closes https://github.com/libsdl-org/SDL/pull/5811
2022-06-17 10:22:28 -07:00
Sam Lantinga b004133f08 Updated to version 2.23.1 for pre-release checkpoint 2022-06-16 12:50:19 -07:00
Francisco Javier Trujillo Mata 6b03c1adf6 Add filesystem driver 2022-06-15 15:15:26 -07:00
Francisco Javier Trujillo Mata 52f00833b0 Add Thread drivers 2022-06-15 15:15:26 -07:00
Francisco Javier Trujillo Mata 217d3a6dab Add systimer support 2022-06-15 15:15:26 -07:00
Francisco Javier Trujillo Mata f0a05ed476 Add some PS2 flags 2022-06-15 15:15:26 -07:00
Anonymous Maarten b5f1fe5004 cmake: Allow integers for SDL_ASSERTIONS + fix -DSDL_ASSERTIONS=0 2022-06-15 11:11:49 -07:00
Sam Lantinga c95edd9450 Fixed spacing 2022-06-13 06:36:48 -07:00
SDL Wiki Bot 33f8a4ddca Sync wiki -> header 2022-06-13 13:29:04 +00:00
Sam Lantinga 6258f2ef3f Fixed spacing 2022-06-13 06:27:14 -07:00
Matthew Morrison b84ce0d484 Fix typo
platform was spelled like plattform
2022-06-11 18:13:10 -07:00
Eric Wasylishen ab81a559f4 Windows DPI scaling/highdpi support
Adds hint "SDL_WINDOWS_DPI_SCALING" which can be set to "1" to
change the SDL coordinate system units to be DPI-scaled points, rather
than pixels everywhere.

This means windows will be appropriately sized, even when created on
high-DPI displays with scaling.

e.g. requesting a 640x480 window from SDL, on a display with 125%
scaling in Windows display settings, will create a window with an
800x600 client area (in pixels).

Setting this to "1" implicitly requests process DPI awareness
(setting SDL_WINDOWS_DPI_AWARENESS is unnecessary),
and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows.
2022-06-11 14:19:01 -07:00
Eric Wasylishen 51ebefeeee Support PMv2 DPI awareness, add SDL_HINT_WINDOWS_DPI_AWARENESS
The hint allows setting a specific DPI awareness ("unaware", "system", "permonitor", "permonitorv2").

This is the first part of High-DPI support on Windows ( https://github.com/libsdl-org/SDL/issues/2119 ).
It doesn't implement a virtualized SDL coordinate system, which will be
addressed in a later commit. (This hint could be useful for SDL apps
that want 1 SDL unit = 1 pixel, though.)

Detecting and behaving correctly under per-monitor V2
(calling AdjustWindowRectExForDpi where needed) should fix the
following issues:

https://github.com/libsdl-org/SDL/issues/3286
https://github.com/libsdl-org/SDL/issues/4712
2022-06-11 14:19:01 -07:00
Frank Praznik e1c8350439 wayland: Add a hint to disable video mode emulation under Wayland
Add the hint "SDL_VIDEO_WAYLAND_MODE_EMULATION", which can be used to disable mode emulation under Wayland. When disabled, only the desktop and/or native display resolution is exposed.
2022-06-10 14:24:12 -07:00
Guldoman 74bcc5a0a3 stdlib: Add `SDL_utf8strnlen` 2022-06-09 15:18:50 -07:00
chalonverse b9c2ad8395 Added additional check for HAVE_D3D12_H and missing SDL_VIDEO_RENDER_D3D12 in SDL_config.h.cmake 2022-06-07 22:36:06 -07:00
SDL Wiki Bot ef4e0e921a Sync wiki -> header 2022-06-07 00:44:04 +00:00
chalonverse 4082821822
DirectX 12 Renderer (#5761)
* DirectX 12 Renderer (27 squashed commits)

* Add missing SDL_hidapi.h of merge of SDL.vcxproj.filters

* Fixed OpenWatcom build failure

* Dynapi fix

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
2022-06-06 17:42:30 -07:00
SDL Wiki Bot 7cd165e2d9 Sync wiki -> header 2022-06-06 15:51:04 +00:00
yuanhecai 17f63e53f8 Add loongarch support
LSX and LASX are enabled by default if compiler supports them.
2022-06-06 08:49:09 -07:00
SDL Wiki Bot 3807e95029 Sync wiki -> header 2022-06-05 00:24:04 +00:00
Christoph Reichenbach 3a20274ddf Refactoring: move GUID operations out of Joystick
- SDL_JoystickGUID -> SDL_GUID (though we retain a type alias)
- Operations for GUID <-> String ops are now in
  src/SDL_guid.c and include/SDL_guid.h
- The corresponding Joystick operations delegate to SDL_guid.c
- Added test/testguid.c
2022-06-04 17:22:13 -07:00
SDL Wiki Bot 3604ae1d1b Sync wiki -> header 2022-06-04 01:52:04 +00:00
Sam Lantinga 423141bfca Added a function to get the controller firmware version 2022-06-03 18:50:00 -07:00
SDL Wiki Bot 4ddf85b1d5 Sync wiki -> header 2022-05-30 14:31:05 +00:00
Ryan C. Gordon 195ca499ca
include/SDL_video.h: You can google it.
This looks bad when reading Markdown as plain text, as one would do when
reading the headers directly.
2022-05-25 10:46:06 -04:00
Ryan C. Gordon 7ce311bead
include/SDL_system.h: Fixed a link that was still hg.libsdl.org 2022-05-25 10:43:14 -04:00
SDL Wiki Bot a8e7548797 Sync wiki -> header 2022-05-24 22:57:04 +00:00
SDL Wiki Bot 179765561c Sync wiki -> header 2022-05-24 18:26:05 +00:00
Sam Lantinga e97b506242 Need SDL_stdinc.h for _SDL_HAS_BUILTIN 2022-05-21 10:06:05 -07:00
Sam Lantinga 626a3c5ef7 Use _SDL_HAS_BUILTIN() instead of __has_builtin 2022-05-21 09:58:39 -07:00
David Carlier 1f48f8cd28 SDL_TriggerBreakPoint update using builtin instead of assembly versions if available 2022-05-21 09:50:04 -07:00
Simon McVittie b0a27cb1de Avoid unintended float -> double conversion in SDL_FRectEqualsEpsilon
Resolves: https://github.com/libsdl-org/SDL/issues/5691
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-19 11:47:03 -07:00
Cameron Cawley 9dfa000bc0 Initial support for building for Windows with OpenWatcom 2022-05-19 20:11:10 +03:00
Ozkan Sezer efa2e6a1ea SDL_thread.h: use SDL_ThreadFunction for SDL_CreateThreadWithStackSize 2022-05-19 18:55:02 +03:00
Cameron Cawley 0cca71a846 Use SDLCALL for callbacks in public APIs 2022-05-18 15:01:27 -07:00
Ivan Epifanov 8c5bda6acd Vita: remove Vita-specific RWOps code 2022-05-18 08:29:25 -07:00
Sam Lantinga f0bc5c9cbf Added effects support for virtual controllers 2022-05-16 07:21:28 -07:00
SDL Wiki Bot 5953422c09 Sync wiki -> header 2022-05-16 03:52:04 +00:00
Sam Lantinga bfac54b59c Added the ability to specify which buttons and axes are present for virtual controllers 2022-05-15 20:34:44 -07:00
SDL Wiki Bot 49ca8bf520 Sync wiki -> header 2022-05-16 03:03:04 +00:00
Sam Lantinga 94eeb587c1 First pass at extending virtual controller functionality
Added the ability to specify a name and the product VID/PID for a virtual controller

Also added a test case to testgamecontroller, if you pass --virtual as a parameter
2022-05-15 20:01:12 -07:00
Cameron Cawley e0f3da497f Remove unused SDL_ASSEMBLY_ROUTINES define 2022-05-12 14:37:00 +03:00
SDL Wiki Bot f93e810780 Sync wiki -> header 2022-05-12 07:39:04 +00:00
Sylvain 6b9884d40a
Fixed bug #4213 - update documentation to reflect SDL2 behavior of SDL_RenderGetLogicalSize 2022-05-12 09:36:49 +02:00
Michael Fitzmayer 9b75fa0165
N-Gage port: add changes from code reviews, overall cleanup (#5618)
* Add changes from code review by @ccawley2011, #5597, overall cleanup

* Update N-Gage README, minor cleanup and rephrasing

* Call SDL_SetMainReady() before calling SDL_main, return SDL_main instead of main
2022-05-11 09:31:34 -07:00
Sam Lantinga 2c2cbbe664 Fixed function reference for SDL_SIMDGetAlignment() 2022-05-11 09:04:23 -07:00
Cameron Cawley 2f924020e8 Add SDL_SCANCODE_CALL and SDL_SCANCODE_ENDCALL 2022-05-10 16:12:10 -07:00
Cameron Cawley 2bc373622b Add SDL_SCANCODE_SOFTLEFT and SDL_SCANCODE_SOFTRIGHT 2022-05-10 16:12:10 -07:00
Alex Szpakowski f871c178b9 macOS: remove dead code for supporting 10.6 at runtime. 2022-05-10 14:04:14 -07:00
Simon McVittie 8ab3ae98f0 stdinc: Add a comment to clarify why inline functions are needed here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-10 06:50:54 -07:00
Alex Szpakowski d35c737f1c macOS: change min supported OS from 10.6 to 10.7. 2022-05-09 21:53:40 -07:00
Simon McVittie f661654fad stdinc: Add overflow-checking add and multiply for size_t
This can be used to check whether untrusted sizes would cause overflow
when used to calculate how much memory is needed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 21:31:39 -07:00
Simon McVittie cd7c2f1de7 Switch versioning scheme to be the same as GLib and Flatpak
For stable releases, this gives us the ability to make bugfix-only point
releases such as 2.24.1 if we want to, and distinguish between them
programmatically. For example, this ability could have been useful after
2.0.16 to fix Xwayland regressions, and after 2.0.18 to fix event loop
regressions.

For development releases, this gives us the ability to make multiple
prereleases during the same feature cycle, and distinguish between them
programmatically. For example, this would have been useful during 2.0.22
development, which went through three prereleases before reaching the
final release.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie ba6f96275e Document SDL_VERSIONNUM as able to encode larger minor versions
Now that we've said this will be removed from SDL 3, we're free to use
any encoding that is compatible with existing SDL versions and will still
compare correctly for all SDL 2 version numbers. This allows the SDL 2
minor version to go beyond 1 digit, limited only by the size of
SDL_version.minor (which is 8 bits), making the largest possible version
number 2.255.99.

The patchlevel (micro version) is still limited to 2 digits.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie e0daa2a530 Deprecate SDL_COMPILEDVERSION and SDL_VERSIONNUM, to be removed in 3.x
The encoding used in SDL_VERSIONNUM (e.g. 2.0.22 -> 2022) cannot
represent 2-digit minor versions without overflowing from the hundreds
digit into the thousands digit, which produces confusing version
numbers that will compare incorrectly when the major version is increased
to 3.

However, we can sidestep this problem by declaring that SDL_VERSIONNUM
will no longer be present in SDL 3, which means it only needs to be able
to represent SDL 2 version numbers losslessly.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie f9a5cf77b8 Make SDL_VERSION_ATLEAST future-proof against larger version numbers
This comparison normally happens at compile-time, not at runtime, so
it doesn't matter if it isn't optimal. This avoids incorrect comparison
if the minor version in SDL_COMPILEDVERSION and SDL_VERSIONNUM has more
than one digit, which would cause it to overflow from the hundreds place
into the thousands place.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Cameron Cawley b398a847be Add SDL_FLOATWORDORDER for older ARM toolchains 2022-05-04 09:52:11 -07:00
atfrase db9e14e504 disabled linux joystick debugging outputs and reverted unnecessary comment edit 2022-05-03 10:44:09 -07:00
atfrase 3696e23d09 added hints SDL_HINT_LINUX_DIGITAL_HATS and SDL_HINT_LINUX_HAT_DEADZONES to control the new Linux hat handling; added define DEBUG_GAMEPAD_MAPPINGS to log messages when generating default gamepad mapings for Linux joysticks 2022-05-03 10:44:09 -07:00
Michael Fitzmayer fbd230bb6c
Add support for the Nokia N-Gage (#5597)
* Add initial support for the Nokia N-Gage

* N-Gage: disable clipping for the time being, issue needs to be resolved later

* Move va_copy definition to SDL_internal.h

* Move stdlib.h include to SDL_config_ngage.h, much cleaner this way

* Remove redundant include, add HAVE_STDLIB_H

* Revert "N-Gage: disable clipping for the time being, issue needs to be resolved later"

This reverts commit 4f5f0fc36cc7f34fad05e45671dfa7b8dc32fd51.

* N-Gage: fix clipping issue by providing proper math functions
2022-05-03 08:51:49 -07:00
Susko3 6150245d65 Add new verbosity level for logging of `SDL_SysWMEvent`s
Now logged only if SDL_HINT_EVENT_LOGGING is set to "3" or above.
2022-05-02 15:33:13 -07:00
Sam Lantinga 829f6b3d7d These headers are system headers, not local headers 2022-04-30 11:33:03 -07:00
Sam Lantinga f81419702e Document that SDL_MAX_LOG_MESSAGE is no longer meaningful 2022-04-29 11:28:59 -07:00
Ryan C. Gordon 7d7ec9c951
x11: Remove XVidMode and Xinerama support.
Fixes #1782.
2022-04-26 23:17:13 -04:00
Sam Lantinga e551384a99 Added functions to get the platform dependent name for a joystick or game controller 2022-04-26 14:54:14 -07:00
Ozkan Sezer e9ff4fdd49 add SDL_bsearch 2022-04-26 04:03:25 +03:00
meyraud705 3dcfe86082 Add joystick battery event 2022-04-25 15:46:17 -07:00
Sam Lantinga fa29e2d7f7 Updated to version 2.0.23 for development 2022-04-25 13:45:51 -07:00
Eddy Jansson 0288de8529 SDL_Rect: Add \sa documentation block to SDL_FRect 2022-04-22 12:09:13 -04:00
Eddy Jansson fc944859d1 SDL_Rect: Use a default epsilon in SDL_FRectEquals()
Add SDL_FRectEqualsEpsilon() for when more control over
equality test is required.
2022-04-20 08:38:53 -07:00
Eddy Jansson 00feca27b0 Add SDL_FLT_EPSILON. 2022-04-20 08:38:53 -07:00
Ethan Lee c37090f9a4 wayland: Add support for TOOLTIP/POPUP_MENU 2022-04-18 12:31:02 -04:00
Ryan C. Gordon c1336b21ed hints: Make SDL_VIDEODRIVER and SDL_AUDIODRIVER formal hints.
They were just environment variables before.

Fixes #5528.
2022-04-17 11:31:55 -07:00
David Gow 9c2f46b0d5 Wayland: Add SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR
This hint allows libdecor to be used even when xdg-decoration is
available. It's mostly useful for debugging libdecor, but could in
theory be used by applications which want to (for example) bundle their
own libdecor plugins.
2022-04-12 11:52:41 -04:00
Sam Lantinga 505d6a4a05 Update version to 2.0.22 for release 2022-04-08 18:18:56 -07:00
Sam Lantinga 6d7d142b70 Fixed typo 2022-04-08 18:10:38 -07:00
Connor Clark 6dbca7c911 Compile with recursive mutexes for emscripten
Emscripten actually does support recursive mutexes, so no need to use SDL's fake recursive code.

Background: #5428, #5479
2022-04-06 18:51:35 -07:00
Ozkan Sezer c0bb39e5e9 check for HAVE_ROAPI_H in cmake and autotools, and
update SDL_config_windows.h and SDL_config_winrt.h
2022-04-02 02:50:02 +03:00
Jaylon Gowie 8c542a3591 Desktop OpenGL 1.X/2.X PSVita Support 2022-03-31 00:02:56 -04:00
Ryan C. Gordon 3425e9950e
stdinc: SDL_COMPILE_TIME_ASSERT defines shouldn't have a semicolon. 2022-03-30 10:13:47 -04:00
Ivan Epifanov 96be9cddcc Vita: add hint to select which touchpad generates mouse events 2022-03-28 08:36:32 -07:00
Cameron Gutman a60986caa8 Correct default structure packing on Windows ARM64
See issue #5454 for details
2022-03-27 19:03:54 -05:00
SDL Wiki Bot 6d1c3cd691 Sync wiki -> header 2022-03-27 17:11:05 +00:00
SDL Wiki Bot 2591f7e39c Sync wiki -> header 2022-03-27 16:52:04 +00:00
SDL Wiki Bot 7ba4d24c25 Sync wiki -> header 2022-03-27 16:49:05 +00:00
Ryan C. Gordon 7bc498d325
direct3d: Implement missing blend operations.
This is only for Direct3D 9; Direct3D 11 already had this implemented.

Fixes #5375.
2022-03-27 09:14:07 -04:00
SDL Wiki Bot 2a4e0f8fd0 Sync wiki -> header 2022-03-23 16:09:05 +00:00
Sylvain Becker c23a7ad38a
Add SDL_RenderGetWindow() API to get the window associated with a renderer (#5440)
Add SDL_RenderGetWindow() API to get the window associated with a renderer
2022-03-23 17:07:56 +01:00
Ryan C. Gordon f782abe5f0
hints: Added SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE.
Fixes #2349.
2022-03-22 09:54:29 -04:00
Ryan C. Gordon 2b3c16eb5b
Sync wiki -> headers. 2022-03-20 23:17:14 -04:00
Ryan C. Gordon d81fee7623
SDL_Rect: Added floating point versions of all the rectangle APIs.
Fixes #5110.
2022-03-19 10:35:24 -04:00
SDL Wiki Bot aef1e56737 Sync wiki -> header 2022-03-18 17:30:05 +00:00
Sam Lantinga 40b7326b38 Added a note that SDL_RenderReadPixels() should be called before SDL_RenderPresent() 2022-03-18 10:28:38 -07:00
Sam Lantinga 6c96217727 Added the hint SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, controlling whether the mouse should be constrained to the center of the window or the whole window in relative mode.
For further info about the pros and cons, check out the discussion in https://github.com/libsdl-org/SDL/issues/5271
2022-03-18 10:07:59 -07:00
Sam Lantinga 5ff42438e3 Added a hint to capture the mouse when mouse buttons are pressed, defaulting on
Fixes https://github.com/libsdl-org/SDL/issues/5301
2022-03-17 17:39:46 -07:00
Sam Lantinga e5f45455c9 Added a hint to mark a foreign window as usable with OpenGL
Fixes https://github.com/libsdl-org/SDL/issues/2942
2022-03-17 14:44:34 -07:00
Ethan Lee 0bf8ccfb60 video: Add a hint to allow Vulkan surfaces on foreign windows 2022-03-17 14:25:55 -07:00
Ozkan Sezer f0d2747df1 use _Static_assert for SDL_COMPILE_TIME_ASSERT(), when available 2022-03-17 08:43:27 -07:00
Ozkan Sezer ecc1c871e6 SDL_endian.h: use endian predefs from newer gcc and clang versions.
Closes: https://github.com/libsdl-org/SDL/pull/5403
2022-03-14 10:10:40 +03:00
SDL Wiki Bot 229297d97f Sync wiki -> header 2022-03-11 22:47:04 +00:00
Zach Reedy d14a126383
IME Composition Truncation + SDL_IsTextInputShown + SDL_ClearComposition (#5398)
* Fixes for IME Composition Truncation + Addition of SDL_ClearComposition, SDL_IsTextInputShown

* Fixed: Documentation and code style issues raised during code review.
2022-03-11 14:45:17 -08:00
SDL Wiki Bot 232c3556ac Sync wiki -> header 2022-03-04 17:30:05 +00:00
Sam Lantinga ae73ea9c07 Clarified documentation for the trigger rumble API
Fixes https://github.com/libsdl-org/SDL/issues/5372
2022-03-04 09:27:46 -08:00
SDL Wiki Bot 669a7f8552 Sync wiki -> header 2022-02-23 16:18:05 +00:00
Phillip Stephens 94d43186f2 GameCubeAdapter: Add suppport for all rumble modes
This adds support for all 3 of the gamecube controller's rumble modes
Rumble: 1
Stop: 0
StopHard: 2
This is useful for applications that need the full range of support
This also adds a hint to control rumble behavior, defaults 0 to maintain compatibility
2022-02-23 07:03:02 -08:00
Sam Lantinga 18032979d8 Added the hint SDL_HINT_JOYSTICK_ROG_CHAKRAM to control whether ROG Chakram mice show up as joysticks
This hint defaults off, but when it is enabled the mice will have a game controller mapping set up for Profile 3 (set in the Armoury Crate software)
2022-02-15 13:07:51 -08:00
Ozkan Sezer 67f12ede3b move bug #5333 fix to headers 2022-02-08 21:32:50 +03:00
SDL Wiki Bot 580d231822 Sync wiki -> header 2022-02-08 10:37:04 +00:00
Sylvain 34d4f5b14e
Fixed bug #2032: add SDL_GetTouchName to expose the driver name of the device (Thanks @mgerhardy!) 2022-02-08 11:32:20 +01:00
Ozkan Sezer 050a5e1a15 removed unused SDL_config_wiz.h 2022-02-04 20:02:20 +03:00
Francisco Javier Trujillo Mata daea9fa19e Remove SDL_config_psp and references 2022-02-02 08:36:39 -05:00
SDL Wiki Bot e1cf8d8748 Sync wiki -> header 2022-02-01 16:58:05 +00:00
SDL Wiki Bot 4fa21dd65b Sync wiki -> header 2022-02-01 10:37:05 +00:00
Sylvain d46cc18afc
Fix function comment 2022-02-01 11:35:26 +01:00
SDL Wiki Bot 61b6a2cad4 Sync wiki -> header 2022-02-01 10:33:04 +00:00
Sylvain fe2ed6cf6f
Fixed bug #5221 - Add SDL_AndroidSendMessage() 2022-02-01 11:30:43 +01:00
pionere 3939ef72f8 cleanup SDL_GetAudioDeviceSpec
- drop unnecessary hascapture check
- call SDL_InvalidParamError and return -1 in case the index is out of range
- do not zfill SDL_AudioSpec
- adjust documentation to reflect the behavior
2022-01-28 20:40:19 -05:00
pionere 014e2bbdb2 use SDL_COMPILE_TIME_ASSERT instead of SDL_STATIC_ASSERT 2022-01-28 20:40:19 -05:00
pionere 65e9415b98 sync handling of subsystems
- add DUMMY-define in case the subsystem is enabled but not available (filesystem/misc/locale)
- add missing PSP/VITA-filesystem defines
- sync the order of filesystems in SDL_config.h.cmake/in
- add option to disable locale subsystem in configure
2022-01-28 20:40:19 -05:00
pionere 998117b3ff add 'Misc' subsystem 2022-01-28 20:40:19 -05:00
pionere 942b01a54c do not use RWOps in WIN_SetWindowIcon 2022-01-28 20:40:19 -05:00
pionere 739f350f45 add SDL_LOCALE_DISABLED to SDL_config.h 2022-01-28 20:40:19 -05:00
ulatekh 57bc90403e Add hint to optionally forcibly raise the window under MS Windows. 2022-01-24 11:10:57 -08:00
Sam Lantinga a0e3c884d4 Updated to version 2.0.21 for development 2022-01-17 15:32:27 -08:00
Ryan C. Gordon 42302d0a59
x11: Let apps specify a custom _NET_WM_WINDOW_TYPE.
Fixes #5185.
2022-01-11 21:17:21 -05:00
SDL Wiki Bot b424665e08 Sync wiki -> header 2022-01-10 20:40:05 +00:00
SDL Wiki Bot 5e3f4ccc34 Sync wiki -> header 2022-01-10 20:35:04 +00:00
Ozkan Sezer f14c7bb443 added missing hidapi stuff for os/2 with libusb 2022-01-09 20:33:32 +03:00
Sam Lantinga 09ece861d1 Added the hint SDL_HINT_RENDER_LINE_METHOD to select the line rendering method 2022-01-08 11:36:52 -08:00
Ozkan Sezer 21914b4e2f updated Makefile.psp and SDL_config_psp.h 2022-01-08 11:55:10 +03:00
Sam Lantinga 9294634840 Updated to version 2.0.20 for release 2022-01-07 18:29:40 -08:00
Sam Lantinga 4b38d4c96b Leave the Metal view active on the window when recreating the Metal renderer
Fixes https://github.com/libsdl-org/SDL/issues/5140

Also move the metal tag definition to SDL_syswm.h so it can be used by applications
2022-01-07 12:38:45 -08:00
Ozkan Sezer 75ac944b9c check for tpcshrd.h and define HAVE_TPCSHRD_H if it's available. 2022-01-06 22:24:00 +03:00
Sam Lantinga 120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Francisco Javier Trujillo Mata 13a9cd4797 Adding sysfilesystem driver to PSP 2022-01-02 08:06:04 -08:00
Alex Szpakowski 7f5339e6c4 Document the packed integer formats SDL_Color is bit-compatible with. 2021-12-14 12:19:16 -08:00
Sam Lantinga 086c74556d Fixed build warning on iOS 2021-12-14 12:08:36 -08:00
Sylvain b7885abc44
Fixed bug #5087: SDL_RenderGeometryRaw() passes colors as int* instead of SDL_Color* 2021-12-14 10:31:55 +01:00
Ozkan Sezer 8d14e6ea44 replaced use of _MAX_PATH with CCHMAXPATH in os/2 code,
it now compiles without HAVE_LIBC
2021-12-08 14:01:02 +03:00
Wouter Wijsman da5dbb4763
Fix SDL2main on PSP (#5076)
- Fix SDL2main on PSP
  SDL2main was not working for PSP, because it wasn't being activated and
  it wasn't unsetting the main. Besides that a debug screen being started
  was causing issues with joystick input and the sceKernelExitGame calli
  is no longer needed with the current PSPDEV SDK.
- Clean up imports in PSP main
- Set PSP GPU and user modes in main
- Fix exit callback in PSP main
2021-12-07 18:43:50 +03:00
Wouter Wijsman 897c7cfa8b Make sure SDL_VIDEO_RENDER_PSP is set 2021-12-07 14:03:00 +03:00
Wouter Wijsman 21fd0047e3 Initial for building PSP version with CMake 2021-12-07 14:03:00 +03:00
Ozkan Sezer 70c5e91d0f os/2 optionally builds against libiconv. 2021-12-01 01:20:10 +03:00
Sam Lantinga 5fc901d4f3 Updated to version 2.0.19 for development 2021-11-30 09:58:21 -08:00
Sam Lantinga 976328bb0f Fixed ABI break in SDL test header 2021-11-28 08:54:18 -08:00
Sam Lantinga 110e4e1334 Use WGI instead of XInput for Windows 10 UWP apps
Fixes https://github.com/libsdl-org/SDL/issues/5017
2021-11-27 10:24:32 -08:00
Ozkan Sezer 5a0ea7fb17 Check for O_CLOEXEC definition in fcntl.h at configuration time,
If not available, define it internally as 0 (in SDL_internal.h).
Define it as available for macOS >= 10.7 in SDL_config_macosx.h.
2021-11-27 19:23:10 +03:00
Sam Lantinga 7242075b2b Updated version to 2.0.18 for release 2021-11-26 08:12:45 -08:00
Ozkan Sezer eb39e20588 SDL_endian.h: remove aarch64 asm.
The asm has been reported broken in at least optimized Apple M1 builds;
and besides, the compiler builtins have precedence over the asm anyway.

Closes https://github.com/libsdl-org/SDL/issues/3943
2021-11-25 17:00:50 +03:00
Ozkan Sezer 53aa8eec5f minor cleanup for watcom _inline keyword. 2021-11-25 17:00:24 +03:00
SDL Wiki Bot 3c71f8939b Sync wiki -> header 2021-11-25 13:53:04 +00:00
Cameron Gutman 57520cbde6 Improve documentation for input grabbing functions 2021-11-25 16:49:57 +03:00
Ozkan Sezer f8900583e5 removed windows winmm joystick driver 2021-11-23 17:04:40 +03:00
Sylvain e5467af7c8
Minor change comment 2021-11-23 09:42:07 +01:00
Sam Lantinga c97b721868 Added SDL_PremultiplyAlpha() to premultiply alpha on a block of SDL_PIXELFORMAT_ARGB8888 pixels 2021-11-21 12:18:10 -08:00
Ryan C. Gordon aeff8748a5
configure: Allow building of the "offscreen" video target.
It was CMake-only before this.
2021-11-20 13:35:56 -05:00
Ozkan Sezer 990fb668f7 tests: several -Wwrite-strings fixes. 2021-11-20 01:02:02 +03:00