-
Notifications
You must be signed in to change notification settings - Fork 12
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
98 changed files
with
6,953 additions
and
4,883 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
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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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 | ||
|
@@ -125,12 +125,10 @@ typedef struct SDL_AssertData | |
const struct SDL_AssertData *next; | ||
} SDL_AssertData; | ||
|
||
#if (SDL_ASSERT_LEVEL > 0) | ||
|
||
/* Never call this directly. Use the SDL_assert* macros. */ | ||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, | ||
const char *, | ||
const char *, int) | ||
const char *, | ||
const char *, int) | ||
#if defined(__clang__) | ||
#if __has_feature(attribute_analyzer_noreturn) | ||
/* this tells Clang's static analysis that we're a custom assert function, | ||
|
@@ -151,9 +149,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, | |
#define SDL_enabled_assert(condition) \ | ||
do { \ | ||
while ( !(condition) ) { \ | ||
static struct SDL_AssertData sdl_assert_data = { \ | ||
0, 0, #condition, 0, 0, 0, 0 \ | ||
}; \ | ||
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \ | ||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ | ||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ | ||
continue; /* go again. */ \ | ||
|
@@ -164,8 +160,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, | |
} \ | ||
} while (SDL_NULL_WHILE_LOOP_CONDITION) | ||
|
||
#endif /* enabled assertions support code */ | ||
|
||
/* Enable various levels of assertions. */ | ||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ | ||
# define SDL_assert(condition) SDL_disabled_assert(condition) | ||
|
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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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 | ||
|
@@ -240,7 +240,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); | |
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */ | ||
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) | ||
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */ | ||
#elif (defined(__arm__) && __ARM_ARCH__ >= 7) || defined(__aarch64__) | ||
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__) | ||
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory") | ||
#elif (defined(__powerpc__) || defined(__powerpc64__)) | ||
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27"); | ||
|
@@ -249,9 +249,8 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); | |
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) | ||
#define SDL_CPUPauseInstruction() __yield() | ||
#elif defined(__WATCOMC__) && defined(__386__) | ||
/* watcom assembler rejects PAUSE if CPU < i686, and it refuses REP NOP as an invalid combination. Hardcode the bytes. */ | ||
extern __inline void SDL_CPUPauseInstruction(void); | ||
#pragma aux SDL_CPUPauseInstruction = "db 0f3h,90h" | ||
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause" | ||
#else | ||
#define SDL_CPUPauseInstruction() | ||
#endif | ||
|
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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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 | ||
|
@@ -169,13 +169,13 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, | |
* The calculated values in this structure are calculated by SDL_OpenAudio(). | ||
* | ||
* For multi-channel audio, the default SDL channel mapping is: | ||
* 2: FL FR (stereo) | ||
* 3: FL FR LFE (2.1 surround) | ||
* 4: FL FR BL BR (quad) | ||
* 5: FL FR LFE BL BR (4.1 surround) | ||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) | ||
* 7: FL FR FC LFE BC SL SR (6.1 surround) | ||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround) | ||
* 2: FL FR (stereo) | ||
* 3: FL FR LFE (2.1 surround) | ||
* 4: FL FR BL BR (quad) | ||
* 5: FL FR LFE BL BR (4.1 surround) | ||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) | ||
* 7: FL FR FC LFE BC SL SR (6.1 surround) | ||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround) | ||
*/ | ||
typedef struct SDL_AudioSpec | ||
{ | ||
|
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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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 | ||
|
@@ -52,7 +52,7 @@ typedef enum | |
dstA = dstA */ | ||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply | ||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) | ||
dstA = (srcA * dstA) + (dstA * (1-srcA)) */ | ||
dstA = dstA */ | ||
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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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 | ||
|
@@ -82,6 +82,53 @@ extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); | |
*/ | ||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); | ||
|
||
/** | ||
* Put UTF-8 text into the primary selection. | ||
* | ||
* \param text the text to store in the primary selection | ||
* \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.26.0. | ||
* | ||
* \sa SDL_GetPrimarySelectionText | ||
* \sa SDL_HasPrimarySelectionText | ||
*/ | ||
extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); | ||
|
||
/** | ||
* Get UTF-8 text from the primary selection, which must be freed with | ||
* SDL_free(). | ||
* | ||
* This functions returns empty string if there was not enough memory left for | ||
* a copy of the primary selection's content. | ||
* | ||
* \returns the primary selection text on success or an empty string on | ||
* failure; call SDL_GetError() for more information. Caller must | ||
* call SDL_free() on the returned pointer when done with it (even if | ||
* there was an error). | ||
* | ||
* \since This function is available since SDL 2.26.0. | ||
* | ||
* \sa SDL_HasPrimarySelectionText | ||
* \sa SDL_SetPrimarySelectionText | ||
*/ | ||
extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void); | ||
|
||
/** | ||
* Query whether the primary selection exists and contains a non-empty text | ||
* string. | ||
* | ||
* \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it | ||
* does not. | ||
* | ||
* \since This function is available since SDL 2.26.0. | ||
* | ||
* \sa SDL_GetPrimarySelectionText | ||
* \sa SDL_SetPrimarySelectionText | ||
*/ | ||
extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void); | ||
|
||
|
||
/* Ends C function definitions when using C++ */ | ||
#ifdef __cplusplus | ||
|
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-2022 Sam Lantinga <[email protected]> | ||
Copyright (C) 1997-2023 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 | ||
|
@@ -52,10 +52,9 @@ | |
|
||
/* This is a set of defines to configure the SDL features */ | ||
|
||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) | ||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) || defined(__BORLANDC__) || defined(__CODEGEARC__) | ||
#define HAVE_STDINT_H 1 | ||
#elif defined(_MSC_VER) | ||
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) | ||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ | ||
#if defined(_MSC_VER) && (_MSC_VER < 1600) | ||
typedef signed __int8 int8_t; | ||
typedef unsigned __int8 uint8_t; | ||
typedef signed __int16 int16_t; | ||
|
@@ -72,28 +71,9 @@ typedef unsigned int uintptr_t; | |
#endif | ||
#define _UINTPTR_T_DEFINED | ||
#endif | ||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ | ||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) | ||
#define DWORD_PTR DWORD | ||
#endif | ||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) | ||
#define LONG_PTR LONG | ||
#endif | ||
#else /* !__GNUC__ && !_MSC_VER */ | ||
typedef signed char int8_t; | ||
typedef unsigned char uint8_t; | ||
typedef signed short int16_t; | ||
typedef unsigned short uint16_t; | ||
typedef signed int int32_t; | ||
typedef unsigned int uint32_t; | ||
typedef signed long long int64_t; | ||
typedef unsigned long long uint64_t; | ||
#ifndef _SIZE_T_DEFINED_ | ||
#define _SIZE_T_DEFINED_ | ||
typedef unsigned int size_t; | ||
#endif | ||
typedef unsigned int uintptr_t; | ||
#endif /* __GNUC__ || _MSC_VER */ | ||
#else | ||
#define HAVE_STDINT_H 1 | ||
#endif /* Visual Studio 2008 */ | ||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ | ||
|
||
#ifdef _WIN64 | ||
|
Oops, something went wrong.