src/main/windows

Branch


Log

Author Commit Date CI Message
Sam Lantinga 15ead9a4 2023-11-02T10:00:33 Updated to version 2.28.5 for release
Sam Lantinga cc016b00 2023-10-01T12:05:05 Updated to version 2.28.4 for release
Sam Lantinga 8a5ba43d 2023-09-01T11:22:07 Updated to version 2.28.3 for release
Sam Lantinga 031912c4 2023-08-02T08:31:19 Updated to version 2.28.2 for release
Christopher Wellons 078e817c 2023-07-09T20:05:32 Unaligned stacks on i686-w64-mingw32, may lead to crashes (#7607) Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>(cherry picked from commit 8231278817faabdff4a232770f798684bd2e12df)
Sam Lantinga 4761467b 2023-07-01T09:56:20 Updated to version 2.28.1 for release
Sam Lantinga ffa78e6b 2023-06-20T11:00:20 Updated to version 2.28.0 for release
Sam Lantinga d4f9be44 2023-06-13T19:44:26 Updated to version 2.27.1 for release candidate
Ryan C. Gordon 7ac43cfb 2023-01-29T11:43:59 Note that version.rc is public domain. This avoids potential concerns that customizing would qualify a build of SDL as an "altered source version" under the zlib license.
Sam Lantinga 0479df53 2023-01-09T09:48:21 Updated copyright for 2023
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
Sam Lantinga b8d85c69 2022-11-30T12:51:59 Update for SDL3 coding style (#6717) I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594 (cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
Sylvain Becker fb0ce375 2022-11-27T17:38:43 Cleanup add brace (#6545) * Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line (cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
Sam Lantinga ea8f8b6d 2022-11-21T16:36:10 Updated to version 2.27.0 for development
Sam Lantinga 0bfeed06 2022-11-21T16:15:58 Updated to version 2.26.0 for release
Sam Lantinga 78ea6af2 2022-11-17T09:01:35 Updated to version 2.25.1 for release candidate
Sam Lantinga 6e9c14e5 2022-08-19T09:38:42 Updated to version 2.25.0 for development
Sam Lantinga 8c9beb0c 2022-08-19T08:44:09 Updated to version Updated to version 2.24.0 for release
Sam Lantinga f1416ef2 2022-08-12T20:27:22 Updated to version 2.23.2 for release candidate
Sam Lantinga b004133f 2022-06-16T12:49:17 Updated to version 2.23.1 for pre-release checkpoint
Ozkan Sezer 63e12cf6 2022-06-06T22:55:56 SDL_windows_main.c: replace CopyMemory() with SDL_memcpy()
Simon McVittie cd7c2f1d 2022-05-03T15:16:11 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>
Sam Lantinga fa29e2d7 2022-04-25T13:45:51 Updated to version 2.0.23 for development
Sam Lantinga 505d6a4a 2022-04-08T18:18:56 Update version to 2.0.22 for release
Sam Lantinga a0e3c884 2022-01-17T15:32:27 Updated to version 2.0.21 for development
Sam Lantinga 92946348 2022-01-07T18:28:25 Updated to version 2.0.20 for release
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Sam Lantinga 5fc901d4 2021-11-30T09:58:21 Updated to version 2.0.19 for development
Sam Lantinga 7242075b 2021-11-26T08:12:45 Updated version to 2.0.18 for release
Sam Lantinga 3f6ebfff 2021-08-10T15:02:36 Updated to version 2.0.17 for development
Sam Lantinga a91ab883 2021-08-06T12:28:03 Fixed building on Windows with cmake, ninja, and clang
Sam Lantinga cb1fd30e 2021-07-31T13:28:54 Updated to version 2.0.16 for release
Steven Noonan f1ad942a 2021-04-22T17:24:05 SDL_windows_main: use HeapAlloc/HeapFree for command line arguments If a developer uses SDL_SetMemoryFunctions, we can't rely on SDL_free() working when SDL_main() returns. Signed-off-by: Steven Noonan <steven@valvesoftware.com> Signed-off-by: Sam Lantinga <slouken@libsdl.org>
Ozkan Sezer 8cb421b2 2021-01-04T10:20:10 SDL_windows_main.c: use new WIN_StringToUTF8W macro
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga 350f1b0d 2020-12-22T10:36:15 Updated SDL to version 2.0.15 for development
Sam Lantinga a2098a47 2020-12-08T18:56:06 Updated SDL to 2.0.14 in preparation for release candidate
Sam Lantinga 983bbf9e 2020-03-10T18:35:31 Backed out changeset 51622f74dc85
Sam Lantinga 93ed3c8b 2020-03-10T18:25:47 Updated SDL to version 2.0.13 for development builds
Sam Lantinga 4fb06a2a 2020-03-10T18:25:47 Updated SDL to version 2.0.13 for development builds
Sam Lantinga 74ed2156 2020-03-01T14:58:16 Updated version to 2.0.12 for release candidate build
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga 3fe2d836 2019-09-22T10:37:16 Updated SDL development builds to version 2.0.11
Ozkan Sezer 1b7fc81e 2019-07-31T19:40:50 minor whitespace tidy-up.
Sam Lantinga f8400cbb 2019-07-31T09:11:20 Fixed bug 4692 - Command line parsing Galadrim As I have seen, SDL implements its own command line parser for Windows in SDL_windows_main.c. Unfortunately, it doesn't seem to allow command line arguments with trailing backslashes if quoting is required. Usually, when you write an application that gets command line arguments passed as argc and argv, the parsing is done by parse_cmdline. The Windows API also provides the function CommandLineToArgvW, so an application can parse itself if only the command line string is provided. Both functions behave almost identically according to their documentation. If the argument "\\" (including the quotes) is passed, they both turn it into a single backslash. The SDL command line parser on the other hand doesn't recognize the second quote character as the closing character in this example and therefore includes it in the parsed argument. The parser does not count the number of backslashes preceding a quote. It always treats a quote as escaped if a backslash is in front of it. Therefore, it should be impossible to quote and escape an argument correctly, if it has a trailing backslash and contains characters that require quoting. Of course, each application is allowed to implement its own parsing rules, so SDL is free to do so. But the problem I see is that there are arguments, that are impossible to be passed to the parser correctly, as I described above. Is there a reason, why SDL does not simply use CommandLineToArgvW instead of implementing its own parser? Here are some links that show that correct argument parsing, as it is usually done in Windows, is quite complicated: https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-commandlinetoargvw http://www.windowsinspired.com/how-a-windows-programs-splits-its-command-line-into-individual-arguments/
Sam Lantinga 67c67f3a 2019-06-17T10:13:28 Updated version to 2.0.10
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Ryan C. Gordon e542d1a3 2018-10-29T20:18:50 winmain: Patched to compile on C89 compilers.
Ryan C. Gordon f434a98c 2018-10-29T20:00:03 winmain: Don't use SDL_malloc (or SDL_stack_alloc, which might be malloc). Otherwise, we are using the allocator before the app can set up its own hooks. Now we use VirtualAlloc, and WideCharToMultiByte (because SDL_iconv uses SDL_malloc, too!) to get ready to call into SDL_main. This also makes console_wmain() call into the same routines as everything else, so we don't have to deal with those allocations, too. Hopefully we end up with the same results from GetCommandLine() as we do in wargv. Fixes Bugzilla #4340.
Ryan C. Gordon b262b0eb 2018-10-22T20:50:32 Small stack allocations fall back to malloc if they're unexpectedly large.
Sam Lantinga bc6c1997 2018-09-26T10:08:14 Updated version to 2.0.9
Sam Lantinga 1143857d 2018-02-10T12:43:11 Fixed bug 4073 - Unquoted Unicode argument parsing broken on Windows due to incorrect usage of SDL_isspace()
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga 2c5724ef 2017-11-04T21:58:48 Updated version to 2.0.8 since SDL_image depends on it
Sam Lantinga 0ce23a54 2017-10-12T08:08:04 Updated version to 2.0.7
Sam Lantinga 2dc5d32f 2017-08-18T18:16:37 Updated version to 2.0.6
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga 8aab39cb 2016-10-14T08:27:44 Fixed bug 3452 - Getting unicode arguments for the main entry point on Windows Simon Hug There are currently three entry points in the SDL2_main code for windows: main, wmain and WinMain. Only the latter two properly convert the arguments to UTF-8. Console applications linked with MSVC will always link with the main entry point (wmain has to be selected by manually setting the entry point). This makes it likely that such programs will not have proper unicode arguments.
Sam Lantinga 14e7da75 2016-10-12T19:50:16 Backed out change 7d3df1df4e91 which was: Fixed bug 3320 - SDL_windows_main.c defines both console application entry points With that change only the wmain() entry point was defined, and applications that linked with main() would no longer build.
Sam Lantinga d870f271 2016-10-01T12:31:31 Fixed bug 3320 - SDL_windows_main.c defines both console application entry points Simon Hug The SDLmain file src/main/windows/SDL_windows_main.c defines both entry points for console applications, main and wmain. This seems to confuse MSVC. It outputs a LNK4067 warning and then chooses main, which is a shame because only wmain has the unicode handling. Using SDLmain.lib provided on libsdl.org, the linker also goes for main. I'm proposing to not define the main entry point at all. wmain should be supported well enough with MSVC.
Sam Lantinga 708def87 2016-10-01T11:48:15 Fixed bug 3338 - console_wmain doesn't null terminate the argv array Simon Hug The function console_wmain in src/main/windows/SDL_windows_main.c does not null terminate the argument list it is creating. As specified by the C standard, "argv[argc] shall be a null pointer." The SDLTest framework makes use of that null pointer and some test programs can cause an access violation because it's missing.
Sam Lantinga e45698d2 2016-09-28T22:24:01 Updated version to 2.0.5 in preparation for release
Sam Lantinga 68a32728 2016-01-02T10:38:51 Fixed sed error on Mac OS X and updated copyright on a few last files
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.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Ryan C. Gordon 33b9d9ad 2015-02-19T21:51:13 Windows: Added a FIXME.
Ryan C. Gordon 674eb556 2015-02-19T21:50:40 Windows: Free the argv we allocated for console_wmain().
Ryan C. Gordon e974ccf8 2015-02-19T21:49:30 Windows: Added a FIXME.
Ryan C. Gordon f7c4c3d0 2015-02-19T21:49:15 Windows: Make a distinction between ANSI mainline and UTF-8 mainline.
Ryan C. Gordon e93ee5d7 2015-02-19T21:44:41 Windows: Support unicode arguments for console applications (thanks, Jorgen!). Fixes Bugzilla #2864.
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!
Sam Lantinga 4dab32a2 2014-11-28T04:51:33 Fixed bug 2786 - "UCS-2-INTERNAL" iconv encoding is not supported everywhere, use UTF-16LE instead Jonas Kulla src/main/windows/SDL_windows_main.c:137: cmdline = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(text), (SDL_wcslen(text)+1)*sizeof(WCHAR)); I'm trying to compile an SDL2 application for windows using the mingw-w64 32bit toolchain provided by my distro (Fedora 19). However, even the simplest test program that does nothing at all fails to startup with a "Fatal error - out of memory" message because the mingw iconv library provided by my distro does not support the "UCS-2-INTERNAL" encoding and the conversion returns null. From my little bit of research, it turns out that even though this encoding is supported by the external GNU libiconv library, some glibc versions (?) don't support it with their internal iconv routines, and will instead provide the native endian encoding when "UCS-2" is specified. Nonetheless, I wonder why the native endianness is considered in the first place when Windows doesn't even run on any big endian archs (to my knowledge). And true enough, 'WIN_StringToUTF8' from core/windows/SDL_windows.h is used everywhere else in the windows backend, which is just a macro to iconv with "UTF-16LE" as source. Therefore it would IMO make sense to use this macro here as well, which would solve my problem (patch attached).
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
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
Sam Lantinga 7242e814 2014-09-02T06:55:47 Updated version to 2.0.4
Ryan C. Gordon 2230df55 2014-07-27T19:52:52 Remove dependency on C runtime from Windows SDLmain.
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.
Sam Lantinga f9a58968 2014-03-13T21:21:26 Added missing copyright notices
Sam Lantinga c167d1f6 2014-03-09T10:38:30 Updated SDL to version 2.0.3
Sam Lantinga 853334af 2014-02-09T03:09:56 Updated SDL to version 2.0.2
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
Ryan C. Gordon d1bde399 2013-10-20T20:24:00 Backed out changeset 737771c47c6f, done testing Buildbot changes.
Ryan C. Gordon df368084 2013-10-20T20:02:02 Intentionally breaking Windows and Raspberry Pi builds to test Buildbot change.
Sam Lantinga 12ca3ce3 2013-10-17T23:02:29 Fixed building using MinGW Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
Sam Lantinga a7e1fddd 2013-10-10T21:50:25 Updated SDL to version 2.0.1
Gabriel Jacobo dad42067 2013-08-12T11:13:50 Fixes #2022, do not resume on Android when surfaceChanged If the app is in landscape mode and the user presses the power button, a pause is followed immediately by a surfaceChanged event because the lock screen is shown in portrait mode. This triggers a "false" resume. So, we just pause and resume following the onWindowFocusChanged events. Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before blocking the event pump.
Sam Lantinga 1ad936eb 2013-08-11T19:56:43 Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() Rainer Deyke I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.