Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1392-2-2-15-attempting-to-draw-a-hud-graphic-with-the-same-lump-name-as-a-lua-script-crashes-the
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
Show changes
Showing
with 379 additions and 123 deletions
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "SDL_atomic.h" #include "SDL_atomic.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#if defined(__WIN32__) #if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
#include <process.h> /* _beginthreadex() and _endthreadex() */ #include <process.h> /* _beginthreadex() and _endthreadex() */
#endif #endif
#if defined(__OS2__) /* for _beginthread() and _endthread() */ #if defined(__OS2__) /* for _beginthread() and _endthread() */
...@@ -88,7 +88,7 @@ typedef enum { ...@@ -88,7 +88,7 @@ typedef enum {
typedef int (SDLCALL * SDL_ThreadFunction) (void *data); typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
#if defined(__WIN32__) #if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
/** /**
* \file SDL_thread.h * \file SDL_thread.h
* *
...@@ -129,7 +129,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, ...@@ -129,7 +129,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
pfnSDL_CurrentEndThread pfnEndThread); pfnSDL_CurrentEndThread pfnEndThread);
extern DECLSPEC SDL_Thread *SDLCALL extern DECLSPEC SDL_Thread *SDLCALL
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
const char *name, const size_t stacksize, void *data, const char *name, const size_t stacksize, void *data,
pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentBeginThread pfnBeginThread,
pfnSDL_CurrentEndThread pfnEndThread); pfnSDL_CurrentEndThread pfnEndThread);
...@@ -142,7 +142,7 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), ...@@ -142,7 +142,7 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#else #else
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#endif #endif
#elif defined(__OS2__) #elif defined(__OS2__)
...@@ -175,7 +175,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz ...@@ -175,7 +175,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
#undef SDL_CreateThread #undef SDL_CreateThread
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#undef SDL_CreateThreadWithStackSize #undef SDL_CreateThreadWithStackSize
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#else #else
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -95,6 +95,14 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); ...@@ -95,6 +95,14 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
*/ */
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
/**
* Get the touch device name as reported from the driver or NULL if the index
* is invalid.
*
* \since This function is available since SDL 2.0.22.
*/
extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index);
/** /**
* Get the type of the given touch device. * Get the type of the given touch device.
* *
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -58,8 +58,8 @@ typedef struct SDL_version ...@@ -58,8 +58,8 @@ typedef struct SDL_version
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/ */
#define SDL_MAJOR_VERSION 2 #define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 0 #define SDL_MINOR_VERSION 28
#define SDL_PATCHLEVEL 20 #define SDL_PATCHLEVEL 5
/** /**
* Macro to determine SDL version program was compiled against. * Macro to determine SDL version program was compiled against.
...@@ -83,6 +83,8 @@ typedef struct SDL_version ...@@ -83,6 +83,8 @@ typedef struct SDL_version
(x)->patch = SDL_PATCHLEVEL; \ (x)->patch = SDL_PATCHLEVEL; \
} }
/* TODO: Remove this whole block in SDL 3 */
#if SDL_MAJOR_VERSION < 3
/** /**
* This macro turns the version numbers into a numeric value: * This macro turns the version numbers into a numeric value:
* \verbatim * \verbatim
...@@ -90,21 +92,35 @@ typedef struct SDL_version ...@@ -90,21 +92,35 @@ typedef struct SDL_version
\endverbatim \endverbatim
* *
* This assumes that there will never be more than 100 patchlevels. * This assumes that there will never be more than 100 patchlevels.
*
* In versions higher than 2.9.0, the minor version overflows into
* the thousands digit: for example, 2.23.0 is encoded as 4300,
* and 2.255.99 would be encoded as 25799.
* This macro will not be available in SDL 3.x.
*/ */
#define SDL_VERSIONNUM(X, Y, Z) \ #define SDL_VERSIONNUM(X, Y, Z) \
((X)*1000 + (Y)*100 + (Z)) ((X)*1000 + (Y)*100 + (Z))
/** /**
* This is the version number macro for the current SDL version. * This is the version number macro for the current SDL version.
*
* In versions higher than 2.9.0, the minor version overflows into
* the thousands digit: for example, 2.23.0 is encoded as 4300.
* This macro will not be available in SDL 3.x.
*
* Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
*/ */
#define SDL_COMPILEDVERSION \ #define SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
#endif /* SDL_MAJOR_VERSION < 3 */
/** /**
* This macro will evaluate to true if compiled with SDL at least X.Y.Z. * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
*/ */
#define SDL_VERSION_ATLEAST(X, Y, Z) \ #define SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) ((SDL_MAJOR_VERSION >= X) && \
(SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \
(SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z))
/** /**
* Get the version of SDL that is linked against your program. * Get the version of SDL that is linked against your program.
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -187,7 +187,8 @@ typedef enum ...@@ -187,7 +187,8 @@ typedef enum
SDL_DISPLAYEVENT_NONE, /**< Never used */ SDL_DISPLAYEVENT_NONE, /**< Never used */
SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */ SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */
SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */ SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */
SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */ SDL_DISPLAYEVENT_DISCONNECTED, /**< Display has been removed from the system */
SDL_DISPLAYEVENT_MOVED /**< Display has changed position */
} SDL_DisplayEventID; } SDL_DisplayEventID;
/** /**
...@@ -248,7 +249,8 @@ typedef enum ...@@ -248,7 +249,8 @@ typedef enum
SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
SDL_GL_CONTEXT_RELEASE_BEHAVIOR, SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
SDL_GL_CONTEXT_RESET_NOTIFICATION, SDL_GL_CONTEXT_RESET_NOTIFICATION,
SDL_GL_CONTEXT_NO_ERROR SDL_GL_CONTEXT_NO_ERROR,
SDL_GL_FLOATBUFFERS
} SDL_GLattr; } SDL_GLattr;
typedef enum typedef enum
...@@ -444,6 +446,15 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rec ...@@ -444,6 +446,15 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rec
* A failure of this function usually means that either no DPI information is * A failure of this function usually means that either no DPI information is
* available or the `displayIndex` is out of range. * available or the `displayIndex` is out of range.
* *
* **WARNING**: This reports the DPI that the hardware reports, and it is not
* always reliable! It is almost always better to use SDL_GetWindowSize() to
* find the window size, which might be in logical points instead of pixels,
* and then SDL_GL_GetDrawableSize(), SDL_Vulkan_GetDrawableSize(),
* SDL_Metal_GetDrawableSize(), or SDL_GetRendererOutputSize(), and compare
* the two values to get an actual scaling value between the two. We will be
* rethinking how high-dpi details should be managed in SDL3 to make things
* more consistent, reliable, and clear.
*
* \param displayIndex the index of the display from which DPI information * \param displayIndex the index of the display from which DPI information
* should be queried * should be queried
* \param ddpi a pointer filled in with the diagonal DPI of the display; may * \param ddpi a pointer filled in with the diagonal DPI of the display; may
...@@ -587,6 +598,35 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_Disp ...@@ -587,6 +598,35 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_Disp
*/ */
extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
/**
* Get the index of the display containing a point
*
* \param point the point to query
* \returns the index of the display containing the point or a negative error
* code on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GetDisplayBounds
* \sa SDL_GetNumVideoDisplays
*/
extern DECLSPEC int SDLCALL SDL_GetPointDisplayIndex(const SDL_Point * point);
/**
* Get the index of the display primarily containing a rect
*
* \param rect the rect to query
* \returns the index of the display entirely containing the rect or closest
* to the center of the rect on success or a negative error code on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GetDisplayBounds
* \sa SDL_GetNumVideoDisplays
*/
extern DECLSPEC int SDLCALL SDL_GetRectDisplayIndex(const SDL_Rect * rect);
/** /**
* Get the index of the display associated with a window. * Get the index of the display associated with a window.
* *
...@@ -697,7 +737,10 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); ...@@ -697,7 +737,10 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
* in pixels may differ from its size in screen coordinates on platforms with * in pixels may differ from its size in screen coordinates on platforms with
* high-DPI support (e.g. iOS and macOS). Use SDL_GetWindowSize() to query the * high-DPI support (e.g. iOS and macOS). Use SDL_GetWindowSize() to query the
* client area's size in screen coordinates, and SDL_GL_GetDrawableSize() or * client area's size in screen coordinates, and SDL_GL_GetDrawableSize() or
* SDL_GetRendererOutputSize() to query the drawable size in pixels. * SDL_GetRendererOutputSize() to query the drawable size in pixels. Note that
* when this flag is set, the drawable size can vary after the window is
* created and should be queried after major window events such as when the
* window is resized or moved between displays.
* *
* If the window is set fullscreen, the width and height parameters `w` and * If the window is set fullscreen, the width and height parameters `w` and
* `h` will not be used. However, invalid size parameters (e.g. too large) may * `h` will not be used. However, invalid size parameters (e.g. too large) may
...@@ -1004,6 +1047,27 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, ...@@ -1004,6 +1047,27 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window,
int *top, int *left, int *top, int *left,
int *bottom, int *right); int *bottom, int *right);
/**
* Get the size of a window in pixels.
*
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
* drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a
* platform with high-DPI support (Apple calls this "Retina"), and not
* disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
*
* \param window the window from which the drawable size should be queried
* \param w a pointer to variable for storing the width in pixels, may be NULL
* \param h a pointer to variable for storing the height in pixels, may be
* NULL
*
* \since This function is available since SDL 2.26.0.
*
* \sa SDL_CreateWindow
* \sa SDL_GetWindowSize
*/
extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window,
int *w, int *h);
/** /**
* Set the minimum size of a window's client area. * Set the minimum size of a window's client area.
* *
...@@ -1211,6 +1275,17 @@ extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); ...@@ -1211,6 +1275,17 @@ extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
Uint32 flags); Uint32 flags);
/**
* Return whether the window has a surface associated with it.
*
* \returns SDL_TRUE if there is a surface associated with the window, or SDL_FALSE otherwise.
*
* \since This function is available since SDL 2.28.0.
*
* \sa SDL_GetWindowSurface
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasWindowSurface(SDL_Window *window);
/** /**
* Get the SDL surface associated with the window. * Get the SDL surface associated with the window.
* *
...@@ -1231,6 +1306,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, ...@@ -1231,6 +1306,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
* *
* \since This function is available since SDL 2.0.0. * \since This function is available since SDL 2.0.0.
* *
* \sa SDL_DestroyWindowSurface
* \sa SDL_HasWindowSurface
* \sa SDL_UpdateWindowSurface * \sa SDL_UpdateWindowSurface
* \sa SDL_UpdateWindowSurfaceRects * \sa SDL_UpdateWindowSurfaceRects
*/ */
...@@ -1265,7 +1342,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); ...@@ -1265,7 +1342,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
* *
* \param window the window to update * \param window the window to update
* \param rects an array of SDL_Rect structures representing areas of the * \param rects an array of SDL_Rect structures representing areas of the
* surface to copy * surface to copy, in pixels
* \param numrects the number of rectangles * \param numrects the number of rectangles
* \returns 0 on success or a negative error code on failure; call * \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information. * SDL_GetError() for more information.
...@@ -1279,6 +1356,20 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, ...@@ -1279,6 +1356,20 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
const SDL_Rect * rects, const SDL_Rect * rects,
int numrects); int numrects);
/**
* Destroy the surface associated with the window.
*
* \param window the window to update
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 2.28.0.
*
* \sa SDL_GetWindowSurface
* \sa SDL_HasWindowSurface
*/
extern DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
/** /**
* Set a window's input grab mode. * Set a window's input grab mode.
* *
...@@ -1337,6 +1428,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window * window, ...@@ -1337,6 +1428,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window * window,
* Mouse grab confines the mouse cursor to the window. * Mouse grab confines the mouse cursor to the window.
* *
* \param window The window for which the mouse grab mode should be set. * \param window The window for which the mouse grab mode should be set.
* \param grabbed This is SDL_TRUE to grab mouse, and SDL_FALSE to release.
* *
* \since This function is available since SDL 2.0.16. * \since This function is available since SDL 2.0.16.
* *
...@@ -1747,6 +1839,9 @@ extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); ...@@ -1747,6 +1839,9 @@ extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
* If you disable the screensaver, it is automatically re-enabled when SDL * If you disable the screensaver, it is automatically re-enabled when SDL
* quits. * quits.
* *
* The screensaver is disabled by default since SDL 2.0.2. Before SDL 2.0.2
* the screensaver was enabled by default.
*
* \since This function is available since SDL 2.0.0. * \since This function is available since SDL 2.0.0.
* *
* \sa SDL_EnableScreenSaver * \sa SDL_EnableScreenSaver
...@@ -2008,13 +2103,8 @@ extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, ...@@ -2008,13 +2103,8 @@ extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
* retry the call with 1 for the interval. * retry the call with 1 for the interval.
* *
* Adaptive vsync is implemented for some glX drivers with * Adaptive vsync is implemented for some glX drivers with
* GLX_EXT_swap_control_tear: * GLX_EXT_swap_control_tear, and for some Windows drivers with
* * WGL_EXT_swap_control_tear.
* https://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt
*
* and for some Windows drivers with WGL_EXT_swap_control_tear:
*
* https://www.opengl.org/registry/specs/EXT/wgl_swap_control_tear.txt
* *
* Read more on the Khronos wiki: * Read more on the Khronos wiki:
* https://www.khronos.org/opengl/wiki/Swap_Interval#Adaptive_Vsync * https://www.khronos.org/opengl/wiki/Swap_Interval#Adaptive_Vsync
......
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -28,13 +28,13 @@ ...@@ -28,13 +28,13 @@
*/ */
/* This shouldn't be nested -- included it around code only. */ /* This shouldn't be nested -- included it around code only. */
#ifdef _begin_code_h #ifdef SDL_begin_code_h
#error Nested inclusion of begin_code.h #error Nested inclusion of begin_code.h
#endif #endif
#define _begin_code_h #define SDL_begin_code_h
#ifndef SDL_DEPRECATED #ifndef SDL_DEPRECATED
# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ # if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
# define SDL_DEPRECATED __attribute__((deprecated)) # define SDL_DEPRECATED __attribute__((deprecated))
# else # else
# define SDL_DEPRECATED # define SDL_DEPRECATED
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
/* Some compilers use a special export keyword */ /* Some compilers use a special export keyword */
#ifndef DECLSPEC #ifndef DECLSPEC
# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
# ifdef DLL_EXPORT # ifdef DLL_EXPORT
# define DECLSPEC __declspec(dllexport) # define DECLSPEC __declspec(dllexport)
# else # else
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
/* By default SDL uses the C calling convention */ /* By default SDL uses the C calling convention */
#ifndef SDLCALL #ifndef SDLCALL
#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) #if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
#define SDLCALL __cdecl #define SDLCALL __cdecl
#elif defined(__OS2__) || defined(__EMX__) #elif defined(__OS2__) || defined(__EMX__)
#define SDLCALL _System #define SDLCALL _System
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma nopackwarning #pragma nopackwarning
#endif #endif
#ifdef _M_X64 #ifdef _WIN64
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
#pragma pack(push,8) #pragma pack(push,8)
#else #else
...@@ -171,17 +171,17 @@ ...@@ -171,17 +171,17 @@
#define SDL_FALLTHROUGH [[fallthrough]] #define SDL_FALLTHROUGH [[fallthrough]]
#else #else
#if defined(__has_attribute) #if defined(__has_attribute)
#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__) #define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
#else #else
#define _HAS_FALLTHROUGH 0 #define SDL_HAS_FALLTHROUGH 0
#endif /* __has_attribute */ #endif /* __has_attribute */
#if _HAS_FALLTHROUGH && \ #if SDL_HAS_FALLTHROUGH && \
((defined(__GNUC__) && __GNUC__ >= 7) || \ ((defined(__GNUC__) && __GNUC__ >= 7) || \
(defined(__clang_major__) && __clang_major__ >= 10)) (defined(__clang_major__) && __clang_major__ >= 10))
#define SDL_FALLTHROUGH __attribute__((__fallthrough__)) #define SDL_FALLTHROUGH __attribute__((__fallthrough__))
#else #else
#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */ #define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
#endif /* _HAS_FALLTHROUGH */ #endif /* SDL_HAS_FALLTHROUGH */
#undef _HAS_FALLTHROUGH #undef SDL_HAS_FALLTHROUGH
#endif /* C++17 or C2x */ #endif /* C++17 or C2x */
#endif /* SDL_FALLTHROUGH not defined */ #endif /* SDL_FALLTHROUGH not defined */
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
* after you finish any function and structure declarations in your headers * after you finish any function and structure declarations in your headers
*/ */
#ifndef _begin_code_h #ifndef SDL_begin_code_h
#error close_code.h included without matching begin_code.h #error close_code.h included without matching begin_code.h
#endif #endif
#undef _begin_code_h #undef SDL_begin_code_h
/* Reset structure packing at previous byte alignment */ /* Reset structure packing at previous byte alignment */
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
......
set(PACKAGE_VERSION "2.0.20") # sdl2 cmake project-config-version input for ./configure scripts
set(PACKAGE_VERSION "2.28.5")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)
...@@ -8,4 +10,3 @@ else() ...@@ -8,4 +10,3 @@ else()
set(PACKAGE_VERSION_EXACT TRUE) set(PACKAGE_VERSION_EXACT TRUE)
endif() endif()
endif() endif()
# sdl2 cmake project-config input for ./configure scripts # sdl2 cmake project-config input for ./configure script
include(FeatureSummary)
set_package_properties(SDL2 PROPERTIES
URL "https://www.libsdl.org/"
DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware"
)
# Copied from `configure_package_config_file`
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR} REALPATH)
get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
set(prefix "/opt/local/i686-w64-mingw32")
set(exec_prefix "${prefix}") set(exec_prefix "${prefix}")
set(bindir "${exec_prefix}/bin")
set(libdir "${exec_prefix}/lib") set(libdir "${exec_prefix}/lib")
set(includedir "${prefix}/include") set(includedir "${prefix}/include")
set(SDL2_PREFIX "${prefix}")
set(SDL2_EXEC_PREFIX "${exec_prefix}") set_and_check(SDL2_PREFIX "${prefix}")
set(SDL2_LIBDIR "${libdir}") set_and_check(SDL2_EXEC_PREFIX "${exec_prefix}")
set(SDL2_INCLUDE_DIRS "${includedir}/SDL2") set_and_check(SDL2_BINDIR "${bindir}")
set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} -lmingw32 -lSDL2main -lSDL2 -mwindows") set_and_check(SDL2_INCLUDE_DIR "${includedir}/SDL2")
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES) set_and_check(SDL2_LIBDIR "${libdir}")
set(SDL2_INCLUDE_DIRS "${includedir};${SDL2_INCLUDE_DIR}")
if(NOT TARGET SDL2::SDL2)
# provide SDL2::SDL2, SDL2::SDL2main and SDL2::SDL2-static targets, like SDL2Config.cmake does, for compatibility set(SDL2_LIBRARIES SDL2::SDL2)
set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static)
# Remove -lSDL2 as that is handled by CMake, note the space at the end so it does not replace e.g. -lSDL2main set(SDL2MAIN_LIBRARY)
# This may require "libdir" beeing set (from above) set(SDL2TEST_LIBRARY SDL2::SDL2test)
string(REPLACE "-lSDL2 " "" SDL2_EXTRA_LINK_FLAGS " -lmingw32 -lSDL2main -lSDL2 -mwindows ")
# also get rid of -lSDL2main, if you want to link against that use both SDL2::SDL2main and SDL2::SDL2 (in that order) unset(prefix)
# (SDL2Config.cmake has the same behavior) unset(exec_prefix)
string(REPLACE "-lSDL2main" "" SDL2_EXTRA_LINK_FLAGS ${SDL2_EXTRA_LINK_FLAGS}) unset(bindir)
string(STRIP "${SDL2_EXTRA_LINK_FLAGS}" SDL2_EXTRA_LINK_FLAGS) unset(libdir)
string(REPLACE "-lSDL2 " "" SDL2_EXTRA_LINK_FLAGS_STATIC " -Wl,--dynamicbase -Wl,--nxcompat -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid ") unset(includedir)
string(STRIP "${SDL2_EXTRA_LINK_FLAGS_STATIC}" SDL2_EXTRA_LINK_FLAGS_STATIC)
set(_sdl2_libraries_in "-lmingw32 -lSDL2main -lSDL2 -mwindows")
if(WIN32 AND NOT MSVC) set(_sdl2_static_private_libs_in " -Wl,--dynamicbase -Wl,--nxcompat -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid")
# MINGW needs very special handling, because the link order must be exactly -lmingw32 -lSDL2main -lSDL2
# for it to work at all (and -mwindows somewhere); a normal SHARED IMPORTED or STATIC IMPORTED library always puts itself first # Convert _sdl2_libraries to list and keep only libraries + library directories
# so handle this like a header-only lib and put everything in INTERFACE_LINK_LIBRARIES string(REGEX MATCHALL "-[lm]([-a-zA-Z0-9._]+)" _sdl2_libraries "${_sdl2_libraries_in}")
string(REGEX REPLACE "^-l" "" _sdl2_libraries "${_sdl2_libraries}")
add_library(SDL2::SDL2 INTERFACE IMPORTED) string(REGEX REPLACE ";-l" ";" _sdl2_libraries "${_sdl2_libraries}")
set_target_properties(SDL2::SDL2 PROPERTIES string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl2_libdirs "${_sdl2_libraries_in}")
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" string(REGEX REPLACE "^-L" "" _sdl2_libdirs "${_sdl2_libdirs}")
INTERFACE_LINK_LIBRARIES "-L${SDL2_LIBDIR} -lSDL2") string(REGEX REPLACE ";-L" ";" _sdl2_libdirs "${_sdl2_libdirs}")
list(APPEND _sdl2_libdirs "${SDL2_LIBDIR}")
add_library(SDL2::SDL2main INTERFACE IMPORTED)
set_target_properties(SDL2::SDL2main PROPERTIES # Convert _sdl2_static_private_libs to list and keep only libraries + library directories
INTERFACE_LINK_LIBRARIES "-L${SDL2_LIBDIR} -lmingw32 -lSDL2main -mwindows") string(REGEX MATCHALL "(-[lm]([-a-zA-Z0-9._]+))|(-Wl,[^ ]*framework[^ ]*)|(-pthread)" _sdl2_static_private_libs "${_sdl2_static_private_libs_in}")
string(REGEX REPLACE "^-l" "" _sdl2_static_private_libs "${_sdl2_static_private_libs}")
else() # (not WIN32) or MSVC string(REGEX REPLACE ";-l" ";" _sdl2_static_private_libs "${_sdl2_static_private_libs}")
string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl2_static_private_libdirs "${_sdl2_static_private_libs_in}")
add_library(SDL2::SDL2 SHARED IMPORTED) string(REGEX REPLACE "^-L" "" _sdl2_static_private_libdirs "${_sdl2_static_private_libdirs}")
set_target_properties(SDL2::SDL2 PROPERTIES string(REGEX REPLACE ";-L" ";" _sdl2_static_private_libdirs "${_sdl2_static_private_libdirs}")
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C" # Set SDL2_NO_MWINDOWS to a true-ish value to not add the -mwindows link option
IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}") if(SDL2_NO_MWINDOWS)
list(REMOVE_ITEM _sdl2_libraries "-mwindows")
if(MSVC) endif()
# This file is generated when building SDL2 with autotools and MinGW, and MinGW/dlltool
# isn't able to generate .lib files that are usable by recent MSVC versions if(_sdl2_libraries MATCHES ".*SDL2main.*")
# (something about "module unsafe for SAFESEH"; SAFESEH is enabled by default in MSVC). list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main)
# The .lib file for SDL2.dll *could* be generated with `gendef SDL2.dll` and then list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main)
# `lib.exe /machine:x86 /def:SDL2.def /out:SDL2.lib` (or /machine:amd64) endif()
# but that requires lib.exe from a Visual Studio installation - and that still doesn't
# give you a static SDL2main.lib with SAFESEH support that you'll need (unless you don't use SDL2main) set(_sdl2main_library ${SDL2_LIBDIR}/libSDL2main.a)
# Note that when building SDL2 with CMake and MSVC, the result works with both MinGW and MSVC. if(EXISTS "${_sdl2main_library}")
set(SDL2MAIN_LIBRARY SDL2::SDL2main)
message(FATAL_ERROR, "This build of libSDL2 only supports MinGW, not MSVC (Visual C++), because it lacks .lib files!") if(NOT TARGET SDL2::SDL2main)
# MSVC needs SDL2.lib set as IMPORTED_IMPLIB to link against (comment out message() call above if you added SDL2.lib yourself) add_library(SDL2::SDL2main STATIC IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES IMPORTED_IMPLIB "${SDL2_LIBDIR}/SDL2.lib") set_target_properties(SDL2::SDL2main
PROPERTIES
IMPORTED_LOCATION "${_sdl2main_library}"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL2"
)
if(WIN32)
# INTERFACE_LINK_OPTIONS needs CMake 3.13
cmake_minimum_required(VERSION 3.13)
# Mark WinMain/WinMain@16 as undefined, such that it will be withheld by the linker.
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set_target_properties(SDL2::SDL2main
PROPERTIES
INTERFACE_LINK_OPTIONS "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=_WinMain@16>"
)
else()
set_target_properties(SDL2::SDL2main
PROPERTIES
INTERFACE_LINK_OPTIONS "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-Wl,--undefined=WinMain>"
)
endif()
endif()
endif()
set(SDL2_SDL2main_FOUND TRUE)
else()
set(SDL2_SDL2main_FOUND FALSE)
endif()
unset(_sdl2main_library)
# Remove SDL2 since this is the "central" library
# Remove SDL2main since this will be provided by SDL2::SDL2main (if available)
# Remove mingw32 and cygwin since these are not needed when using `-Wl,--undefined,WinMain`
set(_sdl2_link_libraries ${_sdl2_libraries})
list(REMOVE_ITEM _sdl2_link_libraries SDL2 SDL2main mingw32 cygwin)
if(WIN32)
set(_sdl2_implib "${SDL2_LIBDIR}/libSDL2.dll.a")
set(_sdl2_dll "${SDL2_BINDIR}/SDL2.dll")
if(EXISTS "${_sdl2_implib}" AND EXISTS "${_sdl2_dll}")
if(NOT TARGET SDL2::SDL2)
add_library(SDL2::SDL2 SHARED IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries}"
INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_IMPLIB "${_sdl2_implib}"
IMPORTED_LOCATION "${_sdl2_dll}"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL2"
)
endif()
set(SDL2_SDL2_FOUND TRUE)
else() else()
# this mustn't be set for MSVC, so do it here in an extra call here set(SDL2_SDL2_FOUND FALSE)
set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS}")
endif() endif()
unset(_sdl2_implib)
unset(_sdl2_dll)
else()
set(_sdl2_shared "${SDL2_LIBDIR}/libSDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(EXISTS "${_sdl2_shared}")
if(NOT TARGET SDL2::SDL2)
add_library(SDL2::SDL2 SHARED IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries}"
INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${_sdl2_shared}"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL2"
)
endif()
set(SDL2_SDL2_FOUND TRUE)
else()
set(SDL2_SDL2_FOUND FALSE)
endif()
unset(_sdl2_shared)
endif()
add_library(SDL2::SDL2main STATIC IMPORTED) set(_sdl2_static "${SDL2_LIBDIR}/libSDL2.a")
set_target_properties(SDL2::SDL2main PROPERTIES if(EXISTS "${_sdl2_static}")
IMPORTED_LINK_INTERFACE_LANGUAGES "C" if(NOT TARGET SDL2::SDL2-static)
IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}") add_library(SDL2::SDL2-static STATIC IMPORTED)
set_target_properties(SDL2::SDL2-static
PROPERTIES
IMPORTED_LOCATION "${_sdl2_static}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries};${_sdl2_static_private_libs}"
INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs};${_sdl2_static_private_libdirs}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL2"
)
endif()
set(SDL2_SDL2-static_FOUND TRUE)
else()
set(SDL2_SDL2-static_FOUND FALSE)
endif()
unset(_sdl2_static)
endif() # (not WIN32) or MSVC unset(_sdl2_link_libraries)
add_library(SDL2::SDL2-static STATIC IMPORTED) set(_sdl2test_library "${SDL2_LIBDIR}/libSDL2_test.a")
set_target_properties(SDL2::SDL2-static PROPERTIES if(EXISTS "${_sdl2test_library}")
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" if(NOT TARGET SDL2::SDL2test)
IMPORTED_LINK_INTERFACE_LANGUAGES "C" add_library(SDL2::SDL2test STATIC IMPORTED)
IMPORTED_LOCATION "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}" set_target_properties(SDL2::SDL2test
INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS_STATIC}") PROPERTIES
IMPORTED_LOCATION "${_sdl2test_library}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL2"
)
endif()
set(SDL2_SDL2test_FOUND TRUE)
else()
set(SDL2_SDL2test_FOUND FALSE)
endif()
unset(_sdl2test_library)
# Copied from `configure_package_config_file`
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
check_required_components(SDL2)
endif() # NOT TARGET SDL2::SDL2 # Create SDL2::SDL2 alias for static-only builds
if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2)
if(CMAKE_VERSION VERSION_LESS "3.18")
# FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global.
add_library(SDL2::SDL2 INTERFACE IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static")
else()
add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
endif()
endif()
No preview for this file type
No preview for this file type
...@@ -23,9 +23,9 @@ dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 - ...@@ -23,9 +23,9 @@ dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -
weak_library_names='' weak_library_names=''
# Version information for libSDL2. # Version information for libSDL2.
current=18 current=2800
age=18 age=2800
revision=2 revision=5
# Is this an already installed library? # Is this an already installed library?
installed=yes installed=yes
...@@ -38,4 +38,4 @@ dlopen='' ...@@ -38,4 +38,4 @@ dlopen=''
dlpreopen='' dlpreopen=''
# Directory that this library needs to be installed in: # Directory that this library needs to be installed in:
libdir='/Users/valve/release/SDL/SDL2-2.0.20/i686-w64-mingw32/lib' libdir='/Users/valve/release/SDL2/SDL2-2.28.5/i686-w64-mingw32/lib'
No preview for this file type