SDL/include/SDL3
Daniel Gibson ca2fe7be1a Implement SDL_main as header-only lib for Win32
(remaining platforms will follow)

SDL_main.h is *not* included by SDL.h anymore, users are supposed to
include it directly now, usually only in the file they implement main() in.
If they need the header elsewhere or don't want SDL_main to implement
main() (but only call SDL_SetMainReady() or whatever), they
can #define SDL_MAIN_HANDLED first, same as before.
For SDL-internal usage, I added _SDL_MAIN_NOIMPL, which *also* skips the
implementation and `#define main SDL_main`, but still defines
SDL_MAIN_AVAILABLE and SDL_MAIN_NEEDED in SDL_main.h, as before.

To make the implementaion in the header shorter and avoid including windows.h,
I moved most of the Win32 SDL_main code into SDL3.dll via SDL_Win32RunApp(),
so the header-only part is just the different main functions calling
SDL_Win32RunApp(SDL_main, NULL)

Note that I changed changed the return value and type of OutOfMemory()
to return -1 instead of FALSE, so main() (or WinMain() or whatever)
returns -1 instead of 0 in case of an out-of-memory error

Compared to original Win32 SDL_main, I tweaked the part of the
implementation in SDL_main_impl.h a bit to avoid linker warnings
and conflicts with stuff from windows.h:

- replaced windows.h with own define of WINAPI
  and typedef-ing HINSTANCE and LPSTR.
  This prevents conflicts between all the generically-named #defines and
  types in windows.h and user code (like DrawState in some SDL tests)
- only using one of main() or wmain() gets rid of a MSVC linker error
  ("warning LNK4067: ambiguous entry point")
  If this still causes problems, we might try getting rid of wmain(),
  seemed to me like MSVC can use regular main() in UNICODE mode as well
- simplified the UNICODE logic for that - while this is not exactly
  equivalent to the old, it should make sense and Works For Me
2022-12-15 08:01:01 -08:00
..
SDL.h Implement SDL_main as header-only lib for Win32 2022-12-15 08:01:01 -08:00
SDL_assert.h SDL_assert: remove old define for obsolete naming 2022-12-10 17:21:51 +01:00
SDL_atomic.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_audio.h re-applied the SDL_NewAudioStream deconstification, including to its definition 2022-12-04 20:50:20 +03:00
SDL_bits.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_blendmode.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_clipboard.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_copying.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_cpuinfo.h Move intrinsic includes into a private header 2022-12-04 09:34:10 -08:00
SDL_egl.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_endian.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_error.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_events.h gesture: Removed the gesture API from SDL3. 2022-12-13 14:54:37 -05:00
SDL_filesystem.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_gamecontroller.h Clarified where the paddle locations are 2022-12-07 14:17:58 -08:00
SDL_guid.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_haptic.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_hidapi.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_hints.h Renamed AUDIODRIVER and VIDEODRIVER hint/env to AUDIO_DRIVER and VIDEO_DRIVER 2022-12-08 09:50:09 -05:00
SDL_joystick.h Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
SDL_keyboard.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_keycode.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_loadso.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_locale.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_log.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_main.h Implement SDL_main as header-only lib for Win32 2022-12-15 08:01:01 -08:00
SDL_main_impl.h Implement SDL_main as header-only lib for Win32 2022-12-15 08:01:01 -08:00
SDL_messagebox.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_metal.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_misc.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_mouse.h docs: Note that you don't need to free SDL_GetDefaultCursor's results. 2022-12-09 22:08:40 -05:00
SDL_mutex.h Added support for clang thread-safety analysis 2022-12-14 09:53:39 -08:00
SDL_name.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengl.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengl_glext.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengles.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengles2.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengles2_gl2.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengles2_gl2ext.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengles2_gl2platform.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_opengles2_khrplatform.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_pixels.h Remove mask versions of SDL_CreateRGBSurface* #6701 (#6711) 2022-12-01 08:04:02 -08:00
SDL_platform.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_power.h Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
SDL_quit.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_rect.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_render.h render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer. 2022-12-13 23:27:35 -05:00
SDL_revision.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_rwops.h rwops: Make read and write work like POSIX, not stdio. 2022-12-14 15:47:13 -05:00
SDL_scancode.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_sensor.h Removed SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp() 2022-12-04 09:29:28 -08:00
SDL_shape.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_stdinc.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_surface.h Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
SDL_system.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_syswm.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_assert.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_common.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_compare.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_crc32.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_font.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_fuzzer.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_harness.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_images.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_log.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_md5.h SDL_test_md5.h: fix MD5UINT4 type to be really 32 bits. 2022-11-29 08:53:56 -08:00
SDL_test_memory.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_test_random.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_thread.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_timer.h Convert ticks to 64-bit, added nanosecond precision to the API 2022-12-02 12:37:41 -08:00
SDL_touch.h gesture: Removed the gesture API from SDL3. 2022-12-13 14:54:37 -05:00
SDL_version.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
SDL_video.h Added SDL_DISPLAYEVENT_MOVED to detect when display positioning changes 2022-12-08 12:47:56 -08:00
SDL_vulkan.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00
begin_code.h begin_code.h: add gcc version checks to the alloc_size attributes. 2022-11-30 11:33:32 +03:00
close_code.h Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>` 2022-11-26 22:15:18 -08:00