src/main


Log

Author Commit Date CI Message
Hubert Maier 3369b016 2022-10-30T08:43:04 SDL_PS2_MAIN.C: Correct spelling mistake untill -> until
Pierre Wendling 83ec6062 2022-09-18T13:46:09 N3DS: Move gfxInit and hidInit from main to video.
Pierre Wendling af2bc2ed 2022-09-18T10:52:35 N3DS: Use osSetSpeedupEnable instead of PTMSYSM.
Pierre Wendling 65527537 2021-03-30T04:32:39 N3DS port (squashed) A dedicated renderer using Citro3D would likely allow for better much better graphical performances.
Sam Lantinga bb74af1e 2022-09-28T00:01:54 Allow including SDL_uikit_main.c in Apple multi-platform builds This file just won't do anything on macOS
Francisco Javier Trujillo Mata a4f84803 2022-08-24T20:42:08 Disable fileXio and patch fio
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
Francisco Javier Trujillo Mata d355ea99 2022-08-08T11:55:04 Add a way to avoid IOP reset
Francisco Javier Trujillo Mata c5fe234d 2022-08-07T23:07:02 Improve SDL main adding usb drivers
Francisco Javier Trujillo Mata a054a5f7 2022-06-29T01:09:17 Improve SDL2 main, adding memory card and usb drivers
chalonverse 3b191580 2022-06-27T17:19:39 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
Francisco Javier Trujillo Mata 84d69da4 2022-03-20T19:42:06 Initial SDL_ps2_main implementation
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()
Michael Fitzmayer 9b75fa01 2022-05-11T18:31:34 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
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>
Michael Fitzmayer fbd230bb 2022-05-03T17:51:49 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
Sam Lantinga 5394238c 2022-04-30T11:40:26 Don't include the internal header for a file intended for use by applications
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
kenmays 094e9440 2022-01-12T06:42:17 haiku: Remove BDirectWindow, fix OpenGL handling. From e6cc4e7f4b8189be55dd3b0e13e54e59f73d7672 Mon Sep 17 00:00:00 2001 From: X512 <danger_mail@list.ru> Date: Thu, 30 Jan 2020 04:01:58 +0900 Subject: libsdl2: Remove BDirectWindow, fix OpenGL handling. * BDirectWindow changed to BWindow. * Implemented fullscreen. * Introduced view for non-OpenGL drawing. * Drawing thread removed, window thread is used instead. * Use BGLView as OpenGL context. Implement proper context switching and OpenGL locking. Only one context per window is supported. BGLView should be not deleted when window is closed, it deleted when deleting context.
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
Ozkan Sezer 8cee50ee 2021-12-07T19:32:56 removed stdlib.h from SDL_psp_main.c now that exit() is gone.
Wouter Wijsman da5dbb47 2021-12-07T16:43:50 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
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
Sam Lantinga 3a4b217d 2021-07-31T12:44:29 Allow defining SDL_MAIN_HANDLED on iOS if you're using another runtime that provides an application delegate
Sam Lantinga deed21a8 2021-07-31T12:44:11 Removed useless forward declaration
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
Ryan C. Gordon 940419b0 2020-11-10T13:09:59 uikit: Fixed a typo in a comment.
Ryan C. Gordon fa23e3d0 2020-05-04T02:27:29 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.
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
Peter Kosyh 33ae5e5e 2019-11-11T22:23:33 haiku: mouse_relative fix Partially fixes Bugzilla #4442.
Peter Kosyh 79510b75 2019-11-11T22:22:40 haiku: mouse->ShowMouse method added Partially fixes Bugzilla #4442.
Gerasim Troeglazov 95a402d7 2019-11-11T22:21:17 haiku: Add support for relative mouse mode. Partially fixes Bugzilla #4442.
Gerasim Troeglazov bd648bd5 2019-11-11T22:18:21 haiku: Add simple relative mode for mouse. Partially fixes Bugzilla #4442.
Peter Kosyh 55b5d8dc 2019-11-11T21:59:39 haiku: Invert mouse wheel values to match what SDL expects. Partially fixes Bugzilla #4442.
EXL b22fb9e2 2019-11-11T16:44:40 haiku: Implement message box for Haiku Add implementation for functions: SDL_ShowSimpleMessageBox() SDL_ShowMessageBox() Add simple customization support also. Fix build for x86_gcc2. Partially fixes Bugzilla #4442.
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/
Ozkan Sezer 4953e050 2019-07-31T05:11:40 use SDL_zeroa at more places where the argument is an array.
Sam Lantinga 67c67f3a 2019-06-17T10:13:28 Updated version to 2.0.10
Sam Lantinga de82759c 2019-03-19T07:53:33 Added support for building SDL as a dynamic library on iOS
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 5febdfce 2018-09-24T11:49:25 Fixed whitespace
Ryan C. Gordon 941c5b47 2018-08-07T18:07:11 haiku: Rename internal functions from BE_* to HAIKU_* Fixes Bugzilla #2349.
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
David Ludwig 0e032d58 2017-10-24T13:21:11 WinRT: Move Windows::Foundation::Initialize to SDL2.dll, from SDL_main. This allows C# UWP applications to use SDL2's SDL_WinRTRunApp function. Kudos to Ethan Lee (flibitijibibo@flibitijibibo.com) for the patch. Thanks!
Sam Lantinga 0ce23a54 2017-10-12T08:08:04 Updated version to 2.0.7
Sam Lantinga dbb0a2aa 2017-08-28T14:34:15 Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations
Sam Lantinga 2dc5d32f 2017-08-18T18:16:37 Updated version to 2.0.6
Sam Lantinga df2d2994 2017-08-13T18:12:06 Fixed bug 2812 - Make libSDL2main.a usable on Android via a dummy symbol Jonas Kulla This eliminates the need to manually compile in SDL_main_android.c. Instead, add "-lSDL2main -Wl,-u,SDL_main_dummy" when linking. I don't know how the nkd-build process works, but unless it was for some reason linking libSDL2main.a it should be unaffected.
Philipp Wiesemann c3bf69ca 2017-07-07T23:00:22 haiku: Fixed compiling without OpenGL support.
Philipp Wiesemann 4b47fa38 2017-06-04T23:15:47 Removed duplicate includes.
Olli Kallioinen 11289b76 2017-06-04T21:25:57 Android cmake build fixed to work with the official android gradle plugin
Philipp Wiesemann 07b0df0a 2017-06-02T22:15:37 haiku: Changed internal variable to be static.
Ryan C. Gordon 619ab7a2 2017-05-01T18:39:05 haiku: Various fixes from haikuports. Based on patch here: https://github.com/haikuports/haikuports/blob/master/media-libs/libsdl2/patches/libsdl2-2.0.5.patchset
Philipp Wiesemann 63e83a31 2017-01-21T22:01:17 Haiku: Removed unused variable. Found by Cppcheck.
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga 8a73f7e8 2016-10-19T20:42:22 Fixed bug 3461 - Implement TEXTINPUT events for Haiku Kai Sterker Apparently, SDL2 on Haiku does not generate SDL_TEXTINPUT events. Attached is a patch that adds this functionality. Tested with SDLs own checkkeys program and different keymaps as well as my own SDL application and German keyboard layout to verify it generates the expected input.
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
Philipp Wiesemann 6b1d5f44 2016-07-17T21:42:53 Android: Fixed compile warning about a missing prototype (thanks, Sylvain!). Fixes Bugzilla #3351.
David Ludwig 441359bd 2016-05-14T23:29:49 WinRT: workaround a possible Windows bug, whereby hiding cursors, disables mouse-moved events This workaround, unfortunately, requires that apps directly link to a set of Win32-style cursor resource files (that contain a transparent cursor image). Copies of suitable resource files are in src/core/winrt/, and should be included directly in an app's MSVC project. A rough explanation of this workaround/hack, and why it's needed (and seemingly can't be done through programmatic means), is in this change's code.
Ryan C. Gordon c137eb61 2016-04-12T18:40:44 Patched to compile on Haiku...?
Ryan C. Gordon 9b4db2b8 2016-04-12T18:11:36 Patched to compile on various platforms.
Ryan C. Gordon c61675dc 2016-04-12T16:45:10 threads: Move SDL's own thread creation to a new internal API. This allows us to set an explicit stack size (overriding the system default and the global hint an app might have set), and remove all the macro salsa for dealing with _beginthreadex and such, as internal threads always set those to NULL anyhow. I've taken some guesses on reasonable (and tiny!) stack sizes for our internal threads, but some of these might turn out to be too small in practice and need an increase. Most of them are simple functions, though.
Eric Wing 704298c0 2016-02-09T17:36:42 Android: C89 cleanup to avoid warnings/errors since the default gcc mode on Android is still pre-C99.
Sam Lantinga 68a32728 2016-01-02T10:38:51 Fixed sed error on Mac OS X and updated copyright on a few last files
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Sam Lantinga 270f38db 2015-08-01T22:03:50 Fixed bug 3083 - Android JNIEXPORT and JNICALL missing Martin Gerhardy Just a minor thing, but a huge outcome. All the other jni related functions already have those flags, but the nativeInit function lacks them - so it might be stripped away.
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.