Commit Graph

50 Commits (f3008e4aabf76f3c3cf2c57d8f01990e779cf477)

Author SHA1 Message Date
Sam Lantinga b299cb3d3c Added a utility function to calculate the next power of 2 for a value 2022-07-17 08:31:16 -07:00
Cameron Cawley 78089e6598 Remove unused internal header SDL_sysevents.h 2022-07-01 07:39:48 -07:00
Anonymous Maarten ae7446a959 stlib: Extract SDL_memcpy and SDL_memset to its own file respectively
This is done such that we can disable LTO for these 2 functions when
building with MSVC.

This is due to a limitation of Link Time Code Generation (LTCG).
Code generation might generate a new reference to memset after linking
has started. The LTCG must make assumptions about where memset is
defined which is normally the C runtime.
2022-06-15 14:17:35 -07: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
Sam Lantinga 17410887d0 Separated controller type data into a C file 2022-06-03 15:03:08 -07:00
Sam Lantinga d5e58049ae Don't specify a specific SDK when building for UWP
Instead use the latest version installed
2022-05-22 10:51:51 -07:00
Sam Lantinga a0cdc1fc30 Added declaration of SDL_LogInit() and SDL_LogQuit()
Fixes compile warning on Android
2022-04-28 15:01:34 -07:00
Ethan Lee b1831715a2
UWP: Require Windows 10 16299 or newer.
This is required to build with WGI support. Thanks for @FrozenChameleon for the fix!

Fixes #5504
2022-04-11 12:09:40 -04:00
Sylvain ad6bc521bd
Move SDL_List functions to SDL_list.c to avoid more merge with eventual PR 2022-04-01 07:59:16 +02: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
Sam Lantinga 11a9cd6344 Fixed building SDL on UWP 2021-11-27 08:14:50 -08:00
Sam Lantinga 5b646cd19e Build hidapi code into SDL as a new public API
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
2021-11-07 23:00:59 -08:00
Ethan Lee 3ed8ba7d33 winrt: Update SDL-UWP to VS2019 2021-09-08 06:26:26 -10:00
Ethan Lee b88077fe5a winrt: Move the UWP project files up one directory 2021-09-08 06:26:26 -10:00
Ethan Lee 2facf5b7b7 winrt: Remove Windows 8.x project files 2021-09-08 06:26:26 -10:00
Ethan Lee 07b59df264 winrt: Remove unused nuspec/targets files 2021-09-08 06:26:26 -10:00
Sylvain a2cd4255c9 Update VisualC projects 2021-08-19 00:10:59 +02:00
Joel Linn 8fc0baad98 Add SDL_cond implementation using Windows Condition Variables
Is automatically used when the SRW SDL_mutex implementation is active.
Otherwise falls back to the generic implementation.

v2: - Rebase onto master fa3ea1051a4b
2020-12-28 11:43:11 -08:00
Joel Linn 2443e51e0e Add optional suffix `_generic` to generic SDL_cond impl
Allows for runtime selectable implementation
2020-12-28 11:42:49 -08:00
Joel Linn 5b64fdc9bf thread/windows: Remove synchronization.lib from WinPhone81 dependencies
synch APIs are implicitly available on this platform.
2020-12-25 10:41:20 +03:00
Joel Linn d6afc1c608 thread/windows: Statically link synchronization APIs on WINRT
GetModuleHandleW is not available on those platforms
---
 .../WinPhone81_VS2013/SDL-WinPhone81.vcxproj         |  8 ++++----
 VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj     | 12 ++++++------
 src/thread/windows/SDL_sysmutex.c                    | 12 ++++++++++++
 src/thread/windows/SDL_syssem.c                      | 11 +++++++++++
 4 files changed, 33 insertions(+), 10 deletions(-)
2020-12-25 04:00:20 +03:00
Ozkan Sezer 250a055727 fix bug #5384 -- define DLL_EXPORT in DLL builds and adjust begin_code.h 2020-12-09 12:01:10 +03:00
Sam Lantinga 0150455d2c Added SDL_crc32.c to the Windows RT projects 2020-11-16 17:42:04 -08:00
Ryan C. Gordon 4627426994 url: WinRT actually works now (and has been tested, hooray!). 2020-10-06 00:42:17 -04:00
Ryan C. Gordon 6c6d2bdd35 url: Build WinRT-specific code as C++/CX instead of plain C++. 2020-10-05 16:25:48 -04:00
Ryan C. Gordon 57e3003d3f url: Attempt at WinRT support. 2020-10-05 15:47:47 -04:00
Ryan C. Gordon b7b2995fbe url: Added to Visual Studio project files. 2020-10-05 15:27:32 -04:00
Sam Lantinga 4d15b5b893 Fixed building with Visual Studio 2019 2020-06-10 09:36:10 -07:00
Ryan C. Gordon fa23e3d00b locale: Implemented SDL_GetPreferredLocales().
This was something I proposed a long time ago, Sylvain Becker did
additional work on it, then back to me.

Fixes Bugzilla #2131.
2020-05-04 02:27:29 -04:00
David Ludwig 40625c4e79 virtual joysticks: MSVC support part 2/2, add file refs to MSVC projects (bug 5028) 2020-03-15 16:01:19 -04:00
Ozkan Sezer eb8f14bb6a added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.) 2019-11-20 20:40:50 +03:00
Sam Lantinga de5367a612 Added display event files to the Visual Studio projects 2018-08-23 02:48:47 -07:00
Sam Lantinga b8ae2c1860 Fixed UWP build 2018-08-21 20:20:54 -07:00
Sam Lantinga 7749ee2a43 Added the dummy sensor driver to the Visual Studio projects 2018-08-21 13:42:44 -07:00
Sam Lantinga 2fc71d879d Windows Phone 8.0 is no longer supported 2018-02-09 08:03:03 -08:00
Ryan C. Gordon 6d32ebdbc9 winrt: Add mmdevapi.lib dependency to WinRT8.1 builds, for WASAPI support. 2017-12-31 03:51:17 -05:00
Ryan C. Gordon 351d6d4784 audio: Port WASAPI to WinRT, remove XAudio2 backend.
XAudio2 doesn't have capture support, so WASAPI was to replace it; the holdout
was WinRT, which still needed it as its primary audio target until the WASAPI
code code be made to work.

The support matrix now looks like:

WinXP: directsound by default, winmm as a fallback for buggy drivers.
Vista+: WASAPI (directsound and winmm as fallbacks for debugging).
WinRT: WASAPI
2017-12-06 12:24:32 -05:00
Sam Lantinga a6a4e27ae8 Updated SDL's YUV support, many thanks to Adrien Descamps
New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
2017-11-12 22:51:12 -08:00
Sam Lantinga adc64f922f Added Visual Studio solution files for WinRT projects 2017-10-21 22:26:24 -07:00
Sam Lantinga b5f31c392d Moved haptic source files into the proper folder 2017-08-30 09:44:38 -07:00
David Ludwig e07e446a3f WinRT: removed Windows 8.0 from build-bot + NuGet package creation scripts
According to Steam's OS stats, Windows 8.0 use is pretty much nil.  Further,
Microsoft hasn't support Windows 8.0 development in any of their
actively-updated toolchains, and setting it up can be a pain.

In theory, SDL2 still supports Windows 8.0, however building of Windows 8.0
.dlls is no longer the default, if and when using the 'winrtbuild.*' scripts.
The MSVC 2012 project files for building Windows 8.0 dlls remain, though,
for the time being.
2017-02-25 21:23:12 -05:00
David Ludwig d6bcec8f6a WinRT: build fixes
These fixes are lumped into two categories:

1. add new file, SDL_dataqueue.c, to UWP/WinRT build-inputs (via MSVC project
   files)

2. implement a temporary, hack-fix for a build error in SDL_xinputjoystick.c.
   Win32's Raw Input APIs are, unfortunately, not available for use in UWP/WinRT
   APIs.  There does appear to be a replacement API, available in the
   Windows.Devices.HumanInterfaceDevice namespace.

   This fix should be sufficient to get SDL compiling again, without affecting
   Win32 builds, however using the UWP/WinRT API (in UWP/WinRT builds) would
   almost certainly be better (for UWP/WinRT builds).

   TODO: research Windows.Devices.HumanInterfaceDevice, and use that if and as
   appropriate.
2016-12-10 15:23:17 -05:00
Ryan C. Gordon 2da1ec8354 Merge audio capture work back into the mainline. 2016-08-28 13:36:13 -04:00
David Ludwig 5150eb361f WinRT: fixed bug where Win10 GameBar, when shown + hidden, might not restore a cursor's hidden state
The repro steps were this:
1. run an sdl2 winrt/uwp app, on Win10, v10.0.10586.0 or higher
2. hide the cursor, via a call to SDL_ShowCursor(0)
3. make the Win10 game bar appear, by pressing the Windows + G hotkey
4. observe that the mouse cursor appears, in order to interact with the
   game bar (this is expected behavior)
5. make the Win10 game bar disappear, either by pressing the Windows + G hotkey
   again, or clicking somewhere in the app

EXPECTED RESULT: cursor disappears, as game bar disappears

ACTUAL RESULT: cursor didn't always disappear
2016-08-20 13:46:45 -04:00
Ryan C. Gordon 979de761c9 audio: Removed internal SDL_audiomem.h and macros.
I think this was important for SDL 1.2 because some targets needed
special device memory for DMA buffers or locked memory buffers for use in
hardware interrupts or something, but since it just defines to SDL_malloc
and SDL_free now, I took it out for clarity's sake.
2016-08-05 01:44:15 -04:00
David Ludwig 5790f59f88 WinRT: minor tweak to NuGet package naming 2015-12-02 08:04:17 -05:00
David Ludwig 89898d8341 WinRT: added NuGet-package creation support to WinRT build script 2015-12-01 22:07:24 -05:00
David Ludwig 25abce513d WinRT: added Win10/UWP (Universal Windows Platform) support
"UWP" appears to be Microsoft's new name for WinRT/Windows-Store APIs.

This set of changes updates SDL's WinRT backends to support the Win10 flavor
of WinRT.  It has been tested on Win10 on a desktop.  In theory, it should
also support Win10 on other devices (phone, Xbox One, etc.), however further
patches may be necessary.

This adds:
- a set of MSVC 2015 project files, for use in creating UWP apps
- modifications to various pieces of SDL, in order to compile via MSVC 2015 +
  the Win10 API set
- enables SDL_Window resizing and programmatic-fullscreen toggling, when using
  the WinRT backend
- WinRT README updates
2015-11-29 19:33:11 -05:00
David Ludwig fa2d5ab497 WinRT: bug-fix - SDL_SetThreadPriority() didn't work on WinRT 8.x platforms
WinRT 8.0 (Phone and non-Phone) didn't offer an API to set an already-created
thread's priority.  WinRT 8.1 offered this API, along with several other
Win32 thread functions that were previously unavailable (in WinRT).

This change makes WinRT 8.1+ platforms use SDL's Win32 backend.
2015-11-26 13:51:03 -05:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00