diff --git a/Linux/sgml/Quakespasm.sgml b/Linux/sgml/Quakespasm.sgml index 848ce1c2..2f4fb236 100644 --- a/Linux/sgml/Quakespasm.sgml +++ b/Linux/sgml/Quakespasm.sgml @@ -4,7 +4,7 @@ -Page last edited: Sep. 2019 +Page last edited: August 2021 About

@@ -21,7 +21,8 @@ SDL is probably less buggy, but SDL2 has nicer features and smoother mouse input - + + @@ -107,16 +108,15 @@ quakespasm.pak contains a default.cfg which has been updated to give some defaul The controller support started as Jeremiah Sypult's implementation in Quakespasm-Rift and also uses ideas and code from LordHavoc (DarkPlaces). Compiling and Installation

-

Quakespasm's (optional) custom data is now stored in the file quakespasm.pak. This file should be placed alongside your quakespasm binary and id1 directory.

-

To checkout the latest version of QuakeSpasm, do: -svn co svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm

+

See the Downloads section to get the sourcecode, then below for platform specific instructions. +Quakespasm can also be built with the cross-platform Codeblocks. + +Quakespasm's (optional) custom data is now stored in the file quakespasm.pak. This file should be placed alongside your quakespasm binary and id1 directory.

Linux/Unix

-After extracting the source tarball, browse the Makefile and edit the music streaming options, then - -make -cp quakespasm /usr/local/games/quake (for example) - +After extracting the source tarball, "cd Quake" and edit the Makefile for music options. +

Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files. +

Then type "make" to compile the program, and copy the "quakespasm" binary (and "quakespasm.pak") to your Quake game directory. Compile time options include @@ -125,8 +125,6 @@ Compile time options include make SDL_CONFIG=/PATH/TO/SDL-CONFIG for unusual SDL installations make USE_SDL2=1 to compile against SDL2 instead of SDL-1.2 -

Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files. -

The project can also be built with Codeblocks (project files included).

Windows

The QuakeSpasm developers cross-compile windows binaries using and . @@ -154,6 +152,23 @@ these patched libSDL binaries may help. Changes

+ Changes in 0.93.3

+ + Fix rendering bug when cl_bobcycle was set to zero (sf.net bug/41) + Fixed buffer overflow with large char skybox names (sf.net bug/38) + Fixed a missing MAXALIASFRAMES bounds check (sf.net bug/37) + OpenGL: workaround Intel UHD 600 driver bug (sf.net bug/39) + OpenGL: merged surface mark & cull optimizations from vkQuake. + Reject lit files if they're the wrong size (eg hipnotic/start.bsp vs id1/start.lit or just a bsp that no longer has any coloured lits, etc) + Save: remove CR/LFs from level name to avoids broken saves, e.g. with autumn_sp map. + Music: improvements to mp3 tag detection / skipping. + Music: umx loader fix for malformed / crafted files. + New console command music_jump: Jump to given order in music, like Unreal's music change - only for module (tracker) music. + Updated third-party libraries (music codecs, SDL, etc.) Other minor fixes, tidy-ups and protability tweaks. + Source repository moved to git. + +

+ Changes in 0.93.2

Lightmaps are now dynamically allocated (from QSS), and BLOCK_WIDTH/HEIGHT raised from 128 to 256. diff --git a/MacOSX/AppController.m b/MacOSX/AppController.m index b39051ef..b20f5a5f 100644 --- a/MacOSX/AppController.m +++ b/MacOSX/AppController.m @@ -110,17 +110,21 @@ NSString *FQPrefScreenModeKey = @"ScreenMode"; return screenModes; } +#ifndef MAC_OS_X_VERSION_10_13 +#define NSControlStateValueOff NSOffState +#define NSControlStateValueOn NSOnState +#endif - (void)awakeFromNib { if ([arguments count] > 0) { [paramTextField setStringValue:[arguments description]]; if ([arguments argument:@"-window"] != nil) - [fullscreenCheckBox setState:NSOffState]; + [fullscreenCheckBox setState:NSControlStateValueOff]; } else { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [paramTextField setStringValue:[defaults stringForKey:FQPrefCommandLineKey]]; BOOL fullscreen = [defaults boolForKey:FQPrefFullscreenKey]; - [fullscreenCheckBox setState:fullscreen ? NSOnState : NSOffState]; + [fullscreenCheckBox setState:fullscreen ? NSControlStateValueOn : NSControlStateValueOff]; int screenModeIndex = [defaults integerForKey:FQPrefScreenModeKey]; [screenModePopUp selectItemAtIndex:screenModeIndex]; @@ -160,7 +164,7 @@ NSString *FQPrefScreenModeKey = @"ScreenMode"; [arguments removeArgument:@"-fullscreen"]; [arguments removeArgument:@"-window"]; - BOOL fullscreen = [fullscreenCheckBox state] == NSOnState; + BOOL fullscreen = [fullscreenCheckBox state] == NSControlStateValueOn; if (fullscreen) [arguments addArgument:@"-fullscreen"]; else @@ -186,7 +190,7 @@ NSString *FQPrefScreenModeKey = @"ScreenMode"; // update the defaults NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[paramTextField stringValue] forKey:FQPrefCommandLineKey]; - [defaults setObject:[NSNumber numberWithBool:[fullscreenCheckBox state] == NSOnState] forKey:FQPrefFullscreenKey]; + [defaults setObject:[NSNumber numberWithBool:[fullscreenCheckBox state] == NSControlStateValueOn] forKey:FQPrefFullscreenKey]; [defaults setObject:[NSNumber numberWithInt:index] forKey:FQPrefScreenModeKey]; [defaults synchronize]; diff --git a/MacOSX/Info.plist b/MacOSX/Info.plist index 7c494e62..1ae82c1a 100644 --- a/MacOSX/Info.plist +++ b/MacOSX/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.93.2 + 0.93.3 CFBundleSignature ???? LSApplicationCategoryType diff --git a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj index be73842c..b6a3782f 100644 --- a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj +++ b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj @@ -1161,6 +1161,7 @@ GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( + "GL_SILENCE_DEPRECATION=1", USE_SDL2, USE_CODEC_MP3, USE_CODEC_VORBIS, @@ -1203,6 +1204,7 @@ GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; GCC_PREPROCESSOR_DEFINITIONS = ( + "GL_SILENCE_DEPRECATION=1", USE_SDL2, USE_CODEC_MP3, USE_CODEC_VORBIS, @@ -1257,6 +1259,7 @@ GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( + "GL_SILENCE_DEPRECATION=1", USE_CODEC_MP3, USE_CODEC_VORBIS, USE_CODEC_WAVE, @@ -1293,6 +1296,7 @@ FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; GCC_MODEL_TUNING = G5; GCC_PREPROCESSOR_DEFINITIONS = ( + "GL_SILENCE_DEPRECATION=1", USE_CODEC_MP3, USE_CODEC_VORBIS, USE_CODEC_WAVE, @@ -1348,7 +1352,10 @@ "$(FRAMEWORK_SEARCH_PATHS)", ); GCC_MODEL_TUNING = G3; - GCC_PREPROCESSOR_DEFINITIONS = SDL_FRAMEWORK; + GCC_PREPROCESSOR_DEFINITIONS = ( + "GL_SILENCE_DEPRECATION=1", + SDL_FRAMEWORK, + ); GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -1383,6 +1390,7 @@ ); GCC_MODEL_TUNING = G3; GCC_PREPROCESSOR_DEFINITIONS = ( + "GL_SILENCE_DEPRECATION=1", USE_CODEC_MP3, USE_CODEC_VORBIS, USE_CODEC_WAVE, diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h index 0342c818..56eb7872 100644 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h +++ b/MacOSX/SDL.framework/Versions/A/Headers/SDL_config_os2.h @@ -70,8 +70,8 @@ #define HAVE__STRREV 1 #define HAVE__STRUPR 1 #define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 +/* #undef HAVE_INDEX */ +/* #undef HAVE_RINDEX */ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 @@ -119,10 +119,11 @@ /* Enable various video drivers */ #define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_OS2FS 1 +#define SDL_VIDEO_DRIVER_OS2GROP 1 +/* #undef SDL_VIDEO_DRIVER_OS2FS */ /* Enable OpenGL support */ -/* Nothing yet for OS/2. */ +/* #undef SDL_VIDEO_OPENGL */ /* Enable assembly routines where available */ #define SDL_ASSEMBLY_ROUTINES 1 diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h index 1335b982..4200d6d1 100644 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h +++ b/MacOSX/SDL.framework/Versions/A/Headers/SDL_cpuinfo.h @@ -60,12 +60,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); /** This function returns true if the CPU has AltiVec features */ extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(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 ARM NEON features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMNEON(void); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h index 953f2c0f..db5343f9 100644 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h +++ b/MacOSX/SDL.framework/Versions/A/Headers/SDL_endian.h @@ -31,7 +31,7 @@ #include "SDL_stdinc.h" /** @name SDL_ENDIANs - * The two types of endianness + * The two types of endianness */ /*@{*/ #define SDL_LIL_ENDIAN 1234 @@ -94,6 +94,12 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x) __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); return (Uint16)result; } +#elif defined(__GNUC__) && defined(__aarch64__) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("rev16 %w1, %w0" : "=r"(x) : "r"(x)); + return x; +} #elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint16 SDL_Swap16(Uint16 x) { @@ -130,11 +136,17 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) { Uint32 result; - __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); - __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); - __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); return result; } +#elif defined(__GNUC__) && defined(__aarch64__) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("rev %w1, %w0": "=r"(x):"r"(x)); + return x; +} #elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint32 SDL_Swap32(Uint32 x) { @@ -143,19 +155,10 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) } #elif defined(__WATCOMC__) && defined(__386__) extern _inline Uint32 SDL_Swap32(Uint32); -#ifndef __SW_3 /* 486+ */ #pragma aux SDL_Swap32 = \ "bswap eax" \ parm [eax] \ modify [eax]; -#else /* 386-only */ -#pragma aux SDL_Swap32 = \ - "xchg al, ah" \ - "ror eax, 16" \ - "xchg al, ah" \ - parm [eax] \ - modify [eax]; -#endif #else static __inline__ Uint32 SDL_Swap32(Uint32 x) { return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); @@ -167,14 +170,14 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) { !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) static __inline__ Uint64 SDL_Swap64(Uint64 x) { - union { + union { struct { Uint32 a,b; } s; Uint64 u; } v; v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" - : "=r" (v.s.a), "=r" (v.s.b) - : "0" (v.s.a), "1" (v.s.b)); + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); return v.u; } #elif defined(__GNUC__) && defined(__x86_64__) @@ -183,6 +186,14 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x) __asm__("bswapq %0" : "=r" (x) : "0" (x)); return x; } +#elif defined(__WATCOMC__) && defined(__386__) +extern _inline Uint64 SDL_Swap64(Uint64); +#pragma aux SDL_Swap64 = \ + "bswap eax" \ + "bswap edx" \ + "xchg eax,edx" \ + parm [eax edx] \ + modify [eax edx]; #else static __inline__ Uint64 SDL_Swap64(Uint64 x) { diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h index 3d791d69..163872a6 100644 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h +++ b/MacOSX/SDL.framework/Versions/A/Headers/SDL_opengl.h @@ -1,96 +1,90 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_opengl.h - * This is a simple file to encapsulate the OpenGL API headers - */ +/* This is a simple file to encapsulate the OpenGL API headers */ #include "SDL_config.h" #ifdef __WIN32__ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #ifndef NOMINMAX -#define NOMINMAX /* Don't defined min() and max() */ +#define NOMINMAX /* Don't define min() and max() */ #endif #include #endif #ifndef NO_SDL_GLEXT -#define __glext_h_ /* Don't let gl.h include glext.h */ +#define __glext_h_ /* Don't let gl.h include glext.h */ +#define __gl_glext_h_ /* Don't let gl.h include glext.h */ #endif #if defined(__MACOSX__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ #elif defined(__MACOS__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ #else -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ #endif #ifndef NO_SDL_GLEXT #undef __glext_h_ +#undef __gl_glext_h_ #endif -/** @name GLext.h - * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. - * It is included here because glext.h is not available on some systems. +/** glext.h + * This is included here because glext.h is not available on some systems. * If you don't want this version included, simply define "NO_SDL_GLEXT" */ -/*@{*/ #ifndef NO_SDL_GLEXT -#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) +#if !(defined(__glext_h_) || defined(__gl_glext_h_)) && !defined(GL_GLEXT_LEGACY) #define __glext_h_ +#define __gl_glext_h_ #ifdef __cplusplus extern "C" { #endif /* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** Copyright (c) 2007 The Khronos Group Inc. ** -** http://oss.sgi.com/projects/FreeB +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: ** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. ** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -111,9 +105,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/06/20 */ -/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 29 +/* glext.h last updated 2008/03/24 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 40 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -518,6 +512,32 @@ extern "C" { #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #endif +#ifndef GL_VERSION_2_1 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -3052,7 +3072,6 @@ extern "C" { #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB @@ -3097,6 +3116,331 @@ extern "C" { #ifndef GL_GREMEDY_string_marker #endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + /*************************************************************/ @@ -3147,6 +3491,51 @@ typedef unsigned short GLhalfARB; typedef unsigned short GLhalfNV; #endif +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && (defined(__GNUC__)||defined(__WATCOMC__)) +#include +#elif defined(_WIN32) +#if 0 /* handled by SDL_config_windows.h */ +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif /* */ +#elif defined(__MACOS__) /* handled by SDL_config_macos.h */ +#else +#include /* Fallback option */ +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #ifdef GL_GLEXT_PROTOTYPES @@ -3659,6 +4048,24 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #endif +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -4366,8 +4773,8 @@ typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum f typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 #endif #ifndef GL_SGI_color_table @@ -6227,12 +6634,12 @@ typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #endif @@ -6560,11 +6967,382 @@ GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); #endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); +GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); +GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); +GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); +GLAPI void APIENTRY glClearDepthdNV (GLdouble); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum); +GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + #ifdef __cplusplus } #endif -#endif +#endif /* GL_GLEXT_LEGACY */ #endif /* NO_SDL_GLEXT */ -/*@}*/ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h index 0df46478..ae20b9db 100644 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h +++ b/MacOSX/SDL.framework/Versions/A/Headers/SDL_stdinc.h @@ -258,7 +258,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); #endif -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && defined(__i386__) #define SDL_memset4(dst, val, len) \ do { \ int u0, u1, u2; \ @@ -291,7 +291,7 @@ do { \ /* We can count on memcpy existing on Mac OS X and being well-tuned. */ #if defined(__MACH__) && defined(__APPLE__) #define SDL_memcpy(dst, src, len) memcpy(dst, src, len) -#elif defined(__GNUC__) && defined(i386) +#elif defined(__GNUC__) && defined(__i386__) #define SDL_memcpy(dst, src, len) \ do { \ int u0, u1, u2; \ @@ -323,7 +323,7 @@ extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len /* We can count on memcpy existing on Mac OS X and being well-tuned. */ #if defined(__MACH__) && defined(__APPLE__) #define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) -#elif defined(__GNUC__) && defined(i386) +#elif defined(__GNUC__) && defined(__i386__) #define SDL_memcpy4(dst, src, len) \ do { \ int ecx, edi, esi; \ @@ -339,7 +339,7 @@ do { \ #define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) #endif -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && defined(__i386__) #define SDL_revcpy(dst, src, len) \ do { \ int u0, u1, u2; \ diff --git a/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h b/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h index f9c4e070..aa0459cd 100644 --- a/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h +++ b/MacOSX/SDL.framework/Versions/A/Headers/SDL_video.h @@ -138,6 +138,7 @@ typedef struct SDL_Surface { #define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ #define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ #define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ +#define SDL_TRIPLEBUF 0x40000100 /**< Set up triple-buffered video mode */ #define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ #define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ #define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ diff --git a/MacOSX/SDL.framework/Versions/A/SDL b/MacOSX/SDL.framework/Versions/A/SDL index c9316d78..f12579f3 100755 Binary files a/MacOSX/SDL.framework/Versions/A/SDL and b/MacOSX/SDL.framework/Versions/A/SDL differ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h index e4329395..e2656caf 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -59,6 +59,8 @@ #include "SDL_timer.h" #include "SDL_version.h" #include "SDL_video.h" +#include "SDL_locale.h" +#include "SDL_misc.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h index 8baecb63..f8a368ec 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -53,6 +53,8 @@ assert can have unique static variables associated with it. #define SDL_TriggerBreakpoint() __debugbreak() #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif ( defined(__APPLE__) && defined(__arm64__) ) /* this might work on other ARM targets, but this is a known quantity... */ + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) #elif defined(__386__) && defined(__WATCOMC__) #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h index deee35f9..e99f1bcc 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h index 305c01a9..4ba34914 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h index b116cc8d..db150ed0 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h index 6f0a22b9..5e21a79e 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga 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() */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h index c4f8766c..dbf69fce 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h index 7d62d3e2..3937dbc3 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h index 9cb70bfe..d1148cf2 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -121,6 +121,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -136,8 +138,9 @@ /* Enable various input drivers */ #define SDL_JOYSTICK_ANDROID 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_ANDROID 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_ANDROID 1 /* Enable sensor driver */ #define SDL_SENSOR_ANDROID 1 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h index edfc03e2..f06ad335 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_iphoneos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -122,6 +122,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -136,9 +138,11 @@ /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ #define SDL_HAPTIC_DUMMY 1 -/* Enable MFi joystick support */ -#define SDL_JOYSTICK_MFI 1 +/* Enable joystick support */ +/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */ /*#define SDL_JOYSTICK_HIDAPI 1*/ +#define SDL_JOYSTICK_MFI 1 +#define SDL_JOYSTICK_VIRTUAL 1 #ifdef __TVOS__ #define SDL_SENSOR_DUMMY 1 @@ -167,8 +171,10 @@ #define SDL_VIDEO_RENDER_OGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES2 1 -/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer */ -#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)) +/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer + Also supported in simulator from iOS 13.0 and tvOS 13.0 + */ +#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000))) #define SDL_PLATFORM_SUPPORTS_METAL 1 #else #define SDL_PLATFORM_SUPPORTS_METAL 0 @@ -195,11 +201,6 @@ /* enable iOS extended launch screen */ #define SDL_IPHONE_LAUNCHSCREEN 1 -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - /* enable filesystem support */ #define SDL_FILESYSTEM_COCOA 1 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h index 22287dfc..4b45f165 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga 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,6 +125,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -139,10 +141,16 @@ #define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ +#define SDL_JOYSTICK_HIDAPI 1 #define SDL_JOYSTICK_IOKIT 1 -#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_IOKIT 1 +/* The MFI controller support requires ARC Objective C runtime */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__) +#define SDL_JOYSTICK_MFI 1 +#endif + /* Enable the dummy sensor driver */ #define SDL_SENSOR_DUMMY 1 @@ -195,7 +203,7 @@ #endif /* Metal only supported on 64-bit architectures with 10.11+ */ -#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) +#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) #define SDL_PLATFORM_SUPPORTS_METAL 1 #else #define SDL_PLATFORM_SUPPORTS_METAL 0 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h index 20e45b88..b9c39584 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_minimal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h index f03ca4a5..1922217d 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_os2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,14 +27,17 @@ #define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_OS2 1 #define SDL_POWER_DISABLED 1 #define SDL_JOYSTICK_DISABLED 1 #define SDL_HAPTIC_DISABLED 1 /*#undef SDL_JOYSTICK_HIDAPI */ +/*#undef SDL_JOYSTICK_VIRTUAL */ #define SDL_SENSOR_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2 1 /* Enable OpenGL support */ /* #undef SDL_VIDEO_OPENGL */ @@ -42,18 +45,19 @@ /* Enable Vulkan support */ /* #undef SDL_VIDEO_VULKAN */ -#define SDL_LOADSO_DISABLED 1 -#define SDL_THREADS_DISABLED 1 -#define SDL_TIMERS_DISABLED 1 -#define SDL_FILESYSTEM_DUMMY 1 +#define SDL_THREAD_OS2 1 +#define SDL_LOADSO_OS2 1 +#define SDL_TIMER_OS2 1 +#define SDL_FILESYSTEM_OS2 1 /* Enable assembly routines */ #define SDL_ASSEMBLY_ROUTINES 1 -/* #undef HAVE_LIBSAMPLERATE_H */ +/* use libsamplerate for audio rate conversion. */ +/*#define HAVE_LIBSAMPLERATE_H 1 */ /* Enable dynamic libsamplerate support */ -/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ +#define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL" #define HAVE_LIBC 1 @@ -99,6 +103,8 @@ #define HAVE_WCSLCPY 1 #define HAVE_WCSLCAT 1 #define HAVE_WCSCMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 @@ -176,5 +182,7 @@ /* #undef HAVE_SQRTF */ #define HAVE_TAN 1 /* #undef HAVE_TANF */ +/* #undef HAVE_TRUNC */ +/* #undef HAVE_TRUNCF */ #endif /* SDL_config_os2_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h index 66ccf895..8728a638 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -102,6 +102,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -110,8 +112,8 @@ #define SDL_AUDIO_DRIVER_OSS 1 #define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 #define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_LINUX 1 #define SDL_SENSOR_DUMMY 1 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h index dd2d6ecf..235fe08e 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_psp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -136,6 +136,7 @@ /* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ #define SDL_JOYSTICK_PSP 1 +#define SDL_JOYSTICK_VIRTUAL 1 /* Enable the dummy sensor driver */ #define SDL_SENSOR_DUMMY 1 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h index c66d8754..18a36382 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga 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,6 +84,7 @@ typedef unsigned int uintptr_t; #define HAVE_XINPUT_H 1 #define HAVE_MMDEVICEAPI_H 1 #define HAVE_AUDIOCLIENT_H 1 +#define HAVE_SENSORSAPI_H /* This is disabled by default to avoid C runtime dependencies and manifest requirements */ #ifdef HAVE_LIBC @@ -133,6 +134,8 @@ typedef unsigned int uintptr_t; #define HAVE_STRNCMP 1 #define HAVE__STRICMP 1 #define HAVE__STRNICMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 #define HAVE_ACOS 1 #define HAVE_ACOSF 1 #define HAVE_ASIN 1 @@ -172,6 +175,8 @@ typedef unsigned int uintptr_t; #define HAVE_VSSCANF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #endif /* This function is available with at least the VC++ 2008 C runtime library */ #if _MSC_VER >= 1400 @@ -186,8 +191,22 @@ typedef unsigned int uintptr_t; #define HAVE_STDDEF_H 1 #endif +/* Check to see if we have Windows 10 build environment */ +#if _MSC_VER >= 1911 /* Visual Studio 15.3 */ +#include +#if _WIN32_WINNT >= 0x0601 /* Windows 7 */ +#define SDL_WINDOWS7_SDK +#endif +#if _WIN32_WINNT >= 0x0602 /* Windows 8 */ +#define SDL_WINDOWS8_SDK +#endif +#if _WIN32_WINNT >= 0x0A00 /* Windows 10 */ +#define SDL_WINDOWS10_SDK +#endif +#endif /* _MSC_VER >= 1911 */ + /* Enable various audio drivers */ -/* #undef SDL_AUDIO_DRIVER_WASAPI */ +#define SDL_AUDIO_DRIVER_WASAPI 1 #define SDL_AUDIO_DRIVER_DSOUND 1 #define SDL_AUDIO_DRIVER_WINMM 1 #define SDL_AUDIO_DRIVER_DISK 1 @@ -195,13 +214,20 @@ typedef unsigned int uintptr_t; /* Enable various input drivers */ #define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_XINPUT 1 #define SDL_JOYSTICK_HIDAPI 1 +#ifndef __WINRT__ +#define SDL_JOYSTICK_RAWINPUT 1 +#endif +#define SDL_JOYSTICK_VIRTUAL 1 +#ifdef SDL_WINDOWS10_SDK +#define SDL_JOYSTICK_WGI 1 +#endif +#define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_DINPUT 1 #define SDL_HAPTIC_XINPUT 1 -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 +/* Enable the sensor driver */ +#define SDL_SENSOR_WINDOWS 1 /* Enable various shared object loading systems */ #define SDL_LOADSO_WINDOWS 1 @@ -219,8 +245,8 @@ typedef unsigned int uintptr_t; #ifndef SDL_VIDEO_RENDER_D3D #define SDL_VIDEO_RENDER_D3D 1 #endif -#ifndef SDL_VIDEO_RENDER_D3D11 -#define SDL_VIDEO_RENDER_D3D11 0 +#ifdef SDL_WINDOWS7_SDK +#define SDL_VIDEO_RENDER_D3D11 1 #endif /* Enable OpenGL support */ @@ -258,3 +284,5 @@ typedef unsigned int uintptr_t; #endif #endif /* SDL_config_windows_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h index cb85b234..02079f53 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -181,6 +181,8 @@ typedef unsigned int uintptr_t; #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE__FSEEKI64 1 /* Enable various audio drivers */ @@ -193,6 +195,7 @@ typedef unsigned int uintptr_t; #define SDL_JOYSTICK_DISABLED 1 #define SDL_HAPTIC_DISABLED 1 #else +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_XINPUT 1 #endif diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h index 724c55fc..f65af8eb 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_config_wiz.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -117,6 +117,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -126,8 +128,8 @@ #define SDL_AUDIO_DRIVER_OSS 1 #define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 #define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_LINUX 1 #define SDL_SENSOR_DUMMY 1 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h index 1ef18cd1..4f8a2bcd 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_copying.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h index 2d094e88..df3123c0 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -246,10 +246,33 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); * \return Pointer to newly-allocated block, NULL if out of memory. * * \sa SDL_SIMDAlignment + * \sa SDL_SIMDRealloc * \sa SDL_SIMDFree */ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); +/** + * \brief Reallocate memory obtained from SDL_SIMDAlloc + * + * It is not valid to use this function on a pointer from anything but + * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, + * SDL_malloc, memalign, new[], etc. + * + * \param mem The pointer obtained from SDL_SIMDAlloc. This function also + * accepts NULL, at which point this function is the same as + * calling SDL_realloc with a NULL pointer. + * \param len The length, in bytes, of the block to allocated. The actual + * allocated block might be larger due to padding, etc. Passing 0 + * will return a non-NULL pointer, assuming the system isn't out of + * memory. + * \return Pointer to newly-reallocated block, NULL if out of memory. + * + * \sa SDL_SIMDAlignment + * \sa SDL_SIMDAlloc + * \sa SDL_SIMDFree + */ +extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len); + /** * \brief Deallocate memory obtained from SDL_SIMDAlloc * @@ -260,6 +283,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); * However, SDL_SIMDFree(NULL) is a legal no-op. * * \sa SDL_SIMDAlloc + * \sa SDL_SIMDRealloc */ extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h index f95a9067..531441e6 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h index 1e6daae1..171c008a 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h index 24416e69..962d62f6 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,9 +37,45 @@ extern "C" { #endif /* Public functions */ -/* SDL_SetError() unconditionally returns -1. */ + + +/** + * \brief Set the error message for the current thread + * + * \return -1, there is no error handling for this function + */ extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Get the last error message that was set + * + * SDL API functions may set error messages and then succeed, so you should + * only use the error value if a function fails. + * + * This returns a pointer to a static buffer for convenience and should not + * be called by multiple threads simultaneously. + * + * \return a pointer to the last error message that was set + */ extern DECLSPEC const char *SDLCALL SDL_GetError(void); + +/** + * \brief Get the last error message that was set for the current thread + * + * SDL API functions may set error messages and then succeed, so you should + * only use the error value if a function fails. + * + * \param errstr A buffer to fill with the last error message that was set + * for the current thread + * \param maxlen The size of the buffer pointed to by the errstr parameter + * + * \return errstr + */ +extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); + +/** + * \brief Clear the error message for the current thread + */ extern DECLSPEC void SDLCALL SDL_ClearError(void); /** diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h index eaf57434..ae560c08 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -85,6 +85,8 @@ typedef enum Called on Android in onResume() */ + SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */ + /* Display events */ SDL_DISPLAYEVENT = 0x150, /**< Display state change */ @@ -123,6 +125,10 @@ typedef enum SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */ + SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ + SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ + SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ /* Touch events */ SDL_FINGERDOWN = 0x700, @@ -413,6 +419,33 @@ typedef struct SDL_ControllerDeviceEvent Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; +/** + * \brief Game controller touchpad event structure (event.ctouchpad.*) + */ +typedef struct SDL_ControllerTouchpadEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Sint32 touchpad; /**< The index of the touchpad */ + Sint32 finger; /**< The index of the finger on the touchpad */ + float x; /**< Normalized in the range 0...1 with 0 being on the left */ + float y; /**< Normalized in the range 0...1 with 0 being at the top */ + float pressure; /**< Normalized in the range 0...1 */ +} SDL_ControllerTouchpadEvent; + +/** + * \brief Game controller sensor event structure (event.csensor.*) + */ +typedef struct SDL_ControllerSensorEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ + float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ +} SDL_ControllerSensorEvent; + /** * \brief Audio device event structure (event.adevice.*) */ @@ -557,33 +590,35 @@ typedef struct SDL_SysWMEvent */ typedef union SDL_Event { - Uint32 type; /**< Event type, shared with all events */ - SDL_CommonEvent common; /**< Common 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 */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ - SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ - SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ - SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ - SDL_AudioDeviceEvent adevice; /**< Audio device event data */ - SDL_SensorEvent sensor; /**< Sensor event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_MultiGestureEvent mgesture; /**< Gesture event data */ - SDL_DollarGestureEvent dgesture; /**< Gesture event data */ - SDL_DropEvent drop; /**< Drag and drop event data */ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common 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 */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */ + SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */ + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ + SDL_SensorEvent sensor; /**< Sensor event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ /* This is necessary for ABI compatibility between Visual C++ and GCC Visual C++ will respect the push pack pragma and use 52 bytes for diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h index 6d97e589..68042b60 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h index 5ee8e8e9..e42433c9 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,6 +31,7 @@ #include "SDL_stdinc.h" #include "SDL_error.h" #include "SDL_rwops.h" +#include "SDL_sensor.h" #include "SDL_joystick.h" #include "begin_code.h" @@ -64,7 +65,9 @@ typedef enum SDL_CONTROLLER_TYPE_XBOXONE, SDL_CONTROLLER_TYPE_PS3, SDL_CONTROLLER_TYPE_PS4, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, + SDL_CONTROLLER_TYPE_VIRTUAL, + SDL_CONTROLLER_TYPE_PS5 } SDL_GameControllerType; typedef enum @@ -170,7 +173,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID * * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller); /** * Is the joystick on this index supported by the game controller interface? @@ -245,19 +248,26 @@ extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController * Get the USB vendor ID of an opened controller, if available. * If the vendor ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller); /** * Get the USB product ID of an opened controller, if available. * If the product ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller); /** * Get the product version of an opened controller, if available. * If the product version isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller); + +/** + * Get the serial number of an opened controller, if available. + * + * Returns the serial number of the controller, or NULL if it is not available. + */ +extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); /** * Returns SDL_TRUE if the controller has been opened and currently connected, @@ -328,6 +338,12 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); +/** + * Return whether a game controller has a given axis + */ +extern DECLSPEC SDL_bool SDLCALL +SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); + /** * Get the current state of an axis control on a game controller. * @@ -337,8 +353,7 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, * The axis indices start at index 0. */ extern DECLSPEC Sint16 SDLCALL -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); /** * The list of buttons available from a controller @@ -361,6 +376,12 @@ typedef enum SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */ + SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */ + SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */ + SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */ + SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */ + SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ SDL_CONTROLLER_BUTTON_MAX } SDL_GameControllerButton; @@ -381,6 +402,11 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button); +/** + * Return whether a game controller has a given button + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); /** * Get the current state of a button on a game controller. @@ -391,7 +417,68 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga SDL_GameControllerButton button); /** - * Trigger a rumble effect + * Get the number of touchpads on a game controller. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); + +/** + * Get the number of supported simultaneous fingers on a touchpad on a game controller. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); + +/** + * Get the current state of a finger on a touchpad on a game controller. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); + +/** + * Return whether a game controller has a particular sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * + * \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Set whether data reporting for a game controller sensor is enabled + * + * \param gamecontroller The controller to update + * \param type The type of sensor to enable/disable + * \param enabled Whether data reporting should be enabled + * + * \return 0 or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled); + +/** + * Query whether sensor data reporting is enabled for a game controller + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * + * \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Get the current state of a game controller sensor. + * + * The number of values and interpretation of the data is sensor dependent. + * See SDL_sensor.h for the details for each type of sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * + * \return 0 or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values); + +/** + * Start a rumble effect * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. * * \param gamecontroller The controller to vibrate @@ -399,10 +486,44 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF * \param duration_ms The duration of the rumble effect, in milliseconds * - * \return 0, or -1 if rumble isn't supported on this joystick + * \return 0, or -1 if rumble isn't supported on this controller */ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); +/** + * Start a rumble effect in the game controller's triggers + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param gamecontroller The controller to vibrate + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if rumble isn't supported on this controller + */ +extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); + +/** + * Return whether a controller has an LED + * + * \param gamecontroller The controller to query + * + * \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller); + +/** + * Update a controller's LED color. + * + * \param gamecontroller The controller to update + * \param red The intensity of the red LED + * \param green The intensity of the green LED + * \param blue The intensity of the blue LED + * + * \return 0, or -1 if this controller does not have a modifiable LED + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue); + /** * Close a controller previously opened with SDL_GameControllerOpen(). */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h index 9d25e9c1..81ed4317 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h index 07562768..c27da118 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -336,6 +336,14 @@ typedef struct _SDL_Haptic SDL_Haptic; */ #define SDL_HAPTIC_SPHERICAL 2 +/** + * \brief Use this value to play an effect on the steering wheel axis. This + * provides better compatibility across platforms and devices as SDL will guess + * the correct axis. + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_STEERING_AXIS 3 + /* @} *//* Direction encodings */ /* @} *//* Haptic features */ @@ -444,6 +452,7 @@ typedef struct _SDL_Haptic SDL_Haptic; * \sa SDL_HAPTIC_POLAR * \sa SDL_HAPTIC_CARTESIAN * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HAPTIC_STEERING_AXIS * \sa SDL_HapticEffect * \sa SDL_HapticNumAxes */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h index d36815b9..50a5a089 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -244,6 +244,17 @@ extern "C" { */ #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" +/** + * \brief A variable controlling whether X11 should use GLX or EGL by default + * + * This variable can be set to the following values: + * "0" - Use GLX + * "1" - Use EGL + * + * By default SDL will use GLX when both are present. + */ +#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL" + /** * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden * @@ -303,6 +314,17 @@ extern "C" { */ #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +/** + * \brief A variable controlling whether relative mouse motion is affected by renderer scaling + * + * This variable can be set to the following values: + * "0" - Relative motion is unaffected by DPI or renderer's logical size + * "1" - Relative motion is scaled according to DPI scaling and logical size + * + * By default relative mouse deltas are affected by DPI and renderer scaling + */ +#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" + /** * \brief A variable controlling whether relative mouse mode is implemented using mouse warping * @@ -347,7 +369,9 @@ extern "C" { #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" /** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. + * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're + * seeing if "true" causes more problems than it solves in modern times. * */ #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" @@ -457,6 +481,25 @@ extern "C" { */ #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" +/** + * \brief A variable that overrides the automatic controller type detection + * + * The variable should be comma separated entries, in the form: VID/PID=type + * + * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd + * + * The type should be one of: + * Xbox360 + * XboxOne + * PS3 + * PS4 + * PS5 + * SwitchPro + * + * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + */ +#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE" + /** * \brief A variable that lets you manually hint extra gamecontroller db entries. * @@ -561,6 +604,17 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" +/** + * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" + /** * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. * @@ -605,10 +659,23 @@ extern "C" { * "0" - HIDAPI driver is not used * "1" - HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" + /** + * \brief A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated + * data from XInput. + * + * This variable can be set to the following values: + * "0" - HIDAPI Xbox driver will only use HIDAPI data + * "1" - HIDAPI Xbox driver will also pull data from XInput, providing better trigger axes, guide button + * presses, and rumble support + * + * The default is "1". This hint applies to any joysticks opened after setting the hint. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT" + /** * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. * @@ -631,6 +698,35 @@ extern "C" { */ #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" + /** + * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. + * + * This variable can be set to the following values: + * "0" - RAWINPUT drivers are not used + * "1" - RAWINPUT drivers are used (the default) + * + */ +#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" + + /** + * \brief A variable controlling whether a separate thread should be used + * for handling joystick detection and raw input messages on Windows + * + * This variable can be set to the following values: + * "0" - A separate thread is not used (the default) + * "1" - A separate thread is used for handling raw input messages + * + */ +#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" + + /** + * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. + * + * This variable can be set to the following values: + * "0" - Return unfiltered joystick axis values (the default) + * "1" - Return axis values with deadzones taken into account + */ +#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" /** * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. @@ -701,6 +797,42 @@ extern "C" { */ #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" +/** +* \brief A string specifying additional information to use with SDL_SetThreadPriority. +* +* By default SDL_SetThreadPriority will make appropriate system changes in order to +* apply a thread priority. For example on systems using pthreads the scheduler policy +* is changed automatically to a policy that works well with a given priority. +* Code which has specific requirements can override SDL's default behavior with this hint. +* +* pthread hint values are "current", "other", "fifo" and "rr". +* Currently no other platform hint values are defined but may be in the future. +* +* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro +* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME +* after calling SDL_SetThreadPriority(). +*/ +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" + +/** + * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. + * + * On some platforms, like Linux, a realtime priority thread may be subject to restrictions + * that require special handling by the application. This hint exists to let SDL know that + * the app is prepared to handle said restrictions. + * + * On Linux, SDL will apply the following configuration to any thread that becomes realtime: + * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, + * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. + * * Exceeding this limit will result in the kernel sending SIGKILL to the app, + * * Refer to the man pages for more information. + * + * This variable can be set to the following values: + * "0" - default platform specific behaviour + * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy + */ +#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" + /** * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) */ @@ -939,6 +1071,18 @@ extern "C" { */ #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" +/** + * \brief A variable to control whether SDL will pause audio in background + * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") + * + * The variable can be set to the following values: + * "0" - Non paused. + * "1" - Paused. (default) + * + * The value should be set before SDL is initialized. + */ +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" + /** * \brief A variable to control whether the return key on the soft keyboard * should hide the soft keyboard on Android and iOS. @@ -965,10 +1109,26 @@ extern "C" { */ #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +/** + * \brief Disable giving back control to the browser automatically + * when running with asyncify + * + * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations + * such as refreshing the screen or polling events. + * + * This hint only applies to the emscripten platform + * + * The variable can be set to the following values: + * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) + * "1" - Enable emscripten_sleep calls (the default) + */ +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" + /** * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. * - * This hint only applies to Unix-like platforms. + * This hint only applies to Unix-like platforms, and should set before + * any calls to SDL_Init() * * The variable can be set to the following values: * "0" - SDL will install a SIGINT and SIGTERM handler, and when it @@ -1142,6 +1302,32 @@ extern "C" { #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" +/** + * \brief A variable controlling whether SDL updates joystick state when getting input events + * + * This variable can be set to the following values: + * + * "0" - You'll call SDL_JoystickUpdate() manually + * "1" - SDL will automatically call SDL_JoystickUpdate() (default) + * + * This hint can be toggled on and off at runtime. + */ +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" + + +/** + * \brief A variable controlling whether SDL updates sensor state when getting input events + * + * This variable can be set to the following values: + * + * "0" - You'll call SDL_SensorUpdate() manually + * "1" - SDL will automatically call SDL_SensorUpdate() (default) + * + * This hint can be toggled on and off at runtime. + */ +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" + + /** * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. * @@ -1229,6 +1415,77 @@ extern "C" { */ #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +/** + * \brief Override for SDL_GetDisplayUsableBounds() + * + * If set, this hint will override the expected results for + * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want + * to do this, but this allows an embedded system to request that some of the + * screen be reserved for other uses when paired with a well-behaved + * application. + * + * The contents of this hint must be 4 comma-separated integers, the first + * is the bounds x, then y, width and height, in that order. + */ +#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" + +/** + * \brief Specify an application name for an audio device. + * + * Some audio backends (such as PulseAudio) allow you to describe your audio + * stream. Among other things, this description might show up in a system + * control panel that lets the user adjust the volume on specific audio + * streams instead of using one giant master volume slider. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your program ("My Game 2: The Revenge") + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: probably the application's name or "SDL Application" if SDL + * doesn't have any better information. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" + +/** + * \brief Specify an application name for an audio device. + * + * Some audio backends (such as PulseAudio) allow you to describe your audio + * stream. Among other things, this description might show up in a system + * control panel that lets the user adjust the volume on specific audio + * streams instead of using one giant master volume slider. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your what your program is playing ("audio stream" is + * probably sufficient in many cases, but this could be useful for something + * like "team chat" if you have a headset playing VoIP audio separately). + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: "audio stream" or something similar. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" + + +/** + * \brief Override for SDL_GetPreferredLocales() + * + * If set, this will be favored over anything the OS might report for the + * user's preferred locales. Changing this hint at runtime will not generate + * a SDL_LOCALECHANGED event (but if you can change the hint, you can push + * your own event, if you want). + * + * The format of this hint is a comma-separated list of language and locale, + * combined with an underscore, as is a common format: "en_GB". Locale is + * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" + */ +#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" + + /** * \brief An enumeration of hint priorities */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h index 3c099dec..0bbeafe0 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -105,6 +105,12 @@ typedef enum SDL_JOYSTICK_POWER_MAX } SDL_JoystickPowerLevel; +/* Set max recognized G-force from accelerometer + See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed + */ +#define SDL_IPHONE_MAX_GFORCE 5.0 + + /* Function prototypes */ /** @@ -199,51 +205,92 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID */ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); +/** + * Attaches a new virtual joystick. + * Returns the joystick's device index, or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, + int naxes, + int nbuttons, + int nhats); + +/** + * Detaches a virtual joystick + * Returns 0 on success, or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); + +/** + * Indicates whether or not a virtual-joystick is at a given device index. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); + +/** + * Set values on an opened, virtual-joystick's controls. + * Please note that values set here will not be applied until the next + * call to SDL_JoystickUpdate, which can either be called directly, + * or can be called indirectly through various other SDL APIS, + * including, but not limited to the following: SDL_PollEvent, + * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent. + * + * Returns 0 on success, -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); + /** * Return the name for this currently opened joystick. * If no name can be found, this function returns NULL. */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); /** * Get the player index of an opened joystick, or -1 if it's not available * * For XInput controllers this returns the XInput user index. */ -extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); /** * Set the player index of an opened joystick */ -extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); /** * Return the GUID for this opened joystick */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); /** * Get the USB vendor ID of an opened joystick, if available. * If the vendor ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); /** * Get the USB product ID of an opened joystick, if available. * If the product ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); /** * Get the product version of an opened joystick, if available. * If the product version isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); + +/** + * Get the serial number of an opened joystick, if available. + * + * Returns the serial number of the joystick, or NULL if it is not available. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); /** * Get the type of an opened joystick. */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); /** * Return a string representation for this guid. pszGUID must point to at least 33 bytes @@ -259,17 +306,17 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha /** * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); /** * Get the instance ID of an opened joystick or -1 if the joystick is invalid. */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); /** * Get the number of general axis controls on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); /** * Get the number of trackballs on a joystick. @@ -277,17 +324,17 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); * Joystick trackballs have only relative motion events associated * with them and their state cannot be polled. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); /** * Get the number of POV hats on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); /** * Get the number of buttons on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); /** * Update the current state of the open joysticks. @@ -317,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); * * The axis indices start at index 0. */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); /** @@ -329,7 +376,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, * * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state); /** @@ -363,7 +410,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * * - ::SDL_HAT_LEFTUP * - ::SDL_HAT_LEFTDOWN */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); /** @@ -373,7 +420,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, * * The ball indices start at index 0. */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); /** @@ -381,11 +428,11 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, * * The button indices start at index 0. */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); /** - * Trigger a rumble effect + * Start a rumble effect * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. * * \param joystick The joystick to vibrate @@ -395,17 +442,51 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, * * \return 0, or -1 if rumble isn't supported on this joystick */ -extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** + * Start a rumble effect in the joystick's triggers + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param joystick The joystick to vibrate + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if trigger rumble isn't supported on this joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); + +/** + * Return whether a joystick has an LED + * + * \param joystick The joystick to query + * + * \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); + +/** + * Update a joystick's LED color. + * + * \param joystick The joystick to update + * \param red The intensity of the red LED + * \param green The intensity of the green LED + * \param blue The intensity of the blue LED + * + * \return 0, or -1 if this joystick does not have a modifiable LED + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); /** * Close a joystick previously opened with SDL_JoystickOpen(). */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); /** * Return the battery level of this joystick */ -extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h index 4b2a055d..f6853c64 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h index 64b72dd3..6f6b65cb 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,9 +88,11 @@ typedef enum SDLK_GREATER = '>', SDLK_QUESTION = '?', SDLK_AT = '@', + /* Skip uppercase letters */ + SDLK_LEFTBRACKET = '[', SDLK_BACKSLASH = '\\', SDLK_RIGHTBRACKET = ']', @@ -336,13 +338,13 @@ typedef enum KMOD_NUM = 0x1000, KMOD_CAPS = 0x2000, KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDL_Keymod; + KMOD_RESERVED = 0x8000, -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, + KMOD_ALT = KMOD_LALT | KMOD_RALT, + KMOD_GUI = KMOD_LGUI | KMOD_RGUI +} SDL_Keymod; #endif /* SDL_keycode_h_ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h index 793ba535..89578a9f 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_locale.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_locale.h new file mode 100644 index 00000000..1f4b0c46 --- /dev/null +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_locale.h @@ -0,0 +1,101 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_locale.h + * + * Include file for SDL locale services + */ + +#ifndef _SDL_locale_h +#define _SDL_locale_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + + +typedef struct SDL_Locale +{ + const char *language; /**< A language name, like "en" for English. */ + const char *country; /**< A country, like "US" for America. Can be NULL. */ +} SDL_Locale; + +/** + * \brief Report the user's preferred locale. + * + * This returns an array of SDL_Locale structs, the final item zeroed out. + * When the caller is done with this array, it should call SDL_free() on + * the returned value; all the memory involved is allocated in a single + * block, so a single SDL_free() will suffice. + * + * Returned language strings are in the format xx, where 'xx' is an ISO-639 + * language specifier (such as "en" for English, "de" for German, etc). + * Country strings are in the format YY, where "YY" is an ISO-3166 country + * code (such as "US" for the United States, "CA" for Canada, etc). Country + * might be NULL if there's no specific guidance on them (so you might get + * { "en", "US" } for American English, but { "en", NULL } means "English + * language, generically"). Language strings are never NULL, except to + * terminate the array. + * + * Please note that not all of these strings are 2 characters; some are + * three or more. + * + * The returned list of locales are in the order of the user's preference. + * For example, a German citizen that is fluent in US English and knows + * enough Japanese to navigate around Tokyo might have a list like: + * { "de", "en_US", "jp", NULL }. Someone from England might prefer British + * English (where "color" is spelled "colour", etc), but will settle for + * anything like it: { "en_GB", "en", NULL }. + * + * This function returns NULL on error, including when the platform does not + * supply this information at all. + * + * This might be a "slow" call that has to query the operating system. It's + * best to ask for this once and save the results. However, this list can + * change, usually because the user has changed a system preference outside + * of your program; SDL will send an SDL_LOCALECHANGED event in this case, + * if possible, and you can call this function again to get an updated copy + * of preferred locales. + * + * \return array of locales, terminated with a locale with a NULL language + * field. Will return NULL on error. + */ +extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_locale_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h index 430e4fd0..c1751fd7 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h index 623f2d00..fcb5c17d 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h index bf50deb9..03639ce4 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h index 0f1e0e94..f9673577 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,18 +55,13 @@ typedef void *SDL_MetalView; * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its * own. It is up to user code to do that. * - * The returned handle can be casted directly to a NSView or UIView, and the - * CAMetalLayer can be accessed from the view's 'layer' property. + * The returned handle can be casted directly to a NSView or UIView. + * To access the backing CAMetalLayer, call SDL_Metal_GetLayer(). * - * \code - * SDL_MetalView metalview = SDL_Metal_CreateView(window); - * UIView *uiview = (__bridge UIView *)metalview; - * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; - * // [...] - * SDL_Metal_DestroyView(metalview); - * \endcode + * \note \a window must be created with the SDL_WINDOW_METAL flag. * * \sa SDL_Metal_DestroyView + * \sa SDL_Metal_GetLayer */ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); @@ -80,6 +75,37 @@ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); */ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); +/** + * \brief Get a pointer to the backing CAMetalLayer for the given view. + * + * \sa SDL_MetalCreateView + */ +extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); + +/** + * \brief Get the size of a window's underlying drawable in pixels (for use + * with setting viewport, scissor & etc). + * + * \param window SDL_Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, + * may be NULL + * \param h Pointer to variable for storing the height in pixels, + * may be NULL + * + * 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 \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. + * + * \note On macOS high-DPI support must be enabled for an application by + * setting NSHighResolutionCapable to true in its Info.plist. + * + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() + */ +extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, + int *h); + /* @} *//* Metal support functions */ /* Ends C function definitions when using C++ */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_misc.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_misc.h new file mode 100644 index 00000000..a04f19ba --- /dev/null +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_misc.h @@ -0,0 +1,75 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_misc.h + * + * \brief Include file for SDL API functions that don't fit elsewhere. + */ + +#ifndef SDL_misc_h_ +#define SDL_misc_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Open an URL / URI in the browser or other + * + * Open a URL in a separate, system-provided application. How this works will + * vary wildly depending on the platform. This will likely launch what + * makes sense to handle a specific URL's protocol (a web browser for http://, + * etc), but it might also be able to launch file managers for directories + * and other things. + * + * What happens when you open a URL varies wildly as well: your game window + * may lose focus (and may or may not lose focus if your game was fullscreen + * or grabbing input at the time). On mobile devices, your app will likely + * move to the background or your process might be paused. Any given platform + * may or may not handle a given URL. + * + * If this is unimplemented (or simply unavailable) for a platform, this will + * fail with an error. A successful result does not mean the URL loaded, just + * that we launched something to handle it (or at least believe we did). + * + * All this to say: this function can be useful, but you should definitely + * test it on every platform you target. + * + * \param url A valid URL to open. + * \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_misc_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h index 277559d2..99b658e9 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h index 970e7871..3c5b9557 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h index 690a8199..a49c4887 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h index 6685be73..5cd302cd 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h index 1e0660c3..5c2a3e63 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h index df29d384..00bc180c 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h index 753f617a..aa90cbc2 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -188,18 +188,22 @@ typedef enum SDL_PIXELFORMAT_RGB332 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_RGB444 = + SDL_PIXELFORMAT_XRGB4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_BGR444 = + SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444, + SDL_PIXELFORMAT_XBGR4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_RGB555 = + SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444, + SDL_PIXELFORMAT_XRGB1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_BGR555 = + SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555, + SDL_PIXELFORMAT_XBGR1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555, SDL_PIXELFORMAT_ARGB4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2), @@ -236,15 +240,17 @@ typedef enum SDL_PIXELFORMAT_BGR24 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3), - SDL_PIXELFORMAT_RGB888 = + SDL_PIXELFORMAT_XRGB8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_RGBX8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGR888 = + SDL_PIXELFORMAT_XBGR8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_BGRX8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4), diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h index c2cbc6b4..8ff00d78 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -70,6 +70,11 @@ /* lets us know what version of Mac OS X we're compiling on */ #include "AvailabilityMacros.h" #include "TargetConditionals.h" +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wundef-prefix" +#endif #if TARGET_OS_TV #undef __TVOS__ #define __TVOS__ 1 @@ -87,6 +92,9 @@ # error SDL for Mac OS X only supports deploying on 10.6 and above. #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */ #endif /* TARGET_OS_IPHONE */ +#ifdef __clang__ +#pragma clang diagnostic pop +#endif /**/ #endif /* defined(__APPLE__) */ #if defined(__NetBSD__) diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h index 4831cb77..39884cc2 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h index c979983c..b2bd5da5 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h index 71a41151..47f0d207 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h index f98c1843..f26fb7e5 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -618,8 +618,8 @@ extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, * \brief Set the clip rectangle for the current target. * * \param renderer The renderer for which clip rectangle should be set. - * \param rect A pointer to the rectangle to set as the clip rectangle, or - * NULL to disable clipping. + * \param rect A pointer to the rectangle to set as the clip rectangle, + * relative to the viewport, or NULL to disable clipping. * * \return 0 on success, or -1 on error * diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h index 6996d603..e0bcf431 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-13387:8a12cc1abc9e" -#define SDL_REVISION_NUMBER 13387 +#define SDL_REVISION "hg-14525:e52d96ea04fc" +#define SDL_REVISION_NUMBER 14525 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h index f66119fb..2e6225fc 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -96,15 +96,7 @@ typedef struct SDL_RWops #if defined(__ANDROID__) struct { - void *fileNameRef; - void *inputStreamRef; - void *readableByteChannelRef; - void *readMethod; - void *assetFileDescriptorRef; - long position; - long size; - long offset; - int fd; + void *asset; } androidio; #elif defined(__WIN32__) struct diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h index a50305f5..b19197d2 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h index 966adbf2..e6236341 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -78,14 +78,16 @@ typedef enum * Accelerometer sensor * * The accelerometer returns the current acceleration in SI meters per - * second squared. This includes gravity, so a device at rest will have - * an acceleration of SDL_STANDARD_GRAVITY straight down. + * second squared. This measurement includes the force of gravity, so + * a device at rest will have an value of SDL_STANDARD_GRAVITY away + * from the center of the earth. * * values[0]: Acceleration on the x axis * values[1]: Acceleration on the y axis * values[2]: Acceleration on the z axis * - * For phones held in portrait mode, the axes are defined as follows: + * For phones held in portrait mode and game controllers held in front of you, + * the axes are defined as follows: * -X ... +X : left ... right * -Y ... +Y : bottom ... top * -Z ... +Z : farther ... closer @@ -105,22 +107,36 @@ typedef enum * see positive rotation on that axis when it appeared to be rotating * counter-clockwise. * - * values[0]: Angular speed around the x axis - * values[1]: Angular speed around the y axis - * values[2]: Angular speed around the z axis + * values[0]: Angular speed around the x axis (pitch) + * values[1]: Angular speed around the y axis (yaw) + * values[2]: Angular speed around the z axis (roll) * - * For phones held in portrait mode, the axes are defined as follows: + * For phones held in portrait mode and game controllers held in front of you, + * the axes are defined as follows: * -X ... +X : left ... right * -Y ... +Y : bottom ... top * -Z ... +Z : farther ... closer * - * The axis data is not changed when the phone is rotated. + * The axis data is not changed when the phone or controller is rotated. * * \sa SDL_GetDisplayOrientation() */ /* Function prototypes */ +/** + * Locking for multi-threaded access to the sensor API + * + * If you are using the sensor API or handling events from multiple threads + * you should use these locking functions to protect access to the sensors. + * + * In particular, you are guaranteed that the sensor list won't change, so + * the API functions that take a sensor index will be valid, and sensor + * events will not be delivered. + */ +extern DECLSPEC void SDLCALL SDL_LockSensors(void); +extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); + /** * \brief Count the number of sensors attached to the system right now */ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h index 2ab43fcd..cbd9debd 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h index 014675b7..91ccaa45 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,6 +30,12 @@ #include "SDL_config.h" +#ifdef __APPLE__ +#ifndef _DARWIN_C_SOURCE +#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */ +#endif +#endif + #ifdef HAVE_SYS_TYPES_H #include #endif @@ -408,9 +414,13 @@ extern DECLSPEC int SDLCALL SDL_abs(int x); extern DECLSPEC int SDLCALL SDL_isdigit(int x); extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_isupper(int x); +extern DECLSPEC int SDLCALL SDL_islower(int x); extern DECLSPEC int SDLCALL SDL_toupper(int x); extern DECLSPEC int SDLCALL SDL_tolower(int x); +extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); + extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) @@ -461,6 +471,8 @@ extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len); extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); @@ -527,6 +539,8 @@ extern DECLSPEC double SDLCALL SDL_fabs(double x); extern DECLSPEC float SDLCALL SDL_fabsf(float x); extern DECLSPEC double SDLCALL SDL_floor(double x); extern DECLSPEC float SDLCALL SDL_floorf(float x); +extern DECLSPEC double SDLCALL SDL_trunc(double x); +extern DECLSPEC float SDLCALL SDL_truncf(float x); extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); extern DECLSPEC double SDLCALL SDL_log(double x); @@ -573,6 +587,17 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, /* force builds using Clang's static analysis tools to use literal C runtime here, since there are possibly tests that are ineffective otherwise. */ #if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) + +/* The analyzer knows about strlcpy even when the system doesn't provide it */ +#ifndef HAVE_STRLCPY +size_t strlcpy(char* dst, const char* src, size_t size); +#endif + +/* The analyzer knows about strlcat even when the system doesn't provide it */ +#ifndef HAVE_STRLCAT +size_t strlcat(char* dst, const char* src, size_t size); +#endif + #define SDL_malloc malloc #define SDL_calloc calloc #define SDL_realloc realloc @@ -581,16 +606,23 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, #define SDL_memcpy memcpy #define SDL_memmove memmove #define SDL_memcmp memcmp -#define SDL_strlen strlen #define SDL_strlcpy strlcpy #define SDL_strlcat strlcat +#define SDL_strlen strlen +#define SDL_wcslen wcslen +#define SDL_wcslcpy wcslcpy +#define SDL_wcslcat wcslcat #define SDL_strdup strdup +#define SDL_wcsdup wcsdup #define SDL_strchr strchr #define SDL_strrchr strrchr #define SDL_strstr strstr +#define SDL_wcsstr wcsstr #define SDL_strtokr strtok_r #define SDL_strcmp strcmp +#define SDL_wcscmp wcscmp #define SDL_strncmp strncmp +#define SDL_wcsncmp wcsncmp #define SDL_strcasecmp strcasecmp #define SDL_strncasecmp strncasecmp #define SDL_sscanf sscanf diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h index 51a12830..d3f8c814 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -80,7 +80,9 @@ typedef struct SDL_Surface /** information needed for surfaces requiring locks */ int locked; /**< Read-only */ - void *lock_data; /**< Read-only */ + + /** list of BlitMap that hold a reference to this surface */ + void *list_blitmap; /**< Private */ /** clipping information */ SDL_Rect clip_rect; /**< Read-only */ @@ -235,6 +237,13 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, int flag); +/** + * \brief Returns whether the surface is RLE enabled + * + * \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); + /** * \brief Sets the color key (transparent pixel) in a blittable surface. * diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h index 3b084076..d296ab1f 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -89,7 +89,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio #endif /* __LINUX__ */ /* Platform specific functions for iOS */ -#if defined(__IPHONEOS__) && __IPHONEOS__ +#ifdef __IPHONEOS__ #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); @@ -101,7 +101,7 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); /* Platform specific functions for Android */ -#if defined(__ANDROID__) && __ANDROID__ +#ifdef __ANDROID__ /** \brief Get the JNI environment for the current thread @@ -120,6 +120,33 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); */ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); +/** + \brief Return API level of the current device + + API level 30: Android 11 + API level 29: Android 10 + API level 28: Android 9 + API level 27: Android 8.1 + API level 26: Android 8.0 + API level 25: Android 7.1 + API level 24: Android 7.0 + API level 23: Android 6.0 + API level 22: Android 5.1 + API level 21: Android 5.0 + API level 20: Android 4.4W + API level 19: Android 4.4 + API level 18: Android 4.3 + API level 17: Android 4.2 + API level 16: Android 4.1 + API level 15: Android 4.0.3 + API level 14: Android 4.0 + API level 13: Android 3.2 + API level 12: Android 3.1 + API level 11: Android 3.0 + API level 10: Android 2.3.3 + */ +extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); + /** \brief Return true if the application is running on Android TV */ @@ -172,10 +199,18 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); */ extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); +/** + \brief Request permissions at runtime. + + This blocks the calling thread until the permission is granted or + denied. Returns SDL_TRUE if the permission was granted. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission); + #endif /* __ANDROID__ */ /* Platform specific functions for WinRT */ -#if defined(__WINRT__) && __WINRT__ +#ifdef __WINRT__ /** * \brief WinRT / Windows Phone path types @@ -268,6 +303,17 @@ extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); */ extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); +/* Functions used by iOS application delegates to notify SDL about state changes */ +extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void); +#ifdef __IPHONEOS__ +extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); +#endif + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h index c8236513..f0e9675d 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -106,6 +106,11 @@ typedef void *EGLSurface; #if defined(SDL_VIDEO_DRIVER_VIVANTE) #include "SDL_egl.h" #endif + +#if defined(SDL_VIDEO_DRIVER_OS2) +#define INCL_WIN +#include +#endif #endif /* SDL_PROTOTYPES_ONLY */ @@ -186,6 +191,16 @@ struct SDL_SysWMmsg int dummy; /* No Vivante window events yet */ } vivante; +#endif +#if defined(SDL_VIDEO_DRIVER_OS2) + struct + { + BOOL fFrame; /**< TRUE if hwnd is a frame window */ + HWND hwnd; /**< The window receiving the message */ + ULONG msg; /**< The message identifier */ + MPARAM mp1; /**< The first first message parameter */ + MPARAM mp2; /**< The second first message parameter */ + } os2; #endif /* Can't have an empty union */ int dummy; @@ -280,6 +295,14 @@ struct SDL_SysWMinfo } android; #endif +#if defined(SDL_VIDEO_DRIVER_OS2) + struct + { + HWND hwnd; /**< The window handle */ + HWND hwndFrame; /**< The frame window handle */ + } os2; +#endif + #if defined(SDL_VIDEO_DRIVER_VIVANTE) struct { diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h index f78b1145..4016358a 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -54,6 +54,11 @@ typedef unsigned int SDL_TLSID; /** * The SDL thread priority. * + * SDL will make system changes as necessary in order to apply the thread priority. + * Code which attempts to control thread state related to priority should be aware + * that calling SDL_SetThreadPriority may alter such state. + * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. + * * \note On many systems you require special privileges to set high or time critical priority. */ typedef enum { @@ -69,7 +74,7 @@ typedef enum { */ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); -#if defined(__WIN32__) && !defined(HAVE_LIBC) +#if defined(__WIN32__) /** * \file SDL_thread.h * @@ -93,11 +98,18 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); #define SDL_PASSED_BEGINTHREAD_ENDTHREAD #include /* _beginthreadex() and _endthreadex() */ -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) +typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned (__stdcall *func)(void *), void * /*arg*/, unsigned, unsigned * /* threadID */); typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); +#ifndef SDL_beginthread +#define SDL_beginthread _beginthreadex +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthreadex +#endif + /** * Create a thread. */ @@ -118,12 +130,12 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), */ #if defined(SDL_CreateThread) && SDL_DYNAMIC_API #undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#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) #endif #elif defined(__OS2__) @@ -132,13 +144,23 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), * into a dll with Watcom's runtime statically linked. */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD + #ifndef __EMX__ #include #else #include #endif + typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); typedef void (*pfnSDL_CurrentEndThread)(void); + +#ifndef SDL_beginthread +#define SDL_beginthread _beginthread +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthread +#endif + extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, @@ -147,14 +169,15 @@ extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); + #if defined(SDL_CreateThread) && SDL_DYNAMIC_API #undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_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) #endif #else diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h index 2a47b043..aada7178 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h index 99dbcb8c..fa5a37ce 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h index 9c3e9896..b6bb5711 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h index 69b02706..23b65f43 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 11 +#define SDL_PATCHLEVEL 14 /** * \brief Macro to determine SDL version program was compiled against. diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h index c1bb7527..54cbe0f0 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -118,7 +118,8 @@ typedef enum SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ - SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ + SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */ + SDL_WINDOW_METAL = 0x20000000 /**< window usable for Metal view */ } SDL_WindowFlags; /** @@ -174,7 +175,9 @@ typedef enum typedef enum { 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_DISCONNECTED /**< Display has been removed from the system */ } SDL_DisplayEventID; typedef enum @@ -484,7 +487,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. + * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN + * ::SDL_WINDOW_METAL. * * \return The created window, or NULL if window creation failed. * @@ -503,6 +507,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. * + * If SDL_WINDOW_METAL is specified on an OS that does not support Metal, + * SDL_CreateWindow() will fail. + * * \note On non-Apple devices, SDL requires you to either not link to the * Vulkan loader or link to a dynamic library version. This limitation * may be removed in a future version of SDL. diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h index d69a436b..a3de1cea 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h @@ -204,10 +204,9 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); * * \sa SDL_Vulkan_CreateSurface() */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( - SDL_Window *window, - unsigned int *pCount, - const char **pNames); +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, + unsigned int *pCount, + const char **pNames); /** * \brief Create a Vulkan rendering surface for a window. @@ -238,10 +237,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( * * \sa SDL_Vulkan_GetInstanceExtensions() */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface( - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR* surface); +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, + VkInstance instance, + VkSurfaceKHR* surface); /** * \brief Get the size of a window's underlying drawable in pixels (for use diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h b/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h index 22c997c4..1ca40ccd 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -51,15 +51,11 @@ /* Some compilers use a special export keyword */ #ifndef DECLSPEC -# if defined(__WIN32__) || defined(__WINRT__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else +# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) +# ifdef DLL_EXPORT # define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC # endif # elif defined(__OS2__) # ifdef BUILD_SDL diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h b/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h index 8e4cac3d..6aa411b0 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist b/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist index 2b228c9f..0aa19b00 100644 --- a/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist +++ b/MacOSX/SDL2.framework/Versions/A/Resources/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.11 + 2.0.14 CFBundleSignature SDLX CFBundleSupportedPlatforms @@ -27,7 +27,7 @@ MacOSX CFBundleVersion - 2.0.11 + 2.0.14 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild diff --git a/MacOSX/SDL2.framework/Versions/A/SDL2 b/MacOSX/SDL2.framework/Versions/A/SDL2 index b7080fd6..51e0612a 100755 Binary files a/MacOSX/SDL2.framework/Versions/A/SDL2 and b/MacOSX/SDL2.framework/Versions/A/SDL2 differ diff --git a/MacOSX/codecs/include/mad.h b/MacOSX/codecs/include/mad.h index d7cdd9a0..34a8e6fc 100644 --- a/MacOSX/codecs/include/mad.h +++ b/MacOSX/codecs/include/mad.h @@ -24,32 +24,18 @@ extern "C" { #endif -#ifdef __i386__ +#if defined(__i386__) # define FPM_INTEL -# define SIZEOF_LONG 4 -#endif -#ifdef __x86_64__ +#elif defined(__x86_64__) # define FPM_64BIT -# ifdef _WIN64 -# define SIZEOF_LONG 4 -# else -# define SIZEOF_LONG 8 -# endif -#endif -#if (defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__)) && !(defined(__ppc64__) || defined(__powerpc64__)) +#elif defined(__aarch64__) +# define FPM_64BIT +#elif defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || \ + defined(__ppc64__)||defined(__powerpc64__) # define FPM_PPC -# define SIZEOF_LONG 4 +#else +# error define FPM for this CPU #endif -#if defined(__ppc64__) || defined(__powerpc64__) -# define FPM_PPC -# define SIZEOF_LONG 8 -#endif - - - -#define SIZEOF_INT 4 -#define SIZEOF_LONG_LONG 8 - /* Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp */ @@ -85,7 +71,9 @@ extern char const mad_build[]; # ifndef LIBMAD_FIXED_H # define LIBMAD_FIXED_H -# if SIZEOF_INT >= 4 +# include + +# if INT_MAX >= 2147483647 typedef signed int mad_fixed_t; typedef signed int mad_fixed64hi_t; @@ -96,6 +84,8 @@ typedef signed long mad_fixed_t; typedef signed long mad_fixed64hi_t; typedef unsigned long mad_fixed64lo_t; # endif +/* compile-time assert: */ +typedef int _mad_check_fixed_t[2*(sizeof(mad_fixed_t)>=4) - 1]; # if defined(_MSC_VER) # define mad_fixed64_t signed __int64 @@ -224,6 +214,20 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) # define mad_f_mul mad_f_mul_inline # define mad_f_scale64 + +# elif defined(__WATCOMC__) && defined(__386__) +mad_fixed_t mad_f_mul_inl(mad_fixed_t,mad_fixed_t); +/* 28 == MAD_F_FRACBITS */ +#pragma aux mad_f_mul_inl = \ + "imul ebx", \ + "shrd eax,edx,28" \ + parm [eax] [ebx] \ + value [eax] \ + modify exact [eax edx] + +# define mad_f_mul mad_f_mul_inl +# define mad_f_scale64 + # else /* * This Intel version is fast and accurate; the disposition of the least @@ -1000,6 +1004,6 @@ int mad_decoder_message(struct mad_decoder *, void *, unsigned int *); # endif -# ifdef __cplusplus +#ifdef __cplusplus } -# endif +#endif diff --git a/MacOSX/codecs/include/opus/opusfile.h b/MacOSX/codecs/include/opus/opusfile.h index 220ac7f7..296d8d9a 100644 --- a/MacOSX/codecs/include/opus/opusfile.h +++ b/MacOSX/codecs/include/opus/opusfile.h @@ -6,7 +6,7 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors https://xiph.org/ * * * ******************************************************************** @@ -28,7 +28,7 @@ reference libogg and - libopus + libopus libraries. libopusfile provides several sets of built-in routines for @@ -58,7 +58,7 @@ it is stored in the header to allow you to resample to it after decoding (the libopusfile API does not currently provide a resampler, but the - the + the Speex resampler is a good choice if you need one). In general, if you are playing back the audio, you should leave it at 48 kHz, provided your audio hardware supports it. @@ -68,7 +68,7 @@ Opus files can contain anywhere from 1 to 255 channels of audio. The channel mappings for up to 8 channels are the same as the - Vorbis + Vorbis mappings. A special stereo API can convert everything to 2 channels, making it simple to support multichannel files in an application which only has stereo @@ -284,7 +284,7 @@ struct OpusHead{ A particular tag may occur more than once, and order is significant. The character set encoding for the strings is always UTF-8, but the tag names are limited to ASCII, and treated as case-insensitive. - See the Vorbis + See the Vorbis comment header specification for details. In filling in this structure, libopusfile will null-terminate the @@ -698,7 +698,7 @@ void opus_picture_tag_clear(OpusPictureTag *_pic) OP_ARG_NONNULL(1); #define OP_HTTP_PROXY_PASS_REQUEST (6720) #define OP_GET_SERVER_INFO_REQUEST (6784) -#define OP_URL_OPT(_request) ((_request)+(char *)0) +#define OP_URL_OPT(_request) ((char *)(_request)) /*These macros trigger compilation errors or warnings if the wrong types are provided to one of the URL options.*/ @@ -1890,7 +1890,7 @@ void op_set_dither_enabled(OggOpusFile *_of,int _enabled) OP_ARG_NONNULL(1); signed native-endian 16-bit values at 48 kHz with a nominal range of [-32768,32767). Multiple channels are interleaved using the - Vorbis + Vorbis channel ordering. This must have room for at least \a _buf_size values. \param _buf_size The number of values that can be stored in \a _pcm. @@ -1972,7 +1972,7 @@ OP_WARN_UNUSED_RESULT int op_read(OggOpusFile *_of, signed floats at 48 kHz with a nominal range of [-1.0,1.0]. Multiple channels are interleaved using the - Vorbis + Vorbis channel ordering. This must have room for at least \a _buf_size floats. \param _buf_size The number of floats that can be stored in \a _pcm. diff --git a/MacOSX/codecs/include/xmp.h b/MacOSX/codecs/include/xmp.h index 8ec6deeb..2d725411 100644 --- a/MacOSX/codecs/include/xmp.h +++ b/MacOSX/codecs/include/xmp.h @@ -26,11 +26,17 @@ extern "C" { #elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL) # define LIBXMP_EXPORT __global #elif defined(EMSCRIPTEN) +# include # define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE +# define LIBXMP_EXPORT_VAR #else # define LIBXMP_EXPORT #endif +#if !defined (LIBXMP_EXPORT_VAR) +# define LIBXMP_EXPORT_VAR LIBXMP_EXPORT +#endif + #define XMP_NAME_SIZE 64 /* Size of module name and type */ #define XMP_KEY_OFF 0x81 /* Note number for key off event */ @@ -171,6 +177,36 @@ struct xmp_envelope { short data[XMP_MAX_ENV_POINTS * 2]; }; +struct xmp_subinstrument { + int vol; /* Default volume */ + int gvl; /* Global volume */ + int pan; /* Pan */ + int xpo; /* Transpose */ + int fin; /* Finetune */ + int vwf; /* Vibrato waveform */ + int vde; /* Vibrato depth */ + int vra; /* Vibrato rate */ + int vsw; /* Vibrato sweep */ + int rvv; /* Random volume/pan variation (IT) */ + int sid; /* Sample number */ +#define XMP_INST_NNA_CUT 0x00 +#define XMP_INST_NNA_CONT 0x01 +#define XMP_INST_NNA_OFF 0x02 +#define XMP_INST_NNA_FADE 0x03 + int nna; /* New note action */ +#define XMP_INST_DCT_OFF 0x00 +#define XMP_INST_DCT_NOTE 0x01 +#define XMP_INST_DCT_SMP 0x02 +#define XMP_INST_DCT_INST 0x03 + int dct; /* Duplicate check type */ +#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT +#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF +#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE + int dca; /* Duplicate check action */ + int ifc; /* Initial filter cutoff */ + int ifr; /* Initial filter resonance */ +}; + struct xmp_instrument { char name[32]; /* Instrument name */ int vol; /* Instrument volume */ @@ -185,35 +221,7 @@ struct xmp_instrument { signed char xpo; /* Instrument transpose for each key */ } map[XMP_MAX_KEYS]; - struct xmp_subinstrument { - int vol; /* Default volume */ - int gvl; /* Global volume */ - int pan; /* Pan */ - int xpo; /* Transpose */ - int fin; /* Finetune */ - int vwf; /* Vibrato waveform */ - int vde; /* Vibrato depth */ - int vra; /* Vibrato rate */ - int vsw; /* Vibrato sweep */ - int rvv; /* Random volume/pan variation (IT) */ - int sid; /* Sample number */ -#define XMP_INST_NNA_CUT 0x00 -#define XMP_INST_NNA_CONT 0x01 -#define XMP_INST_NNA_OFF 0x02 -#define XMP_INST_NNA_FADE 0x03 - int nna; /* New note action */ -#define XMP_INST_DCT_OFF 0x00 -#define XMP_INST_DCT_NOTE 0x01 -#define XMP_INST_DCT_SMP 0x02 -#define XMP_INST_DCT_INST 0x03 - int dct; /* Duplicate check type */ -#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT -#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF -#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE - int dca; /* Duplicate check action */ - int ifc; /* Initial filter cutoff */ - int ifr; /* Initial filter resonance */ - } *sub; + struct xmp_subinstrument *sub; void *extra; /* Extra fields */ }; @@ -276,6 +284,19 @@ struct xmp_module_info { struct xmp_sequence *seq_data; /* Pointer to sequence data */ }; +struct xmp_channel_info { + unsigned int period; /* Sample period (* 4096) */ + unsigned int position; /* Sample position */ + short pitchbend; /* Linear bend from base note*/ + unsigned char note; /* Current base note number */ + unsigned char instrument; /* Current instrument number */ + unsigned char sample; /* Current sample number */ + unsigned char volume; /* Current volume */ + unsigned char pan; /* Current stereo pan */ + unsigned char reserved; /* Reserved */ + struct xmp_event event; /* Current track event */ +}; + struct xmp_frame_info { /* Current frame information */ int pos; /* Current position */ int pattern; /* Current pattern */ @@ -296,32 +317,40 @@ struct xmp_frame_info { /* Current frame information */ int virt_used; /* Used virtual channels */ int sequence; /* Current sequence */ - struct xmp_channel_info { /* Current channel information */ - unsigned int period; /* Sample period (* 4096) */ - unsigned int position; /* Sample position */ - short pitchbend; /* Linear bend from base note*/ - unsigned char note; /* Current base note number */ - unsigned char instrument; /* Current instrument number */ - unsigned char sample; /* Current sample number */ - unsigned char volume; /* Current volume */ - unsigned char pan; /* Current stereo pan */ - unsigned char reserved; /* Reserved */ - struct xmp_event event; /* Current track event */ - } channel_info[XMP_MAX_CHANNELS]; + struct xmp_channel_info channel_info[XMP_MAX_CHANNELS]; /* Current channel information */ }; +struct xmp_callbacks { + unsigned long (*read_func)(void *dest, unsigned long len, + unsigned long nmemb, void *priv); + int (*seek_func)(void *priv, long offset, int whence); + long (*tell_func)(void *priv); + int (*close_func)(void *priv); +}; typedef char *xmp_context; -LIBXMP_EXPORT extern const char *xmp_version; -LIBXMP_EXPORT extern const unsigned int xmp_vercode; +LIBXMP_EXPORT_VAR extern const char *xmp_version; +LIBXMP_EXPORT_VAR extern const unsigned int xmp_vercode; + +LIBXMP_EXPORT int xmp_syserrno (void); LIBXMP_EXPORT xmp_context xmp_create_context (void); LIBXMP_EXPORT void xmp_free_context (xmp_context); -LIBXMP_EXPORT int xmp_test_module (char *, struct xmp_test_info *); -LIBXMP_EXPORT int xmp_load_module (xmp_context, char *); + +LIBXMP_EXPORT int xmp_load_module (xmp_context, const char *); +LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, const void *, long); +LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); +LIBXMP_EXPORT int xmp_load_module_from_callbacks (xmp_context, void *, struct xmp_callbacks); + +LIBXMP_EXPORT int xmp_test_module (const char *, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_memory (const void *, long, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_file (void *, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_callbacks (void *, struct xmp_callbacks, struct xmp_test_info *); + LIBXMP_EXPORT void xmp_scan_module (xmp_context); LIBXMP_EXPORT void xmp_release_module (xmp_context); + LIBXMP_EXPORT int xmp_start_player (xmp_context, int, int); LIBXMP_EXPORT int xmp_play_frame (xmp_context); LIBXMP_EXPORT int xmp_play_buffer (xmp_context, void *, int, int); @@ -329,7 +358,7 @@ LIBXMP_EXPORT void xmp_get_frame_info (xmp_context, struct xmp_frame_inf LIBXMP_EXPORT void xmp_end_player (xmp_context); LIBXMP_EXPORT void xmp_inject_event (xmp_context, int, struct xmp_event *); LIBXMP_EXPORT void xmp_get_module_info (xmp_context, struct xmp_module_info *); -LIBXMP_EXPORT char **xmp_get_format_list (void); +LIBXMP_EXPORT const char *const *xmp_get_format_list (void); LIBXMP_EXPORT int xmp_next_position (xmp_context); LIBXMP_EXPORT int xmp_prev_position (xmp_context); LIBXMP_EXPORT int xmp_set_position (xmp_context, int); @@ -342,9 +371,7 @@ LIBXMP_EXPORT int xmp_channel_mute (xmp_context, int, int); LIBXMP_EXPORT int xmp_channel_vol (xmp_context, int, int); LIBXMP_EXPORT int xmp_set_player (xmp_context, int, int); LIBXMP_EXPORT int xmp_get_player (xmp_context, int); -LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, char *); -LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, void *, long); -LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); +LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, const char *); /* External sample mixer API */ LIBXMP_EXPORT int xmp_start_smix (xmp_context, int, int); @@ -352,7 +379,7 @@ LIBXMP_EXPORT void xmp_end_smix (xmp_context); LIBXMP_EXPORT int xmp_smix_play_instrument(xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_play_sample (xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_channel_pan (xmp_context, int, int); -LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, char *); +LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, const char *); LIBXMP_EXPORT int xmp_smix_release_sample (xmp_context, int); #ifdef __cplusplus diff --git a/MacOSX/codecs/lib/libFLAC.dylib b/MacOSX/codecs/lib/libFLAC.dylib index face0420..b9e7d7c1 100755 Binary files a/MacOSX/codecs/lib/libFLAC.dylib and b/MacOSX/codecs/lib/libFLAC.dylib differ diff --git a/MacOSX/codecs/lib/libmad.dylib b/MacOSX/codecs/lib/libmad.dylib index 98f98d98..331e647d 100755 Binary files a/MacOSX/codecs/lib/libmad.dylib and b/MacOSX/codecs/lib/libmad.dylib differ diff --git a/MacOSX/codecs/lib/libmikmod.dylib b/MacOSX/codecs/lib/libmikmod.dylib index e28462c8..bbffac6b 100755 Binary files a/MacOSX/codecs/lib/libmikmod.dylib and b/MacOSX/codecs/lib/libmikmod.dylib differ diff --git a/MacOSX/codecs/lib/libmpg123.dylib b/MacOSX/codecs/lib/libmpg123.dylib index 951f8460..ed407741 100755 Binary files a/MacOSX/codecs/lib/libmpg123.dylib and b/MacOSX/codecs/lib/libmpg123.dylib differ diff --git a/MacOSX/codecs/lib/libopusfile.dylib b/MacOSX/codecs/lib/libopusfile.dylib index c3abf290..49d4c9d4 100755 Binary files a/MacOSX/codecs/lib/libopusfile.dylib and b/MacOSX/codecs/lib/libopusfile.dylib differ diff --git a/MacOSX/codecs/lib/libvorbis.dylib b/MacOSX/codecs/lib/libvorbis.dylib index 06575941..0aad3213 100755 Binary files a/MacOSX/codecs/lib/libvorbis.dylib and b/MacOSX/codecs/lib/libvorbis.dylib differ diff --git a/MacOSX/codecs/lib/libvorbisfile.dylib b/MacOSX/codecs/lib/libvorbisfile.dylib index a355dc51..fa789bb7 100755 Binary files a/MacOSX/codecs/lib/libvorbisfile.dylib and b/MacOSX/codecs/lib/libvorbisfile.dylib differ diff --git a/MacOSX/codecs/lib/libxmp.dylib b/MacOSX/codecs/lib/libxmp.dylib index ef0d97fa..db4fa361 100755 Binary files a/MacOSX/codecs/lib/libxmp.dylib and b/MacOSX/codecs/lib/libxmp.dylib differ diff --git a/Quake/Makefile b/Quake/Makefile index 9304ed61..326a3f0f 100644 --- a/Quake/Makefile +++ b/Quake/Makefile @@ -49,6 +49,7 @@ CC ?= gcc LINKER = $(CC) STRIP ?= strip +PKG_CONFIG ?= pkg-config #CPUFLAGS= -mtune=i686 #CPUFLAGS= -march=pentium4 @@ -160,9 +161,9 @@ ifeq ($(USE_CODEC_OPUS),1) # but they include the headers without the opus directory # prefix and rely on pkg-config. ewww... CFLAGS+= -DUSE_CODEC_OPUS -CFLAGS+= $(shell pkg-config --cflags opusfile) -CODECLIBS+= $(shell pkg-config --libs opusfile) -CODECLIBS+= $(shell pkg-config --libs opus) +CFLAGS+= $(shell $(PKG_CONFIG) --cflags opusfile) +CODECLIBS+= $(shell $(PKG_CONFIG) --libs opusfile) +CODECLIBS+= $(shell $(PKG_CONFIG) --libs opus) endif ifeq ($(USE_CODEC_VORBIS),1) CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec) diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin index d1170215..8bca487a 100644 --- a/Quake/Makefile.darwin +++ b/Quake/Makefile.darwin @@ -80,6 +80,11 @@ CFLAGS +=-mmacosx-version-min=10.6 LDFLAGS +=-mmacosx-version-min=10.6 -Wl,-lbundle1.o USE_RPATH=1 endif +ifeq ($(MACH_TYPE),arm64) +CFLAGS +=-mmacosx-version-min=11.0 +LDFLAGS +=-mmacosx-version-min=11.0 +USE_RPATH=1 +endif CFLAGS += $(CPUFLAGS) ifeq ($(USE_RPATH),1) LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks @@ -107,6 +112,7 @@ endif ifeq ($(USE_SDL2),1) CFLAGS += -DUSE_SDL2 endif +CFLAGS += -DGL_SILENCE_DEPRECATION=1 # not relying on sdl-config command and assuming # /Library/Frameworks/SDL.framework is available diff --git a/Quake/Makefile.w32 b/Quake/Makefile.w32 index 2f5d187d..c8ee1778 100644 --- a/Quake/Makefile.w32 +++ b/Quake/Makefile.w32 @@ -168,7 +168,7 @@ CFLAGS+= -DUSE_CODEC_UMX endif CFLAGS+= $(CODEC_INC) -COMMON_LIBS:= -lm -lopengl32 -lwinmm +COMMON_LIBS:= -lopengl32 -lwinmm ifeq ($(USE_ZLIB),1) CFLAGS+= -DUSE_ZLIB diff --git a/Quake/Makefile.w64 b/Quake/Makefile.w64 index ce7a8a5c..1a9dad5a 100644 --- a/Quake/Makefile.w64 +++ b/Quake/Makefile.w64 @@ -166,7 +166,7 @@ CFLAGS+= -DUSE_CODEC_UMX endif CFLAGS+= $(CODEC_INC) -COMMON_LIBS:= -lm -lopengl32 -lwinmm +COMMON_LIBS:= -lopengl32 -lwinmm ifeq ($(USE_ZLIB),1) CFLAGS+= -DUSE_ZLIB diff --git a/Quake/OWMakefile.win32 b/Quake/OWMakefile.win32 index ec95772e..f8cfc488 100644 --- a/Quake/OWMakefile.win32 +++ b/Quake/OWMakefile.win32 @@ -238,9 +238,7 @@ OBJS = strlcat.obj & # 1 MB stack size. quakespasm.exe: $(OBJS) quakespasm.res - wlink N $@ SYS NT_WIN OPTION q OPTION STACK=0x100000 LIBR {$(LIBS)} F {$(OBJS)} - wrc -q $^*.res + wlink N $@ SYS NT_WIN OPTION q OPTION STACK=0x100000 OPTION RESOURCE=$^*.res LIBR {$(LIBS)} F {$(OBJS)} clean: .symbolic rm -f *.obj *.res *.err quakespasm.exe - diff --git a/Quake/bgmusic.c b/Quake/bgmusic.c index 65df3ca9..03dba8ba 100644 --- a/Quake/bgmusic.c +++ b/Quake/bgmusic.c @@ -76,14 +76,11 @@ static snd_stream_t *bgmstream = NULL; static void BGM_Play_f (void) { - if (Cmd_Argc() == 2) - { + if (Cmd_Argc() == 2) { BGM_Play (Cmd_Argv(1)); } - else - { + else { Con_Printf ("music \n"); - return; } } @@ -99,16 +96,17 @@ static void BGM_Resume_f (void) static void BGM_Loop_f (void) { - if (Cmd_Argc() == 2) - { + if (Cmd_Argc() == 2) { if (q_strcasecmp(Cmd_Argv(1), "0") == 0 || q_strcasecmp(Cmd_Argv(1),"off") == 0) bgmloop = false; else if (q_strcasecmp(Cmd_Argv(1), "1") == 0 || - q_strcasecmp(Cmd_Argv(1),"on") == 0) + q_strcasecmp(Cmd_Argv(1),"on") == 0) bgmloop = true; else if (q_strcasecmp(Cmd_Argv(1),"toggle") == 0) bgmloop = !bgmloop; + + if (bgmstream) bgmstream->loop = bgmloop; } if (bgmloop) @@ -122,6 +120,16 @@ static void BGM_Stop_f (void) BGM_Stop(); } +static void BGM_Jump_f (void) +{ + if (Cmd_Argc() != 2) { + Con_Printf ("music_jump \n"); + } + else if (bgmstream) { + S_CodecJumpToOrder(bgmstream, atoi(Cmd_Argv(1))); + } +} + qboolean BGM_Init (void) { music_handler_t *handlers = NULL; @@ -133,6 +141,7 @@ qboolean BGM_Init (void) Cmd_AddCommand("music_resume", BGM_Resume_f); Cmd_AddCommand("music_loop", BGM_Loop_f); Cmd_AddCommand("music_stop", BGM_Stop_f); + Cmd_AddCommand("music_jump", BGM_Jump_f); if (COM_CheckParm("-noextmusic") != 0) no_extmusic = true; @@ -206,7 +215,7 @@ static void BGM_Play_noext (const char *filename, unsigned int allowed_types) /* not supported in quake */ break; case BGM_STREAMER: - bgmstream = S_CodecOpenStreamType(tmp, handler->type); + bgmstream = S_CodecOpenStreamType(tmp, handler->type, bgmloop); if (bgmstream) return; /* success */ break; @@ -264,7 +273,7 @@ void BGM_Play (const char *filename) /* not supported in quake */ break; case BGM_STREAMER: - bgmstream = S_CodecOpenStreamType(tmp, handler->type); + bgmstream = S_CodecOpenStreamType(tmp, handler->type, bgmloop); if (bgmstream) return; /* success */ break; @@ -329,7 +338,7 @@ void BGM_PlayCDtrack (byte track, qboolean looping) { q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s", MUSIC_DIRNAME, (int)track, ext); - bgmstream = S_CodecOpenStreamType(tmp, type); + bgmstream = S_CodecOpenStreamType(tmp, type, bgmloop); if (! bgmstream) Con_Printf("Couldn't handle music file %s\n", tmp); } diff --git a/Quake/cl_parse.c b/Quake/cl_parse.c index fc0a8f3b..734697b6 100644 --- a/Quake/cl_parse.c +++ b/Quake/cl_parse.c @@ -91,7 +91,7 @@ const char *svc_strings[128] = //spike -- particle stuff, and padded to 128 to avoid possible crashes. "50 svc_downloaddata_dp", // 50 "51 svc_updatestatbyte", // 51 - "52 svc_effect_dp", // 52 + "52 svc_effect_dp/svc_achievement_qx", // 52 "53 svc_effect2_dp", // 53 "54 svc_precache", // 54 //[short] type+idx [string] name "55 svc_baseline2_dp", // 55 @@ -2759,11 +2759,21 @@ void CL_ParseServerMessage (void) Con_DPrintf("Ignoring svcdp_hidepic\n"); break; - case svcdp_effect: + case 52: + if (cl.protocol == PROTOCOL_VERSION_DP7) + { //svcdp_effect + CL_ParseEffect(false); + } + else + { //2021 release: svc_achievement + str = MSG_ReadString(); + Con_DPrintf("Ignoring svc_achievement (%s)\n", str); + } + break; case svcdp_effect2: //these are kinda pointless when the particle system can do it if (cl.protocol != PROTOCOL_VERSION_DP7) - Host_Error ("Received svcdp_effect[1|2] but extension not active"); - CL_ParseEffect(cmd==svcdp_effect2); + Host_Error ("Received svcdp_effect2 but extension not active"); + CL_ParseEffect(true); break; case svcdp_csqcentities: //FTE uses DP's svc number for nq, because compat (despite fte's svc being first). same payload either way. if (!(cl.protocol_pext2 & PEXT2_REPLACEMENTDELTAS) && cl.protocol != PROTOCOL_VERSION_DP7) diff --git a/Quake/cmd.c b/Quake/cmd.c index 771491cd..179ccc46 100644 --- a/Quake/cmd.c +++ b/Quake/cmd.c @@ -353,7 +353,7 @@ void Cmd_Alias_f (void) return; } - // if the alias allready exists, reuse it + // if the alias already exists, reuse it for (a = cmd_alias ; a ; a=a->next) { if (!strcmp(s, a->name)) diff --git a/Quake/common.c b/Quake/common.c index f70f3a44..c478124c 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -305,7 +305,7 @@ void Q_memset (void *dest, int fill, size_t count) { size_t i; - if ( (((size_t)dest | count) & 3) == 0) + if ( (((uintptr_t)dest | count) & 3) == 0) { count >>= 2; fill = fill | (fill<<8) | (fill<<16) | (fill<<24); @@ -321,7 +321,7 @@ void Q_memcpy (void *dest, const void *src, size_t count) { size_t i; - if (( ( (size_t)dest | (size_t)src | count) & 3) == 0 ) + if (( ( (uintptr_t)dest | (uintptr_t)src | count) & 3) == 0) { count >>= 2; for (i = 0; i < count; i++) @@ -2138,6 +2138,7 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file, && strcmp(ext, "jpeg") != 0 && strcmp(ext, "dds") != 0 && strcmp(ext, "lit") != 0 + && strcmp(ext, "vis") != 0 && strcmp(ext, "ent") != 0) Con_DPrintf ("FindFile: can't find %s\n", filename); else Con_DPrintf2("FindFile: can't find %s\n", filename); @@ -2989,6 +2990,7 @@ static void COM_Game_f (void) //clear out and reload appropriate data Cache_Flush (); Mod_ResetAll(); + Sky_ClearAll(); if (!isDedicated) Draw_ReloadTextures(true); ExtraMaps_NewGame (); diff --git a/Quake/gl_model.c b/Quake/gl_model.c index ba70a221..d7b90dbc 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -39,6 +39,7 @@ qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash); cvar_t external_ents = {"external_ents", "1", CVAR_ARCHIVE}; cvar_t gl_load24bit = {"gl_load24bit", "1", CVAR_ARCHIVE}; cvar_t mod_ignorelmscale = {"mod_ignorelmscale", "0"}; +cvar_t external_vis = {"external_vis", "1", CVAR_ARCHIVE}; static byte *mod_novis; static int mod_novis_capacity; @@ -61,6 +62,7 @@ Mod_Init void Mod_Init (void) { Cvar_RegisterVariable (&gl_subdivide_size); + Cvar_RegisterVariable (&external_vis); Cvar_RegisterVariable (&external_ents); Cvar_RegisterVariable (&gl_load24bit); Cvar_RegisterVariable (&mod_ignorelmscale); @@ -846,7 +848,7 @@ void Mod_LoadTextures (lump_t *l) if (!tx || tx->name[0] != '+') continue; if (tx->anim_next) - continue; // allready sequenced + continue; // already sequenced // find the number of frames in the animation memset (anims, 0, sizeof(anims)); @@ -1236,7 +1238,6 @@ void Mod_LoadTexinfo (lump_t *l) texinfo_t *in; mtexinfo_t *out; int i, j, count, miptex; - float len1, len2; int missing = 0; //johnfitz in = (texinfo_t *)(mod_base + l->fileofs); @@ -1255,23 +1256,6 @@ void Mod_LoadTexinfo (lump_t *l) out->vecs[0][j] = LittleFloat (in->vecs[0][j]); out->vecs[1][j] = LittleFloat (in->vecs[1][j]); } - len1 = VectorLength (out->vecs[0]); - len2 = VectorLength (out->vecs[1]); - len1 = (len1 + len2)/2; - if (len1 < 0.32) - out->mipadjust = 4; - else if (len1 < 0.49) - out->mipadjust = 3; - else if (len1 < 0.99) - out->mipadjust = 2; - else - out->mipadjust = 1; -#if 0 - if (len1 + len2 < 0.001) - out->mipadjust = 1; // don't crash - else - out->mipadjust = 1 / floor((len1+len2)/2 + 0.1); -#endif miptex = LittleLong (in->miptex); out->flags = LittleLong (in->flags); @@ -2171,10 +2155,10 @@ void Mod_LoadClipnodes (lump_t *l, qboolean bsp2) { out->planenum = LittleLong(ins->planenum); - //johnfitz -- bounds check - if (out->planenum < 0 || out->planenum >= loadmodel->numplanes) - Host_Error ("Mod_LoadClipnodes: planenum out of bounds"); - //johnfitz + //johnfitz -- bounds check + if (out->planenum < 0 || out->planenum >= loadmodel->numplanes) + Host_Error ("Mod_LoadClipnodes: planenum out of bounds"); + //johnfitz //johnfitz -- support clipnodes > 32k out->children[0] = (unsigned short)LittleShort(ins->children[0]); @@ -2522,6 +2506,101 @@ void Mod_BoundsFromClipNode (qmodel_t *mod, int hull, int nodenum) Mod_BoundsFromClipNode (mod, hull, node->children[1]); } +/* EXTERNAL VIS FILE SUPPORT: + */ +typedef struct vispatch_s +{ + char mapname[32]; + int filelen; // length of data after header (VIS+Leafs) +} vispatch_t; +#define VISPATCH_HEADER_LEN 36 + +static FILE *Mod_FindVisibilityExternal(void) +{ + vispatch_t header; + char visfilename[MAX_QPATH]; + const char* shortname; + unsigned int path_id; + FILE *f; + long pos; + size_t r; + + q_snprintf(visfilename, sizeof(visfilename), "maps/%s.vis", loadname); + if (COM_FOpenFile(visfilename, &f, &path_id) < 0) + { + Con_DPrintf("%s not found, trying ", visfilename); + q_snprintf(visfilename, sizeof(visfilename), "%s.vis", COM_SkipPath(com_gamedir)); + Con_DPrintf("%s\n", visfilename); + if (COM_FOpenFile(visfilename, &f, &path_id) < 0) + { + Con_DPrintf("external vis not found\n"); + return NULL; + } + } + if (path_id < loadmodel->path_id) + { + fclose(f); + Con_DPrintf("ignored %s from a gamedir with lower priority\n", visfilename); + return NULL; + } + + Con_DPrintf("Found external VIS %s\n", visfilename); + + shortname = COM_SkipPath(loadmodel->name); + pos = 0; + while ((r = fread(&header, 1, VISPATCH_HEADER_LEN, f)) == VISPATCH_HEADER_LEN) + { + header.filelen = LittleLong(header.filelen); + if (header.filelen <= 0) { /* bad entry -- don't trust the rest. */ + fclose(f); + return NULL; + } + if (!q_strcasecmp(header.mapname, shortname)) + break; + pos += header.filelen + VISPATCH_HEADER_LEN; + fseek(f, pos, SEEK_SET); + } + if (r != VISPATCH_HEADER_LEN) { + fclose(f); + Con_DPrintf("%s not found in %s\n", shortname, visfilename); + return NULL; + } + + return f; +} + +static byte *Mod_LoadVisibilityExternal(FILE* f) +{ + int filelen; + byte* visdata; + + filelen = 0; + fread(&filelen, 1, 4, f); + filelen = LittleLong(filelen); + if (filelen <= 0) return NULL; + Con_DPrintf("...%d bytes visibility data\n", filelen); + visdata = (byte *) Hunk_AllocName(filelen, "EXT_VIS"); + if (!fread(visdata, filelen, 1, f)) + return NULL; + return visdata; +} + +static void Mod_LoadLeafsExternal(FILE* f) +{ + int filelen; + void* in; + + filelen = 0; + fread(&filelen, 1, 4, f); + filelen = LittleLong(filelen); + if (filelen <= 0) return; + Con_DPrintf("...%d bytes leaf data\n", filelen); + in = Hunk_AllocName(filelen, "EXT_LEAF"); + if (!fread(in, filelen, 1, f)) + return; + Mod_ProcessLeafs_S((dsleaf_t *)in, filelen); +} + /* ================= Mod_LoadBrushModel @@ -2578,8 +2657,33 @@ void Mod_LoadBrushModel (qmodel_t *mod, void *buffer) Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]); //Spike: moved this earlier, so that we can parse worldspawn keys earlier. Mod_LoadFaces (&header->lumps[LUMP_FACES], bsp2); Mod_LoadMarksurfaces (&header->lumps[LUMP_MARKSURFACES], bsp2); + + if (!bsp2 && external_vis.value && sv.modelname[0] && !q_strcasecmp(loadname, sv.name)) + { + FILE* fvis; + Con_DPrintf("trying to open external vis file\n"); + fvis = Mod_FindVisibilityExternal(); + if (fvis) { + int mark = Hunk_LowMark(); + loadmodel->leafs = NULL; + loadmodel->numleafs = 0; + Con_DPrintf("found valid external .vis file for map\n"); + loadmodel->visdata = Mod_LoadVisibilityExternal(fvis); + if (loadmodel->visdata) { + Mod_LoadLeafsExternal(fvis); + } + fclose(fvis); + if (loadmodel->visdata && loadmodel->leafs && loadmodel->numleafs) { + goto visdone; + } + Hunk_FreeToLowMark(mark); + Con_DPrintf("External VIS data failed, using standard vis.\n"); + } + } + Mod_LoadVisibility (&header->lumps[LUMP_VISIBILITY]); Mod_LoadLeafs (&header->lumps[LUMP_LEAFS], bsp2); +visdone: Mod_LoadNodes (&header->lumps[LUMP_NODES], bsp2); Mod_LoadClipnodes (&header->lumps[LUMP_CLIPNODES], bsp2); Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]); diff --git a/Quake/gl_model.h b/Quake/gl_model.h index 992d1207..e50ef0df 100644 --- a/Quake/gl_model.h +++ b/Quake/gl_model.h @@ -115,7 +115,6 @@ typedef struct typedef struct { float vecs[2][4]; - float mipadjust; texture_t *texture; int flags; } mtexinfo_t; @@ -133,7 +132,6 @@ typedef struct glpoly_s typedef struct msurface_s { int visframe; // should be drawn when node is crossed - qboolean culled; // johnfitz -- for frustum culling float mins[3]; // johnfitz -- for frustum culling float maxs[3]; // johnfitz -- for frustum culling diff --git a/Quake/gl_rmain.c b/Quake/gl_rmain.c index aed15fb1..618fb135 100644 --- a/Quake/gl_rmain.c +++ b/Quake/gl_rmain.c @@ -277,48 +277,21 @@ qboolean R_CullBox (vec3_t emins, vec3_t emaxs) { int i; mplane_t *p; + byte signbits; + float vec[3]; for (i = 0;i < 4;i++) { p = frustum + i; - switch(p->signbits) - { - default: - case 0: - if (p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2] < p->dist) - return true; - break; - case 1: - if (p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2] < p->dist) - return true; - break; - case 2: - if (p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2] < p->dist) - return true; - break; - case 3: - if (p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2] < p->dist) - return true; - break; - case 4: - if (p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2] < p->dist) - return true; - break; - case 5: - if (p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2] < p->dist) - return true; - break; - case 6: - if (p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2] < p->dist) - return true; - break; - case 7: - if (p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2] < p->dist) - return true; - break; - } + signbits = p->signbits; + vec[0] = ((signbits % 2)<1) ? emaxs[0] : emins[0]; + vec[1] = ((signbits % 4)<2) ? emaxs[1] : emins[1]; + vec[2] = ((signbits % 8)<4) ? emaxs[2] : emins[2]; + if (p->normal[0]*vec[0] + p->normal[1]*vec[1] + p->normal[2]*vec[2] < p->dist) + return true; } return false; } + /* =============== R_CullModelForEntity -- johnfitz -- uses correct bounds based on rotation @@ -643,8 +616,6 @@ void R_SetupView (void) { R_MarkSurfaces (); //johnfitz -- create texture chains from PVS - R_CullSurfaces (); //johnfitz -- do after R_SetFrustum and R_MarkSurfaces - if (!skyroom_drawn) R_UpdateWarpTextures (); //johnfitz -- do this before R_Clear } diff --git a/Quake/gl_rmisc.c b/Quake/gl_rmisc.c index 5724a85c..80ba6089 100644 --- a/Quake/gl_rmisc.c +++ b/Quake/gl_rmisc.c @@ -86,17 +86,6 @@ static void R_SetClearColor_f (cvar_t *var) glClearColor (rgb[0]/255.0,rgb[1]/255.0,rgb[2]/255.0,0); } -/* -==================== -R_Novis_f -- johnfitz -==================== -*/ -static void R_VisChanged (cvar_t *var) -{ - extern int vis_changed; - vis_changed = 1; -} - /* =============== R_Model_ExtraFlags_List_f -- johnfitz -- called when r_nolerp_list or r_noshadow_list cvar changes @@ -198,7 +187,6 @@ void R_Init (void) Cvar_SetCallback (&r_wateralpha, R_SetWateralpha_f); Cvar_RegisterVariable (&r_dynamic); Cvar_RegisterVariable (&r_novis); - Cvar_SetCallback (&r_novis, R_VisChanged); Cvar_RegisterVariable (&r_speeds); Cvar_RegisterVariable (&r_pos); @@ -223,7 +211,6 @@ void R_Init (void) Cvar_RegisterVariable (&r_drawflat); Cvar_RegisterVariable (&r_flatlightstyles); Cvar_RegisterVariable (&r_oldskyleaf); - Cvar_SetCallback (&r_oldskyleaf, R_VisChanged); Cvar_RegisterVariable (&r_drawworld); Cvar_RegisterVariable (&r_showtris); Cvar_RegisterVariable (&r_showbboxes); @@ -620,6 +607,7 @@ void R_DeleteShaders (void) } gl_num_programs = 0; } + GLuint current_array_buffer, current_element_array_buffer; /* @@ -635,7 +623,7 @@ void GL_BindBuffer (GLenum target, GLuint buffer) if (!gl_vbo_able) return; - + switch (target) { case GL_ARRAY_BUFFER: @@ -648,7 +636,7 @@ void GL_BindBuffer (GLenum target, GLuint buffer) Host_Error("GL_BindBuffer: unsupported target %d", (int)target); return; } - + if (*cache != buffer) { *cache = buffer; diff --git a/Quake/gl_sky.c b/Quake/gl_sky.c index 74642015..f15cb92c 100644 --- a/Quake/gl_sky.c +++ b/Quake/gl_sky.c @@ -231,6 +231,25 @@ void Sky_LoadSkyBox (const char *name) q_strlcpy(skybox_name, name, sizeof(skybox_name)); } +/* +================= +Sky_ClearAll + +Called on map unload/game change to avoid keeping pointers to freed data +================= +*/ +void Sky_ClearAll (void) +{ + int i; + + skyroom_enabled = false; + skybox_name[0] = 0; + for (i=0; i<6; i++) + skybox_textures[i] = NULL; + solidskytexture = NULL; + alphaskytexture = NULL; +} + /* ================= Sky_NewMap @@ -240,15 +259,7 @@ void Sky_NewMap (void) { char key[128], value[4096]; const char *data; - int i; - // - // initially no sky - // - skyroom_enabled = false; - skybox_name[0] = 0; - for (i=0; i<6; i++) - skybox_textures[i] = NULL; skyfog = r_skyfog.value; // @@ -636,8 +647,7 @@ void Sky_ProcessTextureChains (void) continue; for (s = t->texturechains[chain_world]; s; s = s->texturechain) - if (!s->culled) - Sky_ProcessPoly (s->polys); + Sky_ProcessPoly (s->polys); } } @@ -779,7 +789,7 @@ FIXME: eliminate cracks by adding an extra vert on tjuncs */ void Sky_DrawSkyBox (void) { - int i; + int i; for (i=0 ; i<6 ; i++) { @@ -989,7 +999,7 @@ void Sky_DrawFace (int axis) vec3_t verts[4]; int i, j, start; float di,qi,dj,qj; - vec3_t vup, vright, temp, temp2; + vec3_t up, right, temp, temp2; Sky_SetBoxVert(-1.0, -1.0, axis, verts[0]); Sky_SetBoxVert(-1.0, 1.0, axis, verts[1]); @@ -999,8 +1009,8 @@ void Sky_DrawFace (int axis) start = Hunk_LowMark (); p = (glpoly_t *) Hunk_Alloc(sizeof(glpoly_t)); - VectorSubtract(verts[2],verts[3],vup); - VectorSubtract(verts[2],verts[1],vright); + VectorSubtract(verts[2],verts[3],up); + VectorSubtract(verts[2],verts[1],right); di = q_max((int)r_sky_quality.value, 1); qi = 1.0 / di; @@ -1016,15 +1026,15 @@ void Sky_DrawFace (int axis) continue; //if (i&1 ^ j&1) continue; //checkerboard test - VectorScale (vright, qi*i, temp); - VectorScale (vup, qj*j, temp2); + VectorScale (right, qi*i, temp); + VectorScale (up, qj*j, temp2); VectorAdd(temp,temp2,temp); VectorAdd(verts[0],temp,p->verts[0]); - VectorScale (vup, qj, temp); + VectorScale (up, qj, temp); VectorAdd (p->verts[0],temp,p->verts[1]); - VectorScale (vright, qi, temp); + VectorScale (right, qi, temp); VectorAdd (p->verts[1],temp,p->verts[2]); VectorAdd (p->verts[0],temp,p->verts[3]); @@ -1066,7 +1076,7 @@ called once per frame before drawing anything else */ void Sky_DrawSky (void) { - int i; + int i; //in these special render modes, the sky faces are handled in the normal world/brush renderer if (r_drawflat_cheatsafe || r_lightmap_cheatsafe) @@ -1090,12 +1100,11 @@ void Sky_DrawSky (void) continue; for (s = t->texturechains[chain_world]; s; s = s->texturechain) - if (!s->culled) - { - DrawGLPoly(s->polys); - rs_brushpasses++; - Sky_ProcessPoly (s->polys); - } + { + DrawGLPoly(s->polys); + rs_brushpasses++; + Sky_ProcessPoly (s->polys); + } } glEnable (GL_TEXTURE_2D); glColorMask(true,true,true,true); @@ -1136,7 +1145,7 @@ void Sky_DrawSky (void) if (skybox_name[0]) Sky_DrawSkyBox (); else - Sky_DrawSkyLayers(); + Sky_DrawSkyLayers (); glDepthMask(1); glDepthFunc(GL_LEQUAL); diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index dce850d3..d09663ef 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -1544,13 +1544,10 @@ void TexMgr_ReloadImage (gltexture_t *glt, int shirt, int pants) mark = Hunk_LowMark (); if (glt->source_file[0] && glt->source_offset) - { - //lump inside file - long size; + { //lump inside file FILE *f; COM_FOpenFile(glt->source_file, &f, NULL); - if (!f) - goto invalid; + if (!f) goto invalid; fseek (f, glt->source_offset, SEEK_CUR); size = TexMgr_ImageSize(glt->source_width, glt->source_height, glt->source_format); @@ -1559,14 +1556,15 @@ void TexMgr_ReloadImage (gltexture_t *glt, int shirt, int pants) fclose (f); } else if (glt->source_file[0] && !glt->source_offset) - data = Image_LoadImage (glt->source_file, (int *)&glt->source_width, (int *)&glt->source_height, &fmt, &malloced); //simple file - else if (!glt->source_file[0] && glt->source_offset) - data = (byte *) glt->source_offset; //image in memory - - if (!data) { -invalid: - Con_Printf ("TexMgr_ReloadImage: invalid source for %s\n", glt->name); + data = Image_LoadImage (glt->source_file, (int *)&glt->source_width, (int *)&glt->source_height, &fmt, &malloced); //simple file + } + else if (!glt->source_file[0] && glt->source_offset) + { + data = (byte *) glt->source_offset; //image in memory + } + if (!data) { +invalid: Con_Printf ("TexMgr_ReloadImage: invalid source for %s\n", glt->name); Hunk_FreeToLowMark(mark); return; } diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index 68bd23f9..ab3826ae 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -668,10 +668,9 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb /* Make window fullscreen if needed, and show the window */ if (fullscreen) { - Uint32 flags = vid_desktopfullscreen.value ? - SDL_WINDOW_FULLSCREEN_DESKTOP : - SDL_WINDOW_FULLSCREEN; - if (SDL_SetWindowFullscreen (draw_context, flags) != 0) + const Uint32 flag = vid_desktopfullscreen.value ? + SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN; + if (SDL_SetWindowFullscreen (draw_context, flag) != 0) Sys_Error ("Couldn't set fullscreen state mode"); } @@ -1518,7 +1517,7 @@ static void VID_InitModelist (void) int bpps[] = {16, 24, 32}; // enumerate >8 bpp modes originalnummodes = nummodes = 0; - format.palette = NULL; + memset(&format, 0, sizeof(format)); // enumerate fullscreen modes flags = DEFAULT_SDL_FLAGS | SDL_FULLSCREEN; diff --git a/Quake/glquake.h b/Quake/glquake.h index 8d83462f..dd2af28c 100644 --- a/Quake/glquake.h +++ b/Quake/glquake.h @@ -344,7 +344,7 @@ struct lightmap_s // main memory so texsubimage can update properly byte *data;//[4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT]; }; -extern struct lightmap_s *lightmap; +extern struct lightmap_s *lightmaps; extern int lightmap_count; //allocated lightmaps extern int gl_warpimagesize; //johnfitz -- for water warp @@ -378,7 +378,6 @@ void R_NewGame (void); void CL_UpdateLightstyle(unsigned int idx, const char *stylestring); void R_AnimateLight (void); void R_MarkSurfaces (void); -void R_CullSurfaces (void); qboolean R_CullBox (vec3_t emins, vec3_t emaxs); void R_StoreEfrags (efrag_t **ppefrag); qboolean R_CullModelForEntity (entity_t *e); @@ -436,6 +435,7 @@ void DrawWaterPoly (glpoly_t *p); void GL_MakeAliasModelDisplayLists (qmodel_t *m, aliashdr_t *hdr); void Sky_Init (void); +void Sky_ClearAll (void); void Sky_DrawSky (void); void Sky_NewMap (void); void Sky_LoadTexture (texture_t *mt, enum srcformat fmt, unsigned int width, unsigned int height); diff --git a/Quake/host.c b/Quake/host.c index b93335d0..ce8de63f 100644 --- a/Quake/host.c +++ b/Quake/host.c @@ -85,6 +85,8 @@ cvar_t temp1 = {"temp1","0",CVAR_NONE}; cvar_t devstats = {"devstats","0",CVAR_NONE}; //johnfitz -- track developer statistics that vary every frame +cvar_t campaign = {"campaign","0",CVAR_NONE}; // for the 2021 rerelease + devstats_t dev_stats, dev_peakstats; overflowtimes_t dev_overflows; //this stores the last time overflow messages were displayed, not the last time overflows occured @@ -318,6 +320,8 @@ void Host_InitLocal (void) Cvar_RegisterVariable (&coop); Cvar_RegisterVariable (&deathmatch); + Cvar_RegisterVariable (&campaign); + Cvar_RegisterVariable (&pausable); Cvar_RegisterVariable (&temp1); @@ -609,6 +613,7 @@ void Host_ClearMemory (void) Con_DPrintf ("Clearing memory\n"); D_FlushCaches (); Mod_ClearAll (); + Sky_ClearAll(); /* host_hunklevel MUST be set at this point */ Hunk_FreeToLowMark (host_hunklevel); cls.signon = 0; diff --git a/Quake/host_cmd.c b/Quake/host_cmd.c index 0452aff7..4b51d8e2 100644 --- a/Quake/host_cmd.c +++ b/Quake/host_cmd.c @@ -1073,9 +1073,18 @@ void Host_SavegameComment (char *text) { int i; char kills[20]; + char *p1, *p2; for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++) text[i] = ' '; + +// Remove CR/LFs from level name to avoid broken saves, e.g. with autumn_sp map: +// https://celephais.net/board/view_thread.php?id=60452&start=3666 + p1 = strchr(cl.levelname, '\n'); + p2 = strchr(cl.levelname, '\r'); + if (p1 != NULL) *p1 = 0; + if (p2 != NULL) *p2 = 0; + memcpy (text, cl.levelname, q_min(strlen(cl.levelname),22)); //johnfitz -- only copy 22 chars. sprintf (kills,"kills:%3i/%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]); memcpy (text+22, kills, strlen(kills)); @@ -1085,6 +1094,8 @@ void Host_SavegameComment (char *text) if (text[i] == ' ') text[i] = '_'; } + if (p1 != NULL) *p1 = '\n'; + if (p2 != NULL) *p2 = '\r'; text[SAVEGAME_COMMENT_LENGTH] = '\0'; } @@ -1701,7 +1712,7 @@ void Host_Kill_f (void) if (sv_player->v.health <= 0) { - SV_ClientPrintf ("Can't suicide -- allready dead!\n"); + SV_ClientPrintf ("Can't suicide -- already dead!\n"); return; } @@ -1770,7 +1781,7 @@ void Host_PreSpawn_f (void) if (host_client->spawned) { - Con_Printf ("prespawn not valid -- allready spawned\n"); + Con_Printf ("prespawn not valid -- already spawned\n"); return; } @@ -1798,7 +1809,7 @@ void Host_Spawn_f (void) if (host_client->spawned) { - Con_Printf ("Spawn not valid -- allready spawned\n"); + Con_Printf ("Spawn not valid -- already spawned\n"); return; } @@ -1806,7 +1817,7 @@ void Host_Spawn_f (void) host_client->lastmovetime = qcvm->time; // run the entrance script if (sv.loadgame) - { // loaded games are fully inited allready + { // loaded games are fully inited already // if this is the last client to be connected, unpause sv.paused = false; } diff --git a/Quake/menu.c b/Quake/menu.c index eb67f5f3..5c7477dd 100644 --- a/Quake/menu.c +++ b/Quake/menu.c @@ -2700,6 +2700,13 @@ void M_ServerList_Key (int k) } +//============================================================================= +/* Credits menu -- used by the 2021 re-release */ + +void M_Menu_Credits_f (void) +{ +} + static struct { const char *name; @@ -2718,6 +2725,7 @@ static struct {"menu_video", M_Menu_Video_f}, {"help", M_Menu_Help_f}, {"menu_quit", M_Menu_Quit_f}, + {"menu_credits", M_Menu_Credits_f}, // needed by the 2021 re-release }; //============================================================================= diff --git a/Quake/net_dgrm.c b/Quake/net_dgrm.c index 7989934c..a7e97b20 100644 --- a/Quake/net_dgrm.c +++ b/Quake/net_dgrm.c @@ -820,7 +820,7 @@ static void Test_Poll (void *unused) break; if (MSG_ReadByte() != CCREP_PLAYER_INFO) - Sys_Error("Unexpected repsonse to Player Info request\n"); + Sys_Error("Unexpected response to Player Info request\n"); MSG_ReadByte(); /* playerNumber */ Q_strcpy(name, MSG_ReadString()); @@ -972,7 +972,7 @@ Reschedule: return; Error: - Con_Printf("Unexpected repsonse to Rule Info request\n"); + Con_Printf("Unexpected response to Rule Info request\n"); Done: dfunc.Close_Socket(test2Socket); test2InProgress = false; diff --git a/Quake/pl_osx.m b/Quake/pl_osx.m index e1022dd7..e9b1e4fe 100644 --- a/Quake/pl_osx.m +++ b/Quake/pl_osx.m @@ -42,6 +42,9 @@ void PL_VID_Shutdown (void) { } +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +#define NSPasteboardTypeString NSStringPboardType +#endif #define MAX_CLIPBOARDTXT MAXCMDLINE /* 256 */ char *PL_GetClipboardData (void) { @@ -49,8 +52,8 @@ char *PL_GetClipboardData (void) NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; NSArray* types = [pasteboard types]; - if ([types containsObject: NSStringPboardType]) { - NSString* clipboardString = [pasteboard stringForType: NSStringPboardType]; + if ([types containsObject: NSPasteboardTypeString]) { + NSString* clipboardString = [pasteboard stringForType: NSPasteboardTypeString]; if (clipboardString != NULL && [clipboardString length] > 0) { size_t sz = [clipboardString length] + 1; sz = q_min(MAX_CLIPBOARDTXT, sz); @@ -65,6 +68,9 @@ char *PL_GetClipboardData (void) return data; } +#ifndef MAC_OS_X_VERSION_10_12 +#define NSAlertStyleCritical NSCriticalAlertStyle +#endif void PL_ErrorDialog(const char *errorMsg) { #if (MAC_OS_X_VERSION_MIN_REQUIRED < 1040) /* ppc builds targeting 10.3 and older */ @@ -72,6 +78,14 @@ void PL_ErrorDialog(const char *errorMsg) #else NSString* msg = [NSString stringWithCString:errorMsg encoding:NSASCIIStringEncoding]; #endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030 NSRunCriticalAlertPanel (@"Quake Error", @"%@", @"OK", nil, nil, msg); +#else + NSAlert *alert = [[[NSAlert alloc] init] autorelease]; + alert.alertStyle = NSAlertStyleCritical; + alert.messageText = @"Quake Error"; + alert.informativeText = msg; + [alert runModal]; +#endif } diff --git a/Quake/pr_cmds.c b/Quake/pr_cmds.c index a39e1e3d..597e739c 100644 --- a/Quake/pr_cmds.c +++ b/Quake/pr_cmds.c @@ -1745,6 +1745,15 @@ void PF_Fixme (void); // PR_RunError ("unimplemented builtin"); //} +/* +============== +PF_finalefinished -- used by 2021 release. +============== +*/ +static void PF_finalefinished (void) +{ +} + void PR_spawnfunc_misc_model(edict_t *self) { eval_t *val; @@ -1853,7 +1862,10 @@ builtin_t pr_ssqcbuiltins[] = PF_sv_precache_sound, // precache_sound2 is different only for qcc PF_precache_file, - PF_sv_setspawnparms + PF_sv_setspawnparms, + + // 2021 release + PF_finalefinished, // void() finaleFinished = #79 }; int pr_ssqcnumbuiltins = sizeof(pr_ssqcbuiltins)/sizeof(pr_ssqcbuiltins[0]); @@ -2345,4 +2357,4 @@ builtin_t pr_menubuiltins[] = { PF_MenuCQExt, //#89 PF_cvar_defstring, //all other builtins will just have to use the extension system }; -int pr_menunumbuiltins = sizeof(pr_menubuiltins)/sizeof(pr_menubuiltins[0]); \ No newline at end of file +int pr_menunumbuiltins = sizeof(pr_menubuiltins)/sizeof(pr_menubuiltins[0]); diff --git a/Quake/progs.h b/Quake/progs.h index e9a8da91..331b51ee 100644 --- a/Quake/progs.h +++ b/Quake/progs.h @@ -374,6 +374,7 @@ struct qcvm_s qboolean cursorforced; void *cursorhandle; //video code. qboolean nogameaccess; //simplecsqc isn't allowed to poke properties of the actual game (to prevent cheats when there's no restrictions on what it can access) + qboolean brokenbouncemissile; //2021 rerelease redefined it, breaking any mod that depends on it. //was static inside pr_edict char *strings; diff --git a/Quake/protocol.h b/Quake/protocol.h index 03179518..7f776cae 100644 --- a/Quake/protocol.h +++ b/Quake/protocol.h @@ -347,6 +347,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define svcfte_updateentities 86 //spike -- end +//used by the 2021 rerelease +//Note: same value as svcdp_effect! +#define svcqx_achievement 52 // [string] id + // // client to server // diff --git a/Quake/q_stdinc.h b/Quake/q_stdinc.h index 9494b2e6..8d5a0e60 100644 --- a/Quake/q_stdinc.h +++ b/Quake/q_stdinc.h @@ -109,7 +109,7 @@ COMPILE_TIME_ASSERT(enum, sizeof(THE_DUMMY_ENUM) == sizeof(int)); * This variant works on most (but not *all*) systems... */ #ifndef offsetof -#define offsetof(t,m) ((size_t)&(((t *)0)->m)) +#define offsetof(t,m) ((intptr_t)&(((t *)0)->m)) #endif diff --git a/Quake/quakedef.h b/Quake/quakedef.h index e908fab8..56ea17e9 100644 --- a/Quake/quakedef.h +++ b/Quake/quakedef.h @@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define FITZQUAKE_VERSION 0.85 //johnfitz #define QUAKESPASM_VERSION 0.93 -#define QUAKESPASM_VER_PATCH 2 // helper to print a string like 0.93.2 +#define QUAKESPASM_VER_PATCH 3 // helper to print a string like 0.93.2 #ifndef QUAKESPASM_VER_SUFFIX #define QUAKESPASM_VER_SUFFIX // optional version suffix string literal like "-beta1" #endif diff --git a/Quake/quakespasm.pak b/Quake/quakespasm.pak index 52a5b103..bf15675d 100644 Binary files a/Quake/quakespasm.pak and b/Quake/quakespasm.pak differ diff --git a/Quake/r_brush.c b/Quake/r_brush.c index f5f8b30d..9d6ee731 100644 --- a/Quake/r_brush.c +++ b/Quake/r_brush.c @@ -32,7 +32,7 @@ int lightmap_bytes; qboolean lightmaps_latecached; #define MAX_SANITY_LIGHTMAPS (1u<<20) -struct lightmap_s *lightmap; +struct lightmap_s *lightmaps; int lightmap_count; int last_lightmap_allocated; int allocated[LMBLOCK_WIDTH]; @@ -666,8 +666,8 @@ void R_RenderDynamicLightmaps (qmodel_t *model, msurface_t *fa) return; // add to lightmap chain - fa->polys->chain = lightmap[fa->lightmaptexturenum].polys; - lightmap[fa->lightmaptexturenum].polys = fa->polys; + fa->polys->chain = lightmaps[fa->lightmaptexturenum].polys; + lightmaps[fa->lightmaptexturenum].polys = fa->polys; // check for lightmap modification for (maps=0; maps < MAXLIGHTMAPS && fa->styles[maps] != INVALID_LIGHTSTYLE; maps++) @@ -680,7 +680,7 @@ void R_RenderDynamicLightmaps (qmodel_t *model, msurface_t *fa) dynamic: if (r_dynamic.value) { - struct lightmap_s *lm = &lightmap[fa->lightmaptexturenum]; + struct lightmap_s *lm = &lightmaps[fa->lightmaptexturenum]; lm->modified = true; theRect = &lm->rectchange; if (fa->light_t < theRect->t) { @@ -727,20 +727,17 @@ int AllocBlock (int w, int h, int *x, int *y) if (texnum == lightmap_count) { lightmap_count++; - lightmap = (struct lightmap_s *) realloc(lightmap, sizeof(*lightmap)*lightmap_count); - memset(&lightmap[texnum], 0, sizeof(lightmap[texnum])); - /* FIXME: we leave 'gaps' in malloc()ed data, CRC_Block() later accesses - * that uninitialized data and valgrind complains for it. use calloc() ? */ - lightmap[texnum].data = (byte *) malloc(4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT); - memset(lightmap[texnum].data, 0, 4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT); + lightmaps = (struct lightmap_s *) realloc(lightmaps, sizeof(*lightmaps)*lightmap_count); + memset(&lightmaps[texnum], 0, sizeof(lightmaps[texnum])); + lightmaps[texnum].data = (byte *) calloc(1, 4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT); //as we're only tracking one texture, we don't need multiple copies of allocated any more. memset(allocated, 0, sizeof(allocated)); - lightmap[texnum].modified = true; - lightmap[texnum].rectchange.l = 0; - lightmap[texnum].rectchange.t = 0; - lightmap[texnum].rectchange.h = LMBLOCK_HEIGHT; - lightmap[texnum].rectchange.w = LMBLOCK_WIDTH; + lightmaps[texnum].modified = true; + lightmaps[texnum].rectchange.l = 0; + lightmaps[texnum].rectchange.t = 0; + lightmaps[texnum].rectchange.h = LMBLOCK_HEIGHT; + lightmaps[texnum].rectchange.w = LMBLOCK_WIDTH; } best = LMBLOCK_HEIGHT; @@ -796,7 +793,7 @@ void GL_CreateSurfaceLightmap (qmodel_t *model, msurface_t *surf) tmax = (surf->extents[1]>>surf->lmshift)+1; surf->lightmaptexturenum = AllocBlock (smax, tmax, &surf->light_s, &surf->light_t); - base = lightmap[surf->lightmaptexturenum].data; + base = lightmaps[surf->lightmaptexturenum].data; base += (surf->light_t * LMBLOCK_WIDTH + surf->light_s) * lightmap_bytes; R_BuildLightMap (model, surf, base, LMBLOCK_WIDTH*lightmap_bytes); } @@ -921,12 +918,12 @@ void GL_BuildLightmaps (void) //Spike -- wipe out all the lightmap data (johnfitz -- the gltexture objects were already freed by Mod_ClearAll) for (i=0; i < lightmap_count; i++) { - if (lightmap[i].texture) - TexMgr_FreeTexture(lightmap[i].texture); - free(lightmap[i].data); + if (lightmaps[i].texture) + TexMgr_FreeTexture(lightmaps[i].texture); + free(lightmaps[i].data); } - free(lightmap); - lightmap = NULL; + free(lightmaps); + lightmaps = NULL; last_lightmap_allocated = 0; lightmap_count = 0; @@ -964,7 +961,7 @@ void GL_BuildLightmaps (void) // for (i=0; imodified = false; lm->rectchange.l = LMBLOCK_WIDTH; lm->rectchange.t = LMBLOCK_HEIGHT; @@ -1316,7 +1313,7 @@ assumes lightmap texture is already bound */ static void R_UploadLightmap(int lmap) { - struct lightmap_s *lm = &lightmap[lmap]; + struct lightmap_s *lm = &lightmaps[lmap]; if (!lm->modified) return; @@ -1346,25 +1343,25 @@ void R_UploadLightmaps (void) for (lmap = 0; lmap < lightmap_count; lmap++) { - if (!lightmap[lmap].modified) + if (!lightmaps[lmap].modified) continue; - if (!lightmap[lmap].texture) + if (!lightmaps[lmap].texture) { char name[24]; sprintf(name, "lightmap%07i",lmap); - lightmap[lmap].texture = TexMgr_LoadImage (cl.worldmodel, name, LMBLOCK_WIDTH, LMBLOCK_HEIGHT, - SRC_LIGHTMAP, lightmap[lmap].data, "", (src_offset_t)lightmap[lmap].data, TEXPREF_LINEAR | TEXPREF_NOPICMIP); + lightmaps[lmap].texture = TexMgr_LoadImage (cl.worldmodel, name, LMBLOCK_WIDTH, LMBLOCK_HEIGHT, + SRC_LIGHTMAP, lightmaps[lmap].data, "", (src_offset_t)lightmaps[lmap].data, TEXPREF_LINEAR | TEXPREF_NOPICMIP); - lightmap[lmap].modified = false; - lightmap[lmap].rectchange.l = LMBLOCK_WIDTH; - lightmap[lmap].rectchange.t = LMBLOCK_HEIGHT; - lightmap[lmap].rectchange.h = 0; - lightmap[lmap].rectchange.w = 0; + lightmaps[lmap].modified = false; + lightmaps[lmap].rectchange.l = LMBLOCK_WIDTH; + lightmaps[lmap].rectchange.t = LMBLOCK_HEIGHT; + lightmaps[lmap].rectchange.h = 0; + lightmaps[lmap].rectchange.w = 0; } else { - GL_Bind (lightmap[lmap].texture); + GL_Bind (lightmaps[lmap].texture); R_UploadLightmap(lmap); } } @@ -1395,7 +1392,7 @@ void R_RebuildAllLightmaps (void) { if (fa->flags & SURF_DRAWTILED) continue; - base = lightmap[fa->lightmaptexturenum].data; + base = lightmaps[fa->lightmaptexturenum].data; base += fa->light_t * LMBLOCK_WIDTH * lightmap_bytes + fa->light_s * lightmap_bytes; R_BuildLightMap (mod, fa, base, LMBLOCK_WIDTH*lightmap_bytes); } @@ -1404,24 +1401,24 @@ void R_RebuildAllLightmaps (void) //for each lightmap, upload it for (i=0; inumtextures ; i++) if (mod->textures[i]) mod->textures[i]->texturechains[chain] = NULL; - + // clear lightmap chains for (i=0 ; itexinfo->texture->texturechains[chain] = surf; } +/* +================ +R_BackFaceCull -- johnfitz -- returns true if the surface is facing away from vieworg +================ +*/ +qboolean R_BackFaceCull (msurface_t *surf) +{ + double dot; + + if (surf->plane->type < 3) + dot = r_refdef.vieworg[surf->plane->type] - surf->plane->dist; + else + dot = DotProduct (r_refdef.vieworg, surf->plane->normal) - surf->plane->dist; + + if ((dot < 0) ^ !!(surf->flags & SURF_PLANEBACK)) + return true; + + return false; +} + /* =============== R_MarkSurfaces -- johnfitz -- mark surfaces based on PVS and rebuild texture chains @@ -78,15 +96,13 @@ void R_MarkSurfaces (void) { byte *vis; mleaf_t *leaf; - mnode_t *node; msurface_t *surf, **mark; int i, j; - unsigned int k; qboolean nearwaterportal; // clear lightmap chains for (i=0 ; ileafs[1]; - for (i=0 ; inumleafs ; i++, leaf++) - if (vis[i>>3] & (1<<(i&7))) - if (leaf->efrags) - R_StoreEfrags (&leaf->efrags); - return; - } - - vis_changed = false; r_visframecount++; - r_oldviewleaf = r_viewleaf; + + // set all chains to null + for (i=0 ; inumtextures ; i++) + if (cl.worldmodel->textures[i]) + cl.worldmodel->textures[i]->texturechains[chain_world] = NULL; // iterate through leaves, marking surfaces leaf = &cl.worldmodel->leafs[1]; @@ -124,146 +132,32 @@ void R_MarkSurfaces (void) { if (vis[i>>3] & (1<<(i&7))) { + if (R_CullBox(leaf->minmaxs, leaf->minmaxs + 3)) + continue; + if (r_oldskyleaf.value || leaf->contents != CONTENTS_SKY) for (j=0, mark = leaf->firstmarksurface; jnummarksurfaces; j++, mark++) - (*mark)->visframe = r_visframecount; + { + surf = *mark; + if (surf->visframe != r_visframecount) + { + surf->visframe = r_visframecount; + if (!R_CullBox(surf->mins, surf->maxs) && !R_BackFaceCull (surf)) + { + rs_brushpolys++; //count wpolys here + R_ChainSurface(surf, chain_world); + R_RenderDynamicLightmaps(cl.worldmodel, surf); + if (surf->texinfo->texture->warpimage) + surf->texinfo->texture->update_warp = true; + } + } + } // add static models if (leaf->efrags) R_StoreEfrags (&leaf->efrags); } } - - // set all chains to null - for (i=0 ; inumtextures ; i++) - if (cl.worldmodel->textures[i]) - cl.worldmodel->textures[i]->texturechains[chain_world] = NULL; - - // rebuild chains - -#if 1 - //iterate through surfaces one node at a time to rebuild chains - //need to do it this way if we want to work with tyrann's skip removal tool - //becuase his tool doesn't actually remove the surfaces from the bsp surfaces lump - //nor does it remove references to them in each leaf's marksurfaces list - for (i=0, node = cl.worldmodel->nodes ; inumnodes ; i++, node++) - for (k=0, surf=&cl.worldmodel->surfaces[node->firstsurface] ; knumsurfaces ; k++, surf++) - if (surf->visframe == r_visframecount) - { - R_ChainSurface(surf, chain_world); - } -#else - //the old way - surf = &cl.worldmodel->surfaces[cl.worldmodel->firstmodelsurface]; - for (i=0 ; inummodelsurfaces ; i++, surf++) - { - if (surf->visframe == r_visframecount) - { - R_ChainSurface(surf, chain_world); - } - } -#endif -} - -/* -================ -R_BackFaceCull -- johnfitz -- returns true if the surface is facing away from vieworg -================ -*/ -qboolean R_BackFaceCull (msurface_t *surf) -{ - double dot; - - switch (surf->plane->type) - { - case PLANE_X: - dot = r_refdef.vieworg[0] - surf->plane->dist; - break; - case PLANE_Y: - dot = r_refdef.vieworg[1] - surf->plane->dist; - break; - case PLANE_Z: - dot = r_refdef.vieworg[2] - surf->plane->dist; - break; - default: - dot = DotProduct (r_refdef.vieworg, surf->plane->normal) - surf->plane->dist; - break; - } - - if ((dot < 0) ^ !!(surf->flags & SURF_PLANEBACK)) - return true; - - return false; -} - -/* -================ -R_CullSurfaces -- johnfitz -================ -*/ -void R_CullSurfaces (void) -{ - msurface_t *s; - int i; - texture_t *t; - - if (!r_drawworld_cheatsafe) - return; - -// ericw -- instead of testing (s->visframe == r_visframecount) on all world -// surfaces, use the chained surfaces, which is exactly the same set of sufaces - for (i=0 ; inumtextures ; i++) - { - t = cl.worldmodel->textures[i]; - - if (!t || !t->texturechains[chain_world]) - continue; - - for (s = t->texturechains[chain_world]; s; s = s->texturechain) - { - if (R_CullBox(s->mins, s->maxs) || R_BackFaceCull (s)) - s->culled = true; - else - { - s->culled = false; - rs_brushpolys++; //count wpolys here - if (s->texinfo->texture->warpimage) - s->texinfo->texture->update_warp = true; - } - } - } -} - -/* -================ -R_BuildLightmapChains -- johnfitz -- used for r_lightmap 1 - -ericw -- now always used at the start of R_DrawTextureChains for the -mh dynamic lighting speedup -================ -*/ -void R_BuildLightmapChains (qmodel_t *model, texchain_t chain) -{ - texture_t *t; - msurface_t *s; - int i; - - // clear lightmap chains (already done in r_marksurfaces, but clearing them here to be safe becuase of r_stereo) - for (i=0 ; inumtextures ; i++) - { - t = model->textures[i]; - - if (!t || !t->texturechains[chain]) - continue; - - for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) - R_RenderDynamicLightmaps (model, s); - } } //============================================================================== @@ -325,19 +219,17 @@ void R_DrawTextureChains_ShowTris (qmodel_t *model, texchain_t chain) if (r_oldwater.value && t->texturechains[chain] && (t->texturechains[chain]->flags & SURF_DRAWTURB)) { for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) - for (p = s->polys->next; p; p = p->next) - { - DrawGLTriangleFan (p); - } + for (p = s->polys->next; p; p = p->next) + { + DrawGLTriangleFan (p); + } } else { for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) - { - DrawGLTriangleFan (s->polys); - } + { + DrawGLTriangleFan (s->polys); + } } } } @@ -363,25 +255,23 @@ void R_DrawTextureChains_Drawflat (qmodel_t *model, texchain_t chain) if (r_oldwater.value && t->texturechains[chain] && (t->texturechains[chain]->flags & SURF_DRAWTURB)) { for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) - for (p = s->polys->next; p; p = p->next) - { - srand((unsigned int) (uintptr_t) p); - glColor3f (rand()%256/255.0, rand()%256/255.0, rand()%256/255.0); - DrawGLPoly (p); - rs_brushpasses++; - } + for (p = s->polys->next; p; p = p->next) + { + srand((unsigned int) (uintptr_t) p); + glColor3f (rand()%256/255.0, rand()%256/255.0, rand()%256/255.0); + DrawGLPoly (p); + rs_brushpasses++; + } } else { for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) - { - srand((unsigned int) (uintptr_t) s->polys); - glColor3f (rand()%256/255.0, rand()%256/255.0, rand()%256/255.0); - DrawGLPoly (s->polys); - rs_brushpasses++; - } + { + srand((unsigned int) (uintptr_t) s->polys); + glColor3f (rand()%256/255.0, rand()%256/255.0, rand()%256/255.0); + DrawGLPoly (s->polys); + rs_brushpasses++; + } } } glColor3f (1,1,1); @@ -411,16 +301,15 @@ void R_DrawTextureChains_Glow (qmodel_t *model, entity_t *ent, texchain_t chain) bound = false; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture - { - GL_Bind (glt); - bound = true; - } - DrawGLPoly (s->polys); - rs_brushpasses++; + GL_Bind (glt); + bound = true; } + DrawGLPoly (s->polys); + rs_brushpasses++; + } } } @@ -498,10 +387,10 @@ static void R_BatchSurface (msurface_t *s) int num_surf_indices; num_surf_indices = R_NumTriangleIndicesForSurf (s); - + if (num_vbo_indices + num_surf_indices > MAX_BATCH_SIZE) R_FlushBatch(); - + R_TriangleIndicesForSurf (s, &vbo_indices[num_vbo_indices]); num_vbo_indices += num_surf_indices; } @@ -528,30 +417,29 @@ void R_DrawTextureChains_Multitexture (qmodel_t *model, entity_t *ent, texchain_ bound = false; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture - { - GL_Bind ((R_TextureAnimation(t, ent != NULL ? ent->frame : 0))->gltexture); + GL_Bind ((R_TextureAnimation(t, ent != NULL ? ent->frame : 0))->gltexture); - if (t->texturechains[chain]->flags & SURF_DRAWFENCE) - glEnable (GL_ALPHA_TEST); // Flip alpha test back on + if (t->texturechains[chain]->flags & SURF_DRAWFENCE) + glEnable (GL_ALPHA_TEST); // Flip alpha test back on - GL_EnableMultitexture(); // selects TEXTURE1 - bound = true; - } - GL_Bind (lightmap[s->lightmaptexturenum].texture); - glBegin(GL_POLYGON); - v = s->polys->verts[0]; - for (j=0 ; jpolys->numverts ; j++, v+= VERTEXSIZE) - { - GL_MTexCoord2fFunc (GL_TEXTURE0_ARB, v[3], v[4]); - GL_MTexCoord2fFunc (GL_TEXTURE1_ARB, v[5], v[6]); - glVertex3fv (v); - } - glEnd (); - rs_brushpasses++; + GL_EnableMultitexture(); // selects TEXTURE1 + bound = true; } + GL_Bind (lightmaps[s->lightmaptexturenum].texture); + glBegin(GL_POLYGON); + v = s->polys->verts[0]; + for (j=0 ; jpolys->numverts ; j++, v+= VERTEXSIZE) + { + GL_MTexCoord2fFunc (GL_TEXTURE0_ARB, v[3], v[4]); + GL_MTexCoord2fFunc (GL_TEXTURE1_ARB, v[5], v[6]); + glVertex3fv (v); + } + glEnd (); + rs_brushpasses++; + } GL_DisableMultitexture(); // selects TEXTURE0 if (bound && t->texturechains[chain]->flags & SURF_DRAWFENCE) @@ -583,16 +471,15 @@ void R_DrawTextureChains_NoTexture (qmodel_t *model, texchain_t chain) bound = false; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture - { - GL_Bind (t->gltexture); - bound = true; - } - DrawGLPoly (s->polys); - rs_brushpasses++; + GL_Bind (t->gltexture); + bound = true; } + DrawGLPoly (s->polys); + rs_brushpasses++; + } } } @@ -618,21 +505,20 @@ void R_DrawTextureChains_TextureOnly (qmodel_t *model, entity_t *ent, texchain_t bound = false; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture - { - GL_Bind ((R_TextureAnimation(t, ent != NULL ? ent->frame : 0))->gltexture); + GL_Bind ((R_TextureAnimation(t, ent != NULL ? ent->frame : 0))->gltexture); - if (t->texturechains[chain]->flags & SURF_DRAWFENCE) - glEnable (GL_ALPHA_TEST); // Flip alpha test back on + if (t->texturechains[chain]->flags & SURF_DRAWFENCE) + glEnable (GL_ALPHA_TEST); // Flip alpha test back on - bound = true; - } - DrawGLPoly (s->polys); - rs_brushpasses++; + bound = true; } - + DrawGLPoly (s->polys); + rs_brushpasses++; + } + if (bound && t->texturechains[chain]->flags & SURF_DRAWFENCE) glDisable (GL_ALPHA_TEST); // Flip alpha test back off } @@ -682,21 +568,20 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain bound = false; entalpha = 1.0f; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture - { - entalpha = GL_WaterAlphaForEntitySurface (ent, s); - R_BeginTransparentDrawing (entalpha); - GL_Bind (t->gltexture); - bound = true; - } - for (p = s->polys->next; p; p = p->next) - { - DrawWaterPoly (p); - rs_brushpasses++; - } + entalpha = GL_WaterAlphaForEntitySurface (ent, s); + R_BeginTransparentDrawing (entalpha); + GL_Bind (t->gltexture); + bound = true; } + for (p = s->polys->next; p; p = p->next) + { + DrawWaterPoly (p); + rs_brushpasses++; + } + } R_EndTransparentDrawing (entalpha); } } @@ -710,27 +595,26 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain bound = false; entalpha = 1.0f; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture + entalpha = GL_WaterAlphaForEntitySurface (ent, s); + R_BeginTransparentDrawing (entalpha); + GL_Bind (t->warpimage); + + if (model != cl.worldmodel) { - entalpha = GL_WaterAlphaForEntitySurface (ent, s); - R_BeginTransparentDrawing (entalpha); - GL_Bind (t->warpimage); - - if (model != cl.worldmodel) - { - // ericw -- this is copied from R_DrawSequentialPoly. - // If the poly is not part of the world we have to - // set this flag - t->update_warp = true; // FIXME: one frame too late! - } - - bound = true; + // ericw -- this is copied from R_DrawSequentialPoly. + // If the poly is not part of the world we have to + // set this flag + t->update_warp = true; // FIXME: one frame too late! } - DrawGLPoly (s->polys); - rs_brushpasses++; + + bound = true; } + DrawGLPoly (s->polys); + rs_brushpasses++; + } R_EndTransparentDrawing (entalpha); } } @@ -756,11 +640,10 @@ void R_DrawTextureChains_White (qmodel_t *model, texchain_t chain) continue; for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) - { - DrawGLPoly (s->polys); - rs_brushpasses++; - } + { + DrawGLPoly (s->polys); + rs_brushpasses++; + } } glEnable (GL_TEXTURE_2D); } @@ -778,11 +661,11 @@ void R_DrawLightmapChains (void) for (i=0 ; ichain) + GL_Bind (lightmaps[i].texture); + for (p = lightmaps[i].polys; p; p=p->chain) { glBegin (GL_POLYGON); v = p->verts[0]; @@ -883,10 +766,10 @@ void GLWorld_CreateShaders (void) " result.a = Alpha;\n" // FIXME: This will make almost transparent things cut holes though heavy fog " gl_FragColor = result;\n" "}\n"; - + if (!gl_glsl_alias_able) return; - + r_world_program = GL_CreateProgram (vertSource, fragSource, sizeof(bindings)/sizeof(bindings[0]), bindings); if (r_world_program != 0) @@ -921,7 +804,7 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain) int lastlightmap; gltexture_t *fullbright = NULL; float entalpha; - + entalpha = (ent != NULL) ? ENTALPHA_DECODE(ent->alpha) : 1.0f; // enable blending / disable depth writes @@ -930,9 +813,9 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain) glDepthMask (GL_FALSE); glEnable (GL_BLEND); } - + GL_UseProgramFunc (r_world_program); - + // Bind the buffers GL_BindBuffer (GL_ARRAY_BUFFER, gl_bmodel_vbo); GL_BindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0); // indices come from client memory! @@ -940,11 +823,11 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain) GL_EnableVertexAttribArrayFunc (vertAttrIndex); GL_EnableVertexAttribArrayFunc (texCoordsAttrIndex); GL_EnableVertexAttribArrayFunc (LMCoordsAttrIndex); - + GL_VertexAttribPointerFunc (vertAttrIndex, 3, GL_FLOAT, GL_FALSE, VERTEXSIZE * sizeof(float), ((float *)0)); GL_VertexAttribPointerFunc (texCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, VERTEXSIZE * sizeof(float), ((float *)0) + 3); GL_VertexAttribPointerFunc (LMCoordsAttrIndex, 2, GL_FLOAT, GL_FALSE, VERTEXSIZE * sizeof(float), ((float *)0) + 5); - + // set uniforms GL_Uniform1iFunc (texLoc, 0); GL_Uniform1iFunc (LMTexLoc, 1); @@ -953,7 +836,7 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain) GL_Uniform1iFunc (useOverbrightLoc, (int)gl_overbright.value); GL_Uniform1iFunc (useAlphaTestLoc, 0); GL_Uniform1fFunc (alphaLoc, entalpha); - + for (i=0 ; inumtextures ; i++) { t = model->textures[i]; @@ -977,45 +860,44 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain) bound = false; lastlightmap = 0; // avoid compiler warning for (s = t->texturechains[chain]; s; s = s->texturechain) - if (!s->culled) + { + if (!bound) //only bind once we are sure we need this texture { - if (!bound) //only bind once we are sure we need this texture - { - GL_SelectTexture (GL_TEXTURE0); - GL_Bind ((R_TextureAnimation(t, ent != NULL ? ent->frame : 0))->gltexture); + GL_SelectTexture (GL_TEXTURE0); + GL_Bind ((R_TextureAnimation(t, ent != NULL ? ent->frame : 0))->gltexture); - if (t->texturechains[chain]->flags & SURF_DRAWFENCE) - GL_Uniform1iFunc (useAlphaTestLoc, 1); // Flip alpha test back on + if (t->texturechains[chain]->flags & SURF_DRAWFENCE) + GL_Uniform1iFunc (useAlphaTestLoc, 1); // Flip alpha test back on - bound = true; - lastlightmap = s->lightmaptexturenum; - } - - if (s->lightmaptexturenum != lastlightmap) - R_FlushBatch (); - - GL_SelectTexture (GL_TEXTURE1); - GL_Bind (lightmap[s->lightmaptexturenum].texture); + bound = true; lastlightmap = s->lightmaptexturenum; - R_BatchSurface (s); - - rs_brushpasses++; } + + if (s->lightmaptexturenum != lastlightmap) + R_FlushBatch (); + + GL_SelectTexture (GL_TEXTURE1); + GL_Bind (lightmaps[s->lightmaptexturenum].texture); + lastlightmap = s->lightmaptexturenum; + R_BatchSurface (s); + + rs_brushpasses++; + } R_FlushBatch (); if (bound && t->texturechains[chain]->flags & SURF_DRAWFENCE) GL_Uniform1iFunc (useAlphaTestLoc, 0); // Flip alpha test back off } - + // clean up GL_DisableVertexAttribArrayFunc (vertAttrIndex); GL_DisableVertexAttribArrayFunc (texCoordsAttrIndex); GL_DisableVertexAttribArrayFunc (LMCoordsAttrIndex); - + GL_UseProgramFunc (0); GL_SelectTexture (GL_TEXTURE0); - + if (entalpha < 1) { glDepthMask (GL_TRUE); @@ -1037,12 +919,6 @@ void R_DrawTextureChains (qmodel_t *model, entity_t *ent, texchain_t chain) else entalpha = 1; -// ericw -- the mh dynamic lightmap speedup: make a first pass through all -// surfaces we are going to draw, and rebuild any lightmaps that need it. -// this also chains surfaces by lightmap which is used by r_lightmap 1. -// the previous implementation of the speedup uploaded lightmaps one frame -// late which was visible under some conditions, this method avoids that. - R_BuildLightmapChains (model, chain); R_UploadLightmaps (); if (r_drawflat_cheatsafe) diff --git a/Quake/server.h b/Quake/server.h index f6228410..4bcf86d1 100644 --- a/Quake/server.h +++ b/Quake/server.h @@ -239,7 +239,7 @@ typedef struct client_s #define MOVETYPE_NOCLIP 8 #define MOVETYPE_FLYMISSILE 9 // extra size to monsters #define MOVETYPE_BOUNCE 10 -//#define MOVETYPE_EXT_BOUNCEMISSILE 11 +#define MOVETYPE_EXT_BOUNCEMISSILE 11 // ifdefed out in the vanilla code, stomped on by 2021 rerelease gibs #define MOVETYPE_EXT_FOLLOW 12 // edict->solid values diff --git a/Quake/snd_codec.c b/Quake/snd_codec.c index e57772fa..7edf6bfe 100644 --- a/Quake/snd_codec.c +++ b/Quake/snd_codec.c @@ -117,7 +117,7 @@ void S_CodecShutdown (void) S_CodecOpenStream ================= */ -snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type) +snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type, qboolean loop) { snd_codec_t *codec; snd_stream_t *stream; @@ -140,7 +140,7 @@ snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type) Con_Printf("Unknown type for %s\n", filename); return NULL; } - stream = S_CodecUtilOpen(filename, codec); + stream = S_CodecUtilOpen(filename, codec, loop); if (stream) { if (codec->codec_open(stream)) stream->status = STREAM_PLAY; @@ -149,7 +149,7 @@ snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type) return stream; } -snd_stream_t *S_CodecOpenStreamExt (const char *filename) +snd_stream_t *S_CodecOpenStreamExt (const char *filename, qboolean loop) { snd_codec_t *codec; snd_stream_t *stream; @@ -174,7 +174,7 @@ snd_stream_t *S_CodecOpenStreamExt (const char *filename) Con_Printf("Unknown extension for %s\n", filename); return NULL; } - stream = S_CodecUtilOpen(filename, codec); + stream = S_CodecUtilOpen(filename, codec, loop); if (stream) { if (codec->codec_open(stream)) stream->status = STREAM_PLAY; @@ -183,7 +183,7 @@ snd_stream_t *S_CodecOpenStreamExt (const char *filename) return stream; } -snd_stream_t *S_CodecOpenStreamAny (const char *filename) +snd_stream_t *S_CodecOpenStreamAny (const char *filename, qboolean loop) { snd_codec_t *codec; snd_stream_t *stream; @@ -198,7 +198,7 @@ snd_stream_t *S_CodecOpenStreamAny (const char *filename) while (codec) { q_snprintf(tmp, sizeof(tmp), "%s.%s", filename, codec->ext); - stream = S_CodecUtilOpen(tmp, codec); + stream = S_CodecUtilOpen(tmp, codec, loop); if (stream) { if (codec->codec_open(stream)) { stream->status = STREAM_PLAY; @@ -225,7 +225,7 @@ snd_stream_t *S_CodecOpenStreamAny (const char *filename) Con_Printf("Unknown extension for %s\n", filename); return NULL; } - stream = S_CodecUtilOpen(filename, codec); + stream = S_CodecUtilOpen(filename, codec, loop); if (stream) { if (codec->codec_open(stream)) stream->status = STREAM_PLAY; @@ -261,6 +261,14 @@ int S_CodecRewindStream (snd_stream_t *stream) return stream->codec->codec_rewind(stream); } +int S_CodecJumpToOrder (snd_stream_t *stream, int to) +{ + if (stream->codec->codec_jump) { + return stream->codec->codec_jump(stream, to); + } + return -1; +} + int S_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer) { return stream->codec->codec_read(stream, bytes, buffer); @@ -268,7 +276,7 @@ int S_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer) /* Util functions (used by codecs) */ -snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec) +snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec, qboolean loop) { snd_stream_t *stream; FILE *handle; @@ -287,6 +295,7 @@ snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec) /* Allocate a stream, Z_Malloc zeroes its content */ stream = (snd_stream_t *) Z_Malloc(sizeof(snd_stream_t)); stream->codec = codec; + stream->loop = loop; stream->fh.file = handle; stream->fh.start = ftell(handle); stream->fh.pos = 0; diff --git a/Quake/snd_codec.h b/Quake/snd_codec.h index 657b0b2a..fcc9f864 100644 --- a/Quake/snd_codec.h +++ b/Quake/snd_codec.h @@ -54,6 +54,7 @@ typedef struct snd_stream_s snd_info_t info; stream_status_t status; snd_codec_t *codec; /* codec handling this stream */ + qboolean loop; void *priv; /* data private to the codec. */ } snd_stream_t; @@ -64,22 +65,24 @@ void S_CodecShutdown (void); /* Callers of the following S_CodecOpenStream* functions * are reponsible for attaching any path to the filename */ -snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type); +snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type, + qboolean loop); /* Decides according to the required type. */ -snd_stream_t *S_CodecOpenStreamAny (const char *filename); +snd_stream_t *S_CodecOpenStreamAny (const char *filename, qboolean loop); /* Decides according to file extension. if the * name has no extension, try all available. */ -snd_stream_t *S_CodecOpenStreamExt (const char *filename); +snd_stream_t *S_CodecOpenStreamExt (const char *filename, qboolean loop); /* Decides according to file extension. the name * MUST have an extension. */ void S_CodecCloseStream (snd_stream_t *stream); int S_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer); int S_CodecRewindStream (snd_stream_t *stream); +int S_CodecJumpToOrder (snd_stream_t *stream, int to); -snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec); +snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec, qboolean loop); void S_CodecUtilClose(snd_stream_t **stream); diff --git a/Quake/snd_codeci.h b/Quake/snd_codeci.h index feedb61c..4df70315 100644 --- a/Quake/snd_codeci.h +++ b/Quake/snd_codeci.h @@ -32,6 +32,7 @@ typedef void (*CODEC_SHUTDOWN)(void); typedef qboolean (*CODEC_OPEN)(snd_stream_t *stream); typedef int (*CODEC_READ)(snd_stream_t *stream, int bytes, void *buffer); typedef int (*CODEC_REWIND)(snd_stream_t *stream); +typedef int (*CODEC_JUMP)(snd_stream_t *stream, int order); typedef void (*CODEC_CLOSE)(snd_stream_t *stream); struct snd_codec_s @@ -44,6 +45,7 @@ struct snd_codec_s CODEC_OPEN codec_open; CODEC_READ codec_read; CODEC_REWIND codec_rewind; + CODEC_JUMP codec_jump; CODEC_CLOSE codec_close; snd_codec_t *next; }; diff --git a/Quake/snd_flac.c b/Quake/snd_flac.c index b5417b32..838404b3 100644 --- a/Quake/snd_flac.c +++ b/Quake/snd_flac.c @@ -356,8 +356,7 @@ static void S_FLAC_CodecCloseStream (snd_stream_t *stream) FLAC__stream_decoder_finish (ff->decoder); FLAC__stream_decoder_delete (ff->decoder); - if (ff->buffer) - free(ff->buffer); + if (ff->buffer) free(ff->buffer); Z_Free(ff); S_CodecUtilClose(&stream); @@ -382,6 +381,7 @@ snd_codec_t flac_codec = S_FLAC_CodecOpenStream, S_FLAC_CodecReadStream, S_FLAC_CodecRewindStream, + NULL, /* jump */ S_FLAC_CodecCloseStream, NULL }; diff --git a/Quake/snd_mem.c b/Quake/snd_mem.c index 48c6fa1d..588f2b06 100644 --- a/Quake/snd_mem.c +++ b/Quake/snd_mem.c @@ -138,9 +138,9 @@ sfxcache_t *S_LoadSound (sfx_t *s) if (strcmp("wav", COM_FileGetExtension(s->name))) { //if its an ogg (or even an mp3) then decode it now. our mixer doesn't support streaming anything but music. //FIXME: I hate depending on extensions for this sort of thing. Its not a very quakey thing to do. - snd_stream_t *stream = S_CodecOpenStreamExt(namebuffer); + snd_stream_t *stream = S_CodecOpenStreamExt(namebuffer, false); if (!stream) - stream = S_CodecOpenStreamExt(s->name); + stream = S_CodecOpenStreamExt(s->name, false); if (stream) { size_t decodedsize = 1024*1024*16; diff --git a/Quake/snd_mikmod.c b/Quake/snd_mikmod.c index 2327181c..bc0859b2 100644 --- a/Quake/snd_mikmod.c +++ b/Quake/snd_mikmod.c @@ -43,12 +43,15 @@ #endif typedef struct _mik_priv { -/* struct MREADER in libmikmod <= 3.2.0-beta2 - * doesn't have iobase members. adding them here - * so that if we compile against 3.2.0-beta2, we - * can still run OK against 3.2.0b3 and newer. */ - struct MREADER reader; + /* MREADER core members in libmikmod2/3: */ + int (*Seek)(struct MREADER*, long, int); + long (*Tell)(struct MREADER*); + BOOL (*Read)(struct MREADER*, void*, size_t); + int (*Get)(struct MREADER*); + BOOL (*Eof)(struct MREADER*); + /* no iobase members in libmikmod <= 3.2.0-beta2 */ long iobase, prev_iobase; + fshandle_t *fh; MODULE *module; } mik_priv_t; @@ -132,11 +135,11 @@ static qboolean S_MIKMOD_CodecOpenStream (snd_stream_t *stream) stream->priv = Z_Malloc(sizeof(mik_priv_t)); priv = (mik_priv_t *) stream->priv; - priv->reader.Seek = MIK_Seek; - priv->reader.Tell = MIK_Tell; - priv->reader.Read = MIK_Read; - priv->reader.Get = MIK_Get; - priv->reader.Eof = MIK_Eof; + priv->Seek = MIK_Seek; + priv->Tell = MIK_Tell; + priv->Read = MIK_Read; + priv->Get = MIK_Get; + priv->Eof = MIK_Eof; priv->fh = &stream->fh; priv->module = Player_LoadGeneric((MREADER *)stream->priv, 64, 0); @@ -147,13 +150,16 @@ static qboolean S_MIKMOD_CodecOpenStream (snd_stream_t *stream) return false; } - /* keep default values of fadeout (0: don't fade out volume during when last - * position of the module is being played), extspd (1: do process Protracker - * extended speed effect), panflag (1: do process panning effects), wrap (0: - * don't wrap to restart position when module is finished) are OK with us as - * set internally by libmikmod::Player_Init(). */ - /* just change the loop setting to 0, i.e. don't process in-module loops: */ - priv->module->loop = 0; + /* default values of module options set by Player_Init(): + * fadeout (0): don't fade out volume during when last position of the + * module is being played, + * extspd (1): process Protracker extended speed effect, + * panflag (1): process panning effects, + * wrap (0): don't wrap to restart position when module is finished, + * loop (1): process all in-module loops -- possible backward loops + * would make the module to loop endlessly. + */ + priv->module->wrap = stream->loop; Player_Start(priv->module); stream->info.rate = md_mixfreq; @@ -169,6 +175,10 @@ static int S_MIKMOD_CodecReadStream (snd_stream_t *stream, int bytes, void *buff { if (!Player_Active()) return 0; + + /* handle possible loop setting change: */ + ((mik_priv_t *)stream->priv)->module->wrap = stream->loop; + return (int) VC_WriteBytes((SBYTE *)buffer, bytes); } @@ -180,9 +190,15 @@ static void S_MIKMOD_CodecCloseStream (snd_stream_t *stream) S_CodecUtilClose(&stream); } +static int S_MIKMOD_CodecJumpToOrder (snd_stream_t *stream, int to) +{ + Player_SetPosition ((UWORD)to); + return 0; +} + static int S_MIKMOD_CodecRewindStream (snd_stream_t *stream) { - Player_SetPosition (0); + Player_SetPosition (0); /* FIXME: WRONG: THIS IS NOT A TIME SEEK */ return 0; } @@ -196,6 +212,7 @@ snd_codec_t mikmod_codec = S_MIKMOD_CodecOpenStream, S_MIKMOD_CodecReadStream, S_MIKMOD_CodecRewindStream, + S_MIKMOD_CodecJumpToOrder, S_MIKMOD_CodecCloseStream, NULL }; diff --git a/Quake/snd_mp3.c b/Quake/snd_mp3.c index 6d5a354f..b3bf9a14 100644 --- a/Quake/snd_mp3.c +++ b/Quake/snd_mp3.c @@ -452,6 +452,7 @@ snd_codec_t mp3_codec = S_MP3_CodecOpenStream, S_MP3_CodecReadStream, S_MP3_CodecRewindStream, + NULL, /* jump */ S_MP3_CodecCloseStream, NULL }; diff --git a/Quake/snd_mpg123.c b/Quake/snd_mpg123.c index 3eaf07a3..74508f23 100644 --- a/Quake/snd_mpg123.c +++ b/Quake/snd_mpg123.c @@ -49,7 +49,7 @@ static ssize_t mp3_read (void *f, void *buf, size_t size) } static off_t mp3_seek (void *f, off_t offset, int whence) { - if (f == NULL) return (-1); + if (f == NULL) return -1; if (FS_fseek((fshandle_t *)f, (long) offset, whence) < 0) return (off_t)-1; return (off_t) FS_ftell((fshandle_t *)f); @@ -200,7 +200,7 @@ static int S_MP3_CodecRewindStream (snd_stream_t *stream) { mp3_priv_t *priv = (mp3_priv_t *) stream->priv; off_t res = mpg123_seek(priv->handle, 0, SEEK_SET); - if (res >= 0) return (0); + if (res >= 0) return 0; return res; } @@ -214,6 +214,7 @@ snd_codec_t mp3_codec = S_MP3_CodecOpenStream, S_MP3_CodecReadStream, S_MP3_CodecRewindStream, + NULL, /* jump */ S_MP3_CodecCloseStream, NULL }; diff --git a/Quake/snd_opus.c b/Quake/snd_opus.c index a2148e9f..ea5e4f24 100644 --- a/Quake/snd_opus.c +++ b/Quake/snd_opus.c @@ -202,6 +202,7 @@ snd_codec_t opus_codec = S_OPUS_CodecOpenStream, S_OPUS_CodecReadStream, S_OPUS_CodecRewindStream, + NULL, /* jump */ S_OPUS_CodecCloseStream, NULL }; diff --git a/Quake/snd_umx.c b/Quake/snd_umx.c index 6cda61f1..d6f4b91c 100644 --- a/Quake/snd_umx.c +++ b/Quake/snd_umx.c @@ -2,14 +2,9 @@ * Unreal UMX container support. * UPKG parsing partially based on Unreal Media Ripper (UMR) v0.3 * by Andy Ward , with additional updates - * by O. Sezer - see git repo at https://github.com/sezero/umr/ + * by O. Sezer - see git repo at https://github.com/sezero/umr.git * - * The cheaper way, i.e. linear search of music object like libxmp - * and libmodplug does, is possible. With this however we're using - * the embedded offset, size and object type directly from the umx - * file, and I feel safer with it. - * - * Copyright (C) 2013 O. Sezer + * Copyright (C) 2013-2021 O. Sezer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,10 +58,9 @@ struct upkg_hdr { uint32_t guid[4]; int32_t generation_count; #define UPKG_HDR_SIZE 64 /* 64 bytes up until here */ - /*struct _genhist *gen;*/ + struct _genhist *gen; }; -/*COMPILE_TIME_ASSERT(upkg_hdr, offsetof(struct upkg_hdr, gen) == UPKG_HDR_SIZE);*/ -COMPILE_TIME_ASSERT(upkg_hdr, sizeof(struct upkg_hdr) == UPKG_HDR_SIZE); +COMPILE_TIME_ASSERT(upkg_hdr, offsetof(struct upkg_hdr, gen) == UPKG_HDR_SIZE); #define UMUSIC_IT 0 #define UMUSIC_S3M 1 @@ -207,13 +201,13 @@ static int read_typname(fshandle_t *f, const struct upkg_hdr *hdr, char buf[64]; if (idx >= hdr->name_count) return -1; - buf[63] = '\0'; + memset(buf, 0, 64); for (i = 0, l = 0; i <= idx; i++) { - FS_fseek(f, hdr->name_offset + l, SEEK_SET); - FS_fread(buf, 1, 63, f); + if (FS_fseek(f, hdr->name_offset + l, SEEK_SET) < 0) return -1; + if (!FS_fread(buf, 1, 63, f)) return -1; if (hdr->file_version >= 64) { s = *(signed char *)buf; /* numchars *including* terminator */ - if (s <= 0 || s > 64) return -1; + if (s <= 0) return -1; l += s + 5; /* 1 for buf[0], 4 for int32_t name_flags */ } else { l += (long)strlen(buf); @@ -236,6 +230,13 @@ static int probe_umx (fshandle_t *f, const struct upkg_hdr *hdr, idx = 0; fsiz = FS_filelength (f); + if (hdr->name_offset >= fsiz || + hdr->export_offset >= fsiz || + hdr->import_offset >= fsiz) { + Con_DPrintf("Illegal values in header.\n"); + return -1; + } + /* Find the offset and size of the first IT, S3M or XM * by parsing the exports table. The umx files should * have only one export. Kran32.umx from Unreal has two, @@ -274,32 +275,32 @@ static int probe_umx (fshandle_t *f, const struct upkg_hdr *hdr, return t; } -static int32_t probe_header (void *header) +static int32_t probe_header (fshandle_t *f, struct upkg_hdr *hdr) { - struct upkg_hdr *hdr; - unsigned char *p; - uint32_t *swp; - int i; - + if (FS_fread(hdr, 1, UPKG_HDR_SIZE, f) < UPKG_HDR_SIZE) + return -1; /* byte swap the header - all members are 32 bit LE values */ - p = (unsigned char *) header; - swp = (uint32_t *) header; - for (i = 0; i < UPKG_HDR_SIZE/4; i++, p += 4) { - swp[i] = p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); - } + hdr->tag = (uint32_t) LittleLong(hdr->tag); + hdr->file_version = LittleLong(hdr->file_version); + hdr->pkg_flags = (uint32_t) LittleLong(hdr->pkg_flags); + hdr->name_count = LittleLong(hdr->name_count); + hdr->name_offset = LittleLong(hdr->name_offset); + hdr->export_count = LittleLong(hdr->export_count); + hdr->export_offset = LittleLong(hdr->export_offset); + hdr->import_count = LittleLong(hdr->import_count); + hdr->import_offset = LittleLong(hdr->import_offset); - hdr = (struct upkg_hdr *) header; if (hdr->tag != UPKG_HDR_TAG) { Con_DPrintf("Unknown header tag 0x%x\n", hdr->tag); return -1; } if (hdr->name_count < 0 || - hdr->name_offset < 0 || hdr->export_count < 0 || - hdr->export_offset < 0 || hdr->import_count < 0 || - hdr->import_offset < 0 ) { - Con_DPrintf("Negative values in header\n"); + hdr->name_offset < 36 || + hdr->export_offset < 36 || + hdr->import_offset < 36) { + Con_DPrintf("Illegal values in header.\n"); return -1; } @@ -325,14 +326,13 @@ static int32_t probe_header (void *header) static int process_upkg (fshandle_t *f, int32_t *ofs, int32_t *objsize) { - char header[UPKG_HDR_SIZE]; + struct upkg_hdr header; - if (FS_fread(header, 1, UPKG_HDR_SIZE, f) < UPKG_HDR_SIZE) - return -1; - if (probe_header(header) < 0) + memset(&header, 0, sizeof(header)); + if (probe_header(f, &header) < 0) return -1; - return probe_umx(f, (struct upkg_hdr *)header, ofs, objsize); + return probe_umx(f, &header, ofs, objsize); } static qboolean S_UMX_CodecInitialize (void) @@ -399,6 +399,7 @@ snd_codec_t umx_codec = S_UMX_CodecOpenStream, S_UMX_CodecReadStream, S_UMX_CodecRewindStream, + NULL, /* jump */ S_UMX_CodecCloseStream, NULL }; diff --git a/Quake/snd_vorbis.c b/Quake/snd_vorbis.c index 16985dc0..7ea02bd9 100644 --- a/Quake/snd_vorbis.c +++ b/Quake/snd_vorbis.c @@ -196,6 +196,7 @@ snd_codec_t vorbis_codec = S_VORBIS_CodecOpenStream, S_VORBIS_CodecReadStream, S_VORBIS_CodecRewindStream, + NULL, /* jump */ S_VORBIS_CodecCloseStream, NULL }; diff --git a/Quake/snd_wave.c b/Quake/snd_wave.c index b31011a2..584c4de4 100644 --- a/Quake/snd_wave.c +++ b/Quake/snd_wave.c @@ -37,9 +37,7 @@ FGetLittleLong static int FGetLittleLong (FILE *f) { int v; - fread(&v, 1, sizeof(v), f); - return LittleLong(v); } @@ -51,9 +49,7 @@ FGetLittleShort static short FGetLittleShort(FILE *f) { short v; - fread(&v, 1, sizeof(v), f); - return LittleShort(v); } @@ -268,6 +264,7 @@ snd_codec_t wav_codec = S_WAV_CodecOpenStream, S_WAV_CodecReadStream, S_WAV_CodecRewindStream, + NULL, /* jump */ S_WAV_CodecCloseStream, NULL }; diff --git a/Quake/snd_xmp.c b/Quake/snd_xmp.c index 27b55a56..7734fd3d 100644 --- a/Quake/snd_xmp.c +++ b/Quake/snd_xmp.c @@ -1,6 +1,6 @@ /* tracker music (module file) decoding support using libxmp >= v4.2.0 * https://sourceforge.net/projects/xmp/ - * https://github.com/cmatsuoka/libxmp.git + * https://github.com/libxmp/libxmp.git * * Copyright (C) 2016 O.Sezer * @@ -34,18 +34,6 @@ #error libxmp version 4.2 or newer is required #endif -static int S_XMP_StartPlay (snd_stream_t *stream) -{ - int fmt = 0; - - if (stream->info.channels == 1) - fmt |= XMP_FORMAT_MONO; - if (stream->info.width == 1) - fmt |= XMP_FORMAT_8BIT|XMP_FORMAT_UNSIGNED; - - return xmp_start_player((xmp_context)stream->priv, stream->info.rate, fmt); -} - static qboolean S_XMP_CodecInitialize (void) { return true; @@ -64,6 +52,7 @@ static qboolean S_XMP_CodecOpenStream (snd_stream_t *stream) xmp_context c; byte *moddata; long len; + int fmt; int mark; c = xmp_create_context(); @@ -74,13 +63,12 @@ static qboolean S_XMP_CodecOpenStream (snd_stream_t *stream) mark = Hunk_LowMark(); moddata = (byte *) Hunk_Alloc(len); FS_fread(moddata, 1, len, &stream->fh); - if (xmp_load_module_from_memory(c, moddata, len) != 0) - { + if (xmp_load_module_from_memory(c, moddata, len) < 0) { Con_DPrintf("Could not load module %s\n", stream->name); goto err1; } - Hunk_FreeToLowMark(mark); /* free original file data */ + stream->priv = c; if (shm->speed > XMP_MAX_SRATE) stream->info.rate = 44100; @@ -91,19 +79,19 @@ static qboolean S_XMP_CodecOpenStream (snd_stream_t *stream) stream->info.width = stream->info.bits / 8; stream->info.channels = shm->channels; - if (S_XMP_StartPlay(stream) != 0) + fmt = 0; + if (stream->info.channels == 1) + fmt |= XMP_FORMAT_MONO; + if (stream->info.width == 1) + fmt |= XMP_FORMAT_8BIT|XMP_FORMAT_UNSIGNED; + if (xmp_start_player(c, stream->info.rate, fmt) < 0) goto err2; - /* percentual left/right channel separation, default is 70. */ - if (stream->info.channels == 2) - if (xmp_set_player(c, XMP_PLAYER_MIX, 100) != 0) - goto err3; + /* interpolation type, default is XMP_INTERP_LINEAR */ - if (xmp_set_player(c, XMP_PLAYER_INTERP, XMP_INTERP_SPLINE) != 0) - goto err3; + xmp_set_player(c, XMP_PLAYER_INTERP, XMP_INTERP_SPLINE); return true; -err3: xmp_end_player(c); err2: xmp_release_module(c); err1: xmp_free_context(c); return false; @@ -115,9 +103,9 @@ static int S_XMP_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer) /* xmp_play_buffer() requires libxmp >= 4.1. it will write * native-endian pcm data to the buffer. if the data write * is partial, the rest of the buffer will be zero-filled. - * the last param is the number that the current sequence of - * the song will be looped at max. */ - r = xmp_play_buffer((xmp_context)stream->priv, buffer, bytes, 1); + * the last param is the max number that the current sequence + * of song will be looped, or 0 to disable loop checking. */ + r = xmp_play_buffer((xmp_context)stream->priv, buffer, bytes, !stream->loop); if (r == 0) { return bytes; } @@ -137,17 +125,16 @@ static void S_XMP_CodecCloseStream (snd_stream_t *stream) S_CodecUtilClose(&stream); } +static int S_XMP_CodecJumpToOrder (snd_stream_t *stream, int to) +{ + return xmp_set_position((xmp_context)stream->priv, to); +} + static int S_XMP_CodecRewindStream (snd_stream_t *stream) { - int ret; - - ret = S_XMP_StartPlay(stream); + int ret = xmp_seek_time((xmp_context)stream->priv, 0); if (ret < 0) return ret; - - /*ret = xmp_set_position((xmp_context)stream->priv, 0);*/ - ret = xmp_seek_time((xmp_context)stream->priv, 0); - if (ret < 0) return ret; - + xmp_play_buffer((xmp_context)stream->priv, NULL, 0, 0); /* reset internal state */ return 0; } @@ -161,6 +148,7 @@ snd_codec_t xmp_codec = S_XMP_CodecOpenStream, S_XMP_CodecReadStream, S_XMP_CodecRewindStream, + S_XMP_CodecJumpToOrder, S_XMP_CodecCloseStream, NULL }; diff --git a/Quake/sv_main.c b/Quake/sv_main.c index 07bed773..89ca71ee 100644 --- a/Quake/sv_main.c +++ b/Quake/sv_main.c @@ -1580,7 +1580,7 @@ Each entity can have eight independant sound sources, like voice, weapon, feet, etc. Channel 0 is an auto-allocate channel, the others override anything -allready running on that entity/channel pair. +already running on that entity/channel pair. An attenuation of 0 will play full volume everywhere in the level. Larger attenuations will drop off. (max 4 attenuation) @@ -1623,7 +1623,7 @@ void SV_StartSound2 (edict_t *entity, float *origin, int channel, const char *sa if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) { - Con_Printf ("SV_StartSound: %s not precacheed\n", sample); + Con_Printf ("SV_StartSound: %s not precached\n", sample); return; } @@ -2689,7 +2689,7 @@ void SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg) bits |= SU_ARMOR; // if (ent->v.weapon) - bits |= SU_WEAPON; + bits |= SU_WEAPON; //johnfitz -- PROTOCOL_FITZQUAKE if (sv.protocol != PROTOCOL_NETQUAKE) diff --git a/Quake/sv_phys.c b/Quake/sv_phys.c index 4a62e772..dbfe8dfd 100644 --- a/Quake/sv_phys.c +++ b/Quake/sv_phys.c @@ -1237,6 +1237,7 @@ void SV_Physics_Client (edict_t *ent, int num) case MOVETYPE_TOSS: case MOVETYPE_BOUNCE: + case MOVETYPE_EXT_BOUNCEMISSILE: SV_Physics_Toss (ent); break; @@ -1359,6 +1360,7 @@ void SV_Physics_Toss (edict_t *ent) trace_t trace; vec3_t move; float backoff; + int movetype; // regular thinking if (!SV_RunThink (ent)) @@ -1371,6 +1373,7 @@ void SV_Physics_Toss (edict_t *ent) SV_CheckVelocity (ent); // add gravity + movetype = ent->v.movetype; if (movetype == MOVETYPE_EXT_BOUNCEMISSILE && qcvm->brokenbouncemissile) movetype = MOVETYPE_BOUNCE; if (ent->v.movetype != MOVETYPE_FLY && ent->v.movetype != MOVETYPE_FLYMISSILE) SV_AddGravity (ent); @@ -1386,8 +1389,11 @@ void SV_Physics_Toss (edict_t *ent) if (ent->free) return; - if (ent->v.movetype == MOVETYPE_BOUNCE) + movetype = ent->v.movetype; if (movetype == MOVETYPE_EXT_BOUNCEMISSILE && qcvm->brokenbouncemissile) movetype = MOVETYPE_BOUNCE; + if (movetype == MOVETYPE_BOUNCE) backoff = 1.5; + else if (movetype == MOVETYPE_EXT_BOUNCEMISSILE) + backoff = 2; //bouncemissile. else backoff = 1; @@ -1596,6 +1602,7 @@ void SV_Physics (void) else if (ent->v.movetype == MOVETYPE_STEP) SV_Physics_Step (ent); else if (ent->v.movetype == MOVETYPE_TOSS + || ent->v.movetype == MOVETYPE_EXT_BOUNCEMISSILE || ent->v.movetype == MOVETYPE_BOUNCE || ent->v.movetype == MOVETYPE_FLY || ent->v.movetype == MOVETYPE_FLYMISSILE) diff --git a/Quake/view.c b/Quake/view.c index 4b6bdae1..52c829ac 100644 --- a/Quake/view.c +++ b/Quake/view.c @@ -118,13 +118,11 @@ float V_CalcBob (void) float bob; float cycle; - if (!cl_bobcycle.value) - cycle = 0; - else - { - cycle = cl.time - (int)(cl.time/cl_bobcycle.value)*cl_bobcycle.value; - cycle /= cl_bobcycle.value; - } + if (!cl_bobcycle.value) /* Avoid divide-by-zero, don't bob */ + return 0.0f; + + cycle = cl.time - (int)(cl.time/cl_bobcycle.value)*cl_bobcycle.value; + cycle /= cl_bobcycle.value; if (cycle < cl_bobup.value) cycle = M_PI * cycle / cl_bobup.value; else diff --git a/Quake/zone.c b/Quake/zone.c index d6e02e29..36bf1033 100644 --- a/Quake/zone.c +++ b/Quake/zone.c @@ -291,12 +291,12 @@ void Z_Print (memzone_t *zone) //============================================================================ -#define HUNK_SENTINAL 0x1df001ed +#define HUNK_SENTINEL 0x1df001ed #define HUNKNAME_LEN 24 typedef struct { - int sentinal; + int sentinel; int size; // including sizeof(hunk_t), -1 = not allocated char name[HUNKNAME_LEN]; } hunk_t; @@ -314,7 +314,7 @@ int hunk_tempmark; ============== Hunk_Check -Run consistancy and sentinal trahing checks +Run consistancy and sentinel trahing checks ============== */ void Hunk_Check (void) @@ -323,8 +323,8 @@ void Hunk_Check (void) for (h = (hunk_t *)hunk_base ; (byte *)h != hunk_base + hunk_low_used ; ) { - if (h->sentinal != HUNK_SENTINAL) - Sys_Error ("Hunk_Check: trahsed sentinal"); + if (h->sentinel != HUNK_SENTINEL) + Sys_Error ("Hunk_Check: trashed sentinel"); if (h->size < (int) sizeof(hunk_t) || h->size + (byte *)h - hunk_base > hunk_size) Sys_Error ("Hunk_Check: bad size"); h = (hunk_t *)((byte *)h+h->size); @@ -380,8 +380,8 @@ void Hunk_Print (qboolean all) // // run consistancy checks // - if (h->sentinal != HUNK_SENTINAL) - Sys_Error ("Hunk_Check: trahsed sentinal"); + if (h->sentinel != HUNK_SENTINEL) + Sys_Error ("Hunk_Check: trashed sentinel"); if (h->size < (int) sizeof(hunk_t) || h->size + (byte *)h - hunk_base > hunk_size) Sys_Error ("Hunk_Check: bad size"); @@ -456,7 +456,7 @@ void *Hunk_AllocName (int size, const char *name) memset (h, 0, size); h->size = size; - h->sentinal = HUNK_SENTINAL; + h->sentinel = HUNK_SENTINEL; q_strlcpy (h->name, name, HUNKNAME_LEN); return (void *)(h+1); @@ -547,7 +547,7 @@ void *Hunk_HighAllocName (int size, const char *name) memset (h, 0, size); h->size = size; - h->sentinal = HUNK_SENTINAL; + h->sentinel = HUNK_SENTINEL; q_strlcpy (h->name, name, HUNKNAME_LEN); return (void *)(h+1); @@ -913,7 +913,7 @@ void *Cache_Alloc (cache_user_t *c, int size, const char *name) cache_system_t *cs; if (c->data) - Sys_Error ("Cache_Alloc: allready allocated"); + Sys_Error ("Cache_Alloc: already allocated"); if (size <= 0) Sys_Error ("Cache_Alloc: size %i", size); diff --git a/Quakespasm-Music.txt b/Quakespasm-Music.txt index 5f4a717b..e188d8de 100644 --- a/Quakespasm-Music.txt +++ b/Quakespasm-Music.txt @@ -59,6 +59,9 @@ New console commands: - music_loop 0 Makes the background music to play once and then stop +- music_jump + Jump to a given order in music (only for module (tracker) music) + New cvars: ------------------------- - bgm_extmusic (0 or 1): Disable or enable playback of external music diff --git a/Quakespasm.html b/Quakespasm.html index 66f0a81d..b1805412 100644 --- a/Quakespasm.html +++ b/Quakespasm.html @@ -12,7 +12,7 @@

 

-

Page last edited: Sep. 2019

+

Page last edited: August 2021

1. About

@@ -42,23 +42,24 @@

6. Changes

7. Todo

@@ -94,7 +95,9 @@ SDL is probably less buggy, but SDL2 has nicer features and smoother mouse input
  • Project Downloads
  • -Automatic Builds
  • +Latest code repository +
  • +Automatic Builds (dead link)
  • @@ -193,20 +196,15 @@ quakespasm.pak contains a default.cfg which has been updated to give some defaul

    4. Compiling and Installation

    -

    Quakespasm's (optional) custom data is now stored in the file quakespasm.pak. This file should be placed alongside your quakespasm binary and id1 directory.

    -

    To checkout the latest version of QuakeSpasm, do: -svn co svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm

    +

    See the Downloads section to get the sourcecode, then below for platform specific instructions. +Quakespasm can also be built with the cross-platform Codeblocks.
    +Quakespasm's (optional) custom data is now stored in the file quakespasm.pak. This file should be placed alongside your quakespasm binary and id1 directory.

    4.1 Linux/Unix

    -

    After extracting the source tarball, browse the Makefile and edit the music streaming options, then -


    -
    -make
    -cp quakespasm /usr/local/games/quake (for example)
    -
    -
    -
    +

    After extracting the source tarball, "cd Quake" and edit the Makefile for music options.

    +

    Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files.

    +

    Then type "make" to compile the program, and copy the "quakespasm" binary (and "quakespasm.pak") to your Quake game directory.
    Compile time options include

    • make DO_USERDIRS=1 to include user directories support
    • @@ -215,8 +213,7 @@ Compile time options include
    • make USE_SDL2=1 to compile against SDL2 instead of SDL-1.2

    -

    Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files.

    -

    The project can also be built with Codeblocks (project files included).

    +

    4.2 Windows

    @@ -232,7 +229,7 @@ Compile time options include

    5. Known Bugs

    Brightness issues should be fixed with GLSL gamma in 0.90.1, if your system supports OpenGL 2. For reference on older systems:
    - + Some versions of Xorg and SDL have brightness issues.
    Try setting "export SDL_VIDEO_X11_NODIRECTCOLOR=1", or if you have Xorg >= 7.5 and broken brightness, these patched libSDL binaries may help. @@ -247,7 +244,26 @@ these patched libSDL binaries may help. -

    6.1 Changes in 0.93.2 +

    6.1 Changes in 0.93.3 +

    + +

    +

      +
    • Fix rendering bug when cl_bobcycle was set to zero (sf.net bug/41)
    • +
    • Fixed buffer overflow with large char skybox names (sf.net bug/38)
    • +
    • Fixed a missing MAXALIASFRAMES bounds check (sf.net bug/37)
    • +
    • OpenGL: workaround Intel UHD 600 driver bug (sf.net bug/39)
    • +
    • OpenGL: merged surface mark & cull optimizations from vkQuake.
    • +
    • Reject lit files if they're the wrong size (eg hipnotic/start.bsp vs id1/start.lit or just a bsp that no longer has any coloured lits, etc)
    • +
    • Save: remove CR/LFs from level name to avoids broken saves, e.g. with autumn_sp map.
    • +
    • Music: improvements to mp3 tag detection / skipping.
    • +
    • Music: umx loader fix for malformed / crafted files.
    • +
    • New console command music_jump: Jump to given order in music, like Unreal's music change - only for module (tracker) music.
    • +
    • Updated third-party libraries (music codecs, SDL, etc.) Other minor fixes, tidy-ups and protability tweaks.
    • +
    • Source repository moved to git.
    • +
    +

    +

    6.2 Changes in 0.93.2

    @@ -260,7 +276,7 @@ these patched libSDL binaries may help.

  • Update the third-party libraries. Other fixes/cleanups.
  • -

    6.2 Changes in 0.93.1 +

    6.3 Changes in 0.93.1

    @@ -274,7 +290,7 @@ these patched libSDL binaries may help.

  • Update the third-party libraries. Other fixes/cleanups.
  • -

    6.3 Changes in 0.93.0 +

    6.4 Changes in 0.93.0

    @@ -317,7 +333,7 @@ these patched libSDL binaries may help.

  • Update the third-party libraries.
  • -

    6.4 Changes in 0.92.1 +

    6.5 Changes in 0.92.1

    @@ -327,7 +343,7 @@ these patched libSDL binaries may help.

  • Updated some of the third-party libraries.
  • -

    6.5 Changes in 0.92.0 +

    6.6 Changes in 0.92.0

    @@ -347,7 +363,7 @@ these patched libSDL binaries may help.

  • Updated some of the third-party libraries. Other fixes/clean-ups.
  • -

    6.6 Changes in 0.91.0 +

    6.7 Changes in 0.91.0

    @@ -407,7 +423,7 @@ these patched libSDL binaries may help.
  • Raised MAX_SFX to 1024 (was 512).
  • -

    6.7 Changes in 0.90.1 +

    6.8 Changes in 0.90.1

    @@ -467,7 +483,7 @@ these patched libSDL binaries may help.
  • Update 3rd-party libraries.
  • -

    6.8 Changes in 0.90.0 +

    6.9 Changes in 0.90.0

    @@ -512,7 +528,7 @@ these patched libSDL binaries may help.

  • Other fixes and clean-ups.
  • -

    6.9 Changes in 0.85.9 +

    6.10 Changes in 0.85.9

    @@ -536,7 +552,7 @@ these patched libSDL binaries may help.

  • Several other minor fixes/cleanups.
  • -

    6.10 Changes in 0.85.8 +

    6.11 Changes in 0.85.8

    @@ -561,7 +577,7 @@ these patched libSDL binaries may help.

  • Miscellaneous source code cleanups.
  • -

    6.11 Changes in 0.85.7 +

    6.12 Changes in 0.85.7

    @@ -579,7 +595,7 @@ these patched libSDL binaries may help.

  • Several other small changes mostly invisible to the end-user
  • -

    6.12 Changes in 0.85.6 +

    6.13 Changes in 0.85.6

    @@ -590,7 +606,7 @@ these patched libSDL binaries may help.

  • Minor SDL video fixes.
  • -

    6.13 Changes in 0.85.5 +

    6.14 Changes in 0.85.5

    @@ -609,7 +625,7 @@ these patched libSDL binaries may help.

  • Several code updates from uHexen2 project, several code cleanups.
  • -

    6.14 Changes in 0.85.4 +

    6.15 Changes in 0.85.4

    @@ -627,7 +643,7 @@ these patched libSDL binaries may help.

  • Other minor sound and cdaudio updates
  • -

    6.15 Changes in 0.85.3 +

    6.16 Changes in 0.85.3

    @@ -650,7 +666,7 @@ these patched libSDL binaries may help.

    -

    6.16 Changes in 0.85.2 +

    6.17 Changes in 0.85.2

    @@ -669,7 +685,7 @@ these patched libSDL binaries may help.

    -

    6.17 Changes in 0.85.1 +

    6.18 Changes in 0.85.1

    @@ -725,12 +741,13 @@ these patched libSDL binaries may help.

  • Ozkan, Eric, -Sander +Sander
  • 10. Links

    +

    • diff --git a/Quakespasm.txt b/Quakespasm.txt index 38c73f0f..3c410574 100644 --- a/Quakespasm.txt +++ b/Quakespasm.txt @@ -19,33 +19,34 @@ 5. Known Bugs 6. Changes - 6.1 Changes in 0.93.2 - 6.2 Changes in 0.93.1 - 6.3 Changes in 0.93.0 - 6.4 Changes in 0.92.1 - 6.5 Changes in 0.92.0 - 6.6 Changes in 0.91.0 - 6.5.1 Bugfixes - 6.5.2 Visual improvements - 6.5.3 Interface improvements - 6.5.4 Code cleanup / Other - 6.5.5 Raised limits - 6.7 Changes in 0.90.1 + 6.1 Changes in 0.93.3 + 6.2 Changes in 0.93.2 + 6.3 Changes in 0.93.1 + 6.4 Changes in 0.93.0 + 6.5 Changes in 0.92.1 + 6.6 Changes in 0.92.0 + 6.7 Changes in 0.91.0 6.7.1 Bugfixes - 6.7.2 Performance - 6.7.3 Visual improvements - 6.7.4 Interface improvements - 6.7.5 Code cleanup - 6.8 Changes in 0.90.0 - 6.9 Changes in 0.85.9 - 6.10 Changes in 0.85.8 - 6.11 Changes in 0.85.7 - 6.12 Changes in 0.85.6 - 6.13 Changes in 0.85.5 - 6.14 Changes in 0.85.4 - 6.15 Changes in 0.85.3 - 6.16 Changes in 0.85.2 - 6.17 Changes in 0.85.1 + 6.7.2 Visual improvements + 6.7.3 Interface improvements + 6.7.4 Code cleanup / Other + 6.7.5 Raised limits + 6.8 Changes in 0.90.1 + 6.8.1 Bugfixes + 6.8.2 Performance + 6.8.3 Visual improvements + 6.8.4 Interface improvements + 6.8.5 Code cleanup + 6.9 Changes in 0.90.0 + 6.10 Changes in 0.85.9 + 6.11 Changes in 0.85.8 + 6.12 Changes in 0.85.7 + 6.13 Changes in 0.85.6 + 6.14 Changes in 0.85.5 + 6.15 Changes in 0.85.4 + 6.16 Changes in 0.85.3 + 6.17 Changes in 0.85.2 + 6.18 Changes in 0.85.1 7. Todo 8. Copyright @@ -55,7 +56,7 @@ ______________________________________________________________________ - Page last edited: Sep. 2019 + Page last edited: August 2021 1. About @@ -68,16 +69,20 @@ sound driver, some graphical niceities, and numerous bug-fixes and other improvements. - Quakespasm utilizes either the SDL or SDL2 frameworks, so choose - which one works best for you. SDL is probably less buggy, but SDL2 - has nicer features and smoother mouse input - though no CD support. + Quakespasm utilizes either the SDL or SDL2 frameworks, so choose which + one works best for you. SDL is probably less buggy, but SDL2 has + nicer features and smoother mouse input - though no CD support. 2. Downloads o Project Downloads: http://quakespasm.sourceforge.net/download.htm - o Automatic Builds: http://quakespasm.ericwa.com/job/quakespasm-sdl2/ + o Latest code repository: + https://sourceforge.net/p/quakespasm/quakespasm/ci/master/tree/ + + o Automatic Builds (dead link): + http://quakespasm.ericwa.com/job/quakespasm-sdl2/ 3. Hints @@ -219,24 +224,23 @@ 4. Compiling and Installation + See the Downloads section to get the sourcecode, then below for + platform specific instructions. Quakespasm can also be built with the + cross-platform Codeblocks. Quakespasm's (optional) custom data is now stored in the file quakespasm.pak. This file should be placed alongside your quakespasm binary and id1 directory. - To checkout the latest version of QuakeSpasm, do: - svn co svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm - 4.1. Linux/Unix - After extracting the source tarball, browse the Makefile and edit the - music streaming options, then - - ______________________________________________________________________ - make - cp quakespasm /usr/local/games/quake (for example) - ______________________________________________________________________ + After extracting the source tarball, "cd Quake" and edit the Makefile + for music options. + Streaming music playback requires "libmad" or "libmpg123" for MP3, and + "libogg" and "libvorbis" for OGG files. + Then type "make" to compile the program, and copy the "quakespasm" + binary (and "quakespasm.pak") to your Quake game directory. Compile time options include o make DO_USERDIRS=1 to include user directories support @@ -247,12 +251,6 @@ o make USE_SDL2=1 to compile against SDL2 instead of SDL-1.2 - Streaming music playback requires "libmad" or "libmpg123" for MP3, and - "libogg" and "libvorbis" for OGG files. - - The project can also be built with Codeblocks (project files - included). - 4.2. Windows The QuakeSpasm developers cross-compile windows binaries using MinGW @@ -289,7 +287,39 @@ 6. Changes - 6.1. Changes in 0.93.2 + 6.1. Changes in 0.93.3 + + o Fix rendering bug when cl_bobcycle was set to zero (sf.net bug/41) + + o Fixed buffer overflow with large char skybox names (sf.net bug/38) + + o Fixed a missing MAXALIASFRAMES bounds check (sf.net bug/37) + + o OpenGL: workaround Intel UHD 600 driver bug (sf.net bug/39) + + o OpenGL: merged surface mark & cull optimizations from vkQuake. + + o Reject lit files if they're the wrong size (eg hipnotic/start.bsp + vs id1/start.lit or just a bsp that no longer has any coloured + lits, etc) + + o Save: remove CR/LFs from level name to avoids broken saves, e.g. + with autumn_sp map. + + o Music: improvements to mp3 tag detection / skipping. + + o Music: umx loader fix for malformed / crafted files. + + o New console command music_jump: Jump to given order in music, like + Unreal's music change - only for module (tracker) music. + + o Updated third-party libraries (music codecs, SDL, etc.) Other minor + fixes, tidy-ups and protability tweaks. + + o Source repository moved to git. + + + 6.2. Changes in 0.93.2 o Lightmaps are now dynamically allocated (from QSS), and BLOCK_WIDTH/HEIGHT raised from 128 to 256. @@ -309,7 +339,7 @@ o Update the third-party libraries. Other fixes/cleanups. - 6.2. Changes in 0.93.1 + 6.3. Changes in 0.93.1 o Fixed a fog regression which was introduced in 0.93.0. @@ -327,7 +357,7 @@ o Update the third-party libraries. Other fixes/cleanups. - 6.3. Changes in 0.93.0 + 6.4. Changes in 0.93.0 o Raise default "joy_deadzone_trigger" cvar to 0.2. @@ -412,7 +442,7 @@ o Update the third-party libraries. - 6.4. Changes in 0.92.1 + 6.5. Changes in 0.92.1 o Fixed large menu scale factors (was broken in 0.92.0). @@ -421,7 +451,7 @@ o Updated some of the third-party libraries. - 6.5. Changes in 0.92.0 + 6.6. Changes in 0.92.0 o SDL2 Game Controller support. @@ -458,9 +488,9 @@ o Updated some of the third-party libraries. Other fixes/clean-ups. - 6.6. Changes in 0.91.0 + 6.7. Changes in 0.91.0 - 6.6.1. Bugfixes + 6.7.1. Bugfixes o Fix unwanted fog mode change upon video restart. @@ -496,7 +526,7 @@ o Prevent a possible vulnerability in MSG_ReadString (old Q1/Q2 bug). - 6.6.2. Visual improvements + 6.7.2. Visual improvements o New cvars r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ/RMQEngine, non-archived, @@ -507,18 +537,18 @@ o GLSL gamma is now supported on older hardware without NPOT extension. - 6.6.3. Interface improvements + 6.7.3. Interface improvements o New r_pos command to show player position. o NaN detection in traceline with "developer 1" set now warns instead of errors. - 6.6.4. Code cleanup / Other + 6.7.4. Code cleanup / Other o Update third-party libraries. - 6.6.5. Raised limits + 6.7.5. Raised limits o Default max_edicts 8192 (was 2048) and no longer saved to config.cfg. @@ -530,9 +560,9 @@ o Raised MAX_SFX to 1024 (was 512). - 6.7. Changes in 0.90.1 + 6.8. Changes in 0.90.1 - 6.7.1. Bugfixes + 6.8.1. Bugfixes o Fix dynamic light artifact where changing lightmap are rendered one frame late (bug introduced in 0.90.0). @@ -555,13 +585,13 @@ o Fix crash on out-of-bounds skin number. - 6.7.2. Performance + 6.8.2. Performance o Use multithreaded OpenGL on OS X for better performance. o New, faster mdl renderer using GLSL. Disable with "-noglslalias". - 6.7.3. Visual improvements + 6.8.3. Visual improvements o New gamma correction implementation using GLSL. Fixes all known gamma issues (affecting the full display, persisting after @@ -575,7 +605,7 @@ o r_noshadow_list cvar added (from MarkV.) - 6.7.4. Interface improvements + 6.8.4. Interface improvements o Support pausing demo playback with the "pause" command. @@ -592,14 +622,14 @@ "trying to load ent", "bad chunk length", "meshing", "PR_AlocStringSlots: realloc'ing" - 6.7.5. Code cleanup + 6.8.5. Code cleanup o Clean up IDE project files to build on fresh systems. o Update 3rd-party libraries. - 6.8. Changes in 0.90.0 + 6.9. Changes in 0.90.0 o Fix issues on Windows systems with DPI scaling. @@ -707,7 +737,7 @@ o Other fixes and clean-ups. - 6.9. Changes in 0.85.9 + 6.10. Changes in 0.85.9 o Fixes for several undefined behaviors in C code (gcc-4.8 support.) @@ -754,7 +784,7 @@ o Several other minor fixes/cleanups. - 6.10. Changes in 0.85.8 + 6.11. Changes in 0.85.8 o Made Quake shareware 1.00 and 1.01 versions to be recognized properly. @@ -801,7 +831,7 @@ o Miscellaneous source code cleanups. - 6.11. Changes in 0.85.7 + 6.12. Changes in 0.85.7 o Added support for cross-level demo playback @@ -827,7 +857,7 @@ o Several other small changes mostly invisible to the end-user - 6.12. Changes in 0.85.6 + 6.13. Changes in 0.85.6 o More work for string buffer safety @@ -840,7 +870,7 @@ o Minor SDL video fixes. - 6.13. Changes in 0.85.5 + 6.14. Changes in 0.85.5 o SDL input driver updated adding native keymap and dead key support to the console @@ -871,7 +901,7 @@ o Several code updates from uHexen2 project, several code cleanups. - 6.14. Changes in 0.85.4 + 6.15. Changes in 0.85.4 o Implement music (OGG, MP3, WAV) playback @@ -899,7 +929,7 @@ o Other minor sound and cdaudio updates - 6.15. Changes in 0.85.3 + 6.16. Changes in 0.85.3 o Fix the "-dedicated" option (thanks Oz) and add platform specific networking code (default) rather than SDL_net @@ -936,7 +966,7 @@ some other CD tweaks. - 6.16. Changes in 0.85.2 + 6.17. Changes in 0.85.2 o Replace the old "Screen size" slider with a "Scale" slider @@ -964,7 +994,7 @@ o Add OSX Makefile (tested?) - 6.17. Changes in 0.85.1 + 6.18. Changes in 0.85.1 o 64 bit CPU support @@ -1045,3 +1075,4 @@ http://www.celephais.net/board/view_thread.php?id=60452 o Inside3D forums: http://forums.insideqc.com + diff --git a/Windows/SDL/include/SDL_config_os2.h b/Windows/SDL/include/SDL_config_os2.h index 0342c818..56eb7872 100644 --- a/Windows/SDL/include/SDL_config_os2.h +++ b/Windows/SDL/include/SDL_config_os2.h @@ -70,8 +70,8 @@ #define HAVE__STRREV 1 #define HAVE__STRUPR 1 #define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 +/* #undef HAVE_INDEX */ +/* #undef HAVE_RINDEX */ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 @@ -119,10 +119,11 @@ /* Enable various video drivers */ #define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_OS2FS 1 +#define SDL_VIDEO_DRIVER_OS2GROP 1 +/* #undef SDL_VIDEO_DRIVER_OS2FS */ /* Enable OpenGL support */ -/* Nothing yet for OS/2. */ +/* #undef SDL_VIDEO_OPENGL */ /* Enable assembly routines where available */ #define SDL_ASSEMBLY_ROUTINES 1 diff --git a/Windows/SDL/include/SDL_cpuinfo.h b/Windows/SDL/include/SDL_cpuinfo.h index 1335b982..4200d6d1 100644 --- a/Windows/SDL/include/SDL_cpuinfo.h +++ b/Windows/SDL/include/SDL_cpuinfo.h @@ -60,12 +60,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); /** This function returns true if the CPU has AltiVec features */ extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(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 ARM NEON features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMNEON(void); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Windows/SDL/include/SDL_endian.h b/Windows/SDL/include/SDL_endian.h index 953f2c0f..db5343f9 100644 --- a/Windows/SDL/include/SDL_endian.h +++ b/Windows/SDL/include/SDL_endian.h @@ -31,7 +31,7 @@ #include "SDL_stdinc.h" /** @name SDL_ENDIANs - * The two types of endianness + * The two types of endianness */ /*@{*/ #define SDL_LIL_ENDIAN 1234 @@ -94,6 +94,12 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x) __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); return (Uint16)result; } +#elif defined(__GNUC__) && defined(__aarch64__) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("rev16 %w1, %w0" : "=r"(x) : "r"(x)); + return x; +} #elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint16 SDL_Swap16(Uint16 x) { @@ -130,11 +136,17 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) { Uint32 result; - __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); - __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); - __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); return result; } +#elif defined(__GNUC__) && defined(__aarch64__) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("rev %w1, %w0": "=r"(x):"r"(x)); + return x; +} #elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) static __inline__ Uint32 SDL_Swap32(Uint32 x) { @@ -143,19 +155,10 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) } #elif defined(__WATCOMC__) && defined(__386__) extern _inline Uint32 SDL_Swap32(Uint32); -#ifndef __SW_3 /* 486+ */ #pragma aux SDL_Swap32 = \ "bswap eax" \ parm [eax] \ modify [eax]; -#else /* 386-only */ -#pragma aux SDL_Swap32 = \ - "xchg al, ah" \ - "ror eax, 16" \ - "xchg al, ah" \ - parm [eax] \ - modify [eax]; -#endif #else static __inline__ Uint32 SDL_Swap32(Uint32 x) { return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); @@ -167,14 +170,14 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x) { !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) static __inline__ Uint64 SDL_Swap64(Uint64 x) { - union { + union { struct { Uint32 a,b; } s; Uint64 u; } v; v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" - : "=r" (v.s.a), "=r" (v.s.b) - : "0" (v.s.a), "1" (v.s.b)); + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); return v.u; } #elif defined(__GNUC__) && defined(__x86_64__) @@ -183,6 +186,14 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x) __asm__("bswapq %0" : "=r" (x) : "0" (x)); return x; } +#elif defined(__WATCOMC__) && defined(__386__) +extern _inline Uint64 SDL_Swap64(Uint64); +#pragma aux SDL_Swap64 = \ + "bswap eax" \ + "bswap edx" \ + "xchg eax,edx" \ + parm [eax edx] \ + modify [eax edx]; #else static __inline__ Uint64 SDL_Swap64(Uint64 x) { diff --git a/Windows/SDL/include/SDL_opengl.h b/Windows/SDL/include/SDL_opengl.h index 3d791d69..163872a6 100644 --- a/Windows/SDL/include/SDL_opengl.h +++ b/Windows/SDL/include/SDL_opengl.h @@ -1,96 +1,90 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_opengl.h - * This is a simple file to encapsulate the OpenGL API headers - */ +/* This is a simple file to encapsulate the OpenGL API headers */ #include "SDL_config.h" #ifdef __WIN32__ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #ifndef NOMINMAX -#define NOMINMAX /* Don't defined min() and max() */ +#define NOMINMAX /* Don't define min() and max() */ #endif #include #endif #ifndef NO_SDL_GLEXT -#define __glext_h_ /* Don't let gl.h include glext.h */ +#define __glext_h_ /* Don't let gl.h include glext.h */ +#define __gl_glext_h_ /* Don't let gl.h include glext.h */ #endif #if defined(__MACOSX__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ #elif defined(__MACOS__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ #else -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ #endif #ifndef NO_SDL_GLEXT #undef __glext_h_ +#undef __gl_glext_h_ #endif -/** @name GLext.h - * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. - * It is included here because glext.h is not available on some systems. +/** glext.h + * This is included here because glext.h is not available on some systems. * If you don't want this version included, simply define "NO_SDL_GLEXT" */ -/*@{*/ #ifndef NO_SDL_GLEXT -#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) +#if !(defined(__glext_h_) || defined(__gl_glext_h_)) && !defined(GL_GLEXT_LEGACY) #define __glext_h_ +#define __gl_glext_h_ #ifdef __cplusplus extern "C" { #endif /* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** Copyright (c) 2007 The Khronos Group Inc. ** -** http://oss.sgi.com/projects/FreeB +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: ** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. ** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -111,9 +105,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/06/20 */ -/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 29 +/* glext.h last updated 2008/03/24 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 40 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -518,6 +512,32 @@ extern "C" { #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #endif +#ifndef GL_VERSION_2_1 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -3052,7 +3072,6 @@ extern "C" { #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB @@ -3097,6 +3116,331 @@ extern "C" { #ifndef GL_GREMEDY_string_marker #endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + /*************************************************************/ @@ -3147,6 +3491,51 @@ typedef unsigned short GLhalfARB; typedef unsigned short GLhalfNV; #endif +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && (defined(__GNUC__)||defined(__WATCOMC__)) +#include +#elif defined(_WIN32) +#if 0 /* handled by SDL_config_windows.h */ +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif /* */ +#elif defined(__MACOS__) /* handled by SDL_config_macos.h */ +#else +#include /* Fallback option */ +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #ifdef GL_GLEXT_PROTOTYPES @@ -3659,6 +4048,24 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #endif +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -4366,8 +4773,8 @@ typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum f typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 #endif #ifndef GL_SGI_color_table @@ -6227,12 +6634,12 @@ typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #endif @@ -6560,11 +6967,382 @@ GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); #endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); +GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); +GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); +GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); +GLAPI void APIENTRY glClearDepthdNV (GLdouble); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum); +GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + #ifdef __cplusplus } #endif -#endif +#endif /* GL_GLEXT_LEGACY */ #endif /* NO_SDL_GLEXT */ -/*@}*/ diff --git a/Windows/SDL/include/SDL_stdinc.h b/Windows/SDL/include/SDL_stdinc.h index 0df46478..ae20b9db 100644 --- a/Windows/SDL/include/SDL_stdinc.h +++ b/Windows/SDL/include/SDL_stdinc.h @@ -258,7 +258,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); #endif -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && defined(__i386__) #define SDL_memset4(dst, val, len) \ do { \ int u0, u1, u2; \ @@ -291,7 +291,7 @@ do { \ /* We can count on memcpy existing on Mac OS X and being well-tuned. */ #if defined(__MACH__) && defined(__APPLE__) #define SDL_memcpy(dst, src, len) memcpy(dst, src, len) -#elif defined(__GNUC__) && defined(i386) +#elif defined(__GNUC__) && defined(__i386__) #define SDL_memcpy(dst, src, len) \ do { \ int u0, u1, u2; \ @@ -323,7 +323,7 @@ extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len /* We can count on memcpy existing on Mac OS X and being well-tuned. */ #if defined(__MACH__) && defined(__APPLE__) #define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) -#elif defined(__GNUC__) && defined(i386) +#elif defined(__GNUC__) && defined(__i386__) #define SDL_memcpy4(dst, src, len) \ do { \ int ecx, edi, esi; \ @@ -339,7 +339,7 @@ do { \ #define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) #endif -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && defined(__i386__) #define SDL_revcpy(dst, src, len) \ do { \ int u0, u1, u2; \ diff --git a/Windows/SDL/include/SDL_video.h b/Windows/SDL/include/SDL_video.h index f9c4e070..aa0459cd 100644 --- a/Windows/SDL/include/SDL_video.h +++ b/Windows/SDL/include/SDL_video.h @@ -138,6 +138,7 @@ typedef struct SDL_Surface { #define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ #define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ #define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ +#define SDL_TRIPLEBUF 0x40000100 /**< Set up triple-buffered video mode */ #define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ #define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ #define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ diff --git a/Windows/SDL/lib/SDL.dll b/Windows/SDL/lib/SDL.dll index 59bff48b..e199dad5 100644 Binary files a/Windows/SDL/lib/SDL.dll and b/Windows/SDL/lib/SDL.dll differ diff --git a/Windows/SDL/lib/SDL.lib b/Windows/SDL/lib/SDL.lib index 0722a5b7..317814bc 100644 Binary files a/Windows/SDL/lib/SDL.lib and b/Windows/SDL/lib/SDL.lib differ diff --git a/Windows/SDL/lib/libSDL.dll.a b/Windows/SDL/lib/libSDL.dll.a index 0d333d47..c4a2b1fe 100644 Binary files a/Windows/SDL/lib/libSDL.dll.a and b/Windows/SDL/lib/libSDL.dll.a differ diff --git a/Windows/SDL/lib/libSDLmain.a b/Windows/SDL/lib/libSDLmain.a index 2ab31840..ba7b8e28 100644 Binary files a/Windows/SDL/lib/libSDLmain.a and b/Windows/SDL/lib/libSDLmain.a differ diff --git a/Windows/SDL/lib64/SDL.dll b/Windows/SDL/lib64/SDL.dll index af8b0a3d..82849072 100644 Binary files a/Windows/SDL/lib64/SDL.dll and b/Windows/SDL/lib64/SDL.dll differ diff --git a/Windows/SDL/lib64/SDL.lib b/Windows/SDL/lib64/SDL.lib index ae2f687f..9b6c0346 100644 Binary files a/Windows/SDL/lib64/SDL.lib and b/Windows/SDL/lib64/SDL.lib differ diff --git a/Windows/SDL/lib64/libSDL.dll.a b/Windows/SDL/lib64/libSDL.dll.a index e82e04d5..08955112 100644 Binary files a/Windows/SDL/lib64/libSDL.dll.a and b/Windows/SDL/lib64/libSDL.dll.a differ diff --git a/Windows/SDL/lib64/libSDLmain.a b/Windows/SDL/lib64/libSDLmain.a index 6c4d94c0..a8136711 100644 Binary files a/Windows/SDL/lib64/libSDLmain.a and b/Windows/SDL/lib64/libSDLmain.a differ diff --git a/Windows/SDL/watcom/SDL.def b/Windows/SDL/watcom/SDL.def index 751a54bc..a4c6c311 100644 --- a/Windows/SDL/watcom/SDL.def +++ b/Windows/SDL/watcom/SDL.def @@ -82,8 +82,6 @@ SDL_GetVideoSurface SDL_GetWMInfo SDL_Has3DNow SDL_Has3DNowExt -SDL_HasARMNEON -SDL_HasARMSIMD SDL_HasAltiVec SDL_HasMMX SDL_HasMMXExt diff --git a/Windows/SDL/watcom/SDL.exp b/Windows/SDL/watcom/SDL.exp index 726aac98..f79fe749 100644 --- a/Windows/SDL/watcom/SDL.exp +++ b/Windows/SDL/watcom/SDL.exp @@ -79,8 +79,6 @@ ++'_SDL_GetWMInfo'.'SDL.DLL'..'SDL_GetWMInfo' ++'_SDL_Has3DNow'.'SDL.DLL'..'SDL_Has3DNow' ++'_SDL_Has3DNowExt'.'SDL.DLL'..'SDL_Has3DNowExt' -++'_SDL_HasARMNEON'.'SDL.DLL'..'SDL_HasARMNEON' -++'_SDL_HasARMSIMD'.'SDL.DLL'..'SDL_HasARMSIMD' ++'_SDL_HasAltiVec'.'SDL.DLL'..'SDL_HasAltiVec' ++'_SDL_HasMMX'.'SDL.DLL'..'SDL_HasMMX' ++'_SDL_HasMMXExt'.'SDL.DLL'..'SDL_HasMMXExt' diff --git a/Windows/SDL/watcom/SDL.lib b/Windows/SDL/watcom/SDL.lib index 79c72c98..ec009eff 100644 Binary files a/Windows/SDL/watcom/SDL.lib and b/Windows/SDL/watcom/SDL.lib differ diff --git a/Windows/SDL2/COPYING.txt b/Windows/SDL2/COPYING.txt index 1a5e2b64..f158cb42 100644 --- a/Windows/SDL2/COPYING.txt +++ b/Windows/SDL2/COPYING.txt @@ -1,6 +1,6 @@ Simple DirectMedia Layer -Copyright (C) 1997-2019 Sam Lantinga +Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/WhatsNew.txt b/Windows/SDL2/WhatsNew.txt index ef2b07b5..04c87588 100644 --- a/Windows/SDL2/WhatsNew.txt +++ b/Windows/SDL2/WhatsNew.txt @@ -2,11 +2,141 @@ This is a list of major changes in SDL's version history. --------------------------------------------------------------------------- -2.0.11/12: +2.0.14: +--------------------------------------------------------------------------- +General: +* Added support for PS5 DualSense and Xbox Series X controllers to the HIDAPI controller driver +* Added game controller button constants for paddles and new buttons +* Added game controller functions to get additional information: + * SDL_GameControllerGetSerial() + * SDL_GameControllerHasAxis() + * SDL_GameControllerHasButton() + * SDL_GameControllerGetNumTouchpads() + * SDL_GameControllerGetNumTouchpadFingers() + * SDL_GameControllerGetTouchpadFinger() + * SDL_GameControllerHasSensor() + * SDL_GameControllerSetSensorEnabled() + * SDL_GameControllerIsSensorEnabled() + * SDL_GameControllerGetSensorData() + * SDL_GameControllerRumbleTriggers() + * SDL_GameControllerHasLED() + * SDL_GameControllerSetLED() +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_PS5 to control whether the HIDAPI driver for PS5 controllers should be used. +* Added joystick functions to get additional information: + * SDL_JoystickGetSerial() + * SDL_JoystickRumbleTriggers() + * SDL_JoystickHasLED() + * SDL_JoystickSetLED() +* Added an API to allow the application to create virtual joysticks: + * SDL_JoystickAttachVirtual() + * SDL_JoystickDetachVirtual() + * SDL_JoystickIsVirtual() + * SDL_JoystickSetVirtualAxis() + * SDL_JoystickSetVirtualButton() + * SDL_JoystickSetVirtualHat() +* Added SDL_LockSensors() and SDL_UnlockSensors() to guarantee exclusive access to the sensor list +* Added SDL_HAPTIC_STEERING_AXIS to play an effect on the steering wheel +* Added the hint SDL_HINT_MOUSE_RELATIVE_SCALING to control whether relative motion is scaled by the screen DPI or renderer logical size +* The default value for SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS is now false for better compatibility with modern window managers +* Added SDL_GetPreferredLocales() to get the application's current locale setting +* Added the hint SDL_HINT_PREFERRED_LOCALES to override your application's default locale setting +* Added SDL_OpenURL() to open a URL in the system's default browser +* Added SDL_HasSurfaceRLE() to tell whether a surface is currently using RLE encoding +* Added SDL_SIMDRealloc() to reallocate memory obtained from SDL_SIMDAlloc() +* Added SDL_GetErrorMsg() to get the last error in a thread-safe way +* Added SDL_crc32(), SDL_wcscasecmp(), SDL_wcsncasecmp(), SDL_trunc(), SDL_truncf() +* Added clearer names for RGB pixel formats, e.g. SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, etc. + +Windows: +* Added the RAWINPUT controller driver to support more than 4 Xbox controllers simultaneously +* Added the hint SDL_HINT_JOYSTICK_RAWINPUT to control whether the RAWINPUT driver should be used +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT to control whether XInput and WGI should be used to for complete controller functionality with the RAWINPUT driver. + +macOS: +* Added the SDL_WINDOW_METAL flag to specify that a window should be created with a Metal view +* Added SDL_Metal_GetLayer() to get the CAMetalLayer backing a Metal view +* Added SDL_Metal_GetDrawableSize() to get the size of a window's drawable, in pixels + +Linux: +* Added the hint SDL_HINT_AUDIO_DEVICE_APP_NAME to specify the name that shows up in PulseAudio for your application +* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_NAME to specify the name that shows up in PulseAudio associated with your audio stream +* Added the hint SDL_HINT_LINUX_JOYSTICK_DEADZONES to control whether HID defined dead zones should be respected on Linux +* Added the hint SDL_HINT_THREAD_PRIORITY_POLICY to specify the thread scheduler policy +* Added the hint SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL to allow time critical threads to use a realtime scheduling policy + +Android: +* Added SDL_AndroidRequestPermission() to request a specific system permission +* Added the hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO to control whether audio will pause when the application goes intot he background + +OS/2: +* Added support for OS/2, see docs/README-os2.md for details + +Emscripten (running in a web browser): +* Added the hint SDL_HINT_EMSCRIPTEN_ASYNCIFY to control whether SDL should call emscripten_sleep internally + + +--------------------------------------------------------------------------- +2.0.12: --------------------------------------------------------------------------- General: +* Added SDL_GetTextureScaleMode() and SDL_SetTextureScaleMode() to get and set the scaling mode used for a texture * Added SDL_LockTextureToSurface(), similar to SDL_LockTexture() but the locked area is exposed as a SDL surface. +* Added new blend mode, SDL_BLENDMODE_MUL, which does a modulate and blend operation +* Added the hint SDL_HINT_DISPLAY_USABLE_BOUNDS to override the results of SDL_GetDisplayUsableBounds() for display index 0. +* Added the window underneath the finger to the SDL_TouchFingerEvent +* Added SDL_GameControllerTypeForIndex(), SDL_GameControllerGetType() to return the type of a game controller (Xbox 360, Xbox One, PS3, PS4, or Nintendo Switch Pro) +* Added the hint SDL_HINT_GAMECONTROLLERTYPE to override the automatic game controller type detection +* Added SDL_JoystickFromPlayerIndex() and SDL_GameControllerFromPlayerIndex() to get the device associated with a player index +* Added SDL_JoystickSetPlayerIndex() and SDL_GameControllerSetPlayerIndex() to set the player index associated with a device +* Added the hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to specify whether Nintendo Switch Pro controllers should use the buttons as labeled or swapped to match positional layout. The default is to use the buttons as labeled. +* Added support for Nintendo GameCube controllers to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE to control whether this is used. +* Improved support for Xbox 360 and Xbox One controllers when using the HIDAPI driver +* Added support for many game controllers, including: + * 8BitDo FC30 Pro + * 8BitDo M30 GamePad + * BDA PS4 Fightpad + * HORI Fighting Commander + * Hyperkin Duke + * Hyperkin X91 + * MOGA XP5-A Plus + * NACON GC-400ES + * NVIDIA Controller v01.04 + * PDP Versus Fighting Pad + * Razer Raion Fightpad for PS4 + * Razer Serval + * Stadia Controller + * SteelSeries Stratus Duo + * Victrix Pro Fight Stick for PS4 + * Xbox One Elite Series 2 +* Fixed blocking game controller rumble calls when using the HIDAPI driver +* Added SDL_zeroa() macro to zero an array of elements +* Added SDL_HasARMSIMD() which returns true if the CPU has ARM SIMD (ARMv6+) features + +Windows: +* Fixed crash when using the release SDL DLL with applications built with gcc +* Fixed performance regression in event handling introduced in 2.0.10 +* Added support for SDL_SetThreadPriority() for UWP applications + +Linux: +* Added the hint SDL_HINT_VIDEO_X11_WINDOW_VISUALID to specify the visual chosen for new X11 windows +* Added the hint SDL_HINT_VIDEO_X11_FORCE_EGL to specify whether X11 should use GLX or EGL by default + +iOS / tvOS / macOS: +* Added SDL_Metal_CreateView() and SDL_Metal_DestroyView() to create CAMetalLayer-backed NSView/UIView and attach it to the specified window. + +iOS/ tvOS: +* Added support for Bluetooth Steam Controllers as game controllers + +tvOS: +* Fixed support for surround sound on Apple TV + +Android: +* Added SDL_GetAndroidSDKVersion() to return the API level of the current device +* Added support for audio capture using OpenSL-ES +* Added support for Bluetooth Steam Controllers as game controllers +* Fixed rare crashes when the app goes into the background or terminates + --------------------------------------------------------------------------- 2.0.10: diff --git a/Windows/SDL2/bin/sdl2-config b/Windows/SDL2/bin/sdl2-config index 737d36f6..859dff16 100755 --- a/Windows/SDL2/bin/sdl2-config +++ b/Windows/SDL2/bin/sdl2-config @@ -40,7 +40,7 @@ while test $# -gt 0; do lib_suffix=$optarg ;; --version) - echo 2.0.11 + echo 2.0.14 ;; --cflags) echo -I${prefix}/include -Dmain=SDL_main diff --git a/Windows/SDL2/include/SDL.h b/Windows/SDL2/include/SDL.h index e4329395..e2656caf 100644 --- a/Windows/SDL2/include/SDL.h +++ b/Windows/SDL2/include/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -59,6 +59,8 @@ #include "SDL_timer.h" #include "SDL_version.h" #include "SDL_video.h" +#include "SDL_locale.h" +#include "SDL_misc.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ diff --git a/Windows/SDL2/include/SDL_assert.h b/Windows/SDL2/include/SDL_assert.h index 8baecb63..f8a368ec 100644 --- a/Windows/SDL2/include/SDL_assert.h +++ b/Windows/SDL2/include/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -53,6 +53,8 @@ assert can have unique static variables associated with it. #define SDL_TriggerBreakpoint() __debugbreak() #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif ( defined(__APPLE__) && defined(__arm64__) ) /* this might work on other ARM targets, but this is a known quantity... */ + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) #elif defined(__386__) && defined(__WATCOMC__) #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) diff --git a/Windows/SDL2/include/SDL_atomic.h b/Windows/SDL2/include/SDL_atomic.h index deee35f9..e99f1bcc 100644 --- a/Windows/SDL2/include/SDL_atomic.h +++ b/Windows/SDL2/include/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_audio.h b/Windows/SDL2/include/SDL_audio.h index 305c01a9..4ba34914 100644 --- a/Windows/SDL2/include/SDL_audio.h +++ b/Windows/SDL2/include/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_bits.h b/Windows/SDL2/include/SDL_bits.h index b116cc8d..db150ed0 100644 --- a/Windows/SDL2/include/SDL_bits.h +++ b/Windows/SDL2/include/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_blendmode.h b/Windows/SDL2/include/SDL_blendmode.h index 6f0a22b9..5e21a79e 100644 --- a/Windows/SDL2/include/SDL_blendmode.h +++ b/Windows/SDL2/include/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga 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() */ diff --git a/Windows/SDL2/include/SDL_clipboard.h b/Windows/SDL2/include/SDL_clipboard.h index c4f8766c..dbf69fce 100644 --- a/Windows/SDL2/include/SDL_clipboard.h +++ b/Windows/SDL2/include/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_config.h b/Windows/SDL2/include/SDL_config.h index 7d62d3e2..3937dbc3 100644 --- a/Windows/SDL2/include/SDL_config.h +++ b/Windows/SDL2/include/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_config_android.h b/Windows/SDL2/include/SDL_config_android.h index 9cb70bfe..d1148cf2 100644 --- a/Windows/SDL2/include/SDL_config_android.h +++ b/Windows/SDL2/include/SDL_config_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -121,6 +121,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -136,8 +138,9 @@ /* Enable various input drivers */ #define SDL_JOYSTICK_ANDROID 1 -#define SDL_JOYSTICK_HIDAPI 1 -#define SDL_HAPTIC_ANDROID 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_ANDROID 1 /* Enable sensor driver */ #define SDL_SENSOR_ANDROID 1 diff --git a/Windows/SDL2/include/SDL_config_iphoneos.h b/Windows/SDL2/include/SDL_config_iphoneos.h index edfc03e2..f06ad335 100644 --- a/Windows/SDL2/include/SDL_config_iphoneos.h +++ b/Windows/SDL2/include/SDL_config_iphoneos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -122,6 +122,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -136,9 +138,11 @@ /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ #define SDL_HAPTIC_DUMMY 1 -/* Enable MFi joystick support */ -#define SDL_JOYSTICK_MFI 1 +/* Enable joystick support */ +/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */ /*#define SDL_JOYSTICK_HIDAPI 1*/ +#define SDL_JOYSTICK_MFI 1 +#define SDL_JOYSTICK_VIRTUAL 1 #ifdef __TVOS__ #define SDL_SENSOR_DUMMY 1 @@ -167,8 +171,10 @@ #define SDL_VIDEO_RENDER_OGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES2 1 -/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer */ -#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)) +/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer + Also supported in simulator from iOS 13.0 and tvOS 13.0 + */ +#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000))) #define SDL_PLATFORM_SUPPORTS_METAL 1 #else #define SDL_PLATFORM_SUPPORTS_METAL 0 @@ -195,11 +201,6 @@ /* enable iOS extended launch screen */ #define SDL_IPHONE_LAUNCHSCREEN 1 -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - /* enable filesystem support */ #define SDL_FILESYSTEM_COCOA 1 diff --git a/Windows/SDL2/include/SDL_config_macosx.h b/Windows/SDL2/include/SDL_config_macosx.h index 22287dfc..4b45f165 100644 --- a/Windows/SDL2/include/SDL_config_macosx.h +++ b/Windows/SDL2/include/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga 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,6 +125,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -139,10 +141,16 @@ #define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ +#define SDL_JOYSTICK_HIDAPI 1 #define SDL_JOYSTICK_IOKIT 1 -#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_IOKIT 1 +/* The MFI controller support requires ARC Objective C runtime */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__) +#define SDL_JOYSTICK_MFI 1 +#endif + /* Enable the dummy sensor driver */ #define SDL_SENSOR_DUMMY 1 @@ -195,7 +203,7 @@ #endif /* Metal only supported on 64-bit architectures with 10.11+ */ -#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) +#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) #define SDL_PLATFORM_SUPPORTS_METAL 1 #else #define SDL_PLATFORM_SUPPORTS_METAL 0 diff --git a/Windows/SDL2/include/SDL_config_minimal.h b/Windows/SDL2/include/SDL_config_minimal.h index 20e45b88..b9c39584 100644 --- a/Windows/SDL2/include/SDL_config_minimal.h +++ b/Windows/SDL2/include/SDL_config_minimal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_config_os2.h b/Windows/SDL2/include/SDL_config_os2.h index f03ca4a5..1922217d 100644 --- a/Windows/SDL2/include/SDL_config_os2.h +++ b/Windows/SDL2/include/SDL_config_os2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,14 +27,17 @@ #define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_OS2 1 #define SDL_POWER_DISABLED 1 #define SDL_JOYSTICK_DISABLED 1 #define SDL_HAPTIC_DISABLED 1 /*#undef SDL_JOYSTICK_HIDAPI */ +/*#undef SDL_JOYSTICK_VIRTUAL */ #define SDL_SENSOR_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2 1 /* Enable OpenGL support */ /* #undef SDL_VIDEO_OPENGL */ @@ -42,18 +45,19 @@ /* Enable Vulkan support */ /* #undef SDL_VIDEO_VULKAN */ -#define SDL_LOADSO_DISABLED 1 -#define SDL_THREADS_DISABLED 1 -#define SDL_TIMERS_DISABLED 1 -#define SDL_FILESYSTEM_DUMMY 1 +#define SDL_THREAD_OS2 1 +#define SDL_LOADSO_OS2 1 +#define SDL_TIMER_OS2 1 +#define SDL_FILESYSTEM_OS2 1 /* Enable assembly routines */ #define SDL_ASSEMBLY_ROUTINES 1 -/* #undef HAVE_LIBSAMPLERATE_H */ +/* use libsamplerate for audio rate conversion. */ +/*#define HAVE_LIBSAMPLERATE_H 1 */ /* Enable dynamic libsamplerate support */ -/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ +#define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL" #define HAVE_LIBC 1 @@ -99,6 +103,8 @@ #define HAVE_WCSLCPY 1 #define HAVE_WCSLCAT 1 #define HAVE_WCSCMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 @@ -176,5 +182,7 @@ /* #undef HAVE_SQRTF */ #define HAVE_TAN 1 /* #undef HAVE_TANF */ +/* #undef HAVE_TRUNC */ +/* #undef HAVE_TRUNCF */ #endif /* SDL_config_os2_h_ */ diff --git a/Windows/SDL2/include/SDL_config_pandora.h b/Windows/SDL2/include/SDL_config_pandora.h index 66ccf895..8728a638 100644 --- a/Windows/SDL2/include/SDL_config_pandora.h +++ b/Windows/SDL2/include/SDL_config_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -102,6 +102,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -110,8 +112,8 @@ #define SDL_AUDIO_DRIVER_OSS 1 #define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 #define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_LINUX 1 #define SDL_SENSOR_DUMMY 1 diff --git a/Windows/SDL2/include/SDL_config_psp.h b/Windows/SDL2/include/SDL_config_psp.h index dd2d6ecf..235fe08e 100644 --- a/Windows/SDL2/include/SDL_config_psp.h +++ b/Windows/SDL2/include/SDL_config_psp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -136,6 +136,7 @@ /* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ #define SDL_JOYSTICK_PSP 1 +#define SDL_JOYSTICK_VIRTUAL 1 /* Enable the dummy sensor driver */ #define SDL_SENSOR_DUMMY 1 diff --git a/Windows/SDL2/include/SDL_config_windows.h b/Windows/SDL2/include/SDL_config_windows.h index c66d8754..18a36382 100644 --- a/Windows/SDL2/include/SDL_config_windows.h +++ b/Windows/SDL2/include/SDL_config_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga 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,6 +84,7 @@ typedef unsigned int uintptr_t; #define HAVE_XINPUT_H 1 #define HAVE_MMDEVICEAPI_H 1 #define HAVE_AUDIOCLIENT_H 1 +#define HAVE_SENSORSAPI_H /* This is disabled by default to avoid C runtime dependencies and manifest requirements */ #ifdef HAVE_LIBC @@ -133,6 +134,8 @@ typedef unsigned int uintptr_t; #define HAVE_STRNCMP 1 #define HAVE__STRICMP 1 #define HAVE__STRNICMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 #define HAVE_ACOS 1 #define HAVE_ACOSF 1 #define HAVE_ASIN 1 @@ -172,6 +175,8 @@ typedef unsigned int uintptr_t; #define HAVE_VSSCANF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #endif /* This function is available with at least the VC++ 2008 C runtime library */ #if _MSC_VER >= 1400 @@ -186,8 +191,22 @@ typedef unsigned int uintptr_t; #define HAVE_STDDEF_H 1 #endif +/* Check to see if we have Windows 10 build environment */ +#if _MSC_VER >= 1911 /* Visual Studio 15.3 */ +#include +#if _WIN32_WINNT >= 0x0601 /* Windows 7 */ +#define SDL_WINDOWS7_SDK +#endif +#if _WIN32_WINNT >= 0x0602 /* Windows 8 */ +#define SDL_WINDOWS8_SDK +#endif +#if _WIN32_WINNT >= 0x0A00 /* Windows 10 */ +#define SDL_WINDOWS10_SDK +#endif +#endif /* _MSC_VER >= 1911 */ + /* Enable various audio drivers */ -/* #undef SDL_AUDIO_DRIVER_WASAPI */ +#define SDL_AUDIO_DRIVER_WASAPI 1 #define SDL_AUDIO_DRIVER_DSOUND 1 #define SDL_AUDIO_DRIVER_WINMM 1 #define SDL_AUDIO_DRIVER_DISK 1 @@ -195,13 +214,20 @@ typedef unsigned int uintptr_t; /* Enable various input drivers */ #define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_XINPUT 1 #define SDL_JOYSTICK_HIDAPI 1 +#ifndef __WINRT__ +#define SDL_JOYSTICK_RAWINPUT 1 +#endif +#define SDL_JOYSTICK_VIRTUAL 1 +#ifdef SDL_WINDOWS10_SDK +#define SDL_JOYSTICK_WGI 1 +#endif +#define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_DINPUT 1 #define SDL_HAPTIC_XINPUT 1 -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 +/* Enable the sensor driver */ +#define SDL_SENSOR_WINDOWS 1 /* Enable various shared object loading systems */ #define SDL_LOADSO_WINDOWS 1 @@ -219,8 +245,8 @@ typedef unsigned int uintptr_t; #ifndef SDL_VIDEO_RENDER_D3D #define SDL_VIDEO_RENDER_D3D 1 #endif -#ifndef SDL_VIDEO_RENDER_D3D11 -#define SDL_VIDEO_RENDER_D3D11 0 +#ifdef SDL_WINDOWS7_SDK +#define SDL_VIDEO_RENDER_D3D11 1 #endif /* Enable OpenGL support */ @@ -258,3 +284,5 @@ typedef unsigned int uintptr_t; #endif #endif /* SDL_config_windows_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_config_winrt.h b/Windows/SDL2/include/SDL_config_winrt.h index cb85b234..02079f53 100644 --- a/Windows/SDL2/include/SDL_config_winrt.h +++ b/Windows/SDL2/include/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -181,6 +181,8 @@ typedef unsigned int uintptr_t; #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE__FSEEKI64 1 /* Enable various audio drivers */ @@ -193,6 +195,7 @@ typedef unsigned int uintptr_t; #define SDL_JOYSTICK_DISABLED 1 #define SDL_HAPTIC_DISABLED 1 #else +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_XINPUT 1 #endif diff --git a/Windows/SDL2/include/SDL_config_wiz.h b/Windows/SDL2/include/SDL_config_wiz.h index 724c55fc..f65af8eb 100644 --- a/Windows/SDL2/include/SDL_config_wiz.h +++ b/Windows/SDL2/include/SDL_config_wiz.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -117,6 +117,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -126,8 +128,8 @@ #define SDL_AUDIO_DRIVER_OSS 1 #define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 #define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_LINUX 1 #define SDL_SENSOR_DUMMY 1 diff --git a/Windows/SDL2/include/SDL_copying.h b/Windows/SDL2/include/SDL_copying.h index 1ef18cd1..4f8a2bcd 100644 --- a/Windows/SDL2/include/SDL_copying.h +++ b/Windows/SDL2/include/SDL_copying.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_cpuinfo.h b/Windows/SDL2/include/SDL_cpuinfo.h index 2d094e88..df3123c0 100644 --- a/Windows/SDL2/include/SDL_cpuinfo.h +++ b/Windows/SDL2/include/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -246,10 +246,33 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); * \return Pointer to newly-allocated block, NULL if out of memory. * * \sa SDL_SIMDAlignment + * \sa SDL_SIMDRealloc * \sa SDL_SIMDFree */ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); +/** + * \brief Reallocate memory obtained from SDL_SIMDAlloc + * + * It is not valid to use this function on a pointer from anything but + * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, + * SDL_malloc, memalign, new[], etc. + * + * \param mem The pointer obtained from SDL_SIMDAlloc. This function also + * accepts NULL, at which point this function is the same as + * calling SDL_realloc with a NULL pointer. + * \param len The length, in bytes, of the block to allocated. The actual + * allocated block might be larger due to padding, etc. Passing 0 + * will return a non-NULL pointer, assuming the system isn't out of + * memory. + * \return Pointer to newly-reallocated block, NULL if out of memory. + * + * \sa SDL_SIMDAlignment + * \sa SDL_SIMDAlloc + * \sa SDL_SIMDFree + */ +extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len); + /** * \brief Deallocate memory obtained from SDL_SIMDAlloc * @@ -260,6 +283,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); * However, SDL_SIMDFree(NULL) is a legal no-op. * * \sa SDL_SIMDAlloc + * \sa SDL_SIMDRealloc */ extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); diff --git a/Windows/SDL2/include/SDL_egl.h b/Windows/SDL2/include/SDL_egl.h index f95a9067..531441e6 100644 --- a/Windows/SDL2/include/SDL_egl.h +++ b/Windows/SDL2/include/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_endian.h b/Windows/SDL2/include/SDL_endian.h index 1e6daae1..171c008a 100644 --- a/Windows/SDL2/include/SDL_endian.h +++ b/Windows/SDL2/include/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_error.h b/Windows/SDL2/include/SDL_error.h index 24416e69..962d62f6 100644 --- a/Windows/SDL2/include/SDL_error.h +++ b/Windows/SDL2/include/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,9 +37,45 @@ extern "C" { #endif /* Public functions */ -/* SDL_SetError() unconditionally returns -1. */ + + +/** + * \brief Set the error message for the current thread + * + * \return -1, there is no error handling for this function + */ extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Get the last error message that was set + * + * SDL API functions may set error messages and then succeed, so you should + * only use the error value if a function fails. + * + * This returns a pointer to a static buffer for convenience and should not + * be called by multiple threads simultaneously. + * + * \return a pointer to the last error message that was set + */ extern DECLSPEC const char *SDLCALL SDL_GetError(void); + +/** + * \brief Get the last error message that was set for the current thread + * + * SDL API functions may set error messages and then succeed, so you should + * only use the error value if a function fails. + * + * \param errstr A buffer to fill with the last error message that was set + * for the current thread + * \param maxlen The size of the buffer pointed to by the errstr parameter + * + * \return errstr + */ +extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); + +/** + * \brief Clear the error message for the current thread + */ extern DECLSPEC void SDLCALL SDL_ClearError(void); /** diff --git a/Windows/SDL2/include/SDL_events.h b/Windows/SDL2/include/SDL_events.h index eaf57434..ae560c08 100644 --- a/Windows/SDL2/include/SDL_events.h +++ b/Windows/SDL2/include/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -85,6 +85,8 @@ typedef enum Called on Android in onResume() */ + SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */ + /* Display events */ SDL_DISPLAYEVENT = 0x150, /**< Display state change */ @@ -123,6 +125,10 @@ typedef enum SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */ + SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ + SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ + SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ /* Touch events */ SDL_FINGERDOWN = 0x700, @@ -413,6 +419,33 @@ typedef struct SDL_ControllerDeviceEvent Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; +/** + * \brief Game controller touchpad event structure (event.ctouchpad.*) + */ +typedef struct SDL_ControllerTouchpadEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Sint32 touchpad; /**< The index of the touchpad */ + Sint32 finger; /**< The index of the finger on the touchpad */ + float x; /**< Normalized in the range 0...1 with 0 being on the left */ + float y; /**< Normalized in the range 0...1 with 0 being at the top */ + float pressure; /**< Normalized in the range 0...1 */ +} SDL_ControllerTouchpadEvent; + +/** + * \brief Game controller sensor event structure (event.csensor.*) + */ +typedef struct SDL_ControllerSensorEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ + float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ +} SDL_ControllerSensorEvent; + /** * \brief Audio device event structure (event.adevice.*) */ @@ -557,33 +590,35 @@ typedef struct SDL_SysWMEvent */ typedef union SDL_Event { - Uint32 type; /**< Event type, shared with all events */ - SDL_CommonEvent common; /**< Common 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 */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ - SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ - SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ - SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ - SDL_AudioDeviceEvent adevice; /**< Audio device event data */ - SDL_SensorEvent sensor; /**< Sensor event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_MultiGestureEvent mgesture; /**< Gesture event data */ - SDL_DollarGestureEvent dgesture; /**< Gesture event data */ - SDL_DropEvent drop; /**< Drag and drop event data */ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common 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 */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */ + SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */ + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ + SDL_SensorEvent sensor; /**< Sensor event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ /* This is necessary for ABI compatibility between Visual C++ and GCC Visual C++ will respect the push pack pragma and use 52 bytes for diff --git a/Windows/SDL2/include/SDL_filesystem.h b/Windows/SDL2/include/SDL_filesystem.h index 6d97e589..68042b60 100644 --- a/Windows/SDL2/include/SDL_filesystem.h +++ b/Windows/SDL2/include/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_gamecontroller.h b/Windows/SDL2/include/SDL_gamecontroller.h index 5ee8e8e9..e42433c9 100644 --- a/Windows/SDL2/include/SDL_gamecontroller.h +++ b/Windows/SDL2/include/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,6 +31,7 @@ #include "SDL_stdinc.h" #include "SDL_error.h" #include "SDL_rwops.h" +#include "SDL_sensor.h" #include "SDL_joystick.h" #include "begin_code.h" @@ -64,7 +65,9 @@ typedef enum SDL_CONTROLLER_TYPE_XBOXONE, SDL_CONTROLLER_TYPE_PS3, SDL_CONTROLLER_TYPE_PS4, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, + SDL_CONTROLLER_TYPE_VIRTUAL, + SDL_CONTROLLER_TYPE_PS5 } SDL_GameControllerType; typedef enum @@ -170,7 +173,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID * * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller); +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller); /** * Is the joystick on this index supported by the game controller interface? @@ -245,19 +248,26 @@ extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController * Get the USB vendor ID of an opened controller, if available. * If the vendor ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller); +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller); /** * Get the USB product ID of an opened controller, if available. * If the product ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller); +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller); /** * Get the product version of an opened controller, if available. * If the product version isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller); +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller); + +/** + * Get the serial number of an opened controller, if available. + * + * Returns the serial number of the controller, or NULL if it is not available. + */ +extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); /** * Returns SDL_TRUE if the controller has been opened and currently connected, @@ -328,6 +338,12 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); +/** + * Return whether a game controller has a given axis + */ +extern DECLSPEC SDL_bool SDLCALL +SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); + /** * Get the current state of an axis control on a game controller. * @@ -337,8 +353,7 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, * The axis indices start at index 0. */ extern DECLSPEC Sint16 SDLCALL -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); /** * The list of buttons available from a controller @@ -361,6 +376,12 @@ typedef enum SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */ + SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */ + SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */ + SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */ + SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */ + SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ SDL_CONTROLLER_BUTTON_MAX } SDL_GameControllerButton; @@ -381,6 +402,11 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button); +/** + * Return whether a game controller has a given button + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); /** * Get the current state of a button on a game controller. @@ -391,7 +417,68 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga SDL_GameControllerButton button); /** - * Trigger a rumble effect + * Get the number of touchpads on a game controller. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); + +/** + * Get the number of supported simultaneous fingers on a touchpad on a game controller. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); + +/** + * Get the current state of a finger on a touchpad on a game controller. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); + +/** + * Return whether a game controller has a particular sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * + * \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Set whether data reporting for a game controller sensor is enabled + * + * \param gamecontroller The controller to update + * \param type The type of sensor to enable/disable + * \param enabled Whether data reporting should be enabled + * + * \return 0 or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled); + +/** + * Query whether sensor data reporting is enabled for a game controller + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * + * \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Get the current state of a game controller sensor. + * + * The number of values and interpretation of the data is sensor dependent. + * See SDL_sensor.h for the details for each type of sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * + * \return 0 or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values); + +/** + * Start a rumble effect * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. * * \param gamecontroller The controller to vibrate @@ -399,10 +486,44 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF * \param duration_ms The duration of the rumble effect, in milliseconds * - * \return 0, or -1 if rumble isn't supported on this joystick + * \return 0, or -1 if rumble isn't supported on this controller */ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); +/** + * Start a rumble effect in the game controller's triggers + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param gamecontroller The controller to vibrate + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if rumble isn't supported on this controller + */ +extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); + +/** + * Return whether a controller has an LED + * + * \param gamecontroller The controller to query + * + * \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller); + +/** + * Update a controller's LED color. + * + * \param gamecontroller The controller to update + * \param red The intensity of the red LED + * \param green The intensity of the green LED + * \param blue The intensity of the blue LED + * + * \return 0, or -1 if this controller does not have a modifiable LED + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue); + /** * Close a controller previously opened with SDL_GameControllerOpen(). */ diff --git a/Windows/SDL2/include/SDL_gesture.h b/Windows/SDL2/include/SDL_gesture.h index 9d25e9c1..81ed4317 100644 --- a/Windows/SDL2/include/SDL_gesture.h +++ b/Windows/SDL2/include/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_haptic.h b/Windows/SDL2/include/SDL_haptic.h index 07562768..c27da118 100644 --- a/Windows/SDL2/include/SDL_haptic.h +++ b/Windows/SDL2/include/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -336,6 +336,14 @@ typedef struct _SDL_Haptic SDL_Haptic; */ #define SDL_HAPTIC_SPHERICAL 2 +/** + * \brief Use this value to play an effect on the steering wheel axis. This + * provides better compatibility across platforms and devices as SDL will guess + * the correct axis. + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_STEERING_AXIS 3 + /* @} *//* Direction encodings */ /* @} *//* Haptic features */ @@ -444,6 +452,7 @@ typedef struct _SDL_Haptic SDL_Haptic; * \sa SDL_HAPTIC_POLAR * \sa SDL_HAPTIC_CARTESIAN * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HAPTIC_STEERING_AXIS * \sa SDL_HapticEffect * \sa SDL_HapticNumAxes */ diff --git a/Windows/SDL2/include/SDL_hints.h b/Windows/SDL2/include/SDL_hints.h index d36815b9..50a5a089 100644 --- a/Windows/SDL2/include/SDL_hints.h +++ b/Windows/SDL2/include/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -244,6 +244,17 @@ extern "C" { */ #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" +/** + * \brief A variable controlling whether X11 should use GLX or EGL by default + * + * This variable can be set to the following values: + * "0" - Use GLX + * "1" - Use EGL + * + * By default SDL will use GLX when both are present. + */ +#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL" + /** * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden * @@ -303,6 +314,17 @@ extern "C" { */ #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +/** + * \brief A variable controlling whether relative mouse motion is affected by renderer scaling + * + * This variable can be set to the following values: + * "0" - Relative motion is unaffected by DPI or renderer's logical size + * "1" - Relative motion is scaled according to DPI scaling and logical size + * + * By default relative mouse deltas are affected by DPI and renderer scaling + */ +#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" + /** * \brief A variable controlling whether relative mouse mode is implemented using mouse warping * @@ -347,7 +369,9 @@ extern "C" { #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" /** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. + * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're + * seeing if "true" causes more problems than it solves in modern times. * */ #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" @@ -457,6 +481,25 @@ extern "C" { */ #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" +/** + * \brief A variable that overrides the automatic controller type detection + * + * The variable should be comma separated entries, in the form: VID/PID=type + * + * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd + * + * The type should be one of: + * Xbox360 + * XboxOne + * PS3 + * PS4 + * PS5 + * SwitchPro + * + * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + */ +#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE" + /** * \brief A variable that lets you manually hint extra gamecontroller db entries. * @@ -561,6 +604,17 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" +/** + * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" + /** * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. * @@ -605,10 +659,23 @@ extern "C" { * "0" - HIDAPI driver is not used * "1" - HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" + /** + * \brief A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated + * data from XInput. + * + * This variable can be set to the following values: + * "0" - HIDAPI Xbox driver will only use HIDAPI data + * "1" - HIDAPI Xbox driver will also pull data from XInput, providing better trigger axes, guide button + * presses, and rumble support + * + * The default is "1". This hint applies to any joysticks opened after setting the hint. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT" + /** * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. * @@ -631,6 +698,35 @@ extern "C" { */ #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" + /** + * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. + * + * This variable can be set to the following values: + * "0" - RAWINPUT drivers are not used + * "1" - RAWINPUT drivers are used (the default) + * + */ +#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" + + /** + * \brief A variable controlling whether a separate thread should be used + * for handling joystick detection and raw input messages on Windows + * + * This variable can be set to the following values: + * "0" - A separate thread is not used (the default) + * "1" - A separate thread is used for handling raw input messages + * + */ +#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" + + /** + * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. + * + * This variable can be set to the following values: + * "0" - Return unfiltered joystick axis values (the default) + * "1" - Return axis values with deadzones taken into account + */ +#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" /** * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. @@ -701,6 +797,42 @@ extern "C" { */ #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" +/** +* \brief A string specifying additional information to use with SDL_SetThreadPriority. +* +* By default SDL_SetThreadPriority will make appropriate system changes in order to +* apply a thread priority. For example on systems using pthreads the scheduler policy +* is changed automatically to a policy that works well with a given priority. +* Code which has specific requirements can override SDL's default behavior with this hint. +* +* pthread hint values are "current", "other", "fifo" and "rr". +* Currently no other platform hint values are defined but may be in the future. +* +* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro +* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME +* after calling SDL_SetThreadPriority(). +*/ +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" + +/** + * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. + * + * On some platforms, like Linux, a realtime priority thread may be subject to restrictions + * that require special handling by the application. This hint exists to let SDL know that + * the app is prepared to handle said restrictions. + * + * On Linux, SDL will apply the following configuration to any thread that becomes realtime: + * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, + * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. + * * Exceeding this limit will result in the kernel sending SIGKILL to the app, + * * Refer to the man pages for more information. + * + * This variable can be set to the following values: + * "0" - default platform specific behaviour + * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy + */ +#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" + /** * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) */ @@ -939,6 +1071,18 @@ extern "C" { */ #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" +/** + * \brief A variable to control whether SDL will pause audio in background + * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") + * + * The variable can be set to the following values: + * "0" - Non paused. + * "1" - Paused. (default) + * + * The value should be set before SDL is initialized. + */ +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" + /** * \brief A variable to control whether the return key on the soft keyboard * should hide the soft keyboard on Android and iOS. @@ -965,10 +1109,26 @@ extern "C" { */ #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +/** + * \brief Disable giving back control to the browser automatically + * when running with asyncify + * + * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations + * such as refreshing the screen or polling events. + * + * This hint only applies to the emscripten platform + * + * The variable can be set to the following values: + * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) + * "1" - Enable emscripten_sleep calls (the default) + */ +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" + /** * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. * - * This hint only applies to Unix-like platforms. + * This hint only applies to Unix-like platforms, and should set before + * any calls to SDL_Init() * * The variable can be set to the following values: * "0" - SDL will install a SIGINT and SIGTERM handler, and when it @@ -1142,6 +1302,32 @@ extern "C" { #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" +/** + * \brief A variable controlling whether SDL updates joystick state when getting input events + * + * This variable can be set to the following values: + * + * "0" - You'll call SDL_JoystickUpdate() manually + * "1" - SDL will automatically call SDL_JoystickUpdate() (default) + * + * This hint can be toggled on and off at runtime. + */ +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" + + +/** + * \brief A variable controlling whether SDL updates sensor state when getting input events + * + * This variable can be set to the following values: + * + * "0" - You'll call SDL_SensorUpdate() manually + * "1" - SDL will automatically call SDL_SensorUpdate() (default) + * + * This hint can be toggled on and off at runtime. + */ +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" + + /** * \brief A variable controlling whether SDL logs all events pushed onto its internal queue. * @@ -1229,6 +1415,77 @@ extern "C" { */ #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +/** + * \brief Override for SDL_GetDisplayUsableBounds() + * + * If set, this hint will override the expected results for + * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want + * to do this, but this allows an embedded system to request that some of the + * screen be reserved for other uses when paired with a well-behaved + * application. + * + * The contents of this hint must be 4 comma-separated integers, the first + * is the bounds x, then y, width and height, in that order. + */ +#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" + +/** + * \brief Specify an application name for an audio device. + * + * Some audio backends (such as PulseAudio) allow you to describe your audio + * stream. Among other things, this description might show up in a system + * control panel that lets the user adjust the volume on specific audio + * streams instead of using one giant master volume slider. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your program ("My Game 2: The Revenge") + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: probably the application's name or "SDL Application" if SDL + * doesn't have any better information. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" + +/** + * \brief Specify an application name for an audio device. + * + * Some audio backends (such as PulseAudio) allow you to describe your audio + * stream. Among other things, this description might show up in a system + * control panel that lets the user adjust the volume on specific audio + * streams instead of using one giant master volume slider. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your what your program is playing ("audio stream" is + * probably sufficient in many cases, but this could be useful for something + * like "team chat" if you have a headset playing VoIP audio separately). + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: "audio stream" or something similar. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" + + +/** + * \brief Override for SDL_GetPreferredLocales() + * + * If set, this will be favored over anything the OS might report for the + * user's preferred locales. Changing this hint at runtime will not generate + * a SDL_LOCALECHANGED event (but if you can change the hint, you can push + * your own event, if you want). + * + * The format of this hint is a comma-separated list of language and locale, + * combined with an underscore, as is a common format: "en_GB". Locale is + * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" + */ +#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" + + /** * \brief An enumeration of hint priorities */ diff --git a/Windows/SDL2/include/SDL_joystick.h b/Windows/SDL2/include/SDL_joystick.h index 3c099dec..0bbeafe0 100644 --- a/Windows/SDL2/include/SDL_joystick.h +++ b/Windows/SDL2/include/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -105,6 +105,12 @@ typedef enum SDL_JOYSTICK_POWER_MAX } SDL_JoystickPowerLevel; +/* Set max recognized G-force from accelerometer + See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed + */ +#define SDL_IPHONE_MAX_GFORCE 5.0 + + /* Function prototypes */ /** @@ -199,51 +205,92 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID */ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); +/** + * Attaches a new virtual joystick. + * Returns the joystick's device index, or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, + int naxes, + int nbuttons, + int nhats); + +/** + * Detaches a virtual joystick + * Returns 0 on success, or -1 if an error occurred. + */ +extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); + +/** + * Indicates whether or not a virtual-joystick is at a given device index. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); + +/** + * Set values on an opened, virtual-joystick's controls. + * Please note that values set here will not be applied until the next + * call to SDL_JoystickUpdate, which can either be called directly, + * or can be called indirectly through various other SDL APIS, + * including, but not limited to the following: SDL_PollEvent, + * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent. + * + * Returns 0 on success, -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); + /** * Return the name for this currently opened joystick. * If no name can be found, this function returns NULL. */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); /** * Get the player index of an opened joystick, or -1 if it's not available * * For XInput controllers this returns the XInput user index. */ -extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); /** * Set the player index of an opened joystick */ -extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index); +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); /** * Return the GUID for this opened joystick */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); /** * Get the USB vendor ID of an opened joystick, if available. * If the vendor ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick * joystick); +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); /** * Get the USB product ID of an opened joystick, if available. * If the product ID isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick * joystick); +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); /** * Get the product version of an opened joystick, if available. * If the product version isn't available this function returns 0. */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick * joystick); +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); + +/** + * Get the serial number of an opened joystick, if available. + * + * Returns the serial number of the joystick, or NULL if it is not available. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); /** * Get the type of an opened joystick. */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); /** * Return a string representation for this guid. pszGUID must point to at least 33 bytes @@ -259,17 +306,17 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha /** * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); /** * Get the instance ID of an opened joystick or -1 if the joystick is invalid. */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); /** * Get the number of general axis controls on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); /** * Get the number of trackballs on a joystick. @@ -277,17 +324,17 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); * Joystick trackballs have only relative motion events associated * with them and their state cannot be polled. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); /** * Get the number of POV hats on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); /** * Get the number of buttons on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); /** * Update the current state of the open joysticks. @@ -317,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); * * The axis indices start at index 0. */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); /** @@ -329,7 +376,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, * * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * joystick, +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state); /** @@ -363,7 +410,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick * * - ::SDL_HAT_LEFTUP * - ::SDL_HAT_LEFTDOWN */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); /** @@ -373,7 +420,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, * * The ball indices start at index 0. */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); /** @@ -381,11 +428,11 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, * * The button indices start at index 0. */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); /** - * Trigger a rumble effect + * Start a rumble effect * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. * * \param joystick The joystick to vibrate @@ -395,17 +442,51 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, * * \return 0, or -1 if rumble isn't supported on this joystick */ -extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** + * Start a rumble effect in the joystick's triggers + * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param joystick The joystick to vibrate + * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF + * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if trigger rumble isn't supported on this joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); + +/** + * Return whether a joystick has an LED + * + * \param joystick The joystick to query + * + * \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); + +/** + * Update a joystick's LED color. + * + * \param joystick The joystick to update + * \param red The intensity of the red LED + * \param green The intensity of the green LED + * \param blue The intensity of the blue LED + * + * \return 0, or -1 if this joystick does not have a modifiable LED + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); /** * Close a joystick previously opened with SDL_JoystickOpen(). */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); /** * Return the battery level of this joystick */ -extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Windows/SDL2/include/SDL_keyboard.h b/Windows/SDL2/include/SDL_keyboard.h index 4b2a055d..f6853c64 100644 --- a/Windows/SDL2/include/SDL_keyboard.h +++ b/Windows/SDL2/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_keycode.h b/Windows/SDL2/include/SDL_keycode.h index 64b72dd3..6f6b65cb 100644 --- a/Windows/SDL2/include/SDL_keycode.h +++ b/Windows/SDL2/include/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,9 +88,11 @@ typedef enum SDLK_GREATER = '>', SDLK_QUESTION = '?', SDLK_AT = '@', + /* Skip uppercase letters */ + SDLK_LEFTBRACKET = '[', SDLK_BACKSLASH = '\\', SDLK_RIGHTBRACKET = ']', @@ -336,13 +338,13 @@ typedef enum KMOD_NUM = 0x1000, KMOD_CAPS = 0x2000, KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDL_Keymod; + KMOD_RESERVED = 0x8000, -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, + KMOD_ALT = KMOD_LALT | KMOD_RALT, + KMOD_GUI = KMOD_LGUI | KMOD_RGUI +} SDL_Keymod; #endif /* SDL_keycode_h_ */ diff --git a/Windows/SDL2/include/SDL_loadso.h b/Windows/SDL2/include/SDL_loadso.h index 793ba535..89578a9f 100644 --- a/Windows/SDL2/include/SDL_loadso.h +++ b/Windows/SDL2/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_locale.h b/Windows/SDL2/include/SDL_locale.h new file mode 100644 index 00000000..1f4b0c46 --- /dev/null +++ b/Windows/SDL2/include/SDL_locale.h @@ -0,0 +1,101 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_locale.h + * + * Include file for SDL locale services + */ + +#ifndef _SDL_locale_h +#define _SDL_locale_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + + +typedef struct SDL_Locale +{ + const char *language; /**< A language name, like "en" for English. */ + const char *country; /**< A country, like "US" for America. Can be NULL. */ +} SDL_Locale; + +/** + * \brief Report the user's preferred locale. + * + * This returns an array of SDL_Locale structs, the final item zeroed out. + * When the caller is done with this array, it should call SDL_free() on + * the returned value; all the memory involved is allocated in a single + * block, so a single SDL_free() will suffice. + * + * Returned language strings are in the format xx, where 'xx' is an ISO-639 + * language specifier (such as "en" for English, "de" for German, etc). + * Country strings are in the format YY, where "YY" is an ISO-3166 country + * code (such as "US" for the United States, "CA" for Canada, etc). Country + * might be NULL if there's no specific guidance on them (so you might get + * { "en", "US" } for American English, but { "en", NULL } means "English + * language, generically"). Language strings are never NULL, except to + * terminate the array. + * + * Please note that not all of these strings are 2 characters; some are + * three or more. + * + * The returned list of locales are in the order of the user's preference. + * For example, a German citizen that is fluent in US English and knows + * enough Japanese to navigate around Tokyo might have a list like: + * { "de", "en_US", "jp", NULL }. Someone from England might prefer British + * English (where "color" is spelled "colour", etc), but will settle for + * anything like it: { "en_GB", "en", NULL }. + * + * This function returns NULL on error, including when the platform does not + * supply this information at all. + * + * This might be a "slow" call that has to query the operating system. It's + * best to ask for this once and save the results. However, this list can + * change, usually because the user has changed a system preference outside + * of your program; SDL will send an SDL_LOCALECHANGED event in this case, + * if possible, and you can call this function again to get an updated copy + * of preferred locales. + * + * \return array of locales, terminated with a locale with a NULL language + * field. Will return NULL on error. + */ +extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_locale_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_log.h b/Windows/SDL2/include/SDL_log.h index 430e4fd0..c1751fd7 100644 --- a/Windows/SDL2/include/SDL_log.h +++ b/Windows/SDL2/include/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_main.h b/Windows/SDL2/include/SDL_main.h index 623f2d00..fcb5c17d 100644 --- a/Windows/SDL2/include/SDL_main.h +++ b/Windows/SDL2/include/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_messagebox.h b/Windows/SDL2/include/SDL_messagebox.h index bf50deb9..03639ce4 100644 --- a/Windows/SDL2/include/SDL_messagebox.h +++ b/Windows/SDL2/include/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_metal.h b/Windows/SDL2/include/SDL_metal.h index 0f1e0e94..f9673577 100644 --- a/Windows/SDL2/include/SDL_metal.h +++ b/Windows/SDL2/include/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,18 +55,13 @@ typedef void *SDL_MetalView; * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its * own. It is up to user code to do that. * - * The returned handle can be casted directly to a NSView or UIView, and the - * CAMetalLayer can be accessed from the view's 'layer' property. + * The returned handle can be casted directly to a NSView or UIView. + * To access the backing CAMetalLayer, call SDL_Metal_GetLayer(). * - * \code - * SDL_MetalView metalview = SDL_Metal_CreateView(window); - * UIView *uiview = (__bridge UIView *)metalview; - * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; - * // [...] - * SDL_Metal_DestroyView(metalview); - * \endcode + * \note \a window must be created with the SDL_WINDOW_METAL flag. * * \sa SDL_Metal_DestroyView + * \sa SDL_Metal_GetLayer */ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); @@ -80,6 +75,37 @@ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); */ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); +/** + * \brief Get a pointer to the backing CAMetalLayer for the given view. + * + * \sa SDL_MetalCreateView + */ +extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); + +/** + * \brief Get the size of a window's underlying drawable in pixels (for use + * with setting viewport, scissor & etc). + * + * \param window SDL_Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, + * may be NULL + * \param h Pointer to variable for storing the height in pixels, + * may be NULL + * + * 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 \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. + * + * \note On macOS high-DPI support must be enabled for an application by + * setting NSHighResolutionCapable to true in its Info.plist. + * + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() + */ +extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, + int *h); + /* @} *//* Metal support functions */ /* Ends C function definitions when using C++ */ diff --git a/Windows/SDL2/include/SDL_misc.h b/Windows/SDL2/include/SDL_misc.h new file mode 100644 index 00000000..a04f19ba --- /dev/null +++ b/Windows/SDL2/include/SDL_misc.h @@ -0,0 +1,75 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2020 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_misc.h + * + * \brief Include file for SDL API functions that don't fit elsewhere. + */ + +#ifndef SDL_misc_h_ +#define SDL_misc_h_ + +#include "SDL_stdinc.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Open an URL / URI in the browser or other + * + * Open a URL in a separate, system-provided application. How this works will + * vary wildly depending on the platform. This will likely launch what + * makes sense to handle a specific URL's protocol (a web browser for http://, + * etc), but it might also be able to launch file managers for directories + * and other things. + * + * What happens when you open a URL varies wildly as well: your game window + * may lose focus (and may or may not lose focus if your game was fullscreen + * or grabbing input at the time). On mobile devices, your app will likely + * move to the background or your process might be paused. Any given platform + * may or may not handle a given URL. + * + * If this is unimplemented (or simply unavailable) for a platform, this will + * fail with an error. A successful result does not mean the URL loaded, just + * that we launched something to handle it (or at least believe we did). + * + * All this to say: this function can be useful, but you should definitely + * test it on every platform you target. + * + * \param url A valid URL to open. + * \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* SDL_misc_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Windows/SDL2/include/SDL_mouse.h b/Windows/SDL2/include/SDL_mouse.h index 277559d2..99b658e9 100644 --- a/Windows/SDL2/include/SDL_mouse.h +++ b/Windows/SDL2/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_mutex.h b/Windows/SDL2/include/SDL_mutex.h index 970e7871..3c5b9557 100644 --- a/Windows/SDL2/include/SDL_mutex.h +++ b/Windows/SDL2/include/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_name.h b/Windows/SDL2/include/SDL_name.h index 690a8199..a49c4887 100644 --- a/Windows/SDL2/include/SDL_name.h +++ b/Windows/SDL2/include/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_opengl.h b/Windows/SDL2/include/SDL_opengl.h index 6685be73..5cd302cd 100644 --- a/Windows/SDL2/include/SDL_opengl.h +++ b/Windows/SDL2/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_opengles.h b/Windows/SDL2/include/SDL_opengles.h index 1e0660c3..5c2a3e63 100644 --- a/Windows/SDL2/include/SDL_opengles.h +++ b/Windows/SDL2/include/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_opengles2.h b/Windows/SDL2/include/SDL_opengles2.h index df29d384..00bc180c 100644 --- a/Windows/SDL2/include/SDL_opengles2.h +++ b/Windows/SDL2/include/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_pixels.h b/Windows/SDL2/include/SDL_pixels.h index 753f617a..aa90cbc2 100644 --- a/Windows/SDL2/include/SDL_pixels.h +++ b/Windows/SDL2/include/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -188,18 +188,22 @@ typedef enum SDL_PIXELFORMAT_RGB332 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_RGB444 = + SDL_PIXELFORMAT_XRGB4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_BGR444 = + SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444, + SDL_PIXELFORMAT_XBGR4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_RGB555 = + SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444, + SDL_PIXELFORMAT_XRGB1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_BGR555 = + SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555, + SDL_PIXELFORMAT_XBGR1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555, SDL_PIXELFORMAT_ARGB4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2), @@ -236,15 +240,17 @@ typedef enum SDL_PIXELFORMAT_BGR24 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3), - SDL_PIXELFORMAT_RGB888 = + SDL_PIXELFORMAT_XRGB8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_RGBX8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGR888 = + SDL_PIXELFORMAT_XBGR8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_BGRX8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4), diff --git a/Windows/SDL2/include/SDL_platform.h b/Windows/SDL2/include/SDL_platform.h index c2cbc6b4..71665579 100644 --- a/Windows/SDL2/include/SDL_platform.h +++ b/Windows/SDL2/include/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_power.h b/Windows/SDL2/include/SDL_power.h index 4831cb77..39884cc2 100644 --- a/Windows/SDL2/include/SDL_power.h +++ b/Windows/SDL2/include/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_quit.h b/Windows/SDL2/include/SDL_quit.h index c979983c..b2bd5da5 100644 --- a/Windows/SDL2/include/SDL_quit.h +++ b/Windows/SDL2/include/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_rect.h b/Windows/SDL2/include/SDL_rect.h index 71a41151..47f0d207 100644 --- a/Windows/SDL2/include/SDL_rect.h +++ b/Windows/SDL2/include/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_render.h b/Windows/SDL2/include/SDL_render.h index f98c1843..f26fb7e5 100644 --- a/Windows/SDL2/include/SDL_render.h +++ b/Windows/SDL2/include/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -618,8 +618,8 @@ extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, * \brief Set the clip rectangle for the current target. * * \param renderer The renderer for which clip rectangle should be set. - * \param rect A pointer to the rectangle to set as the clip rectangle, or - * NULL to disable clipping. + * \param rect A pointer to the rectangle to set as the clip rectangle, + * relative to the viewport, or NULL to disable clipping. * * \return 0 on success, or -1 on error * diff --git a/Windows/SDL2/include/SDL_revision.h b/Windows/SDL2/include/SDL_revision.h index 6996d603..e0bcf431 100644 --- a/Windows/SDL2/include/SDL_revision.h +++ b/Windows/SDL2/include/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-13387:8a12cc1abc9e" -#define SDL_REVISION_NUMBER 13387 +#define SDL_REVISION "hg-14525:e52d96ea04fc" +#define SDL_REVISION_NUMBER 14525 diff --git a/Windows/SDL2/include/SDL_rwops.h b/Windows/SDL2/include/SDL_rwops.h index f66119fb..2e6225fc 100644 --- a/Windows/SDL2/include/SDL_rwops.h +++ b/Windows/SDL2/include/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -96,15 +96,7 @@ typedef struct SDL_RWops #if defined(__ANDROID__) struct { - void *fileNameRef; - void *inputStreamRef; - void *readableByteChannelRef; - void *readMethod; - void *assetFileDescriptorRef; - long position; - long size; - long offset; - int fd; + void *asset; } androidio; #elif defined(__WIN32__) struct diff --git a/Windows/SDL2/include/SDL_scancode.h b/Windows/SDL2/include/SDL_scancode.h index a50305f5..b19197d2 100644 --- a/Windows/SDL2/include/SDL_scancode.h +++ b/Windows/SDL2/include/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_sensor.h b/Windows/SDL2/include/SDL_sensor.h index 966adbf2..e6236341 100644 --- a/Windows/SDL2/include/SDL_sensor.h +++ b/Windows/SDL2/include/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -78,14 +78,16 @@ typedef enum * Accelerometer sensor * * The accelerometer returns the current acceleration in SI meters per - * second squared. This includes gravity, so a device at rest will have - * an acceleration of SDL_STANDARD_GRAVITY straight down. + * second squared. This measurement includes the force of gravity, so + * a device at rest will have an value of SDL_STANDARD_GRAVITY away + * from the center of the earth. * * values[0]: Acceleration on the x axis * values[1]: Acceleration on the y axis * values[2]: Acceleration on the z axis * - * For phones held in portrait mode, the axes are defined as follows: + * For phones held in portrait mode and game controllers held in front of you, + * the axes are defined as follows: * -X ... +X : left ... right * -Y ... +Y : bottom ... top * -Z ... +Z : farther ... closer @@ -105,22 +107,36 @@ typedef enum * see positive rotation on that axis when it appeared to be rotating * counter-clockwise. * - * values[0]: Angular speed around the x axis - * values[1]: Angular speed around the y axis - * values[2]: Angular speed around the z axis + * values[0]: Angular speed around the x axis (pitch) + * values[1]: Angular speed around the y axis (yaw) + * values[2]: Angular speed around the z axis (roll) * - * For phones held in portrait mode, the axes are defined as follows: + * For phones held in portrait mode and game controllers held in front of you, + * the axes are defined as follows: * -X ... +X : left ... right * -Y ... +Y : bottom ... top * -Z ... +Z : farther ... closer * - * The axis data is not changed when the phone is rotated. + * The axis data is not changed when the phone or controller is rotated. * * \sa SDL_GetDisplayOrientation() */ /* Function prototypes */ +/** + * Locking for multi-threaded access to the sensor API + * + * If you are using the sensor API or handling events from multiple threads + * you should use these locking functions to protect access to the sensors. + * + * In particular, you are guaranteed that the sensor list won't change, so + * the API functions that take a sensor index will be valid, and sensor + * events will not be delivered. + */ +extern DECLSPEC void SDLCALL SDL_LockSensors(void); +extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); + /** * \brief Count the number of sensors attached to the system right now */ diff --git a/Windows/SDL2/include/SDL_shape.h b/Windows/SDL2/include/SDL_shape.h index 2ab43fcd..cbd9debd 100644 --- a/Windows/SDL2/include/SDL_shape.h +++ b/Windows/SDL2/include/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_stdinc.h b/Windows/SDL2/include/SDL_stdinc.h index 014675b7..91ccaa45 100644 --- a/Windows/SDL2/include/SDL_stdinc.h +++ b/Windows/SDL2/include/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,6 +30,12 @@ #include "SDL_config.h" +#ifdef __APPLE__ +#ifndef _DARWIN_C_SOURCE +#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */ +#endif +#endif + #ifdef HAVE_SYS_TYPES_H #include #endif @@ -408,9 +414,13 @@ extern DECLSPEC int SDLCALL SDL_abs(int x); extern DECLSPEC int SDLCALL SDL_isdigit(int x); extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_isupper(int x); +extern DECLSPEC int SDLCALL SDL_islower(int x); extern DECLSPEC int SDLCALL SDL_toupper(int x); extern DECLSPEC int SDLCALL SDL_tolower(int x); +extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); + extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) @@ -461,6 +471,8 @@ extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len); extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); @@ -527,6 +539,8 @@ extern DECLSPEC double SDLCALL SDL_fabs(double x); extern DECLSPEC float SDLCALL SDL_fabsf(float x); extern DECLSPEC double SDLCALL SDL_floor(double x); extern DECLSPEC float SDLCALL SDL_floorf(float x); +extern DECLSPEC double SDLCALL SDL_trunc(double x); +extern DECLSPEC float SDLCALL SDL_truncf(float x); extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); extern DECLSPEC double SDLCALL SDL_log(double x); @@ -573,6 +587,17 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, /* force builds using Clang's static analysis tools to use literal C runtime here, since there are possibly tests that are ineffective otherwise. */ #if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) + +/* The analyzer knows about strlcpy even when the system doesn't provide it */ +#ifndef HAVE_STRLCPY +size_t strlcpy(char* dst, const char* src, size_t size); +#endif + +/* The analyzer knows about strlcat even when the system doesn't provide it */ +#ifndef HAVE_STRLCAT +size_t strlcat(char* dst, const char* src, size_t size); +#endif + #define SDL_malloc malloc #define SDL_calloc calloc #define SDL_realloc realloc @@ -581,16 +606,23 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, #define SDL_memcpy memcpy #define SDL_memmove memmove #define SDL_memcmp memcmp -#define SDL_strlen strlen #define SDL_strlcpy strlcpy #define SDL_strlcat strlcat +#define SDL_strlen strlen +#define SDL_wcslen wcslen +#define SDL_wcslcpy wcslcpy +#define SDL_wcslcat wcslcat #define SDL_strdup strdup +#define SDL_wcsdup wcsdup #define SDL_strchr strchr #define SDL_strrchr strrchr #define SDL_strstr strstr +#define SDL_wcsstr wcsstr #define SDL_strtokr strtok_r #define SDL_strcmp strcmp +#define SDL_wcscmp wcscmp #define SDL_strncmp strncmp +#define SDL_wcsncmp wcsncmp #define SDL_strcasecmp strcasecmp #define SDL_strncasecmp strncasecmp #define SDL_sscanf sscanf diff --git a/Windows/SDL2/include/SDL_surface.h b/Windows/SDL2/include/SDL_surface.h index 51a12830..d3f8c814 100644 --- a/Windows/SDL2/include/SDL_surface.h +++ b/Windows/SDL2/include/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -80,7 +80,9 @@ typedef struct SDL_Surface /** information needed for surfaces requiring locks */ int locked; /**< Read-only */ - void *lock_data; /**< Read-only */ + + /** list of BlitMap that hold a reference to this surface */ + void *list_blitmap; /**< Private */ /** clipping information */ SDL_Rect clip_rect; /**< Read-only */ @@ -235,6 +237,13 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, int flag); +/** + * \brief Returns whether the surface is RLE enabled + * + * \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); + /** * \brief Sets the color key (transparent pixel) in a blittable surface. * diff --git a/Windows/SDL2/include/SDL_system.h b/Windows/SDL2/include/SDL_system.h index 3b084076..d296ab1f 100644 --- a/Windows/SDL2/include/SDL_system.h +++ b/Windows/SDL2/include/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -89,7 +89,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio #endif /* __LINUX__ */ /* Platform specific functions for iOS */ -#if defined(__IPHONEOS__) && __IPHONEOS__ +#ifdef __IPHONEOS__ #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); @@ -101,7 +101,7 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); /* Platform specific functions for Android */ -#if defined(__ANDROID__) && __ANDROID__ +#ifdef __ANDROID__ /** \brief Get the JNI environment for the current thread @@ -120,6 +120,33 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); */ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); +/** + \brief Return API level of the current device + + API level 30: Android 11 + API level 29: Android 10 + API level 28: Android 9 + API level 27: Android 8.1 + API level 26: Android 8.0 + API level 25: Android 7.1 + API level 24: Android 7.0 + API level 23: Android 6.0 + API level 22: Android 5.1 + API level 21: Android 5.0 + API level 20: Android 4.4W + API level 19: Android 4.4 + API level 18: Android 4.3 + API level 17: Android 4.2 + API level 16: Android 4.1 + API level 15: Android 4.0.3 + API level 14: Android 4.0 + API level 13: Android 3.2 + API level 12: Android 3.1 + API level 11: Android 3.0 + API level 10: Android 2.3.3 + */ +extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); + /** \brief Return true if the application is running on Android TV */ @@ -172,10 +199,18 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); */ extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); +/** + \brief Request permissions at runtime. + + This blocks the calling thread until the permission is granted or + denied. Returns SDL_TRUE if the permission was granted. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission); + #endif /* __ANDROID__ */ /* Platform specific functions for WinRT */ -#if defined(__WINRT__) && __WINRT__ +#ifdef __WINRT__ /** * \brief WinRT / Windows Phone path types @@ -268,6 +303,17 @@ extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); */ extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); +/* Functions used by iOS application delegates to notify SDL about state changes */ +extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void); +#ifdef __IPHONEOS__ +extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); +#endif + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Windows/SDL2/include/SDL_syswm.h b/Windows/SDL2/include/SDL_syswm.h index c8236513..f0e9675d 100644 --- a/Windows/SDL2/include/SDL_syswm.h +++ b/Windows/SDL2/include/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -106,6 +106,11 @@ typedef void *EGLSurface; #if defined(SDL_VIDEO_DRIVER_VIVANTE) #include "SDL_egl.h" #endif + +#if defined(SDL_VIDEO_DRIVER_OS2) +#define INCL_WIN +#include +#endif #endif /* SDL_PROTOTYPES_ONLY */ @@ -186,6 +191,16 @@ struct SDL_SysWMmsg int dummy; /* No Vivante window events yet */ } vivante; +#endif +#if defined(SDL_VIDEO_DRIVER_OS2) + struct + { + BOOL fFrame; /**< TRUE if hwnd is a frame window */ + HWND hwnd; /**< The window receiving the message */ + ULONG msg; /**< The message identifier */ + MPARAM mp1; /**< The first first message parameter */ + MPARAM mp2; /**< The second first message parameter */ + } os2; #endif /* Can't have an empty union */ int dummy; @@ -280,6 +295,14 @@ struct SDL_SysWMinfo } android; #endif +#if defined(SDL_VIDEO_DRIVER_OS2) + struct + { + HWND hwnd; /**< The window handle */ + HWND hwndFrame; /**< The frame window handle */ + } os2; +#endif + #if defined(SDL_VIDEO_DRIVER_VIVANTE) struct { diff --git a/Windows/SDL2/include/SDL_thread.h b/Windows/SDL2/include/SDL_thread.h index f78b1145..4016358a 100644 --- a/Windows/SDL2/include/SDL_thread.h +++ b/Windows/SDL2/include/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -54,6 +54,11 @@ typedef unsigned int SDL_TLSID; /** * The SDL thread priority. * + * SDL will make system changes as necessary in order to apply the thread priority. + * Code which attempts to control thread state related to priority should be aware + * that calling SDL_SetThreadPriority may alter such state. + * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. + * * \note On many systems you require special privileges to set high or time critical priority. */ typedef enum { @@ -69,7 +74,7 @@ typedef enum { */ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); -#if defined(__WIN32__) && !defined(HAVE_LIBC) +#if defined(__WIN32__) /** * \file SDL_thread.h * @@ -93,11 +98,18 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); #define SDL_PASSED_BEGINTHREAD_ENDTHREAD #include /* _beginthreadex() and _endthreadex() */ -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) +typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned (__stdcall *func)(void *), void * /*arg*/, unsigned, unsigned * /* threadID */); typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); +#ifndef SDL_beginthread +#define SDL_beginthread _beginthreadex +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthreadex +#endif + /** * Create a thread. */ @@ -118,12 +130,12 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), */ #if defined(SDL_CreateThread) && SDL_DYNAMIC_API #undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#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) #endif #elif defined(__OS2__) @@ -132,13 +144,23 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), * into a dll with Watcom's runtime statically linked. */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD + #ifndef __EMX__ #include #else #include #endif + typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); typedef void (*pfnSDL_CurrentEndThread)(void); + +#ifndef SDL_beginthread +#define SDL_beginthread _beginthread +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthread +#endif + extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, @@ -147,14 +169,15 @@ extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); + #if defined(SDL_CreateThread) && SDL_DYNAMIC_API #undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_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) #endif #else diff --git a/Windows/SDL2/include/SDL_timer.h b/Windows/SDL2/include/SDL_timer.h index 2a47b043..aada7178 100644 --- a/Windows/SDL2/include/SDL_timer.h +++ b/Windows/SDL2/include/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_touch.h b/Windows/SDL2/include/SDL_touch.h index 99dbcb8c..fa5a37ce 100644 --- a/Windows/SDL2/include/SDL_touch.h +++ b/Windows/SDL2/include/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_types.h b/Windows/SDL2/include/SDL_types.h index 9c3e9896..b6bb5711 100644 --- a/Windows/SDL2/include/SDL_types.h +++ b/Windows/SDL2/include/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/include/SDL_version.h b/Windows/SDL2/include/SDL_version.h index 69b02706..23b65f43 100644 --- a/Windows/SDL2/include/SDL_version.h +++ b/Windows/SDL2/include/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 11 +#define SDL_PATCHLEVEL 14 /** * \brief Macro to determine SDL version program was compiled against. diff --git a/Windows/SDL2/include/SDL_video.h b/Windows/SDL2/include/SDL_video.h index c1bb7527..54cbe0f0 100644 --- a/Windows/SDL2/include/SDL_video.h +++ b/Windows/SDL2/include/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -118,7 +118,8 @@ typedef enum SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ - SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */ + SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */ + SDL_WINDOW_METAL = 0x20000000 /**< window usable for Metal view */ } SDL_WindowFlags; /** @@ -174,7 +175,9 @@ typedef enum typedef enum { 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_DISCONNECTED /**< Display has been removed from the system */ } SDL_DisplayEventID; typedef enum @@ -484,7 +487,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, - * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN. + * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN + * ::SDL_WINDOW_METAL. * * \return The created window, or NULL if window creation failed. * @@ -503,6 +507,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. * + * If SDL_WINDOW_METAL is specified on an OS that does not support Metal, + * SDL_CreateWindow() will fail. + * * \note On non-Apple devices, SDL requires you to either not link to the * Vulkan loader or link to a dynamic library version. This limitation * may be removed in a future version of SDL. diff --git a/Windows/SDL2/include/SDL_vulkan.h b/Windows/SDL2/include/SDL_vulkan.h index d69a436b..a3de1cea 100644 --- a/Windows/SDL2/include/SDL_vulkan.h +++ b/Windows/SDL2/include/SDL_vulkan.h @@ -204,10 +204,9 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); * * \sa SDL_Vulkan_CreateSurface() */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( - SDL_Window *window, - unsigned int *pCount, - const char **pNames); +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, + unsigned int *pCount, + const char **pNames); /** * \brief Create a Vulkan rendering surface for a window. @@ -238,10 +237,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions( * * \sa SDL_Vulkan_GetInstanceExtensions() */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface( - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR* surface); +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, + VkInstance instance, + VkSurfaceKHR* surface); /** * \brief Get the size of a window's underlying drawable in pixels (for use diff --git a/Windows/SDL2/include/begin_code.h b/Windows/SDL2/include/begin_code.h index 22c997c4..1ca40ccd 100644 --- a/Windows/SDL2/include/begin_code.h +++ b/Windows/SDL2/include/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -51,15 +51,11 @@ /* Some compilers use a special export keyword */ #ifndef DECLSPEC -# if defined(__WIN32__) || defined(__WINRT__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else +# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) +# ifdef DLL_EXPORT # define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC # endif # elif defined(__OS2__) # ifdef BUILD_SDL diff --git a/Windows/SDL2/include/close_code.h b/Windows/SDL2/include/close_code.h index 8e4cac3d..6aa411b0 100644 --- a/Windows/SDL2/include/close_code.h +++ b/Windows/SDL2/include/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/lib/SDL2.dll b/Windows/SDL2/lib/SDL2.dll index be564f68..3392016f 100644 Binary files a/Windows/SDL2/lib/SDL2.dll and b/Windows/SDL2/lib/SDL2.dll differ diff --git a/Windows/SDL2/lib/SDL2.lib b/Windows/SDL2/lib/SDL2.lib index 81328beb..266b0827 100644 Binary files a/Windows/SDL2/lib/SDL2.lib and b/Windows/SDL2/lib/SDL2.lib differ diff --git a/Windows/SDL2/lib/SDL2main.lib b/Windows/SDL2/lib/SDL2main.lib index 60b24acd..29c80881 100644 Binary files a/Windows/SDL2/lib/SDL2main.lib and b/Windows/SDL2/lib/SDL2main.lib differ diff --git a/Windows/SDL2/lib/libSDL2.dll.a b/Windows/SDL2/lib/libSDL2.dll.a index eedefe06..65f29a56 100644 Binary files a/Windows/SDL2/lib/libSDL2.dll.a and b/Windows/SDL2/lib/libSDL2.dll.a differ diff --git a/Windows/SDL2/lib/libSDL2main.a b/Windows/SDL2/lib/libSDL2main.a index 9ff7a6d0..f10f6c64 100644 Binary files a/Windows/SDL2/lib/libSDL2main.a and b/Windows/SDL2/lib/libSDL2main.a differ diff --git a/Windows/SDL2/lib64/SDL2.dll b/Windows/SDL2/lib64/SDL2.dll index 36cf97f9..ddba03c7 100644 Binary files a/Windows/SDL2/lib64/SDL2.dll and b/Windows/SDL2/lib64/SDL2.dll differ diff --git a/Windows/SDL2/lib64/SDL2.lib b/Windows/SDL2/lib64/SDL2.lib index 1317f4cc..db6f19e6 100644 Binary files a/Windows/SDL2/lib64/SDL2.lib and b/Windows/SDL2/lib64/SDL2.lib differ diff --git a/Windows/SDL2/lib64/SDL2main.lib b/Windows/SDL2/lib64/SDL2main.lib index 4e72c408..aa3c4f9f 100644 Binary files a/Windows/SDL2/lib64/SDL2main.lib and b/Windows/SDL2/lib64/SDL2main.lib differ diff --git a/Windows/SDL2/lib64/libSDL2.dll.a b/Windows/SDL2/lib64/libSDL2.dll.a index edeeef6a..123fd63a 100644 Binary files a/Windows/SDL2/lib64/libSDL2.dll.a and b/Windows/SDL2/lib64/libSDL2.dll.a differ diff --git a/Windows/SDL2/lib64/libSDL2main.a b/Windows/SDL2/lib64/libSDL2main.a index 4c28ea1c..b2778053 100644 Binary files a/Windows/SDL2/lib64/libSDL2main.a and b/Windows/SDL2/lib64/libSDL2main.a differ diff --git a/Windows/SDL2/main/SDL_windows.h b/Windows/SDL2/main/SDL_windows.h index 3217026b..3707fe30 100644 --- a/Windows/SDL2/main/SDL_windows.h +++ b/Windows/SDL2/main/SDL_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2019 Sam Lantinga + Copyright (C) 1997-2020 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Windows/SDL2/watcom/SDL2.def b/Windows/SDL2/watcom/SDL2.def index 7e449894..d95ebae7 100644 --- a/Windows/SDL2/watcom/SDL2.def +++ b/Windows/SDL2/watcom/SDL2.def @@ -125,13 +125,23 @@ SDL_GameControllerGetBindForButton SDL_GameControllerGetButton SDL_GameControllerGetButtonFromString SDL_GameControllerGetJoystick +SDL_GameControllerGetNumTouchpadFingers +SDL_GameControllerGetNumTouchpads SDL_GameControllerGetPlayerIndex SDL_GameControllerGetProduct SDL_GameControllerGetProductVersion +SDL_GameControllerGetSensorData +SDL_GameControllerGetSerial SDL_GameControllerGetStringForAxis SDL_GameControllerGetStringForButton +SDL_GameControllerGetTouchpadFinger SDL_GameControllerGetType SDL_GameControllerGetVendor +SDL_GameControllerHasAxis +SDL_GameControllerHasButton +SDL_GameControllerHasLED +SDL_GameControllerHasSensor +SDL_GameControllerIsSensorEnabled SDL_GameControllerMapping SDL_GameControllerMappingForDeviceIndex SDL_GameControllerMappingForGUID @@ -141,7 +151,10 @@ SDL_GameControllerNameForIndex SDL_GameControllerNumMappings SDL_GameControllerOpen SDL_GameControllerRumble +SDL_GameControllerRumbleTriggers +SDL_GameControllerSetLED SDL_GameControllerSetPlayerIndex +SDL_GameControllerSetSensorEnabled SDL_GameControllerTypeForIndex SDL_GameControllerUpdate SDL_GetAssertionHandler @@ -171,6 +184,7 @@ SDL_GetDisplayName SDL_GetDisplayOrientation SDL_GetDisplayUsableBounds SDL_GetError +SDL_GetErrorMsg SDL_GetEventFilter SDL_GetGlobalMouseState SDL_GetGrabbedWindow @@ -200,6 +214,7 @@ SDL_GetPixelFormatName SDL_GetPlatform SDL_GetPowerInfo SDL_GetPrefPath +SDL_GetPreferredLocales SDL_GetQueuedAudioSize SDL_GetRGB SDL_GetRGBA @@ -302,6 +317,7 @@ SDL_HasSSE3 SDL_HasSSE41 SDL_HasSSE42 SDL_HasScreenKeyboardSupport +SDL_HasSurfaceRLE SDL_HideWindow SDL_Init SDL_InitSubSystem @@ -313,8 +329,10 @@ SDL_IsScreenSaverEnabled SDL_IsShapedWindow SDL_IsTablet SDL_IsTextInputActive +SDL_JoystickAttachVirtual SDL_JoystickClose SDL_JoystickCurrentPowerLevel +SDL_JoystickDetachVirtual SDL_JoystickEventState SDL_JoystickFromInstanceID SDL_JoystickFromPlayerIndex @@ -337,10 +355,13 @@ SDL_JoystickGetHat SDL_JoystickGetPlayerIndex SDL_JoystickGetProduct SDL_JoystickGetProductVersion +SDL_JoystickGetSerial SDL_JoystickGetType SDL_JoystickGetVendor +SDL_JoystickHasLED SDL_JoystickInstanceID SDL_JoystickIsHaptic +SDL_JoystickIsVirtual SDL_JoystickName SDL_JoystickNameForIndex SDL_JoystickNumAxes @@ -349,7 +370,12 @@ SDL_JoystickNumButtons SDL_JoystickNumHats SDL_JoystickOpen SDL_JoystickRumble +SDL_JoystickRumbleTriggers +SDL_JoystickSetLED SDL_JoystickSetPlayerIndex +SDL_JoystickSetVirtualAxis +SDL_JoystickSetVirtualButton +SDL_JoystickSetVirtualHat SDL_JoystickUpdate SDL_LoadBMP_RW SDL_LoadDollarTemplates @@ -362,6 +388,7 @@ SDL_LockAudio SDL_LockAudioDevice SDL_LockJoysticks SDL_LockMutex +SDL_LockSensors SDL_LockSurface SDL_LockTexture SDL_LockTextureToSurface @@ -390,6 +417,8 @@ SDL_MemoryBarrierAcquireFunction SDL_MemoryBarrierReleaseFunction SDL_Metal_CreateView SDL_Metal_DestroyView +SDL_Metal_GetDrawableSize +SDL_Metal_GetLayer SDL_MinimizeWindow SDL_MixAudio SDL_MixAudioFormat @@ -398,8 +427,15 @@ SDL_NewAudioStream SDL_NumHaptics SDL_NumJoysticks SDL_NumSensors +SDL_OnApplicationDidBecomeActive +SDL_OnApplicationDidEnterBackground +SDL_OnApplicationDidReceiveMemoryWarning +SDL_OnApplicationWillEnterForeground +SDL_OnApplicationWillResignActive +SDL_OnApplicationWillTerminate SDL_OpenAudio SDL_OpenAudioDevice +SDL_OpenURL SDL_PauseAudio SDL_PauseAudioDevice SDL_PeepEvents @@ -478,6 +514,7 @@ SDL_RestoreWindow SDL_SIMDAlloc SDL_SIMDFree SDL_SIMDGetAlignment +SDL_SIMDRealloc SDL_SaveAllDollarTemplates SDL_SaveBMP_RW SDL_SaveDollarTemplate @@ -567,6 +604,7 @@ SDL_UnlockAudio SDL_UnlockAudioDevice SDL_UnlockJoysticks SDL_UnlockMutex +SDL_UnlockSensors SDL_UnlockSurface SDL_UnlockTexture SDL_UnregisterApp @@ -615,6 +653,7 @@ SDL_copysign SDL_copysignf SDL_cos SDL_cosf +SDL_crc32 SDL_exp SDL_expf SDL_fabs @@ -630,7 +669,9 @@ SDL_iconv_close SDL_iconv_open SDL_iconv_string SDL_isdigit +SDL_islower SDL_isspace +SDL_isupper SDL_itoa SDL_lltoa SDL_log @@ -680,6 +721,8 @@ SDL_tan SDL_tanf SDL_tolower SDL_toupper +SDL_trunc +SDL_truncf SDL_uitoa SDL_ulltoa SDL_ultoa @@ -687,10 +730,12 @@ SDL_utf8strlcpy SDL_utf8strlen SDL_vsnprintf SDL_vsscanf +SDL_wcscasecmp SDL_wcscmp SDL_wcsdup SDL_wcslcat SDL_wcslcpy SDL_wcslen +SDL_wcsncasecmp SDL_wcsncmp SDL_wcsstr diff --git a/Windows/SDL2/watcom/SDL2.exp b/Windows/SDL2/watcom/SDL2.exp index 648b8612..0d6d8c75 100644 --- a/Windows/SDL2/watcom/SDL2.exp +++ b/Windows/SDL2/watcom/SDL2.exp @@ -122,13 +122,23 @@ ++'_SDL_GameControllerGetButton'.'SDL2.DLL'..'SDL_GameControllerGetButton' ++'_SDL_GameControllerGetButtonFromString'.'SDL2.DLL'..'SDL_GameControllerGetButtonFromString' ++'_SDL_GameControllerGetJoystick'.'SDL2.DLL'..'SDL_GameControllerGetJoystick' +++'_SDL_GameControllerGetNumTouchpadFingers'.'SDL2.DLL'..'SDL_GameControllerGetNumTouchpadFingers' +++'_SDL_GameControllerGetNumTouchpads'.'SDL2.DLL'..'SDL_GameControllerGetNumTouchpads' ++'_SDL_GameControllerGetPlayerIndex'.'SDL2.DLL'..'SDL_GameControllerGetPlayerIndex' ++'_SDL_GameControllerGetProduct'.'SDL2.DLL'..'SDL_GameControllerGetProduct' ++'_SDL_GameControllerGetProductVersion'.'SDL2.DLL'..'SDL_GameControllerGetProductVersion' +++'_SDL_GameControllerGetSensorData'.'SDL2.DLL'..'SDL_GameControllerGetSensorData' +++'_SDL_GameControllerGetSerial'.'SDL2.DLL'..'SDL_GameControllerGetSerial' ++'_SDL_GameControllerGetStringForAxis'.'SDL2.DLL'..'SDL_GameControllerGetStringForAxis' ++'_SDL_GameControllerGetStringForButton'.'SDL2.DLL'..'SDL_GameControllerGetStringForButton' +++'_SDL_GameControllerGetTouchpadFinger'.'SDL2.DLL'..'SDL_GameControllerGetTouchpadFinger' ++'_SDL_GameControllerGetType'.'SDL2.DLL'..'SDL_GameControllerGetType' ++'_SDL_GameControllerGetVendor'.'SDL2.DLL'..'SDL_GameControllerGetVendor' +++'_SDL_GameControllerHasAxis'.'SDL2.DLL'..'SDL_GameControllerHasAxis' +++'_SDL_GameControllerHasButton'.'SDL2.DLL'..'SDL_GameControllerHasButton' +++'_SDL_GameControllerHasLED'.'SDL2.DLL'..'SDL_GameControllerHasLED' +++'_SDL_GameControllerHasSensor'.'SDL2.DLL'..'SDL_GameControllerHasSensor' +++'_SDL_GameControllerIsSensorEnabled'.'SDL2.DLL'..'SDL_GameControllerIsSensorEnabled' ++'_SDL_GameControllerMapping'.'SDL2.DLL'..'SDL_GameControllerMapping' ++'_SDL_GameControllerMappingForDeviceIndex'.'SDL2.DLL'..'SDL_GameControllerMappingForDeviceIndex' ++'_SDL_GameControllerMappingForGUID'.'SDL2.DLL'..'SDL_GameControllerMappingForGUID' @@ -138,7 +148,10 @@ ++'_SDL_GameControllerNumMappings'.'SDL2.DLL'..'SDL_GameControllerNumMappings' ++'_SDL_GameControllerOpen'.'SDL2.DLL'..'SDL_GameControllerOpen' ++'_SDL_GameControllerRumble'.'SDL2.DLL'..'SDL_GameControllerRumble' +++'_SDL_GameControllerRumbleTriggers'.'SDL2.DLL'..'SDL_GameControllerRumbleTriggers' +++'_SDL_GameControllerSetLED'.'SDL2.DLL'..'SDL_GameControllerSetLED' ++'_SDL_GameControllerSetPlayerIndex'.'SDL2.DLL'..'SDL_GameControllerSetPlayerIndex' +++'_SDL_GameControllerSetSensorEnabled'.'SDL2.DLL'..'SDL_GameControllerSetSensorEnabled' ++'_SDL_GameControllerTypeForIndex'.'SDL2.DLL'..'SDL_GameControllerTypeForIndex' ++'_SDL_GameControllerUpdate'.'SDL2.DLL'..'SDL_GameControllerUpdate' ++'_SDL_GetAssertionHandler'.'SDL2.DLL'..'SDL_GetAssertionHandler' @@ -168,6 +181,7 @@ ++'_SDL_GetDisplayOrientation'.'SDL2.DLL'..'SDL_GetDisplayOrientation' ++'_SDL_GetDisplayUsableBounds'.'SDL2.DLL'..'SDL_GetDisplayUsableBounds' ++'_SDL_GetError'.'SDL2.DLL'..'SDL_GetError' +++'_SDL_GetErrorMsg'.'SDL2.DLL'..'SDL_GetErrorMsg' ++'_SDL_GetEventFilter'.'SDL2.DLL'..'SDL_GetEventFilter' ++'_SDL_GetGlobalMouseState'.'SDL2.DLL'..'SDL_GetGlobalMouseState' ++'_SDL_GetGrabbedWindow'.'SDL2.DLL'..'SDL_GetGrabbedWindow' @@ -197,6 +211,7 @@ ++'_SDL_GetPlatform'.'SDL2.DLL'..'SDL_GetPlatform' ++'_SDL_GetPowerInfo'.'SDL2.DLL'..'SDL_GetPowerInfo' ++'_SDL_GetPrefPath'.'SDL2.DLL'..'SDL_GetPrefPath' +++'_SDL_GetPreferredLocales'.'SDL2.DLL'..'SDL_GetPreferredLocales' ++'_SDL_GetQueuedAudioSize'.'SDL2.DLL'..'SDL_GetQueuedAudioSize' ++'_SDL_GetRGB'.'SDL2.DLL'..'SDL_GetRGB' ++'_SDL_GetRGBA'.'SDL2.DLL'..'SDL_GetRGBA' @@ -299,6 +314,7 @@ ++'_SDL_HasSSE41'.'SDL2.DLL'..'SDL_HasSSE41' ++'_SDL_HasSSE42'.'SDL2.DLL'..'SDL_HasSSE42' ++'_SDL_HasScreenKeyboardSupport'.'SDL2.DLL'..'SDL_HasScreenKeyboardSupport' +++'_SDL_HasSurfaceRLE'.'SDL2.DLL'..'SDL_HasSurfaceRLE' ++'_SDL_HideWindow'.'SDL2.DLL'..'SDL_HideWindow' ++'_SDL_Init'.'SDL2.DLL'..'SDL_Init' ++'_SDL_InitSubSystem'.'SDL2.DLL'..'SDL_InitSubSystem' @@ -310,8 +326,10 @@ ++'_SDL_IsShapedWindow'.'SDL2.DLL'..'SDL_IsShapedWindow' ++'_SDL_IsTablet'.'SDL2.DLL'..'SDL_IsTablet' ++'_SDL_IsTextInputActive'.'SDL2.DLL'..'SDL_IsTextInputActive' +++'_SDL_JoystickAttachVirtual'.'SDL2.DLL'..'SDL_JoystickAttachVirtual' ++'_SDL_JoystickClose'.'SDL2.DLL'..'SDL_JoystickClose' ++'_SDL_JoystickCurrentPowerLevel'.'SDL2.DLL'..'SDL_JoystickCurrentPowerLevel' +++'_SDL_JoystickDetachVirtual'.'SDL2.DLL'..'SDL_JoystickDetachVirtual' ++'_SDL_JoystickEventState'.'SDL2.DLL'..'SDL_JoystickEventState' ++'_SDL_JoystickFromInstanceID'.'SDL2.DLL'..'SDL_JoystickFromInstanceID' ++'_SDL_JoystickFromPlayerIndex'.'SDL2.DLL'..'SDL_JoystickFromPlayerIndex' @@ -334,10 +352,13 @@ ++'_SDL_JoystickGetPlayerIndex'.'SDL2.DLL'..'SDL_JoystickGetPlayerIndex' ++'_SDL_JoystickGetProduct'.'SDL2.DLL'..'SDL_JoystickGetProduct' ++'_SDL_JoystickGetProductVersion'.'SDL2.DLL'..'SDL_JoystickGetProductVersion' +++'_SDL_JoystickGetSerial'.'SDL2.DLL'..'SDL_JoystickGetSerial' ++'_SDL_JoystickGetType'.'SDL2.DLL'..'SDL_JoystickGetType' ++'_SDL_JoystickGetVendor'.'SDL2.DLL'..'SDL_JoystickGetVendor' +++'_SDL_JoystickHasLED'.'SDL2.DLL'..'SDL_JoystickHasLED' ++'_SDL_JoystickInstanceID'.'SDL2.DLL'..'SDL_JoystickInstanceID' ++'_SDL_JoystickIsHaptic'.'SDL2.DLL'..'SDL_JoystickIsHaptic' +++'_SDL_JoystickIsVirtual'.'SDL2.DLL'..'SDL_JoystickIsVirtual' ++'_SDL_JoystickName'.'SDL2.DLL'..'SDL_JoystickName' ++'_SDL_JoystickNameForIndex'.'SDL2.DLL'..'SDL_JoystickNameForIndex' ++'_SDL_JoystickNumAxes'.'SDL2.DLL'..'SDL_JoystickNumAxes' @@ -346,7 +367,12 @@ ++'_SDL_JoystickNumHats'.'SDL2.DLL'..'SDL_JoystickNumHats' ++'_SDL_JoystickOpen'.'SDL2.DLL'..'SDL_JoystickOpen' ++'_SDL_JoystickRumble'.'SDL2.DLL'..'SDL_JoystickRumble' +++'_SDL_JoystickRumbleTriggers'.'SDL2.DLL'..'SDL_JoystickRumbleTriggers' +++'_SDL_JoystickSetLED'.'SDL2.DLL'..'SDL_JoystickSetLED' ++'_SDL_JoystickSetPlayerIndex'.'SDL2.DLL'..'SDL_JoystickSetPlayerIndex' +++'_SDL_JoystickSetVirtualAxis'.'SDL2.DLL'..'SDL_JoystickSetVirtualAxis' +++'_SDL_JoystickSetVirtualButton'.'SDL2.DLL'..'SDL_JoystickSetVirtualButton' +++'_SDL_JoystickSetVirtualHat'.'SDL2.DLL'..'SDL_JoystickSetVirtualHat' ++'_SDL_JoystickUpdate'.'SDL2.DLL'..'SDL_JoystickUpdate' ++'_SDL_LoadBMP_RW'.'SDL2.DLL'..'SDL_LoadBMP_RW' ++'_SDL_LoadDollarTemplates'.'SDL2.DLL'..'SDL_LoadDollarTemplates' @@ -359,6 +385,7 @@ ++'_SDL_LockAudioDevice'.'SDL2.DLL'..'SDL_LockAudioDevice' ++'_SDL_LockJoysticks'.'SDL2.DLL'..'SDL_LockJoysticks' ++'_SDL_LockMutex'.'SDL2.DLL'..'SDL_LockMutex' +++'_SDL_LockSensors'.'SDL2.DLL'..'SDL_LockSensors' ++'_SDL_LockSurface'.'SDL2.DLL'..'SDL_LockSurface' ++'_SDL_LockTexture'.'SDL2.DLL'..'SDL_LockTexture' ++'_SDL_LockTextureToSurface'.'SDL2.DLL'..'SDL_LockTextureToSurface' @@ -387,6 +414,8 @@ ++'_SDL_MemoryBarrierReleaseFunction'.'SDL2.DLL'..'SDL_MemoryBarrierReleaseFunction' ++'_SDL_Metal_CreateView'.'SDL2.DLL'..'SDL_Metal_CreateView' ++'_SDL_Metal_DestroyView'.'SDL2.DLL'..'SDL_Metal_DestroyView' +++'_SDL_Metal_GetDrawableSize'.'SDL2.DLL'..'SDL_Metal_GetDrawableSize' +++'_SDL_Metal_GetLayer'.'SDL2.DLL'..'SDL_Metal_GetLayer' ++'_SDL_MinimizeWindow'.'SDL2.DLL'..'SDL_MinimizeWindow' ++'_SDL_MixAudio'.'SDL2.DLL'..'SDL_MixAudio' ++'_SDL_MixAudioFormat'.'SDL2.DLL'..'SDL_MixAudioFormat' @@ -395,8 +424,15 @@ ++'_SDL_NumHaptics'.'SDL2.DLL'..'SDL_NumHaptics' ++'_SDL_NumJoysticks'.'SDL2.DLL'..'SDL_NumJoysticks' ++'_SDL_NumSensors'.'SDL2.DLL'..'SDL_NumSensors' +++'_SDL_OnApplicationDidBecomeActive'.'SDL2.DLL'..'SDL_OnApplicationDidBecomeActive' +++'_SDL_OnApplicationDidEnterBackground'.'SDL2.DLL'..'SDL_OnApplicationDidEnterBackground' +++'_SDL_OnApplicationDidReceiveMemoryWarning'.'SDL2.DLL'..'SDL_OnApplicationDidReceiveMemoryWarning' +++'_SDL_OnApplicationWillEnterForeground'.'SDL2.DLL'..'SDL_OnApplicationWillEnterForeground' +++'_SDL_OnApplicationWillResignActive'.'SDL2.DLL'..'SDL_OnApplicationWillResignActive' +++'_SDL_OnApplicationWillTerminate'.'SDL2.DLL'..'SDL_OnApplicationWillTerminate' ++'_SDL_OpenAudio'.'SDL2.DLL'..'SDL_OpenAudio' ++'_SDL_OpenAudioDevice'.'SDL2.DLL'..'SDL_OpenAudioDevice' +++'_SDL_OpenURL'.'SDL2.DLL'..'SDL_OpenURL' ++'_SDL_PauseAudio'.'SDL2.DLL'..'SDL_PauseAudio' ++'_SDL_PauseAudioDevice'.'SDL2.DLL'..'SDL_PauseAudioDevice' ++'_SDL_PeepEvents'.'SDL2.DLL'..'SDL_PeepEvents' @@ -475,6 +511,7 @@ ++'_SDL_SIMDAlloc'.'SDL2.DLL'..'SDL_SIMDAlloc' ++'_SDL_SIMDFree'.'SDL2.DLL'..'SDL_SIMDFree' ++'_SDL_SIMDGetAlignment'.'SDL2.DLL'..'SDL_SIMDGetAlignment' +++'_SDL_SIMDRealloc'.'SDL2.DLL'..'SDL_SIMDRealloc' ++'_SDL_SaveAllDollarTemplates'.'SDL2.DLL'..'SDL_SaveAllDollarTemplates' ++'_SDL_SaveBMP_RW'.'SDL2.DLL'..'SDL_SaveBMP_RW' ++'_SDL_SaveDollarTemplate'.'SDL2.DLL'..'SDL_SaveDollarTemplate' @@ -564,6 +601,7 @@ ++'_SDL_UnlockAudioDevice'.'SDL2.DLL'..'SDL_UnlockAudioDevice' ++'_SDL_UnlockJoysticks'.'SDL2.DLL'..'SDL_UnlockJoysticks' ++'_SDL_UnlockMutex'.'SDL2.DLL'..'SDL_UnlockMutex' +++'_SDL_UnlockSensors'.'SDL2.DLL'..'SDL_UnlockSensors' ++'_SDL_UnlockSurface'.'SDL2.DLL'..'SDL_UnlockSurface' ++'_SDL_UnlockTexture'.'SDL2.DLL'..'SDL_UnlockTexture' ++'_SDL_UnregisterApp'.'SDL2.DLL'..'SDL_UnregisterApp' @@ -612,6 +650,7 @@ ++'_SDL_copysignf'.'SDL2.DLL'..'SDL_copysignf' ++'_SDL_cos'.'SDL2.DLL'..'SDL_cos' ++'_SDL_cosf'.'SDL2.DLL'..'SDL_cosf' +++'_SDL_crc32'.'SDL2.DLL'..'SDL_crc32' ++'_SDL_exp'.'SDL2.DLL'..'SDL_exp' ++'_SDL_expf'.'SDL2.DLL'..'SDL_expf' ++'_SDL_fabs'.'SDL2.DLL'..'SDL_fabs' @@ -627,7 +666,9 @@ ++'_SDL_iconv_open'.'SDL2.DLL'..'SDL_iconv_open' ++'_SDL_iconv_string'.'SDL2.DLL'..'SDL_iconv_string' ++'_SDL_isdigit'.'SDL2.DLL'..'SDL_isdigit' +++'_SDL_islower'.'SDL2.DLL'..'SDL_islower' ++'_SDL_isspace'.'SDL2.DLL'..'SDL_isspace' +++'_SDL_isupper'.'SDL2.DLL'..'SDL_isupper' ++'_SDL_itoa'.'SDL2.DLL'..'SDL_itoa' ++'_SDL_lltoa'.'SDL2.DLL'..'SDL_lltoa' ++'_SDL_log'.'SDL2.DLL'..'SDL_log' @@ -677,6 +718,8 @@ ++'_SDL_tanf'.'SDL2.DLL'..'SDL_tanf' ++'_SDL_tolower'.'SDL2.DLL'..'SDL_tolower' ++'_SDL_toupper'.'SDL2.DLL'..'SDL_toupper' +++'_SDL_trunc'.'SDL2.DLL'..'SDL_trunc' +++'_SDL_truncf'.'SDL2.DLL'..'SDL_truncf' ++'_SDL_uitoa'.'SDL2.DLL'..'SDL_uitoa' ++'_SDL_ulltoa'.'SDL2.DLL'..'SDL_ulltoa' ++'_SDL_ultoa'.'SDL2.DLL'..'SDL_ultoa' @@ -684,10 +727,12 @@ ++'_SDL_utf8strlen'.'SDL2.DLL'..'SDL_utf8strlen' ++'_SDL_vsnprintf'.'SDL2.DLL'..'SDL_vsnprintf' ++'_SDL_vsscanf'.'SDL2.DLL'..'SDL_vsscanf' +++'_SDL_wcscasecmp'.'SDL2.DLL'..'SDL_wcscasecmp' ++'_SDL_wcscmp'.'SDL2.DLL'..'SDL_wcscmp' ++'_SDL_wcsdup'.'SDL2.DLL'..'SDL_wcsdup' ++'_SDL_wcslcat'.'SDL2.DLL'..'SDL_wcslcat' ++'_SDL_wcslcpy'.'SDL2.DLL'..'SDL_wcslcpy' ++'_SDL_wcslen'.'SDL2.DLL'..'SDL_wcslen' +++'_SDL_wcsncasecmp'.'SDL2.DLL'..'SDL_wcsncasecmp' ++'_SDL_wcsncmp'.'SDL2.DLL'..'SDL_wcsncmp' ++'_SDL_wcsstr'.'SDL2.DLL'..'SDL_wcsstr' diff --git a/Windows/SDL2/watcom/SDL2.lib b/Windows/SDL2/watcom/SDL2.lib index df572140..97502cce 100644 Binary files a/Windows/SDL2/watcom/SDL2.lib and b/Windows/SDL2/watcom/SDL2.lib differ diff --git a/Windows/codecs/include/mad.h b/Windows/codecs/include/mad.h index a2738e87..065c672a 100644 --- a/Windows/codecs/include/mad.h +++ b/Windows/codecs/include/mad.h @@ -24,40 +24,14 @@ extern "C" { #endif -/* windows-only configuration : */ -#ifdef _WIN64 -# define FPM_64BIT /* FPM_DEFAULT */ -#else -# define FPM_INTEL /* for x86 only */ -#endif -# define SIZEOF_LONG 4 -/* -#ifdef __i386__ -# define FPM_INTEL -# define SIZEOF_LONG 4 -#endif -#ifdef __x86_64__ +/* configuration for windows */ +#if defined(_WIN64) # define FPM_64BIT -# ifdef _WIN64 -# define SIZEOF_LONG 4 -# else -# define SIZEOF_LONG 8 -# endif +#elif defined(_M_IX86) || defined(__i386__) || defined(__386__) +# define FPM_INTEL +#else +# define FPM_DEFAULT #endif -#if (defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__)) && !(defined(__ppc64__) || defined(__powerpc64__)) -# define FPM_PPC -# define SIZEOF_LONG 4 -#endif -#if defined(__ppc64__) || defined(__powerpc64__) -# define FPM_PPC -# define SIZEOF_LONG 8 -#endif -*/ - - -#define SIZEOF_INT 4 -#define SIZEOF_LONG_LONG 8 - /* Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp */ @@ -93,7 +67,9 @@ extern char const mad_build[]; # ifndef LIBMAD_FIXED_H # define LIBMAD_FIXED_H -# if SIZEOF_INT >= 4 +# include + +# if INT_MAX >= 2147483647 typedef signed int mad_fixed_t; typedef signed int mad_fixed64hi_t; @@ -104,6 +80,8 @@ typedef signed long mad_fixed_t; typedef signed long mad_fixed64hi_t; typedef unsigned long mad_fixed64lo_t; # endif +/* compile-time assert: */ +typedef int _mad_check_fixed_t[2*(sizeof(mad_fixed_t)>=4) - 1]; # if defined(_MSC_VER) # define mad_fixed64_t signed __int64 @@ -232,6 +210,20 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) # define mad_f_mul mad_f_mul_inline # define mad_f_scale64 + +# elif defined(__WATCOMC__) && defined(__386__) +mad_fixed_t mad_f_mul_inl(mad_fixed_t,mad_fixed_t); +/* 28 == MAD_F_FRACBITS */ +#pragma aux mad_f_mul_inl = \ + "imul ebx", \ + "shrd eax,edx,28" \ + parm [eax] [ebx] \ + value [eax] \ + modify exact [eax edx] + +# define mad_f_mul mad_f_mul_inl +# define mad_f_scale64 + # else /* * This Intel version is fast and accurate; the disposition of the least @@ -1008,6 +1000,6 @@ int mad_decoder_message(struct mad_decoder *, void *, unsigned int *); # endif -# ifdef __cplusplus +#ifdef __cplusplus } -# endif +#endif diff --git a/Windows/codecs/include/opus/opusfile.h b/Windows/codecs/include/opus/opusfile.h index 220ac7f7..296d8d9a 100644 --- a/Windows/codecs/include/opus/opusfile.h +++ b/Windows/codecs/include/opus/opusfile.h @@ -6,7 +6,7 @@ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * - * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * by the Xiph.Org Foundation and contributors https://xiph.org/ * * * ******************************************************************** @@ -28,7 +28,7 @@ reference libogg and - libopus + libopus libraries. libopusfile provides several sets of built-in routines for @@ -58,7 +58,7 @@ it is stored in the header to allow you to resample to it after decoding (the libopusfile API does not currently provide a resampler, but the - the + the Speex resampler is a good choice if you need one). In general, if you are playing back the audio, you should leave it at 48 kHz, provided your audio hardware supports it. @@ -68,7 +68,7 @@ Opus files can contain anywhere from 1 to 255 channels of audio. The channel mappings for up to 8 channels are the same as the - Vorbis + Vorbis mappings. A special stereo API can convert everything to 2 channels, making it simple to support multichannel files in an application which only has stereo @@ -284,7 +284,7 @@ struct OpusHead{ A particular tag may occur more than once, and order is significant. The character set encoding for the strings is always UTF-8, but the tag names are limited to ASCII, and treated as case-insensitive. - See the Vorbis + See the Vorbis comment header specification for details. In filling in this structure, libopusfile will null-terminate the @@ -698,7 +698,7 @@ void opus_picture_tag_clear(OpusPictureTag *_pic) OP_ARG_NONNULL(1); #define OP_HTTP_PROXY_PASS_REQUEST (6720) #define OP_GET_SERVER_INFO_REQUEST (6784) -#define OP_URL_OPT(_request) ((_request)+(char *)0) +#define OP_URL_OPT(_request) ((char *)(_request)) /*These macros trigger compilation errors or warnings if the wrong types are provided to one of the URL options.*/ @@ -1890,7 +1890,7 @@ void op_set_dither_enabled(OggOpusFile *_of,int _enabled) OP_ARG_NONNULL(1); signed native-endian 16-bit values at 48 kHz with a nominal range of [-32768,32767). Multiple channels are interleaved using the - Vorbis + Vorbis channel ordering. This must have room for at least \a _buf_size values. \param _buf_size The number of values that can be stored in \a _pcm. @@ -1972,7 +1972,7 @@ OP_WARN_UNUSED_RESULT int op_read(OggOpusFile *_of, signed floats at 48 kHz with a nominal range of [-1.0,1.0]. Multiple channels are interleaved using the - Vorbis + Vorbis channel ordering. This must have room for at least \a _buf_size floats. \param _buf_size The number of floats that can be stored in \a _pcm. diff --git a/Windows/codecs/include/tremor/ivorbiscodec.h b/Windows/codecs/include/tremor/ivorbiscodec.h deleted file mode 100644 index 46d1c4db..00000000 --- a/Windows/codecs/include/tremor/ivorbiscodec.h +++ /dev/null @@ -1,201 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * - * * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * - * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * - * * - ******************************************************************** - - function: libvorbis codec headers - - ********************************************************************/ - -#ifndef _vorbis_codec_h_ -#define _vorbis_codec_h_ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include - -typedef struct vorbis_info{ - int version; - int channels; - long rate; - - /* The below bitrate declarations are *hints*. - Combinations of the three values carry the following implications: - - all three set to the same value: - implies a fixed rate bitstream - only nominal set: - implies a VBR stream that averages the nominal bitrate. No hard - upper/lower limit - upper and or lower set: - implies a VBR bitstream that obeys the bitrate limits. nominal - may also be set to give a nominal rate. - none set: - the coder does not care to speculate. - */ - - long bitrate_upper; - long bitrate_nominal; - long bitrate_lower; - long bitrate_window; - - void *codec_setup; -} vorbis_info; - -/* vorbis_dsp_state buffers the current vorbis audio - analysis/synthesis state. The DSP state belongs to a specific - logical bitstream ****************************************************/ -typedef struct vorbis_dsp_state{ - int analysisp; - vorbis_info *vi; - - ogg_int32_t **pcm; - ogg_int32_t **pcmret; - int pcm_storage; - int pcm_current; - int pcm_returned; - - int preextrapolate; - int eofflag; - - long lW; - long W; - long nW; - long centerW; - - ogg_int64_t granulepos; - ogg_int64_t sequence; - - void *backend_state; -} vorbis_dsp_state; - -typedef struct vorbis_block{ - /* necessary stream state for linking to the framing abstraction */ - ogg_int32_t **pcm; /* this is a pointer into local storage */ - oggpack_buffer opb; - - long lW; - long W; - long nW; - int pcmend; - int mode; - - int eofflag; - ogg_int64_t granulepos; - ogg_int64_t sequence; - vorbis_dsp_state *vd; /* For read-only access of configuration */ - - /* local storage to avoid remallocing; it's up to the mapping to - structure it */ - void *localstore; - long localtop; - long localalloc; - long totaluse; - struct alloc_chain *reap; - -} vorbis_block; - -/* vorbis_block is a single block of data to be processed as part of -the analysis/synthesis stream; it belongs to a specific logical -bitstream, but is independant from other vorbis_blocks belonging to -that logical bitstream. *************************************************/ - -struct alloc_chain{ - void *ptr; - struct alloc_chain *next; -}; - -/* vorbis_info contains all the setup information specific to the - specific compression/decompression mode in progress (eg, - psychoacoustic settings, channel setup, options, codebook - etc). vorbis_info and substructures are in backends.h. -*********************************************************************/ - -/* the comments are not part of vorbis_info so that vorbis_info can be - static storage */ -typedef struct vorbis_comment{ - /* unlimited user comment fields. libvorbis writes 'libvorbis' - whatever vendor is set to in encode */ - char **user_comments; - int *comment_lengths; - int comments; - char *vendor; - -} vorbis_comment; - - -/* libvorbis encodes in two abstraction layers; first we perform DSP - and produce a packet (see docs/analysis.txt). The packet is then - coded into a framed OggSquish bitstream by the second layer (see - docs/framing.txt). Decode is the reverse process; we sync/frame - the bitstream and extract individual packets, then decode the - packet back into PCM audio. - - The extra framing/packetizing is used in streaming formats, such as - files. Over the net (such as with UDP), the framing and - packetization aren't necessary as they're provided by the transport - and the streaming layer is not used */ - -/* Vorbis PRIMITIVES: general ***************************************/ - -extern void vorbis_info_init(vorbis_info *vi); -extern void vorbis_info_clear(vorbis_info *vi); -extern int vorbis_info_blocksize(vorbis_info *vi,int zo); -extern void vorbis_comment_init(vorbis_comment *vc); -extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); -extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); -extern void vorbis_comment_clear(vorbis_comment *vc); - -extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb); -extern int vorbis_block_clear(vorbis_block *vb); -extern void vorbis_dsp_clear(vorbis_dsp_state *v); - -/* Vorbis PRIMITIVES: synthesis layer *******************************/ -extern int vorbis_synthesis_idheader(ogg_packet *op); -extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc, - ogg_packet *op); - -extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi); -extern int vorbis_synthesis_restart(vorbis_dsp_state *v); -extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op); -extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op); -extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb); -extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm); -extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples); -extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op); - -/* Vorbis ERRORS and return codes ***********************************/ - -#define OV_FALSE -1 -#define OV_EOF -2 -#define OV_HOLE -3 - -#define OV_EREAD -128 -#define OV_EFAULT -129 -#define OV_EIMPL -130 -#define OV_EINVAL -131 -#define OV_ENOTVORBIS -132 -#define OV_EBADHEADER -133 -#define OV_EVERSION -134 -#define OV_ENOTAUDIO -135 -#define OV_EBADPACKET -136 -#define OV_EBADLINK -137 -#define OV_ENOSEEK -138 - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/Windows/codecs/include/tremor/ivorbisfile.h b/Windows/codecs/include/tremor/ivorbisfile.h deleted file mode 100644 index f6ecb0e4..00000000 --- a/Windows/codecs/include/tremor/ivorbisfile.h +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * - * * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * - * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * - * * - ******************************************************************** - - function: stdio-based convenience library for opening/seeking/decoding - - ********************************************************************/ - -#ifndef _OV_FILE_H_ -#define _OV_FILE_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include -#include "ivorbiscodec.h" - -#define CHUNKSIZE 65535 -#define READSIZE 1024 -/* The function prototypes for the callbacks are basically the same as for - * the stdio functions fread, fseek, fclose, ftell. - * The one difference is that the FILE * arguments have been replaced with - * a void * - this is to be used as a pointer to whatever internal data these - * functions might need. In the stdio case, it's just a FILE * cast to a void * - * - * If you use other functions, check the docs for these functions and return - * the right values. For seek_func(), you *MUST* return -1 if the stream is - * unseekable - */ -typedef struct { - size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource); - int (*seek_func) (void *datasource, ogg_int64_t offset, int whence); - int (*close_func) (void *datasource); - long (*tell_func) (void *datasource); -} ov_callbacks; - -#define NOTOPEN 0 -#define PARTOPEN 1 -#define OPENED 2 -#define STREAMSET 3 -#define INITSET 4 - -typedef struct OggVorbis_File { - void *datasource; /* Pointer to a FILE *, etc. */ - int seekable; - ogg_int64_t offset; - ogg_int64_t end; - ogg_sync_state oy; - - /* If the FILE handle isn't seekable (eg, a pipe), only the current - stream appears */ - int links; - ogg_int64_t *offsets; - ogg_int64_t *dataoffsets; - ogg_uint32_t *serialnos; - ogg_int64_t *pcmlengths; - vorbis_info *vi; - vorbis_comment *vc; - - /* Decoding working state local storage */ - ogg_int64_t pcm_offset; - int ready_state; - ogg_uint32_t current_serialno; - int current_link; - - ogg_int64_t bittrack; - ogg_int64_t samptrack; - - ogg_stream_state os; /* take physical pages, weld into a logical - stream of packets */ - vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ - vorbis_block vb; /* local working space for packet->PCM decode */ - - ov_callbacks callbacks; - -} OggVorbis_File; - -extern int ov_clear(OggVorbis_File *vf); -extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); -extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, - const char *initial, long ibytes, ov_callbacks callbacks); - -extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); -extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, - const char *initial, long ibytes, ov_callbacks callbacks); -extern int ov_test_open(OggVorbis_File *vf); - -extern long ov_bitrate(OggVorbis_File *vf,int i); -extern long ov_bitrate_instant(OggVorbis_File *vf); -extern long ov_streams(OggVorbis_File *vf); -extern long ov_seekable(OggVorbis_File *vf); -extern long ov_serialnumber(OggVorbis_File *vf,int i); - -extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i); -extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i); -extern ogg_int64_t ov_time_total(OggVorbis_File *vf,int i); - -extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_time_seek(OggVorbis_File *vf,ogg_int64_t pos); -extern int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t pos); - -extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf); -extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf); -extern ogg_int64_t ov_time_tell(OggVorbis_File *vf); - -extern vorbis_info *ov_info(OggVorbis_File *vf,int link); -extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link); - -extern long ov_read(OggVorbis_File *vf,char *buffer,int length, - int *bitstream); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - - diff --git a/Windows/codecs/include/xmp.h b/Windows/codecs/include/xmp.h index 8ec6deeb..2d725411 100644 --- a/Windows/codecs/include/xmp.h +++ b/Windows/codecs/include/xmp.h @@ -26,11 +26,17 @@ extern "C" { #elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL) # define LIBXMP_EXPORT __global #elif defined(EMSCRIPTEN) +# include # define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE +# define LIBXMP_EXPORT_VAR #else # define LIBXMP_EXPORT #endif +#if !defined (LIBXMP_EXPORT_VAR) +# define LIBXMP_EXPORT_VAR LIBXMP_EXPORT +#endif + #define XMP_NAME_SIZE 64 /* Size of module name and type */ #define XMP_KEY_OFF 0x81 /* Note number for key off event */ @@ -171,6 +177,36 @@ struct xmp_envelope { short data[XMP_MAX_ENV_POINTS * 2]; }; +struct xmp_subinstrument { + int vol; /* Default volume */ + int gvl; /* Global volume */ + int pan; /* Pan */ + int xpo; /* Transpose */ + int fin; /* Finetune */ + int vwf; /* Vibrato waveform */ + int vde; /* Vibrato depth */ + int vra; /* Vibrato rate */ + int vsw; /* Vibrato sweep */ + int rvv; /* Random volume/pan variation (IT) */ + int sid; /* Sample number */ +#define XMP_INST_NNA_CUT 0x00 +#define XMP_INST_NNA_CONT 0x01 +#define XMP_INST_NNA_OFF 0x02 +#define XMP_INST_NNA_FADE 0x03 + int nna; /* New note action */ +#define XMP_INST_DCT_OFF 0x00 +#define XMP_INST_DCT_NOTE 0x01 +#define XMP_INST_DCT_SMP 0x02 +#define XMP_INST_DCT_INST 0x03 + int dct; /* Duplicate check type */ +#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT +#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF +#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE + int dca; /* Duplicate check action */ + int ifc; /* Initial filter cutoff */ + int ifr; /* Initial filter resonance */ +}; + struct xmp_instrument { char name[32]; /* Instrument name */ int vol; /* Instrument volume */ @@ -185,35 +221,7 @@ struct xmp_instrument { signed char xpo; /* Instrument transpose for each key */ } map[XMP_MAX_KEYS]; - struct xmp_subinstrument { - int vol; /* Default volume */ - int gvl; /* Global volume */ - int pan; /* Pan */ - int xpo; /* Transpose */ - int fin; /* Finetune */ - int vwf; /* Vibrato waveform */ - int vde; /* Vibrato depth */ - int vra; /* Vibrato rate */ - int vsw; /* Vibrato sweep */ - int rvv; /* Random volume/pan variation (IT) */ - int sid; /* Sample number */ -#define XMP_INST_NNA_CUT 0x00 -#define XMP_INST_NNA_CONT 0x01 -#define XMP_INST_NNA_OFF 0x02 -#define XMP_INST_NNA_FADE 0x03 - int nna; /* New note action */ -#define XMP_INST_DCT_OFF 0x00 -#define XMP_INST_DCT_NOTE 0x01 -#define XMP_INST_DCT_SMP 0x02 -#define XMP_INST_DCT_INST 0x03 - int dct; /* Duplicate check type */ -#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT -#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF -#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE - int dca; /* Duplicate check action */ - int ifc; /* Initial filter cutoff */ - int ifr; /* Initial filter resonance */ - } *sub; + struct xmp_subinstrument *sub; void *extra; /* Extra fields */ }; @@ -276,6 +284,19 @@ struct xmp_module_info { struct xmp_sequence *seq_data; /* Pointer to sequence data */ }; +struct xmp_channel_info { + unsigned int period; /* Sample period (* 4096) */ + unsigned int position; /* Sample position */ + short pitchbend; /* Linear bend from base note*/ + unsigned char note; /* Current base note number */ + unsigned char instrument; /* Current instrument number */ + unsigned char sample; /* Current sample number */ + unsigned char volume; /* Current volume */ + unsigned char pan; /* Current stereo pan */ + unsigned char reserved; /* Reserved */ + struct xmp_event event; /* Current track event */ +}; + struct xmp_frame_info { /* Current frame information */ int pos; /* Current position */ int pattern; /* Current pattern */ @@ -296,32 +317,40 @@ struct xmp_frame_info { /* Current frame information */ int virt_used; /* Used virtual channels */ int sequence; /* Current sequence */ - struct xmp_channel_info { /* Current channel information */ - unsigned int period; /* Sample period (* 4096) */ - unsigned int position; /* Sample position */ - short pitchbend; /* Linear bend from base note*/ - unsigned char note; /* Current base note number */ - unsigned char instrument; /* Current instrument number */ - unsigned char sample; /* Current sample number */ - unsigned char volume; /* Current volume */ - unsigned char pan; /* Current stereo pan */ - unsigned char reserved; /* Reserved */ - struct xmp_event event; /* Current track event */ - } channel_info[XMP_MAX_CHANNELS]; + struct xmp_channel_info channel_info[XMP_MAX_CHANNELS]; /* Current channel information */ }; +struct xmp_callbacks { + unsigned long (*read_func)(void *dest, unsigned long len, + unsigned long nmemb, void *priv); + int (*seek_func)(void *priv, long offset, int whence); + long (*tell_func)(void *priv); + int (*close_func)(void *priv); +}; typedef char *xmp_context; -LIBXMP_EXPORT extern const char *xmp_version; -LIBXMP_EXPORT extern const unsigned int xmp_vercode; +LIBXMP_EXPORT_VAR extern const char *xmp_version; +LIBXMP_EXPORT_VAR extern const unsigned int xmp_vercode; + +LIBXMP_EXPORT int xmp_syserrno (void); LIBXMP_EXPORT xmp_context xmp_create_context (void); LIBXMP_EXPORT void xmp_free_context (xmp_context); -LIBXMP_EXPORT int xmp_test_module (char *, struct xmp_test_info *); -LIBXMP_EXPORT int xmp_load_module (xmp_context, char *); + +LIBXMP_EXPORT int xmp_load_module (xmp_context, const char *); +LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, const void *, long); +LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); +LIBXMP_EXPORT int xmp_load_module_from_callbacks (xmp_context, void *, struct xmp_callbacks); + +LIBXMP_EXPORT int xmp_test_module (const char *, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_memory (const void *, long, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_file (void *, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_callbacks (void *, struct xmp_callbacks, struct xmp_test_info *); + LIBXMP_EXPORT void xmp_scan_module (xmp_context); LIBXMP_EXPORT void xmp_release_module (xmp_context); + LIBXMP_EXPORT int xmp_start_player (xmp_context, int, int); LIBXMP_EXPORT int xmp_play_frame (xmp_context); LIBXMP_EXPORT int xmp_play_buffer (xmp_context, void *, int, int); @@ -329,7 +358,7 @@ LIBXMP_EXPORT void xmp_get_frame_info (xmp_context, struct xmp_frame_inf LIBXMP_EXPORT void xmp_end_player (xmp_context); LIBXMP_EXPORT void xmp_inject_event (xmp_context, int, struct xmp_event *); LIBXMP_EXPORT void xmp_get_module_info (xmp_context, struct xmp_module_info *); -LIBXMP_EXPORT char **xmp_get_format_list (void); +LIBXMP_EXPORT const char *const *xmp_get_format_list (void); LIBXMP_EXPORT int xmp_next_position (xmp_context); LIBXMP_EXPORT int xmp_prev_position (xmp_context); LIBXMP_EXPORT int xmp_set_position (xmp_context, int); @@ -342,9 +371,7 @@ LIBXMP_EXPORT int xmp_channel_mute (xmp_context, int, int); LIBXMP_EXPORT int xmp_channel_vol (xmp_context, int, int); LIBXMP_EXPORT int xmp_set_player (xmp_context, int, int); LIBXMP_EXPORT int xmp_get_player (xmp_context, int); -LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, char *); -LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, void *, long); -LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); +LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, const char *); /* External sample mixer API */ LIBXMP_EXPORT int xmp_start_smix (xmp_context, int, int); @@ -352,7 +379,7 @@ LIBXMP_EXPORT void xmp_end_smix (xmp_context); LIBXMP_EXPORT int xmp_smix_play_instrument(xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_play_sample (xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_channel_pan (xmp_context, int, int); -LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, char *); +LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, const char *); LIBXMP_EXPORT int xmp_smix_release_sample (xmp_context, int); #ifdef __cplusplus diff --git a/Windows/codecs/x64/libFLAC-8.dll b/Windows/codecs/x64/libFLAC-8.dll index 16590692..1b62045e 100644 Binary files a/Windows/codecs/x64/libFLAC-8.dll and b/Windows/codecs/x64/libFLAC-8.dll differ diff --git a/Windows/codecs/x64/libmad-0.dll b/Windows/codecs/x64/libmad-0.dll index 3fa2832a..4e045541 100644 Binary files a/Windows/codecs/x64/libmad-0.dll and b/Windows/codecs/x64/libmad-0.dll differ diff --git a/Windows/codecs/x64/libmikmod-3.dll b/Windows/codecs/x64/libmikmod-3.dll index 5ca6bf94..f24ee961 100644 Binary files a/Windows/codecs/x64/libmikmod-3.dll and b/Windows/codecs/x64/libmikmod-3.dll differ diff --git a/Windows/codecs/x64/libmpg123-0.dll b/Windows/codecs/x64/libmpg123-0.dll index 0498ec54..d9b5a186 100644 Binary files a/Windows/codecs/x64/libmpg123-0.dll and b/Windows/codecs/x64/libmpg123-0.dll differ diff --git a/Windows/codecs/x64/libopusfile-0.dll b/Windows/codecs/x64/libopusfile-0.dll index 4d86316a..92b3cdb5 100644 Binary files a/Windows/codecs/x64/libopusfile-0.dll and b/Windows/codecs/x64/libopusfile-0.dll differ diff --git a/Windows/codecs/x64/libvorbis-0.dll b/Windows/codecs/x64/libvorbis-0.dll index 302a5cb9..f57124be 100644 Binary files a/Windows/codecs/x64/libvorbis-0.dll and b/Windows/codecs/x64/libvorbis-0.dll differ diff --git a/Windows/codecs/x64/libvorbisfile-3.dll b/Windows/codecs/x64/libvorbisfile-3.dll index 1f76ad41..e8f1d7e6 100644 Binary files a/Windows/codecs/x64/libvorbisfile-3.dll and b/Windows/codecs/x64/libvorbisfile-3.dll differ diff --git a/Windows/codecs/x64/libvorbisidec-1.dll b/Windows/codecs/x64/libvorbisidec-1.dll deleted file mode 100644 index d4259714..00000000 Binary files a/Windows/codecs/x64/libvorbisidec-1.dll and /dev/null differ diff --git a/Windows/codecs/x64/libvorbisidec.dll.a b/Windows/codecs/x64/libvorbisidec.dll.a deleted file mode 100644 index 2965a6a2..00000000 Binary files a/Windows/codecs/x64/libvorbisidec.dll.a and /dev/null differ diff --git a/Windows/codecs/x64/libvorbisidec.lib b/Windows/codecs/x64/libvorbisidec.lib deleted file mode 100644 index 4f7830a0..00000000 Binary files a/Windows/codecs/x64/libvorbisidec.lib and /dev/null differ diff --git a/Windows/codecs/x64/libxmp.dll b/Windows/codecs/x64/libxmp.dll index 3ab0c29b..2cc0ea09 100644 Binary files a/Windows/codecs/x64/libxmp.dll and b/Windows/codecs/x64/libxmp.dll differ diff --git a/Windows/codecs/x64/libxmp.dll.a b/Windows/codecs/x64/libxmp.dll.a index 37c2ca29..09d6e519 100644 Binary files a/Windows/codecs/x64/libxmp.dll.a and b/Windows/codecs/x64/libxmp.dll.a differ diff --git a/Windows/codecs/x64/libxmp.lib b/Windows/codecs/x64/libxmp.lib index 1dbfed33..6f8522f1 100644 Binary files a/Windows/codecs/x64/libxmp.lib and b/Windows/codecs/x64/libxmp.lib differ diff --git a/Windows/codecs/x86-watcom/FLAC.lib b/Windows/codecs/x86-watcom/FLAC.lib index 82dfc5d4..26d891fd 100644 Binary files a/Windows/codecs/x86-watcom/FLAC.lib and b/Windows/codecs/x86-watcom/FLAC.lib differ diff --git a/Windows/codecs/x86-watcom/libxmp.lib b/Windows/codecs/x86-watcom/libxmp.lib index 0e916e16..fe9ece81 100644 Binary files a/Windows/codecs/x86-watcom/libxmp.lib and b/Windows/codecs/x86-watcom/libxmp.lib differ diff --git a/Windows/codecs/x86-watcom/mad.lib b/Windows/codecs/x86-watcom/mad.lib index f9e5e338..9482d5ee 100644 Binary files a/Windows/codecs/x86-watcom/mad.lib and b/Windows/codecs/x86-watcom/mad.lib differ diff --git a/Windows/codecs/x86-watcom/mikmod.lib b/Windows/codecs/x86-watcom/mikmod.lib index b784f186..b1f3105a 100644 Binary files a/Windows/codecs/x86-watcom/mikmod.lib and b/Windows/codecs/x86-watcom/mikmod.lib differ diff --git a/Windows/codecs/x86-watcom/mpg123.lib b/Windows/codecs/x86-watcom/mpg123.lib index d93d265a..f2e1dd81 100644 Binary files a/Windows/codecs/x86-watcom/mpg123.lib and b/Windows/codecs/x86-watcom/mpg123.lib differ diff --git a/Windows/codecs/x86-watcom/opusfile.lib b/Windows/codecs/x86-watcom/opusfile.lib index 9ac986ab..c0c47755 100644 Binary files a/Windows/codecs/x86-watcom/opusfile.lib and b/Windows/codecs/x86-watcom/opusfile.lib differ diff --git a/Windows/codecs/x86-watcom/vorbis.lib b/Windows/codecs/x86-watcom/vorbis.lib index b1acb832..03c1cf7f 100644 Binary files a/Windows/codecs/x86-watcom/vorbis.lib and b/Windows/codecs/x86-watcom/vorbis.lib differ diff --git a/Windows/codecs/x86-watcom/vorbisfile.lib b/Windows/codecs/x86-watcom/vorbisfile.lib index c6a0a484..a292d96a 100644 Binary files a/Windows/codecs/x86-watcom/vorbisfile.lib and b/Windows/codecs/x86-watcom/vorbisfile.lib differ diff --git a/Windows/codecs/x86-watcom/vorbisidec.lib b/Windows/codecs/x86-watcom/vorbisidec.lib deleted file mode 100644 index 8e0013f4..00000000 Binary files a/Windows/codecs/x86-watcom/vorbisidec.lib and /dev/null differ diff --git a/Windows/codecs/x86/libFLAC-8.dll b/Windows/codecs/x86/libFLAC-8.dll index f95d4e6b..f6be0557 100644 Binary files a/Windows/codecs/x86/libFLAC-8.dll and b/Windows/codecs/x86/libFLAC-8.dll differ diff --git a/Windows/codecs/x86/libmad-0.dll b/Windows/codecs/x86/libmad-0.dll index 2ac23504..bc1b61e9 100644 Binary files a/Windows/codecs/x86/libmad-0.dll and b/Windows/codecs/x86/libmad-0.dll differ diff --git a/Windows/codecs/x86/libmikmod-3.dll b/Windows/codecs/x86/libmikmod-3.dll index f59f6389..f4ccd8ee 100644 Binary files a/Windows/codecs/x86/libmikmod-3.dll and b/Windows/codecs/x86/libmikmod-3.dll differ diff --git a/Windows/codecs/x86/libmpg123-0.dll b/Windows/codecs/x86/libmpg123-0.dll index c0bbca24..96ee5c7b 100644 Binary files a/Windows/codecs/x86/libmpg123-0.dll and b/Windows/codecs/x86/libmpg123-0.dll differ diff --git a/Windows/codecs/x86/libopusfile-0.dll b/Windows/codecs/x86/libopusfile-0.dll index 8d35ab66..3cb063e0 100644 Binary files a/Windows/codecs/x86/libopusfile-0.dll and b/Windows/codecs/x86/libopusfile-0.dll differ diff --git a/Windows/codecs/x86/libvorbis-0.dll b/Windows/codecs/x86/libvorbis-0.dll index 86451f36..6c116142 100644 Binary files a/Windows/codecs/x86/libvorbis-0.dll and b/Windows/codecs/x86/libvorbis-0.dll differ diff --git a/Windows/codecs/x86/libvorbisfile-3.dll b/Windows/codecs/x86/libvorbisfile-3.dll index 72968857..7eb9b353 100644 Binary files a/Windows/codecs/x86/libvorbisfile-3.dll and b/Windows/codecs/x86/libvorbisfile-3.dll differ diff --git a/Windows/codecs/x86/libvorbisidec-1.dll b/Windows/codecs/x86/libvorbisidec-1.dll deleted file mode 100644 index 1296aec6..00000000 Binary files a/Windows/codecs/x86/libvorbisidec-1.dll and /dev/null differ diff --git a/Windows/codecs/x86/libvorbisidec.dll.a b/Windows/codecs/x86/libvorbisidec.dll.a deleted file mode 100644 index 64e6ebd1..00000000 Binary files a/Windows/codecs/x86/libvorbisidec.dll.a and /dev/null differ diff --git a/Windows/codecs/x86/libvorbisidec.lib b/Windows/codecs/x86/libvorbisidec.lib deleted file mode 100644 index 1717b5ac..00000000 Binary files a/Windows/codecs/x86/libvorbisidec.lib and /dev/null differ diff --git a/Windows/codecs/x86/libxmp.dll b/Windows/codecs/x86/libxmp.dll index 06064ed2..2de2711f 100644 Binary files a/Windows/codecs/x86/libxmp.dll and b/Windows/codecs/x86/libxmp.dll differ diff --git a/Windows/codecs/x86/libxmp.dll.a b/Windows/codecs/x86/libxmp.dll.a index e9919783..18b38695 100644 Binary files a/Windows/codecs/x86/libxmp.dll.a and b/Windows/codecs/x86/libxmp.dll.a differ diff --git a/Windows/codecs/x86/libxmp.lib b/Windows/codecs/x86/libxmp.lib index 0b809066..70a2fb6f 100644 Binary files a/Windows/codecs/x86/libxmp.lib and b/Windows/codecs/x86/libxmp.lib differ