-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
512 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
|
||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -47,6 +47,7 @@ | |
#include "SDL_loadso.h" | ||
#include "SDL_log.h" | ||
#include "SDL_messagebox.h" | ||
#include "SDL_metal.h" | ||
#include "SDL_mutex.h" | ||
#include "SDL_power.h" | ||
#include "SDL_render.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -50,6 +50,9 @@ typedef enum | |
SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate | ||
dstRGB = srcRGB * dstRGB | ||
dstA = dstA */ | ||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply | ||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) | ||
dstA = (srcA * dstA) + (dstA * (1-srcA)) */ | ||
SDL_BLENDMODE_INVALID = 0x7FFFFFFF | ||
|
||
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -84,7 +84,6 @@ typedef unsigned int uintptr_t; | |
#define HAVE_XINPUT_H 1 | ||
#define HAVE_MMDEVICEAPI_H 1 | ||
#define HAVE_AUDIOCLIENT_H 1 | ||
#define HAVE_ENDPOINTVOLUME_H 1 | ||
|
||
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ | ||
#ifdef HAVE_LIBC | ||
|
@@ -118,6 +117,10 @@ typedef unsigned int uintptr_t; | |
#define HAVE_STRCHR 1 | ||
#define HAVE_STRRCHR 1 | ||
#define HAVE_STRSTR 1 | ||
/* #undef HAVE_STRTOK_R */ | ||
#if defined(_MSC_VER) | ||
#define HAVE_STRTOK_S 1 | ||
#endif | ||
/* These functions have security warnings, so we won't use them */ | ||
/* #undef HAVE__LTOA */ | ||
/* #undef HAVE__ULTOA */ | ||
|
@@ -139,7 +142,7 @@ typedef unsigned int uintptr_t; | |
#define HAVE_ATAN2 1 | ||
#define HAVE_ATAN2F 1 | ||
#define HAVE_CEILF 1 | ||
#define HAVE__COPYSIGN 1 | ||
#define HAVE__COPYSIGN 1 | ||
#define HAVE_COS 1 | ||
#define HAVE_COSF 1 | ||
#define HAVE_EXP 1 | ||
|
@@ -168,7 +171,7 @@ typedef unsigned int uintptr_t; | |
#define HAVE_STRTOLL 1 | ||
#define HAVE_VSSCANF 1 | ||
#define HAVE_SCALBN 1 | ||
#define HAVE_SCALBNF 1 | ||
#define HAVE_SCALBNF 1 | ||
#endif | ||
/* This function is available with at least the VC++ 2008 C runtime library */ | ||
#if _MSC_VER >= 1400 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -73,8 +73,8 @@ | |
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ | ||
# endif | ||
# if defined (_M_ARM64) | ||
# include <armintr.h> | ||
# include <arm_neon.h> | ||
# include <arm64intr.h> | ||
# include <arm64_neon.h> | ||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ | ||
# endif | ||
# endif | ||
|
@@ -186,6 +186,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); | |
*/ | ||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); | ||
|
||
/** | ||
* This function returns true if the CPU has ARM SIMD (ARMv6) features. | ||
*/ | ||
extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); | ||
|
||
/** | ||
* This function returns true if the CPU has NEON (ARM SIMD) features. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -390,6 +390,9 @@ typedef enum { | |
#ifndef WIN32_LEAN_AND_MEAN | ||
#define WIN32_LEAN_AND_MEAN 1 | ||
#endif | ||
#ifndef NOMINMAX /* don't define min() and max(). */ | ||
#define NOMINMAX | ||
#endif | ||
#include <windows.h> | ||
|
||
#if __WINRT__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -42,10 +42,13 @@ | |
#ifdef __linux__ | ||
#include <endian.h> | ||
#define SDL_BYTEORDER __BYTE_ORDER | ||
#else /* __linux__ */ | ||
#elif defined(__OpenBSD__) | ||
#include <endian.h> | ||
#define SDL_BYTEORDER BYTE_ORDER | ||
#else | ||
#if defined(__hppa__) || \ | ||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ | ||
(defined(__MIPS__) && defined(__MISPEB__)) || \ | ||
(defined(__MIPS__) && defined(__MIPSEB__)) || \ | ||
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ | ||
defined(__sparc__) | ||
#define SDL_BYTEORDER SDL_BIG_ENDIAN | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -442,6 +442,7 @@ typedef struct SDL_TouchFingerEvent | |
float dx; /**< Normalized in the range -1...1 */ | ||
float dy; /**< Normalized in the range -1...1 */ | ||
float pressure; /**< Normalized in the range 0...1 */ | ||
Uint32 windowID; /**< The window underneath the finger, if any */ | ||
} SDL_TouchFingerEvent; | ||
|
||
|
||
|
@@ -558,7 +559,7 @@ typedef union SDL_Event | |
{ | ||
Uint32 type; /**< Event type, shared with all events */ | ||
SDL_CommonEvent common; /**< Common event data */ | ||
SDL_DisplayEvent display; /**< Window event data */ | ||
SDL_DisplayEvent display; /**< Display event data */ | ||
SDL_WindowEvent window; /**< Window event data */ | ||
SDL_KeyboardEvent key; /**< Keyboard event data */ | ||
SDL_TextEditingEvent edit; /**< Text editing event data */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
@@ -57,6 +57,15 @@ extern "C" { | |
struct _SDL_GameController; | ||
typedef struct _SDL_GameController SDL_GameController; | ||
|
||
typedef enum | ||
{ | ||
SDL_CONTROLLER_TYPE_UNKNOWN = 0, | ||
SDL_CONTROLLER_TYPE_XBOX360, | ||
SDL_CONTROLLER_TYPE_XBOXONE, | ||
SDL_CONTROLLER_TYPE_PS3, | ||
SDL_CONTROLLER_TYPE_PS4, | ||
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO | ||
} SDL_GameControllerType; | ||
|
||
typedef enum | ||
{ | ||
|
@@ -175,6 +184,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); | |
*/ | ||
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); | ||
|
||
/** | ||
* Get the type of a game controller. | ||
* This can be called before any controllers are opened. | ||
*/ | ||
extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); | ||
|
||
/** | ||
* Get the mapping of a game controller. | ||
* This can be called before any controllers are opened. | ||
|
@@ -199,18 +214,33 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_ | |
*/ | ||
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); | ||
|
||
/** | ||
* Return the SDL_GameController associated with a player index. | ||
*/ | ||
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); | ||
|
||
/** | ||
* Return the name for this currently opened controller | ||
*/ | ||
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); | ||
|
||
/** | ||
* Return the type of this currently opened controller | ||
*/ | ||
extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); | ||
|
||
/** | ||
* Get the player index of an opened game controller, or -1 if it's not available | ||
* | ||
* For XInput controllers this returns the XInput user index. | ||
*/ | ||
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); | ||
|
||
/** | ||
* Set the player index of an opened game controller | ||
*/ | ||
extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); | ||
|
||
/** | ||
* Get the USB vendor ID of an opened controller, if available. | ||
* If the vendor ID isn't available this function returns 0. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Simple DirectMedia Layer | ||
Copyright (C) 1997-2019 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2020 Sam Lantinga <[email protected]> | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
|
Oops, something went wrong.