src/video/winrt/SDL_winrtvideo.cpp


Log

Author Commit Date CI Message
Simon McVittie 412ceb84 2022-05-24T16:27:54 video: Only check major version in SDL_GetWindowWMInfo Since #5602, SDL is intended to have the same ABI across the whole major-version 2 cycle, so we should not check that the minor version matches the one that was used to compile an application. There are two checks that could make sense here. The first check is that the major version matches the expected major version. This is usually unnecessary and is not usually done (if we're calling into the wrong library we'll likely crash anyway), but since we have the information, we might as well continue to use it. The second check is whether the version provided by the caller is equal to or greater than a threshold version at which additional fields were added to the struct. If it is, we should populate those fields; if it is not, then we cannot. This is only useful on platforms where additional fields have genuinely been added during the lifetime of SDL 2, like Windows and DirectFB (but not X11). This commit changes the first check to be consistent about only looking at the minor version, while leaving the second check using SDL_VERSIONNUM (which will be removed or widened in SDL 3, but it's fine for now). Resolves: https://github.com/libsdl-org/SDL/issues/5711 Fixes: cd7c2f1 "Switch versioning scheme to be the same as GLib and Flatpak" Signed-off-by: Simon McVittie <smcv@collabora.com>
pionere 3bef4a5d 2022-01-22T15:43:09 cleanup error-handling in SDL_egl.c - always set error message in SDL_EGL_ChooseConfig / SDL_EGL_CreateContext - assume SDL_EGL_DeleteContext does not alter the error message - sync generic error message of SDL_EGL_MakeCurrent with SDL_EGL_Get/SetSwapInterval - do not overwrite error message of SDL_EGL_ChooseConfig in WINRT_CreateWindow
pionere 60deadba 2022-01-17T17:22:30 re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Sam Lantinga 11a9cd63 2021-11-27T08:14:50 Fixed building SDL on UWP
Ryan C. Gordon 350ca0f9 2021-08-03T04:57:53 winrt: Don't register orientation hint callback in startup code. SDL_AddHintCallback() uses SDL_malloc(), which means this would run before main(), so the app wouldn't be able to supply its own replacement SDL_malloc() implementation in time. This code was moved to under SDL_Init. Since the hint callback already makes efforts to not override the app manifest's orientation settings, this is safe to move until after pre-main() startup. Fixes #4449.
okuoku 8fa2ce56 2021-04-03T22:47:47 WinRT: Rename Interface ID symbols Rename locally-defined Interface ID symbols to avoid conflict with locally linked dxgi library. Prefixed with `SDL_` to match with other references in render_d3d11 or wasapi.
Cameron Cawley 391bb80b 2021-03-05T16:53:06 Replace duplicate functions and lstrlen/lstrcat with SDL string functions
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga 76980e30 2020-10-08T16:42:20 Added events for dynamically connecting and disconnecting displays, with an iOS implementation
M Stoeckl 052a1373 2020-07-12T19:11:15 Merge VideoBootStrap::available into VideoBootStrap::create The two are only ever called together, and combining them makes it possible to eliminate redundant symbol loading and redundant attempts to connect to a display server.
Sam Lantinga b6afbe63 2020-04-07T09:38:57 Added SDL_log.h to SDL_internal.h so logging is available everywhere
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga 50efbda7 2017-08-28T00:43:14 Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h
Philipp Wiesemann 266816b4 2017-03-26T21:00:19 Removed newlines from error messages.
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
David Ludwig 0cfa0aa1 2016-12-29T11:49:18 improved SDL_GetError() output generated by EGL code This change attempts to report the EGL error codes generated by SDL's calls into EGL, along with the name of the EGL function that failed.
David Ludwig f5d43cf9 2016-08-31T12:52:55 WinRT: added an extra NULL pointer check for SDL_*ScreenSaver() backend code
David Ludwig 5020fe8f 2016-08-29T20:27:21 WinRT: added SDL_*ScreenSaver() support; fixed crash when restoring app from screensaver
David Ludwig 5150eb36 2016-08-20T13:46:45 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
Philipp Wiesemann 9f97ee8a 2016-08-03T22:32:02 WinRT: Removed not needed SDL_zerop() after SDL_calloc(). SDL_calloc() already sets memory to zero.
David Ludwig 52fec6af 2016-05-07T21:41:59 WinRT: allow on-screen keyboard to be shown via SDL APIs, Win10/UWP only
Philipp Wiesemann 0c923fda 2016-03-10T21:00:44 WinRT: Removed dead code and fixed memory leak if allocation for driver failed.
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
David Ludwig 44c0b2da 2015-12-31T01:54:11 WinRT: minor code-comment cleanups
David Ludwig 8281cc72 2015-12-22T00:58:47 WinRT: Fixed bug 3210, "alt-tab doesn't work correctly with full-screened, UWP (Win10 Store) apps"
David Ludwig 976bc9a9 2015-12-06T18:48:46 WinRT: build fix for Windows Phone 8.0
David Ludwig 2b484818 2015-12-06T18:42:30 WinRT: enabled the Win10-Store Cert Kit bug-workaround, for Windows 8.0 apps
David Ludwig a40d49aa 2015-12-06T18:33:43 WinRT: enabled the Win10-Store Cert Kit bug-workaround, for Windows 8.1 apps
David Ludwig 898054a1 2015-12-06T17:32:33 WinRT: fixed a build error when compiling Windows 8.1 .dlls
David Ludwig c8e3bfbf 2015-12-06T17:07:37 WinRT: removed an unused variable from DXGI-based display-detection code
David Ludwig 781455fd 2015-12-06T17:06:40 WinRT: workaround for a possible bug in the Win10 Store's Certification Kit DXGI fails to report any displays in at least one of the "Windows App Certification Kit 10.0"'s tests for Store Apps. This was causing SDL's video initialization code to fail, when the suspect test ("Direct3D Feature Test") was run, as DXGI was unable to report a display-output at adapter-index 0, output-index 0. The workaround that is applied here attempts to detect this case, then use a hopefully-reasonable alternative means to calculate at least one display output.
David Ludwig 25abce51 2015-11-29T19:33:11 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
David Ludwig d07aa877 2015-11-26T11:15:43 WinRT: minor code cleanup in window-creation code Window flags can be detected on all WinRT platforms.
David Ludwig a70fe9a5 2015-11-26T11:09:50 WinRT: native windows are inherently resizable (in WinRT 8.x)
David Ludwig 7bd640d5 2015-11-26T02:37:51 WinRT: bug-fix, fullscreen mode wasn't getting reported in Windows 8.0 apps This bug did not occur in Windows 8.1 apps, just Windows 8.0.
David Ludwig 36090f57 2015-11-26T02:13:15 WinRT: bug-fix, OpenGLES2 was failing to init, after recent windowing fixes Some SDL_Window flags were getting lost inside WINRT_UpdateWindowFlags, namely SDL_WINDOW_OPENGL.
David Ludwig f5209944 2015-11-26T01:36:36 WinRT: bug-fix, fullscreen window flags weren't set if device was rotated 90 degrees
David Ludwig 623898f7 2015-11-26T00:41:39 WinRT: lots of display and windowing related fixes This change-set fixes a lot of windowing related bugs, especially with regards to Windows 8.x apps running on Windows 10 (which was the driver for this work). The primary fixes include: * listed display modes were wrong, especially when launching apps into a non-fullscreen space * reported window flags were often wrong, especially on Windows 10 * fullscreen/windowed mode switches weren't failing (they are not programmatically possible in Win 8.x apps).
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 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().
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Philipp Wiesemann 0fbd3372 2015-04-13T20:52:18 WinRT: Fixed format string for error message.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
David Ludwig 577ef5e0 2014-11-02T10:38:29 WinRT: fixed crash when trying, and failing, to load the opengles2 renderer The crash would occur when a WinRT app explicitly tried to create an SDL_Renderer using the "opengles2" renderer (via SDL_HINT_RENDER_DRIVER), but OpenGL ES 2 / ANGLE .dlls weren't packaged in the app.
David Ludwig 18ecc34d 2014-11-02T09:02:01 WinRT: updated an OpenGL-related code-comment
David Ludwig 0bcc254e 2014-11-02T08:47:05 WinRT: expanded OpenGL ES 2 support to enable recent updates to ANGLE/WinRT ANGLE for WinRT has at least two versions: - an older version, which supports Windows 8.0 and 8.1. This is currently the "winrt" branch in MSOpenTech's ANGLE repository (at https://github.com/msopentech/angle) - a newer version, which drops support for Windows 8.0, but is under more active development (via MSOpenTech's "future-dev" branch), and which was recently merged into the ANGLE project's official "master" branch (at https://chromium.googlesource.com/angle/angle) Both versions are setup using slightly different APIs. SDL/WinRT will now attempt to detect which version is being used, and configure it appropriately.
Pierre-Loup A. Griffais 24c86b55 2014-09-11T19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
David Ludwig 164e5b89 2014-05-09T21:28:52 WinRT: display-information code cleanups
David Ludwig 0a879d63 2014-05-09T20:16:21 Fixed rendering-alignment issues on WinPhone 8.1, when the device was rotated If a Windows Phone 8.1 device was rotated to anything but Portrait mode, the Direct3D 11 renderer's output wouldn't get aligned correctly with the screen.
David Ludwig c5c1a2c6 2014-04-30T21:07:30 WinRT: preliminary support for building against the Windows Phone 8.1 SDK This is a step towards supporting "Universal" Windows apps, when building for Windows Phone. SDL can now build against the Windows Phone 8.1 SDK, and apps linked to it can run, however further work and testing is required as some previously Phone-only code appears to no longer be applicable for Windows Phone 8.1. The Windows 8.1 code paths does seem to be preferable, but should probably be tested and updated on a finer-grained basis. If in doubt, use the Windows Phone 8.0 projects for now, as located in VisualC-WinRT/WinPhone80_VS2012/ TODO: - look at any Windows Phone specific code paths in SDL, and see if Phone 8.1 should use the Windows Phone code path(s), or the Windows 8.x or 8.1 paths
David Ludwig 3dcb451f 2014-04-09T21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
David Ludwig 823bf721 2014-03-22T21:08:05 WinRT globals cleanup: Removed WINRT_GlobalSDLVideoDevice
David Ludwig b51a3206 2014-03-22T20:48:18 WinRT: Got OpenGL ES 2 working with the latest version of ANGLE/WinRT. SDL/WinRT did have support for OpenGL ES 2 via an older version of ANGLE/WinRT, however its API changed a few months ago, and SDL/WinRT would crash when trying to use it. It would also occasionally crash when using the older version. This changeset should make SDL/WinRT work with the latest version, as available via MS Open Tech's git repository of it at https://github.com/msopentech/angle Older versions of ANGLE/WinRT (from either https://github.com/stammen/angleproject or https://bitbucket.org/DavidLudwig/angleproject) will need to be updated to MS Open Tech's latest version.
David Ludwig f25ee50b 2014-03-15T14:54:23 Fixed broken rotation detection routines on WinRT Rotation detection and handling should now work across all, publicly-released, WinRT-based platforms (Windows 8.0, Windows 8.1, and Windows Phone 8.0).
Sam Lantinga ed02f61d 2014-03-13T00:40:08 Fixed the copyright date on files contributed by David Ludwig
David Ludwig e8eb1427 2014-03-10T21:21:35 build fixes for most WinRT-related files Still TODO: getting the D3D11 renderer back up and running in VC 2012.
Sam Lantinga 05c23063 2014-03-09T11:06:11 Fixed line endings on WinRT source code
David Ludwig 6687ece1 2014-03-01T16:37:30 WinRT: cleaned up some hard-to-read SDL_DisplayMode management code
David Ludwig f4a5a0fa 2014-03-01T16:08:16 WinRT: fixed a crash in SDL_Quit SDL was expected that each SDL_DisplayMode had a driverdata field that was SDL_malloc'ed, and was calling SDL_free on them. This change moves WinRT's driverdata content into a SDL_malloc'ed field.
David Ludwig 910c1cd0 2013-12-26T14:21:47 WinRT: minor error cleanup regarding OpenGL init
David Ludwig fed81d12 2013-12-26T13:59:01 WinRT: fixed crash on ARM and x64 during OpenGL window init
David Ludwig 27e79b93 2013-12-24T21:08:11 WinRT: bug fix: game-controller/joystick button-down events weren't getting sent
David Ludwig 749117ac 2013-11-04T19:54:29 WinRT: added experimental OpenGL ES 2.0 support A port of the ANGLE library (OpenGL ES 2.0 for Direct3D) to WinRT, via https://github.com/stammen/angleproject, is used as a base. To enable, clone 'angleproject' into the directory one above where SDL/WinRT is, open the file SDL/include/SDL_config_winrt.h, and uncomment the #defines that begin with 'SDL_VIDEO_OPENGL'. From there, apps can create an OpenGL capable SDL_Window via the flag, SDL_WINDOW_OPENGL, and an OpenGL ES 2 context via SDL_GL_CreateContext. The Direct3D 11.1 renderer cannot be used alongside SDL_WINDOW_OPENGL. Only Windows 8/8.1 is supported for now. Shaders may need to be precompiled, in some (all?) cases.
David Ludwig 0022dbf2 2013-09-16T11:02:18 WinRT: made SDL_GetWindowWMInfo return window data in a slightly easier-to-use format Having the window pointer available as a WinRT IInspectable should make it a bit easier to use in conjunction with WRL-based weak references.
David Ludwig 34722465 2013-09-06T21:13:15 WinRT: code cleanup: attempted to make it more clear what code is specific to what app type (plain Direct3D or XAML)
David Ludwig 8fc04cc7 2013-09-02T15:29:46 WinRT: renamed a mouse-related header file for naming-consistency's sake
David Ludwig 7e06b806 2013-09-02T15:23:33 WinRT: misc code cleanups regarding touch and mouse events, and also SDL-internal globals
David Ludwig 1d5082d8 2013-08-28T16:51:07 WinRT: corrected SDL_MOUSE* coordinates in non-Portrait modes Thanks to Pierre-Yves Gueniffey for proper pointer geometry transform code!
David Ludwig 31235b4b 2013-08-28T15:27:01 WinRT: made rendering work with orientation changes on Windows Phone Pointer event geometry still needs to be adjusted on Windows Phone, to note.
David Ludwig 2cafee9d 2013-08-27T21:21:09 WinRT: experimental and preliminary support for XAML-based overlays on Windows 8/RT The XAML support here is still rudimentary. Bugs do exist. You've been warned. XAML support in Windows Phone 8 is not yet available (in SDL/WinRT).
David Ludwig 17ca1d00 2013-08-27T12:56:49 WinRT: code cleanup wrt. display mode(s)
David Ludwig fa229f37 2013-08-27T12:22:02 WinRT: fixed a crash that occurred on device rotation (oops!)
David Ludwig 1e78c4a5 2013-08-27T12:20:35 WinRT: more "Windows RT" to "WinRT" renaming
David Ludwig 30700864 2013-08-27T12:16:42 WinRT: took out a deprecated TODO-comment
David Ludwig 6dc2a410 2013-08-27T12:13:45 WinRT: moved the WinRT SDL_VideoDevice out of SDL_WinRTApp This was done to help pave the way for XAML support.
David Ludwig 253b9aae 2013-08-27T11:51:17 WinRT: moved the pointer to the global SDL_Window to a separate variable This is a cleanup that is being done to help with WIP XAML support. It may be reverted in the future.
David Ludwig 7be2ad71 2013-08-27T11:44:43 WinRT: renamed SDL_SYSWM_WINDOWSRT to SDL_SYSWM_WINRT This is part of an overall effort to use the name, "WinRT", rather than "WindowsRT" (or "Windows RT"), as the shorthand name often seems to mean something different than the longhand name. (WinRT is an API, Windows RT is a product name)
David Ludwig 3e83fd78 2013-08-27T11:39:44 WinRT: misc code cleanups
David Ludwig 80abfc4d 2013-08-27T10:57:55 WinRT: minor function and variable name cleanup
David Ludwig 065b2cf4 2013-08-27T10:56:10 WinRT: made all SDL_Windows get sized to the WinRT-defined window size This change removes some code that attempted to allow non-standard window sizes, the idea of which was to do display scaling, and a hackish one at that. If display scaling is needed, use SDL_Renderer as appropriate.
David Ludwig 19a168b4 2013-08-20T21:22:32 WinRT: file naming and placement cleanup - moved SDL_WinRTApp.* from src/video/windowsrt/ to src/core/winrt/, and renamed them to SDL_winrtapp.* (to mimick case-sensitivity used elsewhere in SDL) - renamed all "windowsrt" directories (in src) to "winrt", as the shorthand name is used more often (and, IMO, "WinRT" != "Windows RT", not entirely at least)