Support dynamic loading of SDL libraries

This is mainly to address old issue when one need to have SDL library installed
in order to use our official builds. Some hip distros already installs SDL,
but it's not quite the same across all the variety of the distros.

We also now switching to SDL-2.0, most of the distros have it in repositories
already, so it shouldn't be huge deal to install it if needed.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D878
This commit is contained in:
Sergey Sharybin 2014-11-17 16:35:36 +05:00
parent 90bf426554
commit 80d1d624d3
92 changed files with 18835 additions and 55 deletions

@ -296,6 +296,9 @@ option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" ${_in
if(UNIX AND NOT APPLE)
option(WITH_JACK_DYNLOAD "Enable runtime dynamic Jack libraries loading" OFF)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF)
endif()
# Compression
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
@ -826,16 +829,23 @@ if(UNIX AND NOT APPLE)
endif()
if(WITH_SDL)
find_package_wrapper(SDL)
mark_as_advanced(
SDLMAIN_LIBRARY
SDL_INCLUDE_DIR
SDL_LIBRARY
SDL_LIBRARY_TEMP
)
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
set(WITH_SDL OFF)
if(WITH_SDL_DYNLOAD)
set(SDLMAIN_LIBRARY)
set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2")
set(SDL_LIBRARY)
set(SDL_LIBRARY_TEMP)
else()
find_package_wrapper(SDL)
mark_as_advanced(
SDLMAIN_LIBRARY
SDL_INCLUDE_DIR
SDL_LIBRARY
SDL_LIBRARY_TEMP
)
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
set(WITH_SDL OFF)
endif()
endif()
endif()
@ -1040,6 +1050,9 @@ if(UNIX AND NOT APPLE)
message(FATAL_ERROR "LLVM not found.")
endif()
endif()
if(WITH_LLVM OR WITH_SDL_DYNLOAD)
# Fix for conflict with Mesa llvmpipe
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/source/creator/blender.map")
endif()
@ -2739,6 +2752,7 @@ if(FIRST_RUN)
info_cfg_text("Audio:")
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_SDL_DYNLOAD)
info_cfg_option(WITH_JACK)
info_cfg_option(WITH_JACK_DYNLOAD)
info_cfg_option(WITH_CODEC_AVI)

@ -218,6 +218,8 @@ else:
if not env['BF_FANCY']:
B.bc.disable()
if env['WITH_BF_SDL_DYNLOAD']:
env['BF_SDL_INC'] = '#extern/sdlew/include/SDL2'
# remove install dir so old and new files are not mixed.
# NOTE: only do the scripts directory for now, otherwise is too disruptive for developers

@ -221,7 +221,7 @@ macro(SETUP_LIBDIRS)
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
link_directories(${PYTHON_LIBPATH})
endif()
if(WITH_SDL)
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
link_directories(${SDL_LIBPATH})
endif()
if(WITH_CODEC_FFMPEG)
@ -321,7 +321,7 @@ macro(setup_liblinks
if(WITH_CODEC_SNDFILE)
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
endif()
if(WITH_SDL)
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
target_link_libraries(${target} ${SDL_LIBRARY})
endif()
if(WITH_CODEC_QUICKTIME)
@ -559,6 +559,7 @@ macro(SETUP_BLENDER_SORTED_LIBS)
extern_wcwidth
extern_libmv
extern_glog
extern_sdlew
bf_intern_glew_mx
)

@ -262,6 +262,6 @@ BF_INSTALLDIR='../install/linux'
#Link against pthread
PLATFORM_LINKFLAGS = ['-pthread']
#Fix for LLVM conflict with Mesa llvmpipe
if WITH_BF_LLVM:
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']
#Fix for LLVM conflict with Mesa llvmpipe, SDL dynload also requires symbols to be hidden.
# TODO(sergey): Move this to SConstruct, so we can have this line depended on user config.
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']

@ -143,7 +143,7 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
if lenv['WITH_BF_PYTHON']:
libincs += Split(lenv['BF_PYTHON_LIBPATH'])
if lenv['WITH_BF_SDL']:
if lenv['WITH_BF_SDL'] and not lenv['WITH_BF_SDL_DYNLOAD']:
libincs += Split(lenv['BF_SDL_LIBPATH'])
if lenv['WITH_BF_JACK'] and not lenv['WITH_BF_JACK_DYNLOAD']:
libincs += Split(lenv['BF_JACK_LIBPATH'])
@ -303,7 +303,7 @@ def setup_syslibs(lenv):
if lenv['WITH_BF_ELTOPO']:
syslibs += Split(lenv['BF_LAPACK_LIB'])
'''
if lenv['WITH_BF_SDL']:
if lenv['WITH_BF_SDL'] and not lenv['WITH_BF_SDL_DYNLOAD']:
syslibs += Split(lenv['BF_SDL_LIB'])
if not lenv['WITH_BF_STATICOPENGL']:
syslibs += Split(lenv['BF_OPENGL_LIB'])
@ -381,6 +381,9 @@ def creator(env):
defs.append('WITH_BINRELOC')
if env['WITH_BF_SDL']:
if env['WITH_BF_SDL_DYNLOAD']:
defs.append('WITH_SDL_DYNLOAD')
incs.append('#/extern/sdlew/include')
defs.append('WITH_SDL')
if env['WITH_BF_LIBMV']:

@ -108,7 +108,7 @@ def validate_arguments(args, bc):
opts_list = [
'WITH_BF_FREESTYLE', 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'WITH_BF_PYTHON_SECURITY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LIBPATH_ARCH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH', 'WITH_BF_SDL_DYNLOAD',
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_JACK_DYNLOAD',
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
@ -300,6 +300,7 @@ def read_opts(env, cfg, args):
('BF_SDL_INC', 'SDL include path', ''),
('BF_SDL_LIB', 'SDL library', ''),
('BF_SDL_LIBPATH', 'SDL library path', ''),
(BoolVariable('WITH_BF_SDL_DYNLOAD', 'Enable runtime dynamic SDL libraries loading (works only on Linux)', False)),
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
('BF_JACK', 'jack base path', ''),

@ -90,3 +90,7 @@ endif()
if(WITH_GTESTS)
add_subdirectory(gtest)
endif()
if(WITH_SDL AND WITH_SDL_DYNLOAD)
add_subdirectory(sdlew)
endif()

3
extern/SConscript vendored

@ -50,3 +50,6 @@ if env['WITH_GHOST_XDND']:
# FreeBSD doesn't seems to support XDND protocol
if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'aix4', 'aix5'):
SConscript(['xdnd/SConscript'])
if env['WITH_BF_SDL'] and env['WITH_BF_SDL_DYNLOAD']:
SConscript(['sdlew/SConscript'])

40
extern/sdlew/CMakeLists.txt vendored Normal file

@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# 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 the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
set(INC
.
include
)
set(INC_SYS
)
set(SRC
include/sdlew.h
src/sdlew.c
)
blender_add_lib(extern_sdlew "${SRC}" "${INC}" "${INC_SYS}")

35
extern/sdlew/SConscript vendored Normal file

@ -0,0 +1,35 @@
#!/usr/bin/env python
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# 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 the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2014, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
Import ('env')
sources = env.Glob('src/sdlew.c')
incs = 'include'
defs = []
env.BlenderLib ('extern_sdlew', sources, Split(incs), defines=defs, libtype=['extern'], priority = [999])

250
extern/sdlew/auto/sdlew_gen.sh vendored Executable file

@ -0,0 +1,250 @@
#!/bin/bash
SDL="SDL2"
INCLUDE_DIR="/usr/include/${SDL}"
SCRIPT=`realpath -s $0`
DIR=`dirname $SCRIPT`
DIR=`dirname $DIR`
mkdir -p $DIR/include/${SDL}
mkdir -p $DIR/src
rm -rf $DIR/include/${SDL}/*.h
rm -rf $DIR/src/sdlew.c
echo "Generating sdlew headers..."
UNSUPPORTED="SDL_MemoryBarrierRelease SDL_MemoryBarrierAcquire SDL_AtomicCAS SDL_AtomicCASPtr \
SDL_iPhoneSetAnimationCallback SDL_iPhoneSetEventPump SDL_AndroidGetJNIEnv SDL_AndroidGetActivity \
SDL_AndroidGetActivity SDL_AndroidGetInternalStoragePath SDL_AndroidGetExternalStorageState \
SDL_AndroidGetExternalStoragePath SDL_CreateShapedWindow SDL_IsShapedWindow tSDL_SetWindowShape \
SDL_GetShapedWindowMode"
for header in $INCLUDE_DIR/*; do
filename=`basename $header`
cat $header \
| sed -r 's/extern DECLSPEC ((const )?[a-z0-9_]+(\s\*)?)\s?SDLCALL /typedef \1 SDLCALL t/i' \
> $DIR/include/${SDL}/$filename
line_num=`cat $DIR/include/${SDL}/$filename | grep -n "Ends C function" | cut -d : -f 1`
if [ ! -z "$line_num" ]; then
functions=`grep -E 'typedef [A-Za-z0-9_ \*]+ SDLCALL' $DIR/include/${SDL}/$filename \
| sed -r 's/typedef [A-Za-z0-9_ \*]+ SDLCALL t([a-z0-9_]+).*/extern t\1 *\1;/i'`
functions=`echo "${functions}" | sed -e 's/[\/&]/\\\&/g'`
echo "$functions" | while read function; do
if [ -z "$function" ]; then
continue;
fi
func_name=`echo $function | cut -d '*' -f 2 | sed -r 's/;//'`
if [ ! -z "`echo "$UNSUPPORTED" | grep $func_name`" ]; then
continue;
fi
if [ "$func_name" == "SDL_memcpy" ]; then
line_num=`cat $DIR/include/${SDL}/$filename | grep -n "SDL_memcpy4" | cut -d : -f 1`
sed -ri "${line_num}s/(.*)/${function}\n\1/" $DIR/include/${SDL}/$filename
else
sed -ri "${line_num}s/(.*)/${function}\n\1/" $DIR/include/${SDL}/$filename
fi
line_num=`cat $DIR/include/${SDL}/$filename | grep -n "Ends C function" | cut -d : -f 1`
done
line_num=`cat $DIR/include/${SDL}/$filename | grep -n "Ends C function" | cut -d : -f 1`
sed -ri "${line_num}s/(.*)/\n\1/" $DIR/include/${SDL}/$filename
fi
if [ $filename == "SDL_stdinc.h" ]; then
cat $header | grep -E '#if(def)? (defined\()?HAVE_' | sed -r 's/#if(def)? //' | while read check; do
func_names=`cat $DIR/include/${SDL}/$filename \
| grep -A 8 "$check\$" \
| grep -v struct \
| grep 'typedef' \
| sed -r 's/typedef [a-z0-9_ \*]+ SDLCALL ([a-z0-9_]+).*/\1/i'`
full_check=`echo "${check}" | sed -e 's/[\/&]/\\\&/g'`
if [ ! -z "`echo $full_check | grep defined`" ]; then
full_check="#if !($full_check)"
else
full_check="#ifndef $full_check"
fi
for func_name in $func_names; do
line_num=`grep -n "extern ${func_name} \*" $DIR/include/${SDL}/$filename | cut -d : -f 1`
let prev_num=line_num-1
if [ -z "`cat $DIR/include/${SDL}/$filename | head -n $prev_num | tail -n 1 | grep '#if'`" ]; then
sed -ri "${line_num}s/(.*)/$full_check \/* GEN_CHECK_MARKER *\/\n\1\n#endif \/* GEN_CHECK_MARKER *\//" $DIR/include/${SDL}/$filename
fi
done
done
fi
done
cat << EOF > $DIR/include/sdlew.h
/*
* Copyright 2014 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
#ifndef __SDL_EW_H__
#define __SDL_EW_H__
#ifdef __cplusplus
extern "C" {
#endif
enum {
SDLEW_SUCCESS = 0,
SDLEW_ERROR_OPEN_FAILED = -1,
SDLEW_ERROR_ATEXIT_FAILED = -2,
SDLEW_ERROR_VERSION = -3,
};
int sdlewInit(void);
#ifdef __cplusplus
}
#endif
#endif /* __SDL_EW_H__ */
EOF
echo "Generating sdlew sources..."
cat << EOF > $DIR/src/sdlew.c
/*
* Copyright 2014 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
#ifdef _MSC_VER
# define snprintf _snprintf
# define popen _popen
# define pclose _pclose
# define _CRT_SECURE_NO_WARNINGS
#endif
#include "sdlew.h"
#include "${SDL}/SDL.h"
#include "${SDL}/SDL_syswm.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# include <windows.h>
/* Utility macros. */
typedef HMODULE DynamicLibrary;
# define dynamic_library_open(path) LoadLibrary(path)
# define dynamic_library_close(lib) FreeLibrary(lib)
# define dynamic_library_find(lib, symbol) GetProcAddress(lib, symbol)
#else
# include <dlfcn.h>
typedef void* DynamicLibrary;
# define dynamic_library_open(path) dlopen(path, RTLD_NOW)
# define dynamic_library_close(lib) dlclose(lib)
# define dynamic_library_find(lib, symbol) dlsym(lib, symbol)
#endif
#define SDL_LIBRARY_FIND_CHECKED(name) \
name = (t##name *)dynamic_library_find(lib, #name); \
assert(name);
#define SDL_LIBRARY_FIND(name) \
name = (t##name *)dynamic_library_find(lib, #name);
static DynamicLibrary lib;
EOF
content=`grep --no-filename -ER "extern tSDL|GEN_CHECK_MARKER" $DIR/include/${SDL}/`
echo "$content" | sed -r 's/extern t([a-z0-9_]+).*/t\1 *\1;/gi' >> $DIR/src/sdlew.c
cat << EOF >> $DIR/src/sdlew.c
static void sdlewExit(void) {
if(lib != NULL) {
/* Ignore errors. */
dynamic_library_close(lib);
lib = NULL;
}
}
/* Implementation function. */
int sdlewInit(void) {
/* Library paths. */
#ifdef _WIN32
/* Expected in c:/windows/system or similar, no path needed. */
const char *path = "SDL2.dll";
#elif defined(__APPLE__)
/* Default installation path. */
const char *path = "/usr/local/cuda/lib/libSDL2.dylib";
#else
const char *path = "libSDL2.so";
#endif
static int initialized = 0;
static int result = 0;
int error;
if (initialized) {
return result;
}
initialized = 1;
error = atexit(sdlewExit);
if (error) {
result = SDLEW_ERROR_ATEXIT_FAILED;
return result;
}
/* Load library. */
lib = dynamic_library_open(path);
if (lib == NULL) {
result = SDLEW_ERROR_OPEN_FAILED;
return result;
}
EOF
echo "$content" | sed -r 's/extern t([a-z0-9_]+).*/ SDL_LIBRARY_FIND(\1);/gi' >> $DIR/src/sdlew.c
cat << EOF >> $DIR/src/sdlew.c
result = SDLEW_SUCCESS;
return result;
}
EOF
sed -i 's/\s\/\* GEN_CHECK_MARKER \*\///g' $DIR/src/sdlew.c
sed -i 's/\s\/\* GEN_CHECK_MARKER \*\///g' $DIR/include/${SDL}/SDL_stdinc.h

15
extern/sdlew/auto/strip_comments.sh vendored Executable file

@ -0,0 +1,15 @@
#!/bin/bash
SDL="SDL2"
INCLUDE_DIR="/usr/include/${SDL}"
SCRIPT=`realpath -s $0`
DIR=`dirname $SCRIPT`
DIR=`dirname $DIR`
for f in $DIR/include/${SDL}/*.h; do
file_name=`basename $f`
echo "Striping $file_name..."
sed -r ':a; s%(.*)/\*.*\*/%\1%; ta; /\/\*/ !b; N; ba' -i $f
sed 's/[ \t]*$//' -i $f
sed '/^$/N;/^\n$/D' -i $f
done

73
extern/sdlew/include/SDL2/SDL.h vendored Normal file

@ -0,0 +1,73 @@
#ifndef _SDL_H
#define _SDL_H
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_assert.h"
#include "SDL_atomic.h"
#include "SDL_audio.h"
#include "SDL_clipboard.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_joystick.h"
#include "SDL_gamecontroller.h"
#include "SDL_haptic.h"
#include "SDL_hints.h"
#include "SDL_loadso.h"
#include "SDL_log.h"
#include "SDL_messagebox.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_render.h"
#include "SDL_rwops.h"
#include "SDL_system.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_version.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_HAPTIC 0x00001000
#define SDL_INIT_GAMECONTROLLER 0x00002000
#define SDL_INIT_EVENTS 0x00004000
#define SDL_INIT_NOPARACHUTE 0x00100000
#define SDL_INIT_EVERYTHING ( \
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
)
typedef int SDLCALL tSDL_Init(Uint32 flags);
typedef int SDLCALL tSDL_InitSubSystem(Uint32 flags);
typedef void SDLCALL tSDL_QuitSubSystem(Uint32 flags);
typedef Uint32 SDLCALL tSDL_WasInit(Uint32 flags);
typedef void SDLCALL tSDL_Quit(void);
extern tSDL_Init *SDL_Init;
extern tSDL_InitSubSystem *SDL_InitSubSystem;
extern tSDL_QuitSubSystem *SDL_QuitSubSystem;
extern tSDL_WasInit *SDL_WasInit;
extern tSDL_Quit *SDL_Quit;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

140
extern/sdlew/include/SDL2/SDL_assert.h vendored Normal file

@ -0,0 +1,140 @@
#ifndef _SDL_assert_h
#define _SDL_assert_h
#include "SDL_config.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SDL_ASSERT_LEVEL
#ifdef SDL_DEFAULT_ASSERT_LEVEL
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
#elif defined(_DEBUG) || defined(DEBUG) || \
(defined(__GNUC__) && !defined(__OPTIMIZE__))
#define SDL_ASSERT_LEVEL 2
#else
#define SDL_ASSERT_LEVEL 1
#endif
#endif
#if defined(_MSC_VER)
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif defined(HAVE_SIGNAL_H)
#include <signal.h>
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
#else
#define SDL_TriggerBreakpoint()
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define SDL_FUNCTION __func__
#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
#endif
#define SDL_FILE __FILE__
#define SDL_LINE __LINE__
#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (0)
typedef enum
{
SDL_ASSERTION_RETRY,
SDL_ASSERTION_BREAK,
SDL_ASSERTION_ABORT,
SDL_ASSERTION_IGNORE,
SDL_ASSERTION_ALWAYS_IGNORE
} SDL_assert_state;
typedef struct SDL_assert_data
{
int always_ignore;
unsigned int trigger_count;
const char *condition;
const char *filename;
int linenum;
const char *function;
const struct SDL_assert_data *next;
} SDL_assert_data;
#if (SDL_ASSERT_LEVEL > 0)
typedef SDL_assert_state SDLCALL tSDL_ReportAssertion(SDL_assert_data *,
const char *,
const char *, int);
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
static struct SDL_assert_data assert_data = { \
0, 0, #condition, 0, 0, 0, 0 \
}; \
const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
SDL_FUNCTION, \
SDL_FILE, \
SDL_LINE); \
if (state == SDL_ASSERTION_RETRY) { \
continue; \
} else if (state == SDL_ASSERTION_BREAK) { \
SDL_TriggerBreakpoint(); \
} \
break; \
} \
} while (0)
#endif
#if SDL_ASSERT_LEVEL == 0
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 1
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 2
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 3
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
#else
# error Unknown assertion level.
#endif
typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)(
const SDL_assert_data* data, void* userdata);
typedef void SDLCALL tSDL_SetAssertionHandler(
SDL_AssertionHandler handler,
void *userdata);
typedef const SDL_assert_data * SDLCALL tSDL_GetAssertionReport(void);
typedef void SDLCALL tSDL_ResetAssertionReport(void);
extern tSDL_ReportAssertion *SDL_ReportAssertion;
extern tSDL_SetAssertionHandler *SDL_SetAssertionHandler;
extern tSDL_GetAssertionReport *SDL_GetAssertionReport;
extern tSDL_ResetAssertionReport *SDL_ResetAssertionReport;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

185
extern/sdlew/include/SDL2/SDL_atomic.h vendored Normal file

@ -0,0 +1,185 @@
#ifndef _SDL_atomic_h_
#define _SDL_atomic_h_
#include "SDL_stdinc.h"
#include "SDL_platform.h"
#include "begin_code.h"
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
#include <intrin.h>
#define HAVE_MSC_ATOMICS 1
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef int SDL_SpinLock;
typedef SDL_bool SDLCALL tSDL_AtomicTryLock(SDL_SpinLock *lock);
typedef void SDLCALL tSDL_AtomicLock(SDL_SpinLock *lock);
typedef void SDLCALL tSDL_AtomicUnlock(SDL_SpinLock *lock);
#if defined(_MSC_VER) && (_MSC_VER > 1200)
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
#define SDL_CompilerBarrier() _ReadWriteBarrier()
#elif defined(__GNUC__)
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
#else
#define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
#endif
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
#elif defined(__GNUC__) && defined(__arm__)
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
#ifdef __thumb__
typedef void SDLCALL tSDL_MemoryBarrierRelease();
typedef void SDLCALL tSDL_MemoryBarrierAcquire();
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#endif
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
#endif
#else
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
#endif
#if defined(SDL_ATOMIC_DISABLED) && SDL_ATOMIC_DISABLED
#define SDL_DISABLE_ATOMIC_INLINE
#endif
#ifndef SDL_DISABLE_ATOMIC_INLINE
#ifdef HAVE_MSC_ATOMICS
#define SDL_AtomicSet(a, v) _InterlockedExchange((long*)&(a)->value, (v))
#define SDL_AtomicAdd(a, v) _InterlockedExchangeAdd((long*)&(a)->value, (v))
#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval))
#define SDL_AtomicSetPtr(a, v) _InterlockedExchangePointer((a), (v))
#if _M_IX86
#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval))
#else
#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchangePointer((a), (newval), (oldval)) == (oldval))
#endif
#elif defined(__MACOSX__)
#include <libkern/OSAtomic.h>
#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
#ifdef __LP64__
#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
#else
#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
#endif
#elif defined(HAVE_GCC_ATOMICS)
#define SDL_AtomicSet(a, v) __sync_lock_test_and_set(&(a)->value, v)
#define SDL_AtomicAdd(a, v) __sync_fetch_and_add(&(a)->value, v)
#define SDL_AtomicSetPtr(a, v) __sync_lock_test_and_set(a, v)
#define SDL_AtomicCAS(a, oldval, newval) __sync_bool_compare_and_swap(&(a)->value, oldval, newval)
#define SDL_AtomicCASPtr(a, oldval, newval) __sync_bool_compare_and_swap(a, oldval, newval)
#endif
#endif
#ifndef SDL_atomic_t_defined
typedef struct { int value; } SDL_atomic_t;
#endif
#ifndef SDL_AtomicCAS
typedef SDL_bool SDLCALL tSDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
#endif
#ifndef SDL_AtomicSet
SDL_FORCE_INLINE int SDL_AtomicSet(SDL_atomic_t *a, int v)
{
int value;
do {
value = a->value;
} while (!SDL_AtomicCAS(a, value, v));
return value;
}
#endif
#ifndef SDL_AtomicGet
SDL_FORCE_INLINE int SDL_AtomicGet(SDL_atomic_t *a)
{
int value = a->value;
SDL_CompilerBarrier();
return value;
}
#endif
#ifndef SDL_AtomicAdd
SDL_FORCE_INLINE int SDL_AtomicAdd(SDL_atomic_t *a, int v)
{
int value;
do {
value = a->value;
} while (!SDL_AtomicCAS(a, value, (value + v)));
return value;
}
#endif
#ifndef SDL_AtomicIncRef
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
#endif
#ifndef SDL_AtomicDecRef
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
#endif
#ifndef SDL_AtomicCASPtr
typedef SDL_bool SDLCALL tSDL_AtomicCASPtr(void* *a, void *oldval, void *newval);
#endif
#ifndef SDL_AtomicSetPtr
SDL_FORCE_INLINE void* SDL_AtomicSetPtr(void* *a, void* v)
{
void* value;
do {
value = *a;
} while (!SDL_AtomicCASPtr(a, value, v));
return value;
}
#endif
#ifndef SDL_AtomicGetPtr
SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a)
{
void* value = *a;
SDL_CompilerBarrier();
return value;
}
#endif
extern tSDL_AtomicTryLock *SDL_AtomicTryLock;
extern tSDL_AtomicLock *SDL_AtomicLock;
extern tSDL_AtomicUnlock *SDL_AtomicUnlock;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

222
extern/sdlew/include/SDL2/SDL_audio.h vendored Normal file

@ -0,0 +1,222 @@
#ifndef _SDL_audio_h
#define _SDL_audio_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_endian.h"
#include "SDL_mutex.h"
#include "SDL_thread.h"
#include "SDL_rwops.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef Uint16 SDL_AudioFormat;
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
#define SDL_AUDIO_MASK_ENDIAN (1<<12)
#define SDL_AUDIO_MASK_SIGNED (1<<15)
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
#define AUDIO_U8 0x0008
#define AUDIO_S8 0x8008
#define AUDIO_U16LSB 0x0010
#define AUDIO_S16LSB 0x8010
#define AUDIO_U16MSB 0x1010
#define AUDIO_S16MSB 0x9010
#define AUDIO_U16 AUDIO_U16LSB
#define AUDIO_S16 AUDIO_S16LSB
#define AUDIO_S32LSB 0x8020
#define AUDIO_S32MSB 0x9020
#define AUDIO_S32 AUDIO_S32LSB
#define AUDIO_F32LSB 0x8120
#define AUDIO_F32MSB 0x9120
#define AUDIO_F32 AUDIO_F32LSB
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_U16SYS AUDIO_U16LSB
#define AUDIO_S16SYS AUDIO_S16LSB
#define AUDIO_S32SYS AUDIO_S32LSB
#define AUDIO_F32SYS AUDIO_F32LSB
#else
#define AUDIO_U16SYS AUDIO_U16MSB
#define AUDIO_S16SYS AUDIO_S16MSB
#define AUDIO_S32SYS AUDIO_S32MSB
#define AUDIO_F32SYS AUDIO_F32MSB
#endif
#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
int len);
typedef struct SDL_AudioSpec
{
int freq;
SDL_AudioFormat format;
Uint8 channels;
Uint8 silence;
Uint16 samples;
Uint16 padding;
Uint32 size;
SDL_AudioCallback callback;
void *userdata;
} SDL_AudioSpec;
struct SDL_AudioCVT;
typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
SDL_AudioFormat format);
#ifdef __GNUC__
#define SDL_AUDIOCVT_PACKED __attribute__((packed))
#else
#define SDL_AUDIOCVT_PACKED
#endif
typedef struct SDL_AudioCVT
{
int needed;
SDL_AudioFormat src_format;
SDL_AudioFormat dst_format;
double rate_incr;
Uint8 *buf;
int len;
int len_cvt;
int len_mult;
double len_ratio;
SDL_AudioFilter filters[10];
int filter_index;
} SDL_AUDIOCVT_PACKED SDL_AudioCVT;
typedef int SDLCALL tSDL_GetNumAudioDrivers(void);
typedef const char * SDLCALL tSDL_GetAudioDriver(int index);
typedef int SDLCALL tSDL_AudioInit(const char *driver_name);
typedef void SDLCALL tSDL_AudioQuit(void);
typedef const char * SDLCALL tSDL_GetCurrentAudioDriver(void);
typedef int SDLCALL tSDL_OpenAudio(SDL_AudioSpec * desired,
SDL_AudioSpec * obtained);
typedef Uint32 SDL_AudioDeviceID;
typedef int SDLCALL tSDL_GetNumAudioDevices(int iscapture);
typedef const char * SDLCALL tSDL_GetAudioDeviceName(int index,
int iscapture);
typedef SDL_AudioDeviceID SDLCALL tSDL_OpenAudioDevice(const char
*device,
int iscapture,
const
SDL_AudioSpec *
desired,
SDL_AudioSpec *
obtained,
int
allowed_changes);
typedef enum
{
SDL_AUDIO_STOPPED = 0,
SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED
} SDL_AudioStatus;
typedef SDL_AudioStatus SDLCALL tSDL_GetAudioStatus(void);
extern DECLSPEC SDL_AudioStatus SDLCALL
SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
typedef void SDLCALL tSDL_PauseAudio(int pause_on);
typedef void SDLCALL tSDL_PauseAudioDevice(SDL_AudioDeviceID dev,
int pause_on);
typedef SDL_AudioSpec * SDLCALL tSDL_LoadWAV_RW(SDL_RWops * src,
int freesrc,
SDL_AudioSpec * spec,
Uint8 ** audio_buf,
Uint32 * audio_len);
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
typedef void SDLCALL tSDL_FreeWAV(Uint8 * audio_buf);
typedef int SDLCALL tSDL_BuildAudioCVT(SDL_AudioCVT * cvt,
SDL_AudioFormat src_format,
Uint8 src_channels,
int src_rate,
SDL_AudioFormat dst_format,
Uint8 dst_channels,
int dst_rate);
typedef int SDLCALL tSDL_ConvertAudio(SDL_AudioCVT * cvt);
#define SDL_MIX_MAXVOLUME 128
typedef void SDLCALL tSDL_MixAudio(Uint8 * dst, const Uint8 * src,
Uint32 len, int volume);
typedef void SDLCALL tSDL_MixAudioFormat(Uint8 * dst,
const Uint8 * src,
SDL_AudioFormat format,
Uint32 len, int volume);
typedef void SDLCALL tSDL_LockAudio(void);
typedef void SDLCALL tSDL_LockAudioDevice(SDL_AudioDeviceID dev);
typedef void SDLCALL tSDL_UnlockAudio(void);
typedef void SDLCALL tSDL_UnlockAudioDevice(SDL_AudioDeviceID dev);
typedef void SDLCALL tSDL_CloseAudio(void);
typedef void SDLCALL tSDL_CloseAudioDevice(SDL_AudioDeviceID dev);
extern tSDL_GetNumAudioDrivers *SDL_GetNumAudioDrivers;
extern tSDL_GetAudioDriver *SDL_GetAudioDriver;
extern tSDL_AudioInit *SDL_AudioInit;
extern tSDL_AudioQuit *SDL_AudioQuit;
extern tSDL_GetCurrentAudioDriver *SDL_GetCurrentAudioDriver;
extern tSDL_OpenAudio *SDL_OpenAudio;
extern tSDL_GetNumAudioDevices *SDL_GetNumAudioDevices;
extern tSDL_GetAudioDeviceName *SDL_GetAudioDeviceName;
extern tSDL_OpenAudioDevice *SDL_OpenAudioDevice;
extern tSDL_GetAudioStatus *SDL_GetAudioStatus;
extern tSDL_PauseAudio *SDL_PauseAudio;
extern tSDL_PauseAudioDevice *SDL_PauseAudioDevice;
extern tSDL_LoadWAV_RW *SDL_LoadWAV_RW;
extern tSDL_FreeWAV *SDL_FreeWAV;
extern tSDL_BuildAudioCVT *SDL_BuildAudioCVT;
extern tSDL_ConvertAudio *SDL_ConvertAudio;
extern tSDL_MixAudio *SDL_MixAudio;
extern tSDL_MixAudioFormat *SDL_MixAudioFormat;
extern tSDL_LockAudio *SDL_LockAudio;
extern tSDL_LockAudioDevice *SDL_LockAudioDevice;
extern tSDL_UnlockAudio *SDL_UnlockAudio;
extern tSDL_UnlockAudioDevice *SDL_UnlockAudioDevice;
extern tSDL_CloseAudio *SDL_CloseAudio;
extern tSDL_CloseAudioDevice *SDL_CloseAudioDevice;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

53
extern/sdlew/include/SDL2/SDL_bits.h vendored Normal file

@ -0,0 +1,53 @@
#ifndef _SDL_bits_h
#define _SDL_bits_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
SDL_FORCE_INLINE int
SDL_MostSignificantBitIndex32(Uint32 x)
{
#if defined(__GNUC__) && __GNUC__ >= 4
if (x == 0) {
return -1;
}
return 31 - __builtin_clz(x);
#else
const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
const int S[] = {1, 2, 4, 8, 16};
int msbIndex = 0;
int i;
if (x == 0) {
return -1;
}
for (i = 4; i >= 0; i--)
{
if (x & b[i])
{
x >>= S[i];
msbIndex |= S[i];
}
}
return msbIndex;
#endif
}
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,25 @@
#ifndef _SDL_blendmode_h
#define _SDL_blendmode_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
SDL_BLENDMODE_NONE = 0x00000000,
SDL_BLENDMODE_BLEND = 0x00000001,
SDL_BLENDMODE_ADD = 0x00000002,
SDL_BLENDMODE_MOD = 0x00000004
} SDL_BlendMode;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,29 @@
#ifndef _SDL_clipboard_h
#define _SDL_clipboard_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int SDLCALL tSDL_SetClipboardText(const char *text);
typedef char * SDLCALL tSDL_GetClipboardText(void);
typedef SDL_bool SDLCALL tSDL_HasClipboardText(void);
extern tSDL_SetClipboardText *SDL_SetClipboardText;
extern tSDL_GetClipboardText *SDL_GetClipboardText;
extern tSDL_HasClipboardText *SDL_HasClipboardText;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

175
extern/sdlew/include/SDL2/SDL_config.h vendored Normal file

@ -0,0 +1,175 @@
#ifndef _SDL_config_h
#define _SDL_config_h
#include "SDL_platform.h"
#ifdef _MSC_VER
#error You should run hg revert SDL_config.h
#endif
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define HAVE_GCC_ATOMICS 1
#define HAVE_PTHREAD_SPINLOCK 1
#define HAVE_LIBC 1
#if HAVE_LIBC
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_ICONV_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_LIBUDEV_H 1
#define HAVE_DBUS_DBUS_H 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#ifndef __WIN32__
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#endif
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI
#define HAVE_ATAN 1
#define HAVE_ATAN2 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_FSEEKO 1
#define HAVE_FSEEKO64 1
#define HAVE_SIGACTION 1
#define HAVE_SA_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_MPROTECT 1
#define HAVE_ICONV 1
#define HAVE_PTHREAD_SETNAME_NP 1
#define HAVE_SEM_TIMEDWAIT 1
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#endif
#define SDL_LOADSO_DISABLED 1
#define SDL_AUDIO_DRIVER_ALSA 1
#define SDL_AUDIO_DRIVER_PULSEAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
#define SDL_AUDIO_DRIVER_OSS 1
#define SDL_INPUT_LINUXEV 1
#define SDL_INPUT_TSLIB 1
#define SDL_JOYSTICK_LINUX 1
#define SDL_HAPTIC_LINUX 1
#define SDL_LOADSO_DLOPEN 1
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
#define SDL_TIMER_UNIX 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_X11 1
#define SDL_VIDEO_DRIVER_X11_XCURSOR 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
#define SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
#define SDL_VIDEO_RENDER_OGL 1
#define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_GLX 1
#define SDL_POWER_LINUX 1
#define SDL_ASSEMBLY_ROUTINES 1
#endif

86
extern/sdlew/include/SDL2/SDL_cpuinfo.h vendored Normal file

@ -0,0 +1,86 @@
#ifndef _SDL_cpuinfo_h
#define _SDL_cpuinfo_h
#include "SDL_stdinc.h"
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
#include <intrin.h>
#ifndef _WIN64
#define __MMX__
#define __3dNOW__
#endif
#define __SSE__
#define __SSE2__
#elif defined(__MINGW64_VERSION_MAJOR)
#include <intrin.h>
#else
#ifdef __ALTIVEC__
#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__)
#include <altivec.h>
#undef pixel
#endif
#endif
#ifdef __MMX__
#include <mmintrin.h>
#endif
#ifdef __3dNOW__
#include <mm3dnow.h>
#endif
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE2__
#include <emmintrin.h>
#endif
#endif
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_CACHELINE_SIZE 128
typedef int SDLCALL tSDL_GetCPUCount(void);
typedef int SDLCALL tSDL_GetCPUCacheLineSize(void);
typedef SDL_bool SDLCALL tSDL_HasRDTSC(void);
typedef SDL_bool SDLCALL tSDL_HasAltiVec(void);
typedef SDL_bool SDLCALL tSDL_HasMMX(void);
typedef SDL_bool SDLCALL tSDL_Has3DNow(void);
typedef SDL_bool SDLCALL tSDL_HasSSE(void);
typedef SDL_bool SDLCALL tSDL_HasSSE2(void);
typedef SDL_bool SDLCALL tSDL_HasSSE3(void);
typedef SDL_bool SDLCALL tSDL_HasSSE41(void);
typedef SDL_bool SDLCALL tSDL_HasSSE42(void);
extern tSDL_GetCPUCount *SDL_GetCPUCount;
extern tSDL_GetCPUCacheLineSize *SDL_GetCPUCacheLineSize;
extern tSDL_HasRDTSC *SDL_HasRDTSC;
extern tSDL_HasAltiVec *SDL_HasAltiVec;
extern tSDL_HasMMX *SDL_HasMMX;
extern tSDL_Has3DNow *SDL_Has3DNow;
extern tSDL_HasSSE *SDL_HasSSE;
extern tSDL_HasSSE2 *SDL_HasSSE2;
extern tSDL_HasSSE3 *SDL_HasSSE3;
extern tSDL_HasSSE41 *SDL_HasSSE41;
extern tSDL_HasSSE42 *SDL_HasSSE42;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

193
extern/sdlew/include/SDL2/SDL_endian.h vendored Normal file

@ -0,0 +1,193 @@
#ifndef _SDL_endian_h
#define _SDL_endian_h
#include "SDL_stdinc.h"
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
#ifndef SDL_BYTEORDER
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#else
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif
#endif
#endif
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__GNUC__) && defined(__i386__) && \
!(__GNUC__ == 2 && __GNUC_MINOR__ == 95 )
SDL_FORCE_INLINE Uint16
SDL_Swap16(Uint16 x)
{
__asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
SDL_FORCE_INLINE Uint16
SDL_Swap16(Uint16 x)
{
__asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
SDL_FORCE_INLINE Uint16
SDL_Swap16(Uint16 x)
{
int result;
__asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
return (Uint16)result;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
SDL_FORCE_INLINE Uint16
SDL_Swap16(Uint16 x)
{
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
return x;
}
#else
SDL_FORCE_INLINE Uint16
SDL_Swap16(Uint16 x)
{
return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
}
#endif
#if defined(__GNUC__) && defined(__i386__)
SDL_FORCE_INLINE Uint32
SDL_Swap32(Uint32 x)
{
__asm__("bswap %0": "=r"(x):"0"(x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
SDL_FORCE_INLINE Uint32
SDL_Swap32(Uint32 x)
{
__asm__("bswapl %0": "=r"(x):"0"(x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
SDL_FORCE_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));
return result;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
SDL_FORCE_INLINE Uint32
SDL_Swap32(Uint32 x)
{
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
return x;
}
#else
SDL_FORCE_INLINE Uint32
SDL_Swap32(Uint32 x)
{
return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
((x >> 8) & 0x0000FF00) | (x >> 24)));
}
#endif
#if defined(__GNUC__) && defined(__i386__)
SDL_FORCE_INLINE Uint64
SDL_Swap64(Uint64 x)
{
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));
return v.u;
}
#elif defined(__GNUC__) && defined(__x86_64__)
SDL_FORCE_INLINE Uint64
SDL_Swap64(Uint64 x)
{
__asm__("bswapq %0": "=r"(x):"0"(x));
return x;
}
#else
SDL_FORCE_INLINE Uint64
SDL_Swap64(Uint64 x)
{
Uint32 hi, lo;
lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
x >>= 32;
hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
x = SDL_Swap32(lo);
x <<= 32;
x |= SDL_Swap32(hi);
return (x);
}
#endif
SDL_FORCE_INLINE float
SDL_SwapFloat(float x)
{
union
{
float f;
Uint32 ui32;
} swapper;
swapper.f = x;
swapper.ui32 = SDL_Swap32(swapper.ui32);
return swapper.f;
}
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SDL_SwapLE16(X) (X)
#define SDL_SwapLE32(X) (X)
#define SDL_SwapLE64(X) (X)
#define SDL_SwapFloatLE(X) (X)
#define SDL_SwapBE16(X) SDL_Swap16(X)
#define SDL_SwapBE32(X) SDL_Swap32(X)
#define SDL_SwapBE64(X) SDL_Swap64(X)
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
#else
#define SDL_SwapLE16(X) SDL_Swap16(X)
#define SDL_SwapLE32(X) SDL_Swap32(X)
#define SDL_SwapLE64(X) SDL_Swap64(X)
#define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
#define SDL_SwapBE16(X) (X)
#define SDL_SwapBE32(X) (X)
#define SDL_SwapBE64(X) (X)
#define SDL_SwapFloatBE(X) (X)
#endif
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

43
extern/sdlew/include/SDL2/SDL_error.h vendored Normal file

@ -0,0 +1,43 @@
#ifndef _SDL_error_h
#define _SDL_error_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int SDLCALL tSDL_SetError(const char *fmt, ...);
typedef const char * SDLCALL tSDL_GetError(void);
typedef void SDLCALL tSDL_ClearError(void);
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
typedef enum
{
SDL_ENOMEM,
SDL_EFREAD,
SDL_EFWRITE,
SDL_EFSEEK,
SDL_UNSUPPORTED,
SDL_LASTERROR
} SDL_errorcode;
typedef int SDLCALL tSDL_Error(SDL_errorcode code);
extern tSDL_SetError *SDL_SetError;
extern tSDL_GetError *SDL_GetError;
extern tSDL_ClearError *SDL_ClearError;
extern tSDL_Error *SDL_Error;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

446
extern/sdlew/include/SDL2/SDL_events.h vendored Normal file

@ -0,0 +1,446 @@
#ifndef _SDL_events_h
#define _SDL_events_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "SDL_keyboard.h"
#include "SDL_mouse.h"
#include "SDL_joystick.h"
#include "SDL_gamecontroller.h"
#include "SDL_quit.h"
#include "SDL_gesture.h"
#include "SDL_touch.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_RELEASED 0
#define SDL_PRESSED 1
typedef enum
{
SDL_FIRSTEVENT = 0,
SDL_QUIT = 0x100,
SDL_APP_TERMINATING,
SDL_APP_LOWMEMORY,
SDL_APP_WILLENTERBACKGROUND,
SDL_APP_DIDENTERBACKGROUND,
SDL_APP_WILLENTERFOREGROUND,
SDL_APP_DIDENTERFOREGROUND,
SDL_WINDOWEVENT = 0x200,
SDL_SYSWMEVENT,
SDL_KEYDOWN = 0x300,
SDL_KEYUP,
SDL_TEXTEDITING,
SDL_TEXTINPUT,
SDL_MOUSEMOTION = 0x400,
SDL_MOUSEBUTTONDOWN,
SDL_MOUSEBUTTONUP,
SDL_MOUSEWHEEL,
SDL_JOYAXISMOTION = 0x600,
SDL_JOYBALLMOTION,
SDL_JOYHATMOTION,
SDL_JOYBUTTONDOWN,
SDL_JOYBUTTONUP,
SDL_JOYDEVICEADDED,
SDL_JOYDEVICEREMOVED,
SDL_CONTROLLERAXISMOTION = 0x650,
SDL_CONTROLLERBUTTONDOWN,
SDL_CONTROLLERBUTTONUP,
SDL_CONTROLLERDEVICEADDED,
SDL_CONTROLLERDEVICEREMOVED,
SDL_CONTROLLERDEVICEREMAPPED,
SDL_FINGERDOWN = 0x700,
SDL_FINGERUP,
SDL_FINGERMOTION,
SDL_DOLLARGESTURE = 0x800,
SDL_DOLLARRECORD,
SDL_MULTIGESTURE,
SDL_CLIPBOARDUPDATE = 0x900,
SDL_DROPFILE = 0x1000,
SDL_USEREVENT = 0x8000,
SDL_LASTEVENT = 0xFFFF
} SDL_EventType;
typedef struct SDL_CommonEvent
{
Uint32 type;
Uint32 timestamp;
} SDL_CommonEvent;
typedef struct SDL_WindowEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint8 event;
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
Sint32 data1;
Sint32 data2;
} SDL_WindowEvent;
typedef struct SDL_KeyboardEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint8 state;
Uint8 repeat;
Uint8 padding2;
Uint8 padding3;
SDL_Keysym keysym;
} SDL_KeyboardEvent;
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
typedef struct SDL_TextEditingEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
Sint32 start;
Sint32 length;
} SDL_TextEditingEvent;
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
typedef struct SDL_TextInputEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
} SDL_TextInputEvent;
typedef struct SDL_MouseMotionEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint32 which;
Uint32 state;
Sint32 x;
Sint32 y;
Sint32 xrel;
Sint32 yrel;
} SDL_MouseMotionEvent;
typedef struct SDL_MouseButtonEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint32 which;
Uint8 button;
Uint8 state;
Uint8 padding1;
Uint8 padding2;
Sint32 x;
Sint32 y;
} SDL_MouseButtonEvent;
typedef struct SDL_MouseWheelEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint32 which;
Sint32 x;
Sint32 y;
} SDL_MouseWheelEvent;
typedef struct SDL_JoyAxisEvent
{
Uint32 type;
Uint32 timestamp;
SDL_JoystickID which;
Uint8 axis;
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
Sint16 value;
Uint16 padding4;
} SDL_JoyAxisEvent;
typedef struct SDL_JoyBallEvent
{
Uint32 type;
Uint32 timestamp;
SDL_JoystickID which;
Uint8 ball;
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
Sint16 xrel;
Sint16 yrel;
} SDL_JoyBallEvent;
typedef struct SDL_JoyHatEvent
{
Uint32 type;
Uint32 timestamp;
SDL_JoystickID which;
Uint8 hat;
Uint8 value;
Uint8 padding1;
Uint8 padding2;
} SDL_JoyHatEvent;
typedef struct SDL_JoyButtonEvent
{
Uint32 type;
Uint32 timestamp;
SDL_JoystickID which;
Uint8 button;
Uint8 state;
Uint8 padding1;
Uint8 padding2;
} SDL_JoyButtonEvent;
typedef struct SDL_JoyDeviceEvent
{
Uint32 type;
Uint32 timestamp;
Sint32 which;
} SDL_JoyDeviceEvent;
typedef struct SDL_ControllerAxisEvent
{
Uint32 type;
Uint32 timestamp;
SDL_JoystickID which;
Uint8 axis;
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
Sint16 value;
Uint16 padding4;
} SDL_ControllerAxisEvent;
typedef struct SDL_ControllerButtonEvent
{
Uint32 type;
Uint32 timestamp;
SDL_JoystickID which;
Uint8 button;
Uint8 state;
Uint8 padding1;
Uint8 padding2;
} SDL_ControllerButtonEvent;
typedef struct SDL_ControllerDeviceEvent
{
Uint32 type;
Uint32 timestamp;
Sint32 which;
} SDL_ControllerDeviceEvent;
typedef struct SDL_TouchFingerEvent
{
Uint32 type;
Uint32 timestamp;
SDL_TouchID touchId;
SDL_FingerID fingerId;
float x;
float y;
float dx;
float dy;
float pressure;
} SDL_TouchFingerEvent;
typedef struct SDL_MultiGestureEvent
{
Uint32 type;
Uint32 timestamp;
SDL_TouchID touchId;
float dTheta;
float dDist;
float x;
float y;
Uint16 numFingers;
Uint16 padding;
} SDL_MultiGestureEvent;
typedef struct SDL_DollarGestureEvent
{
Uint32 type;
Uint32 timestamp;
SDL_TouchID touchId;
SDL_GestureID gestureId;
Uint32 numFingers;
float error;
float x;
float y;
} SDL_DollarGestureEvent;
typedef struct SDL_DropEvent
{
Uint32 type;
Uint32 timestamp;
char *file;
} SDL_DropEvent;
typedef struct SDL_QuitEvent
{
Uint32 type;
Uint32 timestamp;
} SDL_QuitEvent;
typedef struct SDL_OSEvent
{
Uint32 type;
Uint32 timestamp;
} SDL_OSEvent;
typedef struct SDL_UserEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Sint32 code;
void *data1;
void *data2;
} SDL_UserEvent;
struct SDL_SysWMmsg;
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct SDL_SysWMEvent
{
Uint32 type;
Uint32 timestamp;
SDL_SysWMmsg *msg;
} SDL_SysWMEvent;
typedef union SDL_Event
{
Uint32 type;
SDL_CommonEvent common;
SDL_WindowEvent window;
SDL_KeyboardEvent key;
SDL_TextEditingEvent edit;
SDL_TextInputEvent text;
SDL_MouseMotionEvent motion;
SDL_MouseButtonEvent button;
SDL_MouseWheelEvent wheel;
SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton;
SDL_JoyDeviceEvent jdevice;
SDL_ControllerAxisEvent caxis;
SDL_ControllerButtonEvent cbutton;
SDL_ControllerDeviceEvent cdevice;
SDL_QuitEvent quit;
SDL_UserEvent user;
SDL_SysWMEvent syswm;
SDL_TouchFingerEvent tfinger;
SDL_MultiGestureEvent mgesture;
SDL_DollarGestureEvent dgesture;
SDL_DropEvent drop;
Uint8 padding[56];
} SDL_Event;
typedef void SDLCALL tSDL_PumpEvents(void);
typedef enum
{
SDL_ADDEVENT,
SDL_PEEKEVENT,
SDL_GETEVENT
} SDL_eventaction;
typedef int SDLCALL tSDL_PeepEvents(SDL_Event * events, int numevents,
SDL_eventaction action,
Uint32 minType, Uint32 maxType);
typedef SDL_bool SDLCALL tSDL_HasEvent(Uint32 type);
typedef SDL_bool SDLCALL tSDL_HasEvents(Uint32 minType, Uint32 maxType);
typedef void SDLCALL tSDL_FlushEvent(Uint32 type);
typedef void SDLCALL tSDL_FlushEvents(Uint32 minType, Uint32 maxType);
typedef int SDLCALL tSDL_PollEvent(SDL_Event * event);
typedef int SDLCALL tSDL_WaitEvent(SDL_Event * event);
typedef int SDLCALL tSDL_WaitEventTimeout(SDL_Event * event,
int timeout);
typedef int SDLCALL tSDL_PushEvent(SDL_Event * event);
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
typedef void SDLCALL tSDL_SetEventFilter(SDL_EventFilter filter,
void *userdata);
typedef SDL_bool SDLCALL tSDL_GetEventFilter(SDL_EventFilter * filter,
void **userdata);
typedef void SDLCALL tSDL_AddEventWatch(SDL_EventFilter filter,
void *userdata);
typedef void SDLCALL tSDL_DelEventWatch(SDL_EventFilter filter,
void *userdata);
typedef void SDLCALL tSDL_FilterEvents(SDL_EventFilter filter,
void *userdata);
#define SDL_QUERY -1
#define SDL_IGNORE 0
#define SDL_DISABLE 0
#define SDL_ENABLE 1
typedef Uint8 SDLCALL tSDL_EventState(Uint32 type, int state);
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
typedef Uint32 SDLCALL tSDL_RegisterEvents(int numevents);
extern tSDL_PumpEvents *SDL_PumpEvents;
extern tSDL_PeepEvents *SDL_PeepEvents;
extern tSDL_HasEvent *SDL_HasEvent;
extern tSDL_HasEvents *SDL_HasEvents;
extern tSDL_FlushEvent *SDL_FlushEvent;
extern tSDL_FlushEvents *SDL_FlushEvents;
extern tSDL_PollEvent *SDL_PollEvent;
extern tSDL_WaitEvent *SDL_WaitEvent;
extern tSDL_WaitEventTimeout *SDL_WaitEventTimeout;
extern tSDL_PushEvent *SDL_PushEvent;
extern tSDL_SetEventFilter *SDL_SetEventFilter;
extern tSDL_GetEventFilter *SDL_GetEventFilter;
extern tSDL_AddEventWatch *SDL_AddEventWatch;
extern tSDL_DelEventWatch *SDL_DelEventWatch;
extern tSDL_FilterEvents *SDL_FilterEvents;
extern tSDL_EventState *SDL_EventState;
extern tSDL_RegisterEvents *SDL_RegisterEvents;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,143 @@
#ifndef _SDL_gamecontroller_h
#define _SDL_gamecontroller_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_joystick.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _SDL_GameController;
typedef struct _SDL_GameController SDL_GameController;
typedef enum
{
SDL_CONTROLLER_BINDTYPE_NONE = 0,
SDL_CONTROLLER_BINDTYPE_BUTTON,
SDL_CONTROLLER_BINDTYPE_AXIS,
SDL_CONTROLLER_BINDTYPE_HAT
} SDL_GameControllerBindType;
typedef struct SDL_GameControllerButtonBind
{
SDL_GameControllerBindType bindType;
union
{
int button;
int axis;
struct {
int hat;
int hat_mask;
} hat;
} value;
} SDL_GameControllerButtonBind;
typedef int SDLCALL tSDL_GameControllerAddMapping( const char* mappingString );
typedef char * SDLCALL tSDL_GameControllerMappingForGUID( SDL_JoystickGUID guid );
typedef char * SDLCALL tSDL_GameControllerMapping( SDL_GameController * gamecontroller );
typedef SDL_bool SDLCALL tSDL_IsGameController(int joystick_index);
typedef const char * SDLCALL tSDL_GameControllerNameForIndex(int joystick_index);
typedef SDL_GameController * SDLCALL tSDL_GameControllerOpen(int joystick_index);
typedef const char * SDLCALL tSDL_GameControllerName(SDL_GameController *gamecontroller);
typedef SDL_bool SDLCALL tSDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
typedef SDL_Joystick * SDLCALL tSDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
typedef int SDLCALL tSDL_GameControllerEventState(int state);
typedef void SDLCALL tSDL_GameControllerUpdate(void);
typedef enum
{
SDL_CONTROLLER_AXIS_INVALID = -1,
SDL_CONTROLLER_AXIS_LEFTX,
SDL_CONTROLLER_AXIS_LEFTY,
SDL_CONTROLLER_AXIS_RIGHTX,
SDL_CONTROLLER_AXIS_RIGHTY,
SDL_CONTROLLER_AXIS_TRIGGERLEFT,
SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
SDL_CONTROLLER_AXIS_MAX
} SDL_GameControllerAxis;
typedef SDL_GameControllerAxis SDLCALL tSDL_GameControllerGetAxisFromString(const char *pchString);
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
SDL_GameControllerAxis axis);
extern DECLSPEC Sint16 SDLCALL
SDL_GameControllerGetAxis(SDL_GameController *gamecontroller,
SDL_GameControllerAxis axis);
typedef enum
{
SDL_CONTROLLER_BUTTON_INVALID = -1,
SDL_CONTROLLER_BUTTON_A,
SDL_CONTROLLER_BUTTON_B,
SDL_CONTROLLER_BUTTON_X,
SDL_CONTROLLER_BUTTON_Y,
SDL_CONTROLLER_BUTTON_BACK,
SDL_CONTROLLER_BUTTON_GUIDE,
SDL_CONTROLLER_BUTTON_START,
SDL_CONTROLLER_BUTTON_LEFTSTICK,
SDL_CONTROLLER_BUTTON_RIGHTSTICK,
SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
SDL_CONTROLLER_BUTTON_DPAD_UP,
SDL_CONTROLLER_BUTTON_DPAD_DOWN,
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
SDL_CONTROLLER_BUTTON_MAX
} SDL_GameControllerButton;
typedef SDL_GameControllerButton SDLCALL tSDL_GameControllerGetButtonFromString(const char *pchString);
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
SDL_GameControllerButton button);
typedef Uint8 SDLCALL tSDL_GameControllerGetButton(SDL_GameController *gamecontroller,
SDL_GameControllerButton button);
typedef void SDLCALL tSDL_GameControllerClose(SDL_GameController *gamecontroller);
extern tSDL_GameControllerAddMapping *SDL_GameControllerAddMapping;
extern tSDL_GameControllerMappingForGUID *SDL_GameControllerMappingForGUID;
extern tSDL_GameControllerMapping *SDL_GameControllerMapping;
extern tSDL_IsGameController *SDL_IsGameController;
extern tSDL_GameControllerNameForIndex *SDL_GameControllerNameForIndex;
extern tSDL_GameControllerOpen *SDL_GameControllerOpen;
extern tSDL_GameControllerName *SDL_GameControllerName;
extern tSDL_GameControllerGetAttached *SDL_GameControllerGetAttached;
extern tSDL_GameControllerGetJoystick *SDL_GameControllerGetJoystick;
extern tSDL_GameControllerEventState *SDL_GameControllerEventState;
extern tSDL_GameControllerUpdate *SDL_GameControllerUpdate;
extern tSDL_GameControllerGetAxisFromString *SDL_GameControllerGetAxisFromString;
extern tSDL_GameControllerGetButtonFromString *SDL_GameControllerGetButtonFromString;
extern tSDL_GameControllerGetButton *SDL_GameControllerGetButton;
extern tSDL_GameControllerClose *SDL_GameControllerClose;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

38
extern/sdlew/include/SDL2/SDL_gesture.h vendored Normal file

@ -0,0 +1,38 @@
#ifndef _SDL_gesture_h
#define _SDL_gesture_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "SDL_touch.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef Sint64 SDL_GestureID;
typedef int SDLCALL tSDL_RecordGesture(SDL_TouchID touchId);
typedef int SDLCALL tSDL_SaveAllDollarTemplates(SDL_RWops *src);
typedef int SDLCALL tSDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src);
typedef int SDLCALL tSDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
extern tSDL_RecordGesture *SDL_RecordGesture;
extern tSDL_SaveAllDollarTemplates *SDL_SaveAllDollarTemplates;
extern tSDL_SaveDollarTemplate *SDL_SaveDollarTemplate;
extern tSDL_LoadDollarTemplates *SDL_LoadDollarTemplates;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

302
extern/sdlew/include/SDL2/SDL_haptic.h vendored Normal file

@ -0,0 +1,302 @@
#ifndef _SDL_haptic_h
#define _SDL_haptic_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_joystick.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _SDL_Haptic;
typedef struct _SDL_Haptic SDL_Haptic;
#define SDL_HAPTIC_CONSTANT (1<<0)
#define SDL_HAPTIC_SINE (1<<1)
#define SDL_HAPTIC_LEFTRIGHT (1<<2)
#define SDL_HAPTIC_TRIANGLE (1<<3)
#define SDL_HAPTIC_SAWTOOTHUP (1<<4)
#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)
#define SDL_HAPTIC_RAMP (1<<6)
#define SDL_HAPTIC_SPRING (1<<7)
#define SDL_HAPTIC_DAMPER (1<<8)
#define SDL_HAPTIC_INERTIA (1<<9)
#define SDL_HAPTIC_FRICTION (1<<10)
#define SDL_HAPTIC_CUSTOM (1<<11)
#define SDL_HAPTIC_GAIN (1<<12)
#define SDL_HAPTIC_AUTOCENTER (1<<13)
#define SDL_HAPTIC_STATUS (1<<14)
#define SDL_HAPTIC_PAUSE (1<<15)
#define SDL_HAPTIC_POLAR 0
#define SDL_HAPTIC_CARTESIAN 1
#define SDL_HAPTIC_SPHERICAL 2
#define SDL_HAPTIC_INFINITY 4294967295U
typedef struct SDL_HapticDirection
{
Uint8 type;
Sint32 dir[3];
} SDL_HapticDirection;
typedef struct SDL_HapticConstant
{
Uint16 type;
SDL_HapticDirection direction;
Uint32 length;
Uint16 delay;
Uint16 button;
Uint16 interval;
Sint16 level;
Uint16 attack_length;
Uint16 attack_level;
Uint16 fade_length;
Uint16 fade_level;
} SDL_HapticConstant;
typedef struct SDL_HapticPeriodic
{
Uint16 type;
SDL_HapticDirection direction;
Uint32 length;
Uint16 delay;
Uint16 button;
Uint16 interval;
Uint16 period;
Sint16 magnitude;
Sint16 offset;
Uint16 phase;
Uint16 attack_length;
Uint16 attack_level;
Uint16 fade_length;
Uint16 fade_level;
} SDL_HapticPeriodic;
typedef struct SDL_HapticCondition
{
Uint16 type;
SDL_HapticDirection direction;
Uint32 length;
Uint16 delay;
Uint16 button;
Uint16 interval;
Uint16 right_sat[3];
Uint16 left_sat[3];
Sint16 right_coeff[3];
Sint16 left_coeff[3];
Uint16 deadband[3];
Sint16 center[3];
} SDL_HapticCondition;
typedef struct SDL_HapticRamp
{
Uint16 type;
SDL_HapticDirection direction;
Uint32 length;
Uint16 delay;
Uint16 button;
Uint16 interval;
Sint16 start;
Sint16 end;
Uint16 attack_length;
Uint16 attack_level;
Uint16 fade_length;
Uint16 fade_level;
} SDL_HapticRamp;
typedef struct SDL_HapticLeftRight
{
Uint16 type;
Uint32 length;
Uint16 large_magnitude;
Uint16 small_magnitude;
} SDL_HapticLeftRight;
typedef struct SDL_HapticCustom
{
Uint16 type;
SDL_HapticDirection direction;
Uint32 length;
Uint16 delay;
Uint16 button;
Uint16 interval;
Uint8 channels;
Uint16 period;
Uint16 samples;
Uint16 *data;
Uint16 attack_length;
Uint16 attack_level;
Uint16 fade_length;
Uint16 fade_level;
} SDL_HapticCustom;
typedef union SDL_HapticEffect
{
Uint16 type;
SDL_HapticConstant constant;
SDL_HapticPeriodic periodic;
SDL_HapticCondition condition;
SDL_HapticRamp ramp;
SDL_HapticLeftRight leftright;
SDL_HapticCustom custom;
} SDL_HapticEffect;
typedef int SDLCALL tSDL_NumHaptics(void);
typedef const char * SDLCALL tSDL_HapticName(int device_index);
typedef SDL_Haptic * SDLCALL tSDL_HapticOpen(int device_index);
typedef int SDLCALL tSDL_HapticOpened(int device_index);
typedef int SDLCALL tSDL_HapticIndex(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_MouseIsHaptic(void);
typedef SDL_Haptic * SDLCALL tSDL_HapticOpenFromMouse(void);
typedef int SDLCALL tSDL_JoystickIsHaptic(SDL_Joystick * joystick);
typedef SDL_Haptic * SDLCALL tSDL_HapticOpenFromJoystick(SDL_Joystick *
joystick);
typedef void SDLCALL tSDL_HapticClose(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticNumEffects(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticNumAxes(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticEffectSupported(SDL_Haptic * haptic,
SDL_HapticEffect *
effect);
typedef int SDLCALL tSDL_HapticNewEffect(SDL_Haptic * haptic,
SDL_HapticEffect * effect);
typedef int SDLCALL tSDL_HapticUpdateEffect(SDL_Haptic * haptic,
int effect,
SDL_HapticEffect * data);
typedef int SDLCALL tSDL_HapticRunEffect(SDL_Haptic * haptic,
int effect,
Uint32 iterations);
typedef int SDLCALL tSDL_HapticStopEffect(SDL_Haptic * haptic,
int effect);
typedef void SDLCALL tSDL_HapticDestroyEffect(SDL_Haptic * haptic,
int effect);
typedef int SDLCALL tSDL_HapticGetEffectStatus(SDL_Haptic * haptic,
int effect);
typedef int SDLCALL tSDL_HapticSetGain(SDL_Haptic * haptic, int gain);
typedef int SDLCALL tSDL_HapticSetAutocenter(SDL_Haptic * haptic,
int autocenter);
typedef int SDLCALL tSDL_HapticPause(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticUnpause(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticStopAll(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticRumbleSupported(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticRumbleInit(SDL_Haptic * haptic);
typedef int SDLCALL tSDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
typedef int SDLCALL tSDL_HapticRumbleStop(SDL_Haptic * haptic);
extern tSDL_NumHaptics *SDL_NumHaptics;
extern tSDL_HapticName *SDL_HapticName;
extern tSDL_HapticOpen *SDL_HapticOpen;
extern tSDL_HapticOpened *SDL_HapticOpened;
extern tSDL_HapticIndex *SDL_HapticIndex;
extern tSDL_MouseIsHaptic *SDL_MouseIsHaptic;
extern tSDL_HapticOpenFromMouse *SDL_HapticOpenFromMouse;
extern tSDL_JoystickIsHaptic *SDL_JoystickIsHaptic;
extern tSDL_HapticOpenFromJoystick *SDL_HapticOpenFromJoystick;
extern tSDL_HapticClose *SDL_HapticClose;
extern tSDL_HapticNumEffects *SDL_HapticNumEffects;
extern tSDL_HapticNumEffectsPlaying *SDL_HapticNumEffectsPlaying;
extern tSDL_HapticNumAxes *SDL_HapticNumAxes;
extern tSDL_HapticEffectSupported *SDL_HapticEffectSupported;
extern tSDL_HapticNewEffect *SDL_HapticNewEffect;
extern tSDL_HapticUpdateEffect *SDL_HapticUpdateEffect;
extern tSDL_HapticRunEffect *SDL_HapticRunEffect;
extern tSDL_HapticStopEffect *SDL_HapticStopEffect;
extern tSDL_HapticDestroyEffect *SDL_HapticDestroyEffect;
extern tSDL_HapticGetEffectStatus *SDL_HapticGetEffectStatus;
extern tSDL_HapticSetGain *SDL_HapticSetGain;
extern tSDL_HapticSetAutocenter *SDL_HapticSetAutocenter;
extern tSDL_HapticPause *SDL_HapticPause;
extern tSDL_HapticUnpause *SDL_HapticUnpause;
extern tSDL_HapticStopAll *SDL_HapticStopAll;
extern tSDL_HapticRumbleSupported *SDL_HapticRumbleSupported;
extern tSDL_HapticRumbleInit *SDL_HapticRumbleInit;
extern tSDL_HapticRumblePlay *SDL_HapticRumblePlay;
extern tSDL_HapticRumbleStop *SDL_HapticRumbleStop;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

87
extern/sdlew/include/SDL2/SDL_hints.h vendored Normal file

@ -0,0 +1,87 @@
#ifndef _SDL_hints_h
#define _SDL_hints_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION"
#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"
#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY"
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE"
#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA"
#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
typedef enum
{
SDL_HINT_DEFAULT,
SDL_HINT_NORMAL,
SDL_HINT_OVERRIDE
} SDL_HintPriority;
typedef SDL_bool SDLCALL tSDL_SetHintWithPriority(const char *name,
const char *value,
SDL_HintPriority priority);
typedef SDL_bool SDLCALL tSDL_SetHint(const char *name,
const char *value);
typedef const char * SDLCALL tSDL_GetHint(const char *name);
typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
typedef void SDLCALL tSDL_AddHintCallback(const char *name,
SDL_HintCallback callback,
void *userdata);
typedef void SDLCALL tSDL_DelHintCallback(const char *name,
SDL_HintCallback callback,
void *userdata);
typedef void SDLCALL tSDL_ClearHints(void);
extern tSDL_SetHintWithPriority *SDL_SetHintWithPriority;
extern tSDL_SetHint *SDL_SetHint;
extern tSDL_GetHint *SDL_GetHint;
extern tSDL_AddHintCallback *SDL_AddHintCallback;
extern tSDL_DelHintCallback *SDL_DelHintCallback;
extern tSDL_ClearHints *SDL_ClearHints;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

106
extern/sdlew/include/SDL2/SDL_joystick.h vendored Normal file

@ -0,0 +1,106 @@
#ifndef _SDL_joystick_h
#define _SDL_joystick_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _SDL_Joystick;
typedef struct _SDL_Joystick SDL_Joystick;
typedef struct {
Uint8 data[16];
} SDL_JoystickGUID;
typedef Sint32 SDL_JoystickID;
typedef int SDLCALL tSDL_NumJoysticks(void);
typedef const char * SDLCALL tSDL_JoystickNameForIndex(int device_index);
typedef SDL_Joystick * SDLCALL tSDL_JoystickOpen(int device_index);
typedef const char * SDLCALL tSDL_JoystickName(SDL_Joystick * joystick);
typedef SDL_JoystickGUID SDLCALL tSDL_JoystickGetDeviceGUID(int device_index);
typedef SDL_JoystickGUID SDLCALL tSDL_JoystickGetGUID(SDL_Joystick * joystick);
extern DECLSPEC void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
typedef SDL_JoystickGUID SDLCALL tSDL_JoystickGetGUIDFromString(const char *pchGUID);
typedef SDL_bool SDLCALL tSDL_JoystickGetAttached(SDL_Joystick * joystick);
typedef SDL_JoystickID SDLCALL tSDL_JoystickInstanceID(SDL_Joystick * joystick);
typedef int SDLCALL tSDL_JoystickNumAxes(SDL_Joystick * joystick);
typedef int SDLCALL tSDL_JoystickNumBalls(SDL_Joystick * joystick);
typedef int SDLCALL tSDL_JoystickNumHats(SDL_Joystick * joystick);
typedef int SDLCALL tSDL_JoystickNumButtons(SDL_Joystick * joystick);
typedef void SDLCALL tSDL_JoystickUpdate(void);
typedef int SDLCALL tSDL_JoystickEventState(int state);
typedef Sint16 SDLCALL tSDL_JoystickGetAxis(SDL_Joystick * joystick,
int axis);
#define SDL_HAT_CENTERED 0x00
#define SDL_HAT_UP 0x01
#define SDL_HAT_RIGHT 0x02
#define SDL_HAT_DOWN 0x04
#define SDL_HAT_LEFT 0x08
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
typedef Uint8 SDLCALL tSDL_JoystickGetHat(SDL_Joystick * joystick,
int hat);
typedef int SDLCALL tSDL_JoystickGetBall(SDL_Joystick * joystick,
int ball, int *dx, int *dy);
typedef Uint8 SDLCALL tSDL_JoystickGetButton(SDL_Joystick * joystick,
int button);
typedef void SDLCALL tSDL_JoystickClose(SDL_Joystick * joystick);
extern tSDL_NumJoysticks *SDL_NumJoysticks;
extern tSDL_JoystickNameForIndex *SDL_JoystickNameForIndex;
extern tSDL_JoystickOpen *SDL_JoystickOpen;
extern tSDL_JoystickName *SDL_JoystickName;
extern tSDL_JoystickGetDeviceGUID *SDL_JoystickGetDeviceGUID;
extern tSDL_JoystickGetGUID *SDL_JoystickGetGUID;
extern tSDL_JoystickGetGUIDFromString *SDL_JoystickGetGUIDFromString;
extern tSDL_JoystickGetAttached *SDL_JoystickGetAttached;
extern tSDL_JoystickInstanceID *SDL_JoystickInstanceID;
extern tSDL_JoystickNumAxes *SDL_JoystickNumAxes;
extern tSDL_JoystickNumBalls *SDL_JoystickNumBalls;
extern tSDL_JoystickNumHats *SDL_JoystickNumHats;
extern tSDL_JoystickNumButtons *SDL_JoystickNumButtons;
extern tSDL_JoystickUpdate *SDL_JoystickUpdate;
extern tSDL_JoystickEventState *SDL_JoystickEventState;
extern tSDL_JoystickGetAxis *SDL_JoystickGetAxis;
extern tSDL_JoystickGetHat *SDL_JoystickGetHat;
extern tSDL_JoystickGetBall *SDL_JoystickGetBall;
extern tSDL_JoystickGetButton *SDL_JoystickGetButton;
extern tSDL_JoystickClose *SDL_JoystickClose;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,79 @@
#ifndef _SDL_keyboard_h
#define _SDL_keyboard_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_keycode.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SDL_Keysym
{
SDL_Scancode scancode;
SDL_Keycode sym;
Uint16 mod;
Uint32 unused;
} SDL_Keysym;
typedef SDL_Window * SDLCALL tSDL_GetKeyboardFocus(void);
typedef const Uint8 * SDLCALL tSDL_GetKeyboardState(int *numkeys);
typedef SDL_Keymod SDLCALL tSDL_GetModState(void);
typedef void SDLCALL tSDL_SetModState(SDL_Keymod modstate);
typedef SDL_Keycode SDLCALL tSDL_GetKeyFromScancode(SDL_Scancode scancode);
typedef SDL_Scancode SDLCALL tSDL_GetScancodeFromKey(SDL_Keycode key);
typedef const char * SDLCALL tSDL_GetScancodeName(SDL_Scancode scancode);
typedef SDL_Scancode SDLCALL tSDL_GetScancodeFromName(const char *name);
typedef const char * SDLCALL tSDL_GetKeyName(SDL_Keycode key);
typedef SDL_Keycode SDLCALL tSDL_GetKeyFromName(const char *name);
typedef void SDLCALL tSDL_StartTextInput(void);
typedef SDL_bool SDLCALL tSDL_IsTextInputActive(void);
typedef void SDLCALL tSDL_StopTextInput(void);
typedef void SDLCALL tSDL_SetTextInputRect(SDL_Rect *rect);
typedef SDL_bool SDLCALL tSDL_HasScreenKeyboardSupport(void);
typedef SDL_bool SDLCALL tSDL_IsScreenKeyboardShown(SDL_Window *window);
extern tSDL_GetKeyboardFocus *SDL_GetKeyboardFocus;
extern tSDL_GetKeyboardState *SDL_GetKeyboardState;
extern tSDL_GetModState *SDL_GetModState;
extern tSDL_SetModState *SDL_SetModState;
extern tSDL_GetKeyFromScancode *SDL_GetKeyFromScancode;
extern tSDL_GetScancodeFromKey *SDL_GetScancodeFromKey;
extern tSDL_GetScancodeName *SDL_GetScancodeName;
extern tSDL_GetScancodeFromName *SDL_GetScancodeFromName;
extern tSDL_GetKeyName *SDL_GetKeyName;
extern tSDL_GetKeyFromName *SDL_GetKeyFromName;
extern tSDL_StartTextInput *SDL_StartTextInput;
extern tSDL_IsTextInputActive *SDL_IsTextInputActive;
extern tSDL_StopTextInput *SDL_StopTextInput;
extern tSDL_SetTextInputRect *SDL_SetTextInputRect;
extern tSDL_HasScreenKeyboardSupport *SDL_HasScreenKeyboardSupport;
extern tSDL_IsScreenKeyboardShown *SDL_IsScreenKeyboardShown;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

301
extern/sdlew/include/SDL2/SDL_keycode.h vendored Normal file

@ -0,0 +1,301 @@
#ifndef _SDL_keycode_h
#define _SDL_keycode_h
#include "SDL_stdinc.h"
#include "SDL_scancode.h"
typedef Sint32 SDL_Keycode;
#define SDLK_SCANCODE_MASK (1<<30)
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
enum
{
SDLK_UNKNOWN = 0,
SDLK_RETURN = '\r',
SDLK_ESCAPE = '\033',
SDLK_BACKSPACE = '\b',
SDLK_TAB = '\t',
SDLK_SPACE = ' ',
SDLK_EXCLAIM = '!',
SDLK_QUOTEDBL = '"',
SDLK_HASH = '#',
SDLK_PERCENT = '%',
SDLK_DOLLAR = '$',
SDLK_AMPERSAND = '&',
SDLK_QUOTE = '\'',
SDLK_LEFTPAREN = '(',
SDLK_RIGHTPAREN = ')',
SDLK_ASTERISK = '*',
SDLK_PLUS = '+',
SDLK_COMMA = ',',
SDLK_MINUS = '-',
SDLK_PERIOD = '.',
SDLK_SLASH = '/',
SDLK_0 = '0',
SDLK_1 = '1',
SDLK_2 = '2',
SDLK_3 = '3',
SDLK_4 = '4',
SDLK_5 = '5',
SDLK_6 = '6',
SDLK_7 = '7',
SDLK_8 = '8',
SDLK_9 = '9',
SDLK_COLON = ':',
SDLK_SEMICOLON = ';',
SDLK_LESS = '<',
SDLK_EQUALS = '=',
SDLK_GREATER = '>',
SDLK_QUESTION = '?',
SDLK_AT = '@',
SDLK_LEFTBRACKET = '[',
SDLK_BACKSLASH = '\\',
SDLK_RIGHTBRACKET = ']',
SDLK_CARET = '^',
SDLK_UNDERSCORE = '_',
SDLK_BACKQUOTE = '`',
SDLK_a = 'a',
SDLK_b = 'b',
SDLK_c = 'c',
SDLK_d = 'd',
SDLK_e = 'e',
SDLK_f = 'f',
SDLK_g = 'g',
SDLK_h = 'h',
SDLK_i = 'i',
SDLK_j = 'j',
SDLK_k = 'k',
SDLK_l = 'l',
SDLK_m = 'm',
SDLK_n = 'n',
SDLK_o = 'o',
SDLK_p = 'p',
SDLK_q = 'q',
SDLK_r = 'r',
SDLK_s = 's',
SDLK_t = 't',
SDLK_u = 'u',
SDLK_v = 'v',
SDLK_w = 'w',
SDLK_x = 'x',
SDLK_y = 'y',
SDLK_z = 'z',
SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
SDLK_DELETE = '\177',
SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
SDLK_KP_EQUALSAS400 =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
SDLK_THOUSANDSSEPARATOR =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
SDLK_DECIMALSEPARATOR =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
SDLK_CURRENCYSUBUNIT =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
SDLK_KP_DBLAMPERSAND =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
SDLK_KP_VERTICALBAR =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
SDLK_KP_DBLVERTICALBAR =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
SDLK_KP_MEMSUBTRACT =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
SDLK_KP_MEMMULTIPLY =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
SDLK_KP_HEXADECIMAL =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
SDLK_BRIGHTNESSDOWN =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
SDLK_KBDILLUMTOGGLE =
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP)
};
typedef enum
{
KMOD_NONE = 0x0000,
KMOD_LSHIFT = 0x0001,
KMOD_RSHIFT = 0x0002,
KMOD_LCTRL = 0x0040,
KMOD_RCTRL = 0x0080,
KMOD_LALT = 0x0100,
KMOD_RALT = 0x0200,
KMOD_LGUI = 0x0400,
KMOD_RGUI = 0x0800,
KMOD_NUM = 0x1000,
KMOD_CAPS = 0x2000,
KMOD_MODE = 0x4000,
KMOD_RESERVED = 0x8000
} SDL_Keymod;
#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)
#endif

31
extern/sdlew/include/SDL2/SDL_loadso.h vendored Normal file

@ -0,0 +1,31 @@
#ifndef _SDL_loadso_h
#define _SDL_loadso_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void * SDLCALL tSDL_LoadObject(const char *sofile);
typedef void * SDLCALL tSDL_LoadFunction(void *handle,
const char *name);
typedef void SDLCALL tSDL_UnloadObject(void *handle);
extern tSDL_LoadObject *SDL_LoadObject;
extern tSDL_LoadFunction *SDL_LoadFunction;
extern tSDL_UnloadObject *SDL_UnloadObject;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

111
extern/sdlew/include/SDL2/SDL_log.h vendored Normal file

@ -0,0 +1,111 @@
#ifndef _SDL_log_h
#define _SDL_log_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_MAX_LOG_MESSAGE 4096
enum
{
SDL_LOG_CATEGORY_APPLICATION,
SDL_LOG_CATEGORY_ERROR,
SDL_LOG_CATEGORY_ASSERT,
SDL_LOG_CATEGORY_SYSTEM,
SDL_LOG_CATEGORY_AUDIO,
SDL_LOG_CATEGORY_VIDEO,
SDL_LOG_CATEGORY_RENDER,
SDL_LOG_CATEGORY_INPUT,
SDL_LOG_CATEGORY_TEST,
SDL_LOG_CATEGORY_RESERVED1,
SDL_LOG_CATEGORY_RESERVED2,
SDL_LOG_CATEGORY_RESERVED3,
SDL_LOG_CATEGORY_RESERVED4,
SDL_LOG_CATEGORY_RESERVED5,
SDL_LOG_CATEGORY_RESERVED6,
SDL_LOG_CATEGORY_RESERVED7,
SDL_LOG_CATEGORY_RESERVED8,
SDL_LOG_CATEGORY_RESERVED9,
SDL_LOG_CATEGORY_RESERVED10,
SDL_LOG_CATEGORY_CUSTOM
};
typedef enum
{
SDL_LOG_PRIORITY_VERBOSE = 1,
SDL_LOG_PRIORITY_DEBUG,
SDL_LOG_PRIORITY_INFO,
SDL_LOG_PRIORITY_WARN,
SDL_LOG_PRIORITY_ERROR,
SDL_LOG_PRIORITY_CRITICAL,
SDL_NUM_LOG_PRIORITIES
} SDL_LogPriority;
typedef void SDLCALL tSDL_LogSetAllPriority(SDL_LogPriority priority);
typedef void SDLCALL tSDL_LogSetPriority(int category,
SDL_LogPriority priority);
typedef SDL_LogPriority SDLCALL tSDL_LogGetPriority(int category);
typedef void SDLCALL tSDL_LogResetPriorities(void);
typedef void SDLCALL tSDL_Log(const char *fmt, ...);
typedef void SDLCALL tSDL_LogVerbose(int category, const char *fmt, ...);
typedef void SDLCALL tSDL_LogDebug(int category, const char *fmt, ...);
typedef void SDLCALL tSDL_LogInfo(int category, const char *fmt, ...);
typedef void SDLCALL tSDL_LogWarn(int category, const char *fmt, ...);
typedef void SDLCALL tSDL_LogError(int category, const char *fmt, ...);
typedef void SDLCALL tSDL_LogCritical(int category, const char *fmt, ...);
typedef void SDLCALL tSDL_LogMessage(int category,
SDL_LogPriority priority,
const char *fmt, ...);
typedef void SDLCALL tSDL_LogMessageV(int category,
SDL_LogPriority priority,
const char *fmt, va_list ap);
typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
typedef void SDLCALL tSDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
typedef void SDLCALL tSDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
extern tSDL_LogSetAllPriority *SDL_LogSetAllPriority;
extern tSDL_LogSetPriority *SDL_LogSetPriority;
extern tSDL_LogGetPriority *SDL_LogGetPriority;
extern tSDL_LogResetPriorities *SDL_LogResetPriorities;
extern tSDL_Log *SDL_Log;
extern tSDL_LogVerbose *SDL_LogVerbose;
extern tSDL_LogDebug *SDL_LogDebug;
extern tSDL_LogInfo *SDL_LogInfo;
extern tSDL_LogWarn *SDL_LogWarn;
extern tSDL_LogError *SDL_LogError;
extern tSDL_LogCritical *SDL_LogCritical;
extern tSDL_LogMessage *SDL_LogMessage;
extern tSDL_LogMessageV *SDL_LogMessageV;
extern tSDL_LogGetOutputFunction *SDL_LogGetOutputFunction;
extern tSDL_LogSetOutputFunction *SDL_LogSetOutputFunction;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

56
extern/sdlew/include/SDL2/SDL_main.h vendored Normal file

@ -0,0 +1,56 @@
#ifndef _SDL_main_h
#define _SDL_main_h
#include "SDL_stdinc.h"
#ifndef SDL_MAIN_HANDLED
#if defined(__WIN32__)
#define SDL_MAIN_AVAILABLE
#elif defined(__IPHONEOS__)
#define SDL_MAIN_NEEDED
#elif defined(__ANDROID__)
#define SDL_MAIN_NEEDED
#endif
#endif
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
#define main SDL_main
#endif
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
extern DECLSPEC void SDL_SetMainReady(void);
#ifdef __WIN32__
typedef int SDLCALL tSDL_RegisterApp(char *name, Uint32 style,
void *hInst);
typedef void SDLCALL tSDL_UnregisterApp(void);
#endif
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,80 @@
#ifndef _SDL_messagebox_h
#define _SDL_messagebox_h
#include "SDL_stdinc.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
SDL_MESSAGEBOX_ERROR = 0x00000010,
SDL_MESSAGEBOX_WARNING = 0x00000020,
SDL_MESSAGEBOX_INFORMATION = 0x00000040
} SDL_MessageBoxFlags;
typedef enum
{
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,
SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002
} SDL_MessageBoxButtonFlags;
typedef struct
{
Uint32 flags;
int buttonid;
const char * text;
} SDL_MessageBoxButtonData;
typedef struct
{
Uint8 r, g, b;
} SDL_MessageBoxColor;
typedef enum
{
SDL_MESSAGEBOX_COLOR_BACKGROUND,
SDL_MESSAGEBOX_COLOR_TEXT,
SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
SDL_MESSAGEBOX_COLOR_MAX
} SDL_MessageBoxColorType;
typedef struct
{
SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
} SDL_MessageBoxColorScheme;
typedef struct
{
Uint32 flags;
SDL_Window *window;
const char *title;
const char *message;
int numbuttons;
const SDL_MessageBoxButtonData *buttons;
const SDL_MessageBoxColorScheme *colorScheme;
} SDL_MessageBoxData;
typedef int SDLCALL tSDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
typedef int SDLCALL tSDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
extern tSDL_ShowMessageBox *SDL_ShowMessageBox;
extern tSDL_ShowSimpleMessageBox *SDL_ShowSimpleMessageBox;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

101
extern/sdlew/include/SDL2/SDL_mouse.h vendored Normal file

@ -0,0 +1,101 @@
#ifndef _SDL_mouse_h
#define _SDL_mouse_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SDL_Cursor SDL_Cursor;
typedef enum
{
SDL_SYSTEM_CURSOR_ARROW,
SDL_SYSTEM_CURSOR_IBEAM,
SDL_SYSTEM_CURSOR_WAIT,
SDL_SYSTEM_CURSOR_CROSSHAIR,
SDL_SYSTEM_CURSOR_WAITARROW,
SDL_SYSTEM_CURSOR_SIZENWSE,
SDL_SYSTEM_CURSOR_SIZENESW,
SDL_SYSTEM_CURSOR_SIZEWE,
SDL_SYSTEM_CURSOR_SIZENS,
SDL_SYSTEM_CURSOR_SIZEALL,
SDL_SYSTEM_CURSOR_NO,
SDL_SYSTEM_CURSOR_HAND,
SDL_NUM_SYSTEM_CURSORS
} SDL_SystemCursor;
typedef SDL_Window * SDLCALL tSDL_GetMouseFocus(void);
typedef Uint32 SDLCALL tSDL_GetMouseState(int *x, int *y);
typedef Uint32 SDLCALL tSDL_GetRelativeMouseState(int *x, int *y);
typedef void SDLCALL tSDL_WarpMouseInWindow(SDL_Window * window,
int x, int y);
typedef int SDLCALL tSDL_SetRelativeMouseMode(SDL_bool enabled);
typedef SDL_bool SDLCALL tSDL_GetRelativeMouseMode(void);
typedef SDL_Cursor * SDLCALL tSDL_CreateCursor(const Uint8 * data,
const Uint8 * mask,
int w, int h, int hot_x,
int hot_y);
typedef SDL_Cursor * SDLCALL tSDL_CreateColorCursor(SDL_Surface *surface,
int hot_x,
int hot_y);
typedef SDL_Cursor * SDLCALL tSDL_CreateSystemCursor(SDL_SystemCursor id);
typedef void SDLCALL tSDL_SetCursor(SDL_Cursor * cursor);
typedef SDL_Cursor * SDLCALL tSDL_GetCursor(void);
typedef SDL_Cursor * SDLCALL tSDL_GetDefaultCursor(void);
typedef void SDLCALL tSDL_FreeCursor(SDL_Cursor * cursor);
typedef int SDLCALL tSDL_ShowCursor(int toggle);
#define SDL_BUTTON(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_X1 4
#define SDL_BUTTON_X2 5
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
extern tSDL_GetMouseFocus *SDL_GetMouseFocus;
extern tSDL_GetMouseState *SDL_GetMouseState;
extern tSDL_GetRelativeMouseState *SDL_GetRelativeMouseState;
extern tSDL_WarpMouseInWindow *SDL_WarpMouseInWindow;
extern tSDL_SetRelativeMouseMode *SDL_SetRelativeMouseMode;
extern tSDL_GetRelativeMouseMode *SDL_GetRelativeMouseMode;
extern tSDL_CreateCursor *SDL_CreateCursor;
extern tSDL_CreateColorCursor *SDL_CreateColorCursor;
extern tSDL_CreateSystemCursor *SDL_CreateSystemCursor;
extern tSDL_SetCursor *SDL_SetCursor;
extern tSDL_GetCursor *SDL_GetCursor;
extern tSDL_GetDefaultCursor *SDL_GetDefaultCursor;
extern tSDL_FreeCursor *SDL_FreeCursor;
extern tSDL_ShowCursor *SDL_ShowCursor;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

91
extern/sdlew/include/SDL2/SDL_mutex.h vendored Normal file

@ -0,0 +1,91 @@
#ifndef _SDL_mutex_h
#define _SDL_mutex_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_MUTEX_TIMEDOUT 1
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
struct SDL_mutex;
typedef struct SDL_mutex SDL_mutex;
typedef SDL_mutex * SDLCALL tSDL_CreateMutex(void);
#define SDL_mutexP(m) SDL_LockMutex(m)
typedef int SDLCALL tSDL_LockMutex(SDL_mutex * mutex);
typedef int SDLCALL tSDL_TryLockMutex(SDL_mutex * mutex);
#define SDL_mutexV(m) SDL_UnlockMutex(m)
typedef int SDLCALL tSDL_UnlockMutex(SDL_mutex * mutex);
typedef void SDLCALL tSDL_DestroyMutex(SDL_mutex * mutex);
struct SDL_semaphore;
typedef struct SDL_semaphore SDL_sem;
typedef SDL_sem * SDLCALL tSDL_CreateSemaphore(Uint32 initial_value);
typedef void SDLCALL tSDL_DestroySemaphore(SDL_sem * sem);
typedef int SDLCALL tSDL_SemWait(SDL_sem * sem);
typedef int SDLCALL tSDL_SemTryWait(SDL_sem * sem);
typedef int SDLCALL tSDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
typedef int SDLCALL tSDL_SemPost(SDL_sem * sem);
typedef Uint32 SDLCALL tSDL_SemValue(SDL_sem * sem);
struct SDL_cond;
typedef struct SDL_cond SDL_cond;
typedef SDL_cond * SDLCALL tSDL_CreateCond(void);
typedef void SDLCALL tSDL_DestroyCond(SDL_cond * cond);
typedef int SDLCALL tSDL_CondSignal(SDL_cond * cond);
typedef int SDLCALL tSDL_CondBroadcast(SDL_cond * cond);
typedef int SDLCALL tSDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
typedef int SDLCALL tSDL_CondWaitTimeout(SDL_cond * cond,
SDL_mutex * mutex, Uint32 ms);
extern tSDL_CreateMutex *SDL_CreateMutex;
extern tSDL_LockMutex *SDL_LockMutex;
extern tSDL_TryLockMutex *SDL_TryLockMutex;
extern tSDL_UnlockMutex *SDL_UnlockMutex;
extern tSDL_DestroyMutex *SDL_DestroyMutex;
extern tSDL_CreateSemaphore *SDL_CreateSemaphore;
extern tSDL_DestroySemaphore *SDL_DestroySemaphore;
extern tSDL_SemWait *SDL_SemWait;
extern tSDL_SemTryWait *SDL_SemTryWait;
extern tSDL_SemWaitTimeout *SDL_SemWaitTimeout;
extern tSDL_SemPost *SDL_SemPost;
extern tSDL_SemValue *SDL_SemValue;
extern tSDL_CreateCond *SDL_CreateCond;
extern tSDL_DestroyCond *SDL_DestroyCond;
extern tSDL_CondSignal *SDL_CondSignal;
extern tSDL_CondBroadcast *SDL_CondBroadcast;
extern tSDL_CondWait *SDL_CondWait;
extern tSDL_CondWaitTimeout *SDL_CondWaitTimeout;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

11
extern/sdlew/include/SDL2/SDL_name.h vendored Normal file

@ -0,0 +1,11 @@
#ifndef _SDLname_h_
#define _SDLname_h_
#if defined(__STDC__) || defined(__cplusplus)
#define NeedFunctionPrototypes 1
#endif
#define SDL_NAME(X) SDL_##X
#endif

10607
extern/sdlew/include/SDL2/SDL_opengl.h vendored Normal file

File diff suppressed because it is too large Load Diff

@ -0,0 +1,12 @@
#ifdef __IPHONEOS__
#include <OpenGLES/ES1/gl.h>
#include <OpenGLES/ES1/glext.h>
#else
#include <GLES/gl.h>
#include <GLES/glext.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif

@ -0,0 +1,12 @@
#ifdef __IPHONEOS__
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif

320
extern/sdlew/include/SDL2/SDL_pixels.h vendored Normal file

@ -0,0 +1,320 @@
#ifndef _SDL_pixels_h
#define _SDL_pixels_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_ALPHA_OPAQUE 255
#define SDL_ALPHA_TRANSPARENT 0
enum
{
SDL_PIXELTYPE_UNKNOWN,
SDL_PIXELTYPE_INDEX1,
SDL_PIXELTYPE_INDEX4,
SDL_PIXELTYPE_INDEX8,
SDL_PIXELTYPE_PACKED8,
SDL_PIXELTYPE_PACKED16,
SDL_PIXELTYPE_PACKED32,
SDL_PIXELTYPE_ARRAYU8,
SDL_PIXELTYPE_ARRAYU16,
SDL_PIXELTYPE_ARRAYU32,
SDL_PIXELTYPE_ARRAYF16,
SDL_PIXELTYPE_ARRAYF32
};
enum
{
SDL_BITMAPORDER_NONE,
SDL_BITMAPORDER_4321,
SDL_BITMAPORDER_1234
};
enum
{
SDL_PACKEDORDER_NONE,
SDL_PACKEDORDER_XRGB,
SDL_PACKEDORDER_RGBX,
SDL_PACKEDORDER_ARGB,
SDL_PACKEDORDER_RGBA,
SDL_PACKEDORDER_XBGR,
SDL_PACKEDORDER_BGRX,
SDL_PACKEDORDER_ABGR,
SDL_PACKEDORDER_BGRA
};
enum
{
SDL_ARRAYORDER_NONE,
SDL_ARRAYORDER_RGB,
SDL_ARRAYORDER_RGBA,
SDL_ARRAYORDER_ARGB,
SDL_ARRAYORDER_BGR,
SDL_ARRAYORDER_BGRA,
SDL_ARRAYORDER_ABGR
};
enum
{
SDL_PACKEDLAYOUT_NONE,
SDL_PACKEDLAYOUT_332,
SDL_PACKEDLAYOUT_4444,
SDL_PACKEDLAYOUT_1555,
SDL_PACKEDLAYOUT_5551,
SDL_PACKEDLAYOUT_565,
SDL_PACKEDLAYOUT_8888,
SDL_PACKEDLAYOUT_2101010,
SDL_PACKEDLAYOUT_1010102
};
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
((bits) << 8) | ((bytes) << 0))
#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
#define SDL_BYTESPERPIXEL(X) \
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
((((X) == SDL_PIXELFORMAT_YUY2) || \
((X) == SDL_PIXELFORMAT_UYVY) || \
((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
#define SDL_ISPIXELFORMAT_INDEXED(format) \
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
#define SDL_ISPIXELFORMAT_ALPHA(format) \
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
#define SDL_ISPIXELFORMAT_FOURCC(format) \
((format) && (SDL_PIXELFLAG(format) != 1))
enum
{
SDL_PIXELFORMAT_UNKNOWN,
SDL_PIXELFORMAT_INDEX1LSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
1, 0),
SDL_PIXELFORMAT_INDEX1MSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
1, 0),
SDL_PIXELFORMAT_INDEX4LSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
4, 0),
SDL_PIXELFORMAT_INDEX4MSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
4, 0),
SDL_PIXELFORMAT_INDEX8 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
SDL_PIXELFORMAT_RGB332 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_332, 8, 1),
SDL_PIXELFORMAT_RGB444 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_4444, 12, 2),
SDL_PIXELFORMAT_RGB555 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_1555, 15, 2),
SDL_PIXELFORMAT_BGR555 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
SDL_PACKEDLAYOUT_1555, 15, 2),
SDL_PIXELFORMAT_ARGB4444 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
SDL_PACKEDLAYOUT_4444, 16, 2),
SDL_PIXELFORMAT_RGBA4444 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
SDL_PACKEDLAYOUT_4444, 16, 2),
SDL_PIXELFORMAT_ABGR4444 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
SDL_PACKEDLAYOUT_4444, 16, 2),
SDL_PIXELFORMAT_BGRA4444 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
SDL_PACKEDLAYOUT_4444, 16, 2),
SDL_PIXELFORMAT_ARGB1555 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
SDL_PACKEDLAYOUT_1555, 16, 2),
SDL_PIXELFORMAT_RGBA5551 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
SDL_PACKEDLAYOUT_5551, 16, 2),
SDL_PIXELFORMAT_ABGR1555 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
SDL_PACKEDLAYOUT_1555, 16, 2),
SDL_PIXELFORMAT_BGRA5551 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
SDL_PACKEDLAYOUT_5551, 16, 2),
SDL_PIXELFORMAT_RGB565 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_565, 16, 2),
SDL_PIXELFORMAT_BGR565 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
SDL_PACKEDLAYOUT_565, 16, 2),
SDL_PIXELFORMAT_RGB24 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
24, 3),
SDL_PIXELFORMAT_BGR24 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
24, 3),
SDL_PIXELFORMAT_RGB888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_RGBX8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_BGR888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_BGRX8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_ARGB8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
SDL_PACKEDLAYOUT_8888, 32, 4),
SDL_PIXELFORMAT_RGBA8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
SDL_PACKEDLAYOUT_8888, 32, 4),
SDL_PIXELFORMAT_ABGR8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
SDL_PACKEDLAYOUT_8888, 32, 4),
SDL_PIXELFORMAT_BGRA8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
SDL_PACKEDLAYOUT_8888, 32, 4),
SDL_PIXELFORMAT_ARGB2101010 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
SDL_PACKEDLAYOUT_2101010, 32, 4),
SDL_PIXELFORMAT_YV12 =
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
SDL_PIXELFORMAT_IYUV =
SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
SDL_PIXELFORMAT_YUY2 =
SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
SDL_PIXELFORMAT_UYVY =
SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
SDL_PIXELFORMAT_YVYU =
SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U')
};
typedef struct SDL_Color
{
Uint8 r;
Uint8 g;
Uint8 b;
Uint8 a;
} SDL_Color;
#define SDL_Colour SDL_Color
typedef struct SDL_Palette
{
int ncolors;
SDL_Color *colors;
Uint32 version;
int refcount;
} SDL_Palette;
typedef struct SDL_PixelFormat
{
Uint32 format;
SDL_Palette *palette;
Uint8 BitsPerPixel;
Uint8 BytesPerPixel;
Uint8 padding[2];
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
Uint8 Rloss;
Uint8 Gloss;
Uint8 Bloss;
Uint8 Aloss;
Uint8 Rshift;
Uint8 Gshift;
Uint8 Bshift;
Uint8 Ashift;
int refcount;
struct SDL_PixelFormat *next;
} SDL_PixelFormat;
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
typedef SDL_bool SDLCALL tSDL_PixelFormatEnumToMasks(Uint32 format,
int *bpp,
Uint32 * Rmask,
Uint32 * Gmask,
Uint32 * Bmask,
Uint32 * Amask);
typedef Uint32 SDLCALL tSDL_MasksToPixelFormatEnum(int bpp,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask);
typedef SDL_PixelFormat * SDLCALL tSDL_AllocFormat(Uint32 pixel_format);
typedef void SDLCALL tSDL_FreeFormat(SDL_PixelFormat *format);
typedef SDL_Palette * SDLCALL tSDL_AllocPalette(int ncolors);
typedef int SDLCALL tSDL_SetPixelFormatPalette(SDL_PixelFormat * format,
SDL_Palette *palette);
typedef int SDLCALL tSDL_SetPaletteColors(SDL_Palette * palette,
const SDL_Color * colors,
int firstcolor, int ncolors);
typedef void SDLCALL tSDL_FreePalette(SDL_Palette * palette);
typedef Uint32 SDLCALL tSDL_MapRGB(const SDL_PixelFormat * format,
Uint8 r, Uint8 g, Uint8 b);
typedef Uint32 SDLCALL tSDL_MapRGBA(const SDL_PixelFormat * format,
Uint8 r, Uint8 g, Uint8 b,
Uint8 a);
typedef void SDLCALL tSDL_GetRGB(Uint32 pixel,
const SDL_PixelFormat * format,
Uint8 * r, Uint8 * g, Uint8 * b);
typedef void SDLCALL tSDL_GetRGBA(Uint32 pixel,
const SDL_PixelFormat * format,
Uint8 * r, Uint8 * g, Uint8 * b,
Uint8 * a);
typedef void SDLCALL tSDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
extern tSDL_PixelFormatEnumToMasks *SDL_PixelFormatEnumToMasks;
extern tSDL_MasksToPixelFormatEnum *SDL_MasksToPixelFormatEnum;
extern tSDL_AllocFormat *SDL_AllocFormat;
extern tSDL_FreeFormat *SDL_FreeFormat;
extern tSDL_AllocPalette *SDL_AllocPalette;
extern tSDL_SetPixelFormatPalette *SDL_SetPixelFormatPalette;
extern tSDL_SetPaletteColors *SDL_SetPaletteColors;
extern tSDL_FreePalette *SDL_FreePalette;
extern tSDL_MapRGB *SDL_MapRGB;
extern tSDL_MapRGBA *SDL_MapRGBA;
extern tSDL_GetRGB *SDL_GetRGB;
extern tSDL_GetRGBA *SDL_GetRGBA;
extern tSDL_CalculateGammaRamp *SDL_CalculateGammaRamp;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

122
extern/sdlew/include/SDL2/SDL_platform.h vendored Normal file

@ -0,0 +1,122 @@
#ifndef _SDL_platform_h
#define _SDL_platform_h
#if defined(_AIX)
#undef __AIX__
#define __AIX__ 1
#endif
#if defined(__BEOS__)
#undef __BEOS__
#define __BEOS__ 1
#endif
#if defined(__HAIKU__)
#undef __HAIKU__
#define __HAIKU__ 1
#endif
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
#undef __BSDI__
#define __BSDI__ 1
#endif
#if defined(_arch_dreamcast)
#undef __DREAMCAST__
#define __DREAMCAST__ 1
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
#undef __FREEBSD__
#define __FREEBSD__ 1
#endif
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
#undef __HPUX__
#define __HPUX__ 1
#endif
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
#undef __IRIX__
#define __IRIX__ 1
#endif
#if defined(linux) || defined(__linux) || defined(__linux__)
#undef __LINUX__
#define __LINUX__ 1
#endif
#if defined(ANDROID)
#undef __ANDROID__
#undef __LINUX__
#define __ANDROID__ 1
#endif
#if defined(__APPLE__)
#include "AvailabilityMacros.h"
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE
#undef __IPHONEOS__
#define __IPHONEOS__ 1
#undef __MACOSX__
#else
#undef __MACOSX__
#define __MACOSX__ 1
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
# error SDL for Mac OS X only supports deploying on 10.5 and above.
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
# error SDL for Mac OS X must be built with a 10.6 SDK or above.
#endif
#endif
#endif
#if defined(__NetBSD__)
#undef __NETBSD__
#define __NETBSD__ 1
#endif
#if defined(__OpenBSD__)
#undef __OPENBSD__
#define __OPENBSD__ 1
#endif
#if defined(__OS2__)
#undef __OS2__
#define __OS2__ 1
#endif
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
#undef __OSF__
#define __OSF__ 1
#endif
#if defined(__QNXNTO__)
#undef __QNXNTO__
#define __QNXNTO__ 1
#endif
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
#undef __RISCOS__
#define __RISCOS__ 1
#endif
#if defined(__SVR4)
#undef __SOLARIS__
#define __SOLARIS__ 1
#endif
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
#undef __WIN32__
#define __WIN32__ 1
#endif
#if defined(__PSP__)
#undef __PSP__
#define __PSP__ 1
#endif
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef const char * SDLCALL tSDL_GetPlatform (void);
extern tSDL_GetPlatform *SDL_GetPlatform;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

32
extern/sdlew/include/SDL2/SDL_power.h vendored Normal file

@ -0,0 +1,32 @@
#ifndef _SDL_power_h
#define _SDL_power_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
SDL_POWERSTATE_UNKNOWN,
SDL_POWERSTATE_ON_BATTERY,
SDL_POWERSTATE_NO_BATTERY,
SDL_POWERSTATE_CHARGING,
SDL_POWERSTATE_CHARGED
} SDL_PowerState;
typedef SDL_PowerState SDLCALL tSDL_GetPowerInfo(int *secs, int *pct);
extern tSDL_GetPowerInfo *SDL_GetPowerInfo;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

11
extern/sdlew/include/SDL2/SDL_quit.h vendored Normal file

@ -0,0 +1,11 @@
#ifndef _SDL_quit_h
#define _SDL_quit_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#define SDL_QuitRequested() \
(SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
#endif

72
extern/sdlew/include/SDL2/SDL_rect.h vendored Normal file

@ -0,0 +1,72 @@
#ifndef _SDL_rect_h
#define _SDL_rect_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_pixels.h"
#include "SDL_rwops.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
int x;
int y;
} SDL_Point;
typedef struct SDL_Rect
{
int x, y;
int w, h;
} SDL_Rect;
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
{
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
}
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
{
return (a && b && (a->x == b->x) && (a->y == b->y) &&
(a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
}
typedef SDL_bool SDLCALL tSDL_HasIntersection(const SDL_Rect * A,
const SDL_Rect * B);
typedef SDL_bool SDLCALL tSDL_IntersectRect(const SDL_Rect * A,
const SDL_Rect * B,
SDL_Rect * result);
typedef void SDLCALL tSDL_UnionRect(const SDL_Rect * A,
const SDL_Rect * B,
SDL_Rect * result);
typedef SDL_bool SDLCALL tSDL_EnclosePoints(const SDL_Point * points,
int count,
const SDL_Rect * clip,
SDL_Rect * result);
typedef SDL_bool SDLCALL tSDL_IntersectRectAndLine(const SDL_Rect *
rect, int *X1,
int *Y1, int *X2,
int *Y2);
extern tSDL_HasIntersection *SDL_HasIntersection;
extern tSDL_IntersectRect *SDL_IntersectRect;
extern tSDL_UnionRect *SDL_UnionRect;
extern tSDL_EnclosePoints *SDL_EnclosePoints;
extern tSDL_IntersectRectAndLine *SDL_IntersectRectAndLine;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

280
extern/sdlew/include/SDL2/SDL_render.h vendored Normal file

@ -0,0 +1,280 @@
#ifndef _SDL_render_h
#define _SDL_render_h
#include "SDL_stdinc.h"
#include "SDL_rect.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
SDL_RENDERER_SOFTWARE = 0x00000001,
SDL_RENDERER_ACCELERATED = 0x00000002,
SDL_RENDERER_PRESENTVSYNC = 0x00000004,
SDL_RENDERER_TARGETTEXTURE = 0x00000008
} SDL_RendererFlags;
typedef struct SDL_RendererInfo
{
const char *name;
Uint32 flags;
Uint32 num_texture_formats;
Uint32 texture_formats[16];
int max_texture_width;
int max_texture_height;
} SDL_RendererInfo;
typedef enum
{
SDL_TEXTUREACCESS_STATIC,
SDL_TEXTUREACCESS_STREAMING,
SDL_TEXTUREACCESS_TARGET
} SDL_TextureAccess;
typedef enum
{
SDL_TEXTUREMODULATE_NONE = 0x00000000,
SDL_TEXTUREMODULATE_COLOR = 0x00000001,
SDL_TEXTUREMODULATE_ALPHA = 0x00000002
} SDL_TextureModulate;
typedef enum
{
SDL_FLIP_NONE = 0x00000000,
SDL_FLIP_HORIZONTAL = 0x00000001,
SDL_FLIP_VERTICAL = 0x00000002
} SDL_RendererFlip;
struct SDL_Renderer;
typedef struct SDL_Renderer SDL_Renderer;
struct SDL_Texture;
typedef struct SDL_Texture SDL_Texture;
typedef int SDLCALL tSDL_GetNumRenderDrivers(void);
typedef int SDLCALL tSDL_GetRenderDriverInfo(int index,
SDL_RendererInfo * info);
typedef int SDLCALL tSDL_CreateWindowAndRenderer(
int width, int height, Uint32 window_flags,
SDL_Window **window, SDL_Renderer **renderer);
typedef SDL_Renderer * SDLCALL tSDL_CreateRenderer(SDL_Window * window,
int index, Uint32 flags);
typedef SDL_Renderer * SDLCALL tSDL_CreateSoftwareRenderer(SDL_Surface * surface);
typedef SDL_Renderer * SDLCALL tSDL_GetRenderer(SDL_Window * window);
typedef int SDLCALL tSDL_GetRendererInfo(SDL_Renderer * renderer,
SDL_RendererInfo * info);
typedef int SDLCALL tSDL_GetRendererOutputSize(SDL_Renderer * renderer,
int *w, int *h);
typedef SDL_Texture * SDLCALL tSDL_CreateTexture(SDL_Renderer * renderer,
Uint32 format,
int access, int w,
int h);
typedef SDL_Texture * SDLCALL tSDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
typedef int SDLCALL tSDL_QueryTexture(SDL_Texture * texture,
Uint32 * format, int *access,
int *w, int *h);
typedef int SDLCALL tSDL_SetTextureColorMod(SDL_Texture * texture,
Uint8 r, Uint8 g, Uint8 b);
typedef int SDLCALL tSDL_GetTextureColorMod(SDL_Texture * texture,
Uint8 * r, Uint8 * g,
Uint8 * b);
typedef int SDLCALL tSDL_SetTextureAlphaMod(SDL_Texture * texture,
Uint8 alpha);
typedef int SDLCALL tSDL_GetTextureAlphaMod(SDL_Texture * texture,
Uint8 * alpha);
typedef int SDLCALL tSDL_SetTextureBlendMode(SDL_Texture * texture,
SDL_BlendMode blendMode);
typedef int SDLCALL tSDL_GetTextureBlendMode(SDL_Texture * texture,
SDL_BlendMode *blendMode);
typedef int SDLCALL tSDL_UpdateTexture(SDL_Texture * texture,
const SDL_Rect * rect,
const void *pixels, int pitch);
typedef int SDLCALL tSDL_LockTexture(SDL_Texture * texture,
const SDL_Rect * rect,
void **pixels, int *pitch);
typedef void SDLCALL tSDL_UnlockTexture(SDL_Texture * texture);
typedef SDL_bool SDLCALL tSDL_RenderTargetSupported(SDL_Renderer *renderer);
typedef int SDLCALL tSDL_SetRenderTarget(SDL_Renderer *renderer,
SDL_Texture *texture);
typedef SDL_Texture * SDLCALL tSDL_GetRenderTarget(SDL_Renderer *renderer);
typedef int SDLCALL tSDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
typedef void SDLCALL tSDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h);
typedef int SDLCALL tSDL_RenderSetViewport(SDL_Renderer * renderer,
const SDL_Rect * rect);
typedef void SDLCALL tSDL_RenderGetViewport(SDL_Renderer * renderer,
SDL_Rect * rect);
typedef int SDLCALL tSDL_RenderSetClipRect(SDL_Renderer * renderer,
const SDL_Rect * rect);
typedef void SDLCALL tSDL_RenderGetClipRect(SDL_Renderer * renderer,
SDL_Rect * rect);
typedef int SDLCALL tSDL_RenderSetScale(SDL_Renderer * renderer,
float scaleX, float scaleY);
typedef void SDLCALL tSDL_RenderGetScale(SDL_Renderer * renderer,
float *scaleX, float *scaleY);
extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
Uint8 r, Uint8 g, Uint8 b,
Uint8 a);
extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
Uint8 * r, Uint8 * g, Uint8 * b,
Uint8 * a);
typedef int SDLCALL tSDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
SDL_BlendMode blendMode);
typedef int SDLCALL tSDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
SDL_BlendMode *blendMode);
typedef int SDLCALL tSDL_RenderClear(SDL_Renderer * renderer);
typedef int SDLCALL tSDL_RenderDrawPoint(SDL_Renderer * renderer,
int x, int y);
typedef int SDLCALL tSDL_RenderDrawPoints(SDL_Renderer * renderer,
const SDL_Point * points,
int count);
typedef int SDLCALL tSDL_RenderDrawLine(SDL_Renderer * renderer,
int x1, int y1, int x2, int y2);
typedef int SDLCALL tSDL_RenderDrawLines(SDL_Renderer * renderer,
const SDL_Point * points,
int count);
typedef int SDLCALL tSDL_RenderDrawRect(SDL_Renderer * renderer,
const SDL_Rect * rect);
typedef int SDLCALL tSDL_RenderDrawRects(SDL_Renderer * renderer,
const SDL_Rect * rects,
int count);
typedef int SDLCALL tSDL_RenderFillRect(SDL_Renderer * renderer,
const SDL_Rect * rect);
typedef int SDLCALL tSDL_RenderFillRects(SDL_Renderer * renderer,
const SDL_Rect * rects,
int count);
typedef int SDLCALL tSDL_RenderCopy(SDL_Renderer * renderer,
SDL_Texture * texture,
const SDL_Rect * srcrect,
const SDL_Rect * dstrect);
typedef int SDLCALL tSDL_RenderCopyEx(SDL_Renderer * renderer,
SDL_Texture * texture,
const SDL_Rect * srcrect,
const SDL_Rect * dstrect,
const double angle,
const SDL_Point *center,
const SDL_RendererFlip flip);
typedef int SDLCALL tSDL_RenderReadPixels(SDL_Renderer * renderer,
const SDL_Rect * rect,
Uint32 format,
void *pixels, int pitch);
typedef void SDLCALL tSDL_RenderPresent(SDL_Renderer * renderer);
typedef void SDLCALL tSDL_DestroyTexture(SDL_Texture * texture);
typedef void SDLCALL tSDL_DestroyRenderer(SDL_Renderer * renderer);
typedef int SDLCALL tSDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
typedef int SDLCALL tSDL_GL_UnbindTexture(SDL_Texture *texture);
extern tSDL_GetNumRenderDrivers *SDL_GetNumRenderDrivers;
extern tSDL_GetRenderDriverInfo *SDL_GetRenderDriverInfo;
extern tSDL_CreateWindowAndRenderer *SDL_CreateWindowAndRenderer;
extern tSDL_CreateRenderer *SDL_CreateRenderer;
extern tSDL_CreateSoftwareRenderer *SDL_CreateSoftwareRenderer;
extern tSDL_GetRenderer *SDL_GetRenderer;
extern tSDL_GetRendererInfo *SDL_GetRendererInfo;
extern tSDL_GetRendererOutputSize *SDL_GetRendererOutputSize;
extern tSDL_CreateTexture *SDL_CreateTexture;
extern tSDL_CreateTextureFromSurface *SDL_CreateTextureFromSurface;
extern tSDL_QueryTexture *SDL_QueryTexture;
extern tSDL_SetTextureColorMod *SDL_SetTextureColorMod;
extern tSDL_GetTextureColorMod *SDL_GetTextureColorMod;
extern tSDL_SetTextureAlphaMod *SDL_SetTextureAlphaMod;
extern tSDL_GetTextureAlphaMod *SDL_GetTextureAlphaMod;
extern tSDL_SetTextureBlendMode *SDL_SetTextureBlendMode;
extern tSDL_GetTextureBlendMode *SDL_GetTextureBlendMode;
extern tSDL_UpdateTexture *SDL_UpdateTexture;
extern tSDL_LockTexture *SDL_LockTexture;
extern tSDL_UnlockTexture *SDL_UnlockTexture;
extern tSDL_RenderTargetSupported *SDL_RenderTargetSupported;
extern tSDL_SetRenderTarget *SDL_SetRenderTarget;
extern tSDL_GetRenderTarget *SDL_GetRenderTarget;
extern tSDL_RenderSetLogicalSize *SDL_RenderSetLogicalSize;
extern tSDL_RenderGetLogicalSize *SDL_RenderGetLogicalSize;
extern tSDL_RenderSetViewport *SDL_RenderSetViewport;
extern tSDL_RenderGetViewport *SDL_RenderGetViewport;
extern tSDL_RenderSetClipRect *SDL_RenderSetClipRect;
extern tSDL_RenderGetClipRect *SDL_RenderGetClipRect;
extern tSDL_RenderSetScale *SDL_RenderSetScale;
extern tSDL_RenderGetScale *SDL_RenderGetScale;
extern tSDL_SetRenderDrawBlendMode *SDL_SetRenderDrawBlendMode;
extern tSDL_GetRenderDrawBlendMode *SDL_GetRenderDrawBlendMode;
extern tSDL_RenderClear *SDL_RenderClear;
extern tSDL_RenderDrawPoint *SDL_RenderDrawPoint;
extern tSDL_RenderDrawPoints *SDL_RenderDrawPoints;
extern tSDL_RenderDrawLine *SDL_RenderDrawLine;
extern tSDL_RenderDrawLines *SDL_RenderDrawLines;
extern tSDL_RenderDrawRect *SDL_RenderDrawRect;
extern tSDL_RenderDrawRects *SDL_RenderDrawRects;
extern tSDL_RenderFillRect *SDL_RenderFillRect;
extern tSDL_RenderFillRects *SDL_RenderFillRects;
extern tSDL_RenderCopy *SDL_RenderCopy;
extern tSDL_RenderCopyEx *SDL_RenderCopyEx;
extern tSDL_RenderReadPixels *SDL_RenderReadPixels;
extern tSDL_RenderPresent *SDL_RenderPresent;
extern tSDL_DestroyTexture *SDL_DestroyTexture;
extern tSDL_DestroyRenderer *SDL_DestroyRenderer;
extern tSDL_GL_BindTexture *SDL_GL_BindTexture;
extern tSDL_GL_UnbindTexture *SDL_GL_UnbindTexture;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,2 @@
#define SDL_REVISION "hg-7633:d6a8fa507a45"
#define SDL_REVISION_NUMBER 7633

162
extern/sdlew/include/SDL2/SDL_rwops.h vendored Normal file

@ -0,0 +1,162 @@
#ifndef _SDL_rwops_h
#define _SDL_rwops_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_RWOPS_UNKNOWN 0
#define SDL_RWOPS_WINFILE 1
#define SDL_RWOPS_STDFILE 2
#define SDL_RWOPS_JNIFILE 3
#define SDL_RWOPS_MEMORY 4
#define SDL_RWOPS_MEMORY_RO 5
typedef struct SDL_RWops
{
Sint64 (SDLCALL * size) (struct SDL_RWops * context);
Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
int whence);
size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
size_t size, size_t maxnum);
size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
size_t size, size_t num);
int (SDLCALL * close) (struct SDL_RWops * context);
Uint32 type;
union
{
#if defined(ANDROID)
struct
{
void *fileNameRef;
void *inputStreamRef;
void *readableByteChannelRef;
void *readMethod;
void *assetFileDescriptorRef;
long position;
long size;
long offset;
int fd;
} androidio;
#elif defined(__WIN32__)
struct
{
SDL_bool append;
void *h;
struct
{
void *data;
size_t size;
size_t left;
} buffer;
} windowsio;
#endif
#ifdef HAVE_STDIO_H
struct
{
SDL_bool autoclose;
FILE *fp;
} stdio;
#endif
struct
{
Uint8 *base;
Uint8 *here;
Uint8 *stop;
} mem;
struct
{
void *data1;
void *data2;
} unknown;
} hidden;
} SDL_RWops;
typedef SDL_RWops * SDLCALL tSDL_RWFromFile(const char *file,
const char *mode);
#ifdef HAVE_STDIO_H
typedef SDL_RWops * SDLCALL tSDL_RWFromFP(FILE * fp,
SDL_bool autoclose);
#else
typedef SDL_RWops * SDLCALL tSDL_RWFromFP(void * fp,
SDL_bool autoclose);
#endif
typedef SDL_RWops * SDLCALL tSDL_RWFromMem(void *mem, int size);
typedef SDL_RWops * SDLCALL tSDL_RWFromConstMem(const void *mem,
int size);
typedef SDL_RWops * SDLCALL tSDL_AllocRW(void);
typedef void SDLCALL tSDL_FreeRW(SDL_RWops * area);
#define RW_SEEK_SET 0
#define RW_SEEK_CUR 1
#define RW_SEEK_END 2
#define SDL_RWsize(ctx) (ctx)->size(ctx)
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx)
typedef Uint8 SDLCALL tSDL_ReadU8(SDL_RWops * src);
typedef Uint16 SDLCALL tSDL_ReadLE16(SDL_RWops * src);
typedef Uint16 SDLCALL tSDL_ReadBE16(SDL_RWops * src);
typedef Uint32 SDLCALL tSDL_ReadLE32(SDL_RWops * src);
typedef Uint32 SDLCALL tSDL_ReadBE32(SDL_RWops * src);
typedef Uint64 SDLCALL tSDL_ReadLE64(SDL_RWops * src);
typedef Uint64 SDLCALL tSDL_ReadBE64(SDL_RWops * src);
typedef size_t SDLCALL tSDL_WriteU8(SDL_RWops * dst, Uint8 value);
typedef size_t SDLCALL tSDL_WriteLE16(SDL_RWops * dst, Uint16 value);
typedef size_t SDLCALL tSDL_WriteBE16(SDL_RWops * dst, Uint16 value);
typedef size_t SDLCALL tSDL_WriteLE32(SDL_RWops * dst, Uint32 value);
typedef size_t SDLCALL tSDL_WriteBE32(SDL_RWops * dst, Uint32 value);
typedef size_t SDLCALL tSDL_WriteLE64(SDL_RWops * dst, Uint64 value);
typedef size_t SDLCALL tSDL_WriteBE64(SDL_RWops * dst, Uint64 value);
extern tSDL_RWFromFile *SDL_RWFromFile;
extern tSDL_RWFromFP *SDL_RWFromFP;
extern tSDL_RWFromFP *SDL_RWFromFP;
extern tSDL_RWFromMem *SDL_RWFromMem;
extern tSDL_RWFromConstMem *SDL_RWFromConstMem;
extern tSDL_AllocRW *SDL_AllocRW;
extern tSDL_FreeRW *SDL_FreeRW;
extern tSDL_ReadU8 *SDL_ReadU8;
extern tSDL_ReadLE16 *SDL_ReadLE16;
extern tSDL_ReadBE16 *SDL_ReadBE16;
extern tSDL_ReadLE32 *SDL_ReadLE32;
extern tSDL_ReadBE32 *SDL_ReadBE32;
extern tSDL_ReadLE64 *SDL_ReadLE64;
extern tSDL_ReadBE64 *SDL_ReadBE64;
extern tSDL_WriteU8 *SDL_WriteU8;
extern tSDL_WriteLE16 *SDL_WriteLE16;
extern tSDL_WriteBE16 *SDL_WriteBE16;
extern tSDL_WriteLE32 *SDL_WriteLE32;
extern tSDL_WriteBE32 *SDL_WriteBE32;
extern tSDL_WriteLE64 *SDL_WriteLE64;
extern tSDL_WriteBE64 *SDL_WriteBE64;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

273
extern/sdlew/include/SDL2/SDL_scancode.h vendored Normal file

@ -0,0 +1,273 @@
#ifndef _SDL_scancode_h
#define _SDL_scancode_h
#include "SDL_stdinc.h"
typedef enum
{
SDL_SCANCODE_UNKNOWN = 0,
SDL_SCANCODE_A = 4,
SDL_SCANCODE_B = 5,
SDL_SCANCODE_C = 6,
SDL_SCANCODE_D = 7,
SDL_SCANCODE_E = 8,
SDL_SCANCODE_F = 9,
SDL_SCANCODE_G = 10,
SDL_SCANCODE_H = 11,
SDL_SCANCODE_I = 12,
SDL_SCANCODE_J = 13,
SDL_SCANCODE_K = 14,
SDL_SCANCODE_L = 15,
SDL_SCANCODE_M = 16,
SDL_SCANCODE_N = 17,
SDL_SCANCODE_O = 18,
SDL_SCANCODE_P = 19,
SDL_SCANCODE_Q = 20,
SDL_SCANCODE_R = 21,
SDL_SCANCODE_S = 22,
SDL_SCANCODE_T = 23,
SDL_SCANCODE_U = 24,
SDL_SCANCODE_V = 25,
SDL_SCANCODE_W = 26,
SDL_SCANCODE_X = 27,
SDL_SCANCODE_Y = 28,
SDL_SCANCODE_Z = 29,
SDL_SCANCODE_1 = 30,
SDL_SCANCODE_2 = 31,
SDL_SCANCODE_3 = 32,
SDL_SCANCODE_4 = 33,
SDL_SCANCODE_5 = 34,
SDL_SCANCODE_6 = 35,
SDL_SCANCODE_7 = 36,
SDL_SCANCODE_8 = 37,
SDL_SCANCODE_9 = 38,
SDL_SCANCODE_0 = 39,
SDL_SCANCODE_RETURN = 40,
SDL_SCANCODE_ESCAPE = 41,
SDL_SCANCODE_BACKSPACE = 42,
SDL_SCANCODE_TAB = 43,
SDL_SCANCODE_SPACE = 44,
SDL_SCANCODE_MINUS = 45,
SDL_SCANCODE_EQUALS = 46,
SDL_SCANCODE_LEFTBRACKET = 47,
SDL_SCANCODE_RIGHTBRACKET = 48,
SDL_SCANCODE_BACKSLASH = 49,
SDL_SCANCODE_NONUSHASH = 50,
SDL_SCANCODE_SEMICOLON = 51,
SDL_SCANCODE_APOSTROPHE = 52,
SDL_SCANCODE_GRAVE = 53,
SDL_SCANCODE_COMMA = 54,
SDL_SCANCODE_PERIOD = 55,
SDL_SCANCODE_SLASH = 56,
SDL_SCANCODE_CAPSLOCK = 57,
SDL_SCANCODE_F1 = 58,
SDL_SCANCODE_F2 = 59,
SDL_SCANCODE_F3 = 60,
SDL_SCANCODE_F4 = 61,
SDL_SCANCODE_F5 = 62,
SDL_SCANCODE_F6 = 63,
SDL_SCANCODE_F7 = 64,
SDL_SCANCODE_F8 = 65,
SDL_SCANCODE_F9 = 66,
SDL_SCANCODE_F10 = 67,
SDL_SCANCODE_F11 = 68,
SDL_SCANCODE_F12 = 69,
SDL_SCANCODE_PRINTSCREEN = 70,
SDL_SCANCODE_SCROLLLOCK = 71,
SDL_SCANCODE_PAUSE = 72,
SDL_SCANCODE_INSERT = 73,
SDL_SCANCODE_HOME = 74,
SDL_SCANCODE_PAGEUP = 75,
SDL_SCANCODE_DELETE = 76,
SDL_SCANCODE_END = 77,
SDL_SCANCODE_PAGEDOWN = 78,
SDL_SCANCODE_RIGHT = 79,
SDL_SCANCODE_LEFT = 80,
SDL_SCANCODE_DOWN = 81,
SDL_SCANCODE_UP = 82,
SDL_SCANCODE_NUMLOCKCLEAR = 83,
SDL_SCANCODE_KP_DIVIDE = 84,
SDL_SCANCODE_KP_MULTIPLY = 85,
SDL_SCANCODE_KP_MINUS = 86,
SDL_SCANCODE_KP_PLUS = 87,
SDL_SCANCODE_KP_ENTER = 88,
SDL_SCANCODE_KP_1 = 89,
SDL_SCANCODE_KP_2 = 90,
SDL_SCANCODE_KP_3 = 91,
SDL_SCANCODE_KP_4 = 92,
SDL_SCANCODE_KP_5 = 93,
SDL_SCANCODE_KP_6 = 94,
SDL_SCANCODE_KP_7 = 95,
SDL_SCANCODE_KP_8 = 96,
SDL_SCANCODE_KP_9 = 97,
SDL_SCANCODE_KP_0 = 98,
SDL_SCANCODE_KP_PERIOD = 99,
SDL_SCANCODE_NONUSBACKSLASH = 100,
SDL_SCANCODE_APPLICATION = 101,
SDL_SCANCODE_POWER = 102,
SDL_SCANCODE_KP_EQUALS = 103,
SDL_SCANCODE_F13 = 104,
SDL_SCANCODE_F14 = 105,
SDL_SCANCODE_F15 = 106,
SDL_SCANCODE_F16 = 107,
SDL_SCANCODE_F17 = 108,
SDL_SCANCODE_F18 = 109,
SDL_SCANCODE_F19 = 110,
SDL_SCANCODE_F20 = 111,
SDL_SCANCODE_F21 = 112,
SDL_SCANCODE_F22 = 113,
SDL_SCANCODE_F23 = 114,
SDL_SCANCODE_F24 = 115,
SDL_SCANCODE_EXECUTE = 116,
SDL_SCANCODE_HELP = 117,
SDL_SCANCODE_MENU = 118,
SDL_SCANCODE_SELECT = 119,
SDL_SCANCODE_STOP = 120,
SDL_SCANCODE_AGAIN = 121,
SDL_SCANCODE_UNDO = 122,
SDL_SCANCODE_CUT = 123,
SDL_SCANCODE_COPY = 124,
SDL_SCANCODE_PASTE = 125,
SDL_SCANCODE_FIND = 126,
SDL_SCANCODE_MUTE = 127,
SDL_SCANCODE_VOLUMEUP = 128,
SDL_SCANCODE_VOLUMEDOWN = 129,
SDL_SCANCODE_KP_COMMA = 133,
SDL_SCANCODE_KP_EQUALSAS400 = 134,
SDL_SCANCODE_INTERNATIONAL1 = 135,
SDL_SCANCODE_INTERNATIONAL2 = 136,
SDL_SCANCODE_INTERNATIONAL3 = 137,
SDL_SCANCODE_INTERNATIONAL4 = 138,
SDL_SCANCODE_INTERNATIONAL5 = 139,
SDL_SCANCODE_INTERNATIONAL6 = 140,
SDL_SCANCODE_INTERNATIONAL7 = 141,
SDL_SCANCODE_INTERNATIONAL8 = 142,
SDL_SCANCODE_INTERNATIONAL9 = 143,
SDL_SCANCODE_LANG1 = 144,
SDL_SCANCODE_LANG2 = 145,
SDL_SCANCODE_LANG3 = 146,
SDL_SCANCODE_LANG4 = 147,
SDL_SCANCODE_LANG5 = 148,
SDL_SCANCODE_LANG6 = 149,
SDL_SCANCODE_LANG7 = 150,
SDL_SCANCODE_LANG8 = 151,
SDL_SCANCODE_LANG9 = 152,
SDL_SCANCODE_ALTERASE = 153,
SDL_SCANCODE_SYSREQ = 154,
SDL_SCANCODE_CANCEL = 155,
SDL_SCANCODE_CLEAR = 156,
SDL_SCANCODE_PRIOR = 157,
SDL_SCANCODE_RETURN2 = 158,
SDL_SCANCODE_SEPARATOR = 159,
SDL_SCANCODE_OUT = 160,
SDL_SCANCODE_OPER = 161,
SDL_SCANCODE_CLEARAGAIN = 162,
SDL_SCANCODE_CRSEL = 163,
SDL_SCANCODE_EXSEL = 164,
SDL_SCANCODE_KP_00 = 176,
SDL_SCANCODE_KP_000 = 177,
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
SDL_SCANCODE_DECIMALSEPARATOR = 179,
SDL_SCANCODE_CURRENCYUNIT = 180,
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
SDL_SCANCODE_KP_LEFTPAREN = 182,
SDL_SCANCODE_KP_RIGHTPAREN = 183,
SDL_SCANCODE_KP_LEFTBRACE = 184,
SDL_SCANCODE_KP_RIGHTBRACE = 185,
SDL_SCANCODE_KP_TAB = 186,
SDL_SCANCODE_KP_BACKSPACE = 187,
SDL_SCANCODE_KP_A = 188,
SDL_SCANCODE_KP_B = 189,
SDL_SCANCODE_KP_C = 190,
SDL_SCANCODE_KP_D = 191,
SDL_SCANCODE_KP_E = 192,
SDL_SCANCODE_KP_F = 193,
SDL_SCANCODE_KP_XOR = 194,
SDL_SCANCODE_KP_POWER = 195,
SDL_SCANCODE_KP_PERCENT = 196,
SDL_SCANCODE_KP_LESS = 197,
SDL_SCANCODE_KP_GREATER = 198,
SDL_SCANCODE_KP_AMPERSAND = 199,
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
SDL_SCANCODE_KP_VERTICALBAR = 201,
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
SDL_SCANCODE_KP_COLON = 203,
SDL_SCANCODE_KP_HASH = 204,
SDL_SCANCODE_KP_SPACE = 205,
SDL_SCANCODE_KP_AT = 206,
SDL_SCANCODE_KP_EXCLAM = 207,
SDL_SCANCODE_KP_MEMSTORE = 208,
SDL_SCANCODE_KP_MEMRECALL = 209,
SDL_SCANCODE_KP_MEMCLEAR = 210,
SDL_SCANCODE_KP_MEMADD = 211,
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
SDL_SCANCODE_KP_MEMDIVIDE = 214,
SDL_SCANCODE_KP_PLUSMINUS = 215,
SDL_SCANCODE_KP_CLEAR = 216,
SDL_SCANCODE_KP_CLEARENTRY = 217,
SDL_SCANCODE_KP_BINARY = 218,
SDL_SCANCODE_KP_OCTAL = 219,
SDL_SCANCODE_KP_DECIMAL = 220,
SDL_SCANCODE_KP_HEXADECIMAL = 221,
SDL_SCANCODE_LCTRL = 224,
SDL_SCANCODE_LSHIFT = 225,
SDL_SCANCODE_LALT = 226,
SDL_SCANCODE_LGUI = 227,
SDL_SCANCODE_RCTRL = 228,
SDL_SCANCODE_RSHIFT = 229,
SDL_SCANCODE_RALT = 230,
SDL_SCANCODE_RGUI = 231,
SDL_SCANCODE_MODE = 257,
SDL_SCANCODE_AUDIONEXT = 258,
SDL_SCANCODE_AUDIOPREV = 259,
SDL_SCANCODE_AUDIOSTOP = 260,
SDL_SCANCODE_AUDIOPLAY = 261,
SDL_SCANCODE_AUDIOMUTE = 262,
SDL_SCANCODE_MEDIASELECT = 263,
SDL_SCANCODE_WWW = 264,
SDL_SCANCODE_MAIL = 265,
SDL_SCANCODE_CALCULATOR = 266,
SDL_SCANCODE_COMPUTER = 267,
SDL_SCANCODE_AC_SEARCH = 268,
SDL_SCANCODE_AC_HOME = 269,
SDL_SCANCODE_AC_BACK = 270,
SDL_SCANCODE_AC_FORWARD = 271,
SDL_SCANCODE_AC_STOP = 272,
SDL_SCANCODE_AC_REFRESH = 273,
SDL_SCANCODE_AC_BOOKMARKS = 274,
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
SDL_SCANCODE_BRIGHTNESSUP = 276,
SDL_SCANCODE_DISPLAYSWITCH = 277,
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
SDL_SCANCODE_KBDILLUMDOWN = 279,
SDL_SCANCODE_KBDILLUMUP = 280,
SDL_SCANCODE_EJECT = 281,
SDL_SCANCODE_SLEEP = 282,
SDL_SCANCODE_APP1 = 283,
SDL_SCANCODE_APP2 = 284,
SDL_NUM_SCANCODES = 512
} SDL_Scancode;
#endif

60
extern/sdlew/include/SDL2/SDL_shape.h vendored Normal file

@ -0,0 +1,60 @@
#ifndef _SDL_shape_h
#define _SDL_shape_h
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_surface.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_NONSHAPEABLE_WINDOW -1
#define SDL_INVALID_SHAPE_ARGUMENT -2
#define SDL_WINDOW_LACKS_SHAPE -3
typedef SDL_Window * SDLCALL tSDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
typedef SDL_bool SDLCALL tSDL_IsShapedWindow(const SDL_Window *window);
typedef enum {
ShapeModeDefault,
ShapeModeBinarizeAlpha,
ShapeModeReverseBinarizeAlpha,
ShapeModeColorKey
} WindowShapeMode;
#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
typedef union {
Uint8 binarizationCutoff;
SDL_Color colorKey;
} SDL_WindowShapeParams;
typedef struct SDL_WindowShapeMode {
WindowShapeMode mode;
SDL_WindowShapeParams parameters;
} SDL_WindowShapeMode;
typedef int SDLCALL tSDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
typedef int SDLCALL tSDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

378
extern/sdlew/include/SDL2/SDL_stdinc.h vendored Normal file

@ -0,0 +1,378 @@
#ifndef _SDL_stdinc_h
#define _SDL_stdinc_h
#include "SDL_config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#if defined(STDC_HEADERS)
# include <stdlib.h>
# include <stddef.h>
# include <stdarg.h>
#else
# if defined(HAVE_STDLIB_H)
# include <stdlib.h>
# elif defined(HAVE_MALLOC_H)
# include <malloc.h>
# endif
# if defined(HAVE_STDDEF_H)
# include <stddef.h>
# endif
# if defined(HAVE_STDARG_H)
# include <stdarg.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
# include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
#elif defined(HAVE_STDINT_H)
# include <stdint.h>
#endif
#ifdef HAVE_CTYPE_H
# include <ctype.h>
#endif
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
# include <iconv.h>
#endif
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#define SDL_TABLESIZE(table) SDL_arraysize(table)
#ifdef __cplusplus
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
#define SDL_static_cast(type, expression) static_cast<type>(expression)
#define SDL_const_cast(type, expression) const_cast<type>(expression)
#else
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
#define SDL_static_cast(type, expression) ((type)(expression))
#define SDL_const_cast(type, expression) ((type)(expression))
#endif
#define SDL_FOURCC(A, B, C, D) \
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
typedef enum
{
SDL_FALSE = 0,
SDL_TRUE = 1
} SDL_bool;
typedef int8_t Sint8;
typedef uint8_t Uint8;
typedef int16_t Sint16;
typedef uint16_t Uint16;
typedef int32_t Sint32;
typedef uint32_t Uint32;
typedef int64_t Sint64;
typedef uint64_t Uint64;
#define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
#endif
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#if !defined(__ANDROID__)
typedef enum
{
DUMMY_ENUM_VALUE
} SDL_DUMMY_ENUM;
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
#endif
#endif
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__BORLANDC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca(unsigned);
# else
char *alloca();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define SDL_stack_free(data)
#else
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
#define SDL_stack_free(data) SDL_free(data)
#endif
typedef void * SDLCALL tSDL_malloc(size_t size);
typedef void * SDLCALL tSDL_calloc(size_t nmemb, size_t size);
typedef void * SDLCALL tSDL_realloc(void *mem, size_t size);
typedef void SDLCALL tSDL_free(void *mem);
typedef char * SDLCALL tSDL_getenv(const char *name);
typedef int SDLCALL tSDL_setenv(const char *name, const char *value, int overwrite);
typedef void SDLCALL tSDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
typedef int SDLCALL tSDL_abs(int x);
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
typedef int SDLCALL tSDL_isdigit(int x);
typedef int SDLCALL tSDL_isspace(int x);
typedef int SDLCALL tSDL_toupper(int x);
typedef int SDLCALL tSDL_tolower(int x);
typedef void * SDLCALL tSDL_memset(void *dst, int c, size_t len);
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t dwords)
{
#if defined(__GNUC__) && defined(i386)
int u0, u1, u2;
__asm__ __volatile__ (
"cld \n\t"
"rep ; stosl \n\t"
: "=&D" (u0), "=&a" (u1), "=&c" (u2)
: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
: "memory"
);
#else
size_t _n = (dwords + 3) / 4;
Uint32 *_p = SDL_static_cast(Uint32 *, dst);
Uint32 _val = (val);
if (dwords == 0)
return;
switch (dwords % 4)
{
case 0: do { *_p++ = _val;
case 3: *_p++ = _val;
case 2: *_p++ = _val;
case 1: *_p++ = _val;
} while ( --_n );
}
#endif
}
typedef void * SDLCALL tSDL_memcpy(void *dst, const void *src, size_t len);
extern tSDL_memcpy *SDL_memcpy;
SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t dwords)
{
return SDL_memcpy(dst, src, dwords * 4);
}
typedef void * SDLCALL tSDL_memmove(void *dst, const void *src, size_t len);
typedef int SDLCALL tSDL_memcmp(const void *s1, const void *s2, size_t len);
typedef size_t SDLCALL tSDL_wcslen(const wchar_t *wstr);
typedef size_t SDLCALL tSDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen);
typedef size_t SDLCALL tSDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen);
typedef size_t SDLCALL tSDL_strlen(const char *str);
typedef size_t SDLCALL tSDL_strlcpy(char *dst, const char *src, size_t maxlen);
typedef size_t SDLCALL tSDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes);
typedef size_t SDLCALL tSDL_strlcat(char *dst, const char *src, size_t maxlen);
typedef char * SDLCALL tSDL_strdup(const char *str);
typedef char * SDLCALL tSDL_strrev(char *str);
typedef char * SDLCALL tSDL_strupr(char *str);
typedef char * SDLCALL tSDL_strlwr(char *str);
typedef char * SDLCALL tSDL_strchr(const char *str, int c);
typedef char * SDLCALL tSDL_strrchr(const char *str, int c);
typedef char * SDLCALL tSDL_strstr(const char *haystack, const char *needle);
typedef char * SDLCALL tSDL_itoa(int value, char *str, int radix);
typedef char * SDLCALL tSDL_uitoa(unsigned int value, char *str, int radix);
typedef char * SDLCALL tSDL_ltoa(long value, char *str, int radix);
typedef char * SDLCALL tSDL_ultoa(unsigned long value, char *str, int radix);
typedef char * SDLCALL tSDL_lltoa(Sint64 value, char *str, int radix);
typedef char * SDLCALL tSDL_ulltoa(Uint64 value, char *str, int radix);
typedef int SDLCALL tSDL_atoi(const char *str);
typedef double SDLCALL tSDL_atof(const char *str);
typedef long SDLCALL tSDL_strtol(const char *str, char **endp, int base);
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
typedef Sint64 SDLCALL tSDL_strtoll(const char *str, char **endp, int base);
typedef Uint64 SDLCALL tSDL_strtoull(const char *str, char **endp, int base);
typedef double SDLCALL tSDL_strtod(const char *str, char **endp);
typedef int SDLCALL tSDL_strcmp(const char *str1, const char *str2);
typedef int SDLCALL tSDL_strncmp(const char *str1, const char *str2, size_t maxlen);
typedef int SDLCALL tSDL_strcasecmp(const char *str1, const char *str2);
typedef int SDLCALL tSDL_strncasecmp(const char *str1, const char *str2, size_t len);
typedef int SDLCALL tSDL_sscanf(const char *text, const char *fmt, ...);
typedef int SDLCALL tSDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
typedef int SDLCALL tSDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
#ifndef HAVE_M_PI
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
#endif
typedef double SDLCALL tSDL_atan(double x);
typedef double SDLCALL tSDL_atan2(double x, double y);
typedef double SDLCALL tSDL_ceil(double x);
typedef double SDLCALL tSDL_copysign(double x, double y);
typedef double SDLCALL tSDL_cos(double x);
typedef float SDLCALL tSDL_cosf(float x);
typedef double SDLCALL tSDL_fabs(double x);
typedef double SDLCALL tSDL_floor(double x);
typedef double SDLCALL tSDL_log(double x);
typedef double SDLCALL tSDL_pow(double x, double y);
typedef double SDLCALL tSDL_scalbn(double x, int n);
typedef double SDLCALL tSDL_sin(double x);
typedef float SDLCALL tSDL_sinf(float x);
typedef double SDLCALL tSDL_sqrt(double x);
#define SDL_ICONV_ERROR (size_t)-1
#define SDL_ICONV_E2BIG (size_t)-2
#define SDL_ICONV_EILSEQ (size_t)-3
#define SDL_ICONV_EINVAL (size_t)-4
typedef struct _SDL_iconv_t *SDL_iconv_t;
typedef SDL_iconv_t SDLCALL tSDL_iconv_open(const char *tocode,
const char *fromcode);
typedef int SDLCALL tSDL_iconv_close(SDL_iconv_t cd);
typedef size_t SDLCALL tSDL_iconv(SDL_iconv_t cd, const char **inbuf,
size_t * inbytesleft, char **outbuf,
size_t * outbytesleft);
typedef char * SDLCALL tSDL_iconv_string(const char *tocode,
const char *fromcode,
const char *inbuf,
size_t inbytesleft);
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
#ifndef HAVE_ALLOCA
extern tSDL_malloc *SDL_malloc;
#endif
extern tSDL_calloc *SDL_calloc;
extern tSDL_realloc *SDL_realloc;
extern tSDL_free *SDL_free;
extern tSDL_getenv *SDL_getenv;
extern tSDL_setenv *SDL_setenv;
extern tSDL_qsort *SDL_qsort;
extern tSDL_abs *SDL_abs;
extern tSDL_isdigit *SDL_isdigit;
extern tSDL_isspace *SDL_isspace;
extern tSDL_toupper *SDL_toupper;
extern tSDL_tolower *SDL_tolower;
extern tSDL_memset *SDL_memset;
extern tSDL_memmove *SDL_memmove;
extern tSDL_memcmp *SDL_memcmp;
extern tSDL_wcslen *SDL_wcslen;
extern tSDL_wcslcpy *SDL_wcslcpy;
extern tSDL_wcslcat *SDL_wcslcat;
extern tSDL_strlen *SDL_strlen;
extern tSDL_strlcpy *SDL_strlcpy;
extern tSDL_utf8strlcpy *SDL_utf8strlcpy;
extern tSDL_strlcat *SDL_strlcat;
extern tSDL_strdup *SDL_strdup;
extern tSDL_strrev *SDL_strrev;
extern tSDL_strupr *SDL_strupr;
extern tSDL_strlwr *SDL_strlwr;
extern tSDL_strchr *SDL_strchr;
extern tSDL_strrchr *SDL_strrchr;
extern tSDL_strstr *SDL_strstr;
extern tSDL_itoa *SDL_itoa;
extern tSDL_uitoa *SDL_uitoa;
extern tSDL_ltoa *SDL_ltoa;
extern tSDL_ultoa *SDL_ultoa;
extern tSDL_lltoa *SDL_lltoa;
extern tSDL_ulltoa *SDL_ulltoa;
extern tSDL_atoi *SDL_atoi;
extern tSDL_atof *SDL_atof;
extern tSDL_strtol *SDL_strtol;
extern tSDL_strtoll *SDL_strtoll;
extern tSDL_strtoull *SDL_strtoull;
extern tSDL_strtod *SDL_strtod;
extern tSDL_strcmp *SDL_strcmp;
extern tSDL_strncmp *SDL_strncmp;
extern tSDL_strcasecmp *SDL_strcasecmp;
extern tSDL_strncasecmp *SDL_strncasecmp;
extern tSDL_sscanf *SDL_sscanf;
extern tSDL_snprintf *SDL_snprintf;
extern tSDL_vsnprintf *SDL_vsnprintf;
extern tSDL_atan *SDL_atan;
extern tSDL_atan2 *SDL_atan2;
extern tSDL_ceil *SDL_ceil;
extern tSDL_copysign *SDL_copysign;
extern tSDL_cos *SDL_cos;
extern tSDL_cosf *SDL_cosf;
extern tSDL_fabs *SDL_fabs;
extern tSDL_floor *SDL_floor;
extern tSDL_log *SDL_log;
extern tSDL_pow *SDL_pow;
extern tSDL_scalbn *SDL_scalbn;
extern tSDL_sin *SDL_sin;
extern tSDL_sinf *SDL_sinf;
extern tSDL_sqrt *SDL_sqrt;
extern tSDL_iconv_open *SDL_iconv_open;
extern tSDL_iconv_close *SDL_iconv_close;
extern tSDL_iconv *SDL_iconv;
extern tSDL_iconv_string *SDL_iconv_string;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

190
extern/sdlew/include/SDL2/SDL_surface.h vendored Normal file

@ -0,0 +1,190 @@
#ifndef _SDL_surface_h
#define _SDL_surface_h
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_blendmode.h"
#include "SDL_rwops.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_SWSURFACE 0
#define SDL_PREALLOC 0x00000001
#define SDL_RLEACCEL 0x00000002
#define SDL_DONTFREE 0x00000004
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
typedef struct SDL_Surface
{
Uint32 flags;
SDL_PixelFormat *format;
int w, h;
int pitch;
void *pixels;
void *userdata;
int locked;
void *lock_data;
SDL_Rect clip_rect;
struct SDL_BlitMap *map;
int refcount;
} SDL_Surface;
typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
struct SDL_Surface * dst, SDL_Rect * dstrect);
typedef SDL_Surface * SDLCALL tSDL_CreateRGBSurface
(Uint32 flags, int width, int height, int depth,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
typedef SDL_Surface * SDLCALL tSDL_CreateRGBSurfaceFrom(void *pixels,
int width,
int height,
int depth,
int pitch,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask);
typedef void SDLCALL tSDL_FreeSurface(SDL_Surface * surface);
typedef int SDLCALL tSDL_SetSurfacePalette(SDL_Surface * surface,
SDL_Palette * palette);
typedef int SDLCALL tSDL_LockSurface(SDL_Surface * surface);
typedef void SDLCALL tSDL_UnlockSurface(SDL_Surface * surface);
typedef SDL_Surface * SDLCALL tSDL_LoadBMP_RW(SDL_RWops * src,
int freesrc);
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
typedef int SDLCALL tSDL_SaveBMP_RW
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
#define SDL_SaveBMP(surface, file) \
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
typedef int SDLCALL tSDL_SetSurfaceRLE(SDL_Surface * surface,
int flag);
typedef int SDLCALL tSDL_SetColorKey(SDL_Surface * surface,
int flag, Uint32 key);
typedef int SDLCALL tSDL_GetColorKey(SDL_Surface * surface,
Uint32 * key);
typedef int SDLCALL tSDL_SetSurfaceColorMod(SDL_Surface * surface,
Uint8 r, Uint8 g, Uint8 b);
typedef int SDLCALL tSDL_GetSurfaceColorMod(SDL_Surface * surface,
Uint8 * r, Uint8 * g,
Uint8 * b);
typedef int SDLCALL tSDL_SetSurfaceAlphaMod(SDL_Surface * surface,
Uint8 alpha);
typedef int SDLCALL tSDL_GetSurfaceAlphaMod(SDL_Surface * surface,
Uint8 * alpha);
typedef int SDLCALL tSDL_SetSurfaceBlendMode(SDL_Surface * surface,
SDL_BlendMode blendMode);
typedef int SDLCALL tSDL_GetSurfaceBlendMode(SDL_Surface * surface,
SDL_BlendMode *blendMode);
typedef SDL_bool SDLCALL tSDL_SetClipRect(SDL_Surface * surface,
const SDL_Rect * rect);
typedef void SDLCALL tSDL_GetClipRect(SDL_Surface * surface,
SDL_Rect * rect);
typedef SDL_Surface * SDLCALL tSDL_ConvertSurface
(SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags);
typedef SDL_Surface * SDLCALL tSDL_ConvertSurfaceFormat
(SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
typedef int SDLCALL tSDL_ConvertPixels(int width, int height,
Uint32 src_format,
const void * src, int src_pitch,
Uint32 dst_format,
void * dst, int dst_pitch);
typedef int SDLCALL tSDL_FillRect
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
typedef int SDLCALL tSDL_FillRects
(SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
#define SDL_BlitSurface SDL_UpperBlit
typedef int SDLCALL tSDL_UpperBlit
(SDL_Surface * src, const SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
typedef int SDLCALL tSDL_LowerBlit
(SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
typedef int SDLCALL tSDL_SoftStretch(SDL_Surface * src,
const SDL_Rect * srcrect,
SDL_Surface * dst,
const SDL_Rect * dstrect);
#define SDL_BlitScaled SDL_UpperBlitScaled
typedef int SDLCALL tSDL_UpperBlitScaled
(SDL_Surface * src, const SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
typedef int SDLCALL tSDL_LowerBlitScaled
(SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
extern tSDL_CreateRGBSurface *SDL_CreateRGBSurface;
extern tSDL_CreateRGBSurfaceFrom *SDL_CreateRGBSurfaceFrom;
extern tSDL_FreeSurface *SDL_FreeSurface;
extern tSDL_SetSurfacePalette *SDL_SetSurfacePalette;
extern tSDL_LockSurface *SDL_LockSurface;
extern tSDL_UnlockSurface *SDL_UnlockSurface;
extern tSDL_LoadBMP_RW *SDL_LoadBMP_RW;
extern tSDL_SaveBMP_RW *SDL_SaveBMP_RW;
extern tSDL_SetSurfaceRLE *SDL_SetSurfaceRLE;
extern tSDL_SetColorKey *SDL_SetColorKey;
extern tSDL_GetColorKey *SDL_GetColorKey;
extern tSDL_SetSurfaceColorMod *SDL_SetSurfaceColorMod;
extern tSDL_GetSurfaceColorMod *SDL_GetSurfaceColorMod;
extern tSDL_SetSurfaceAlphaMod *SDL_SetSurfaceAlphaMod;
extern tSDL_GetSurfaceAlphaMod *SDL_GetSurfaceAlphaMod;
extern tSDL_SetSurfaceBlendMode *SDL_SetSurfaceBlendMode;
extern tSDL_GetSurfaceBlendMode *SDL_GetSurfaceBlendMode;
extern tSDL_SetClipRect *SDL_SetClipRect;
extern tSDL_GetClipRect *SDL_GetClipRect;
extern tSDL_ConvertSurface *SDL_ConvertSurface;
extern tSDL_ConvertSurfaceFormat *SDL_ConvertSurfaceFormat;
extern tSDL_ConvertPixels *SDL_ConvertPixels;
extern tSDL_FillRect *SDL_FillRect;
extern tSDL_FillRects *SDL_FillRects;
extern tSDL_UpperBlit *SDL_UpperBlit;
extern tSDL_LowerBlit *SDL_LowerBlit;
extern tSDL_SoftStretch *SDL_SoftStretch;
extern tSDL_UpperBlitScaled *SDL_UpperBlitScaled;
extern tSDL_LowerBlitScaled *SDL_LowerBlitScaled;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

48
extern/sdlew/include/SDL2/SDL_system.h vendored Normal file

@ -0,0 +1,48 @@
#ifndef _SDL_system_h
#define _SDL_system_h
#include "SDL_stdinc.h"
#if defined(__IPHONEOS__) && __IPHONEOS__
#include "SDL_video.h"
#include "SDL_keyboard.h"
#endif
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__IPHONEOS__) && __IPHONEOS__
typedef int SDLCALL tSDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
typedef void SDLCALL tSDL_iPhoneSetEventPump(SDL_bool enabled);
#endif
#if defined(__ANDROID__) && __ANDROID__
typedef void * SDLCALL tSDL_AndroidGetJNIEnv();
typedef void * SDLCALL tSDL_AndroidGetActivity();
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
typedef const char * SDLCALL tSDL_AndroidGetInternalStoragePath();
typedef int SDLCALL tSDL_AndroidGetExternalStorageState();
typedef const char * SDLCALL tSDL_AndroidGetExternalStoragePath();
#endif
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

171
extern/sdlew/include/SDL2/SDL_syswm.h vendored Normal file

@ -0,0 +1,171 @@
#ifndef _SDL_syswm_h
#define _SDL_syswm_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo;
#else
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__)
#define Cursor X11Cursor
#endif
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#if defined(__APPLE__) && defined(__MACH__)
#undef Cursor
#endif
#endif
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
#include <directfb.h>
#endif
#if defined(SDL_VIDEO_DRIVER_COCOA)
#ifdef __OBJC__
#include <Cocoa/Cocoa.h>
#else
typedef struct _NSWindow NSWindow;
#endif
#endif
#if defined(SDL_VIDEO_DRIVER_UIKIT)
#ifdef __OBJC__
#include <UIKit/UIKit.h>
#else
typedef struct _UIWindow UIWindow;
#endif
#endif
typedef enum
{
SDL_SYSWM_UNKNOWN,
SDL_SYSWM_WINDOWS,
SDL_SYSWM_X11,
SDL_SYSWM_DIRECTFB,
SDL_SYSWM_COCOA,
SDL_SYSWM_UIKIT,
} SDL_SYSWM_TYPE;
struct SDL_SysWMmsg
{
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union
{
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
struct {
HWND hwnd;
UINT msg;
WPARAM wParam;
LPARAM lParam;
} win;
#endif
#if defined(SDL_VIDEO_DRIVER_X11)
struct {
XEvent event;
} x11;
#endif
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
struct {
DFBEvent event;
} dfb;
#endif
#if defined(SDL_VIDEO_DRIVER_COCOA)
struct
{
} cocoa;
#endif
#if defined(SDL_VIDEO_DRIVER_UIKIT)
struct
{
} uikit;
#endif
int dummy;
} msg;
};
struct SDL_SysWMinfo
{
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union
{
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
struct
{
HWND window;
} win;
#endif
#if defined(SDL_VIDEO_DRIVER_X11)
struct
{
Display *display;
Window window;
} x11;
#endif
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
struct
{
IDirectFB *dfb;
IDirectFBWindow *window;
IDirectFBSurface *surface;
} dfb;
#endif
#if defined(SDL_VIDEO_DRIVER_COCOA)
struct
{
NSWindow *window;
} cocoa;
#endif
#if defined(SDL_VIDEO_DRIVER_UIKIT)
struct
{
UIWindow *window;
} uikit;
#endif
int dummy;
} info;
};
#endif
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
typedef SDL_bool SDLCALL tSDL_GetWindowWMInfo(SDL_Window * window,
SDL_SysWMinfo * info);
extern tSDL_GetWindowWMInfo *SDL_GetWindowWMInfo;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

32
extern/sdlew/include/SDL2/SDL_test.h vendored Normal file

@ -0,0 +1,32 @@
#ifndef _SDL_test_h
#define _SDL_test_h
#include "SDL.h"
#include "SDL_test_common.h"
#include "SDL_test_font.h"
#include "SDL_test_random.h"
#include "SDL_test_fuzzer.h"
#include "SDL_test_crc32.h"
#include "SDL_test_md5.h"
#include "SDL_test_log.h"
#include "SDL_test_assert.h"
#include "SDL_test_harness.h"
#include "SDL_test_images.h"
#include "SDL_test_compare.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,33 @@
#ifndef _SDL_test_assert_h
#define _SDL_test_assert_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ASSERT_FAIL 0
#define ASSERT_PASS 1
void SDLTest_Assert(int assertCondition, const char *assertDescription, ...);
int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...);
void SDLTest_AssertPass(const char *assertDescription, ...);
void SDLTest_ResetAssertSummary();
void SDLTest_LogAssertSummary();
int SDLTest_AssertSummaryToTestResult();
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,103 @@
#ifndef _SDL_test_common_h
#define _SDL_test_common_h
#include "SDL.h"
#if defined(__PSP__)
#define DEFAULT_WINDOW_WIDTH 480
#define DEFAULT_WINDOW_HEIGHT 272
#else
#define DEFAULT_WINDOW_WIDTH 640
#define DEFAULT_WINDOW_HEIGHT 480
#endif
#define VERBOSE_VIDEO 0x00000001
#define VERBOSE_MODES 0x00000002
#define VERBOSE_RENDER 0x00000004
#define VERBOSE_EVENT 0x00000008
#define VERBOSE_AUDIO 0x00000010
typedef struct
{
char **argv;
Uint32 flags;
Uint32 verbose;
const char *videodriver;
int display;
const char *window_title;
const char *window_icon;
Uint32 window_flags;
int window_x;
int window_y;
int window_w;
int window_h;
int window_minW;
int window_minH;
int window_maxW;
int window_maxH;
int logical_w;
int logical_h;
float scale;
int depth;
int refresh_rate;
int num_windows;
SDL_Window **windows;
const char *renderdriver;
Uint32 render_flags;
SDL_bool skip_renderer;
SDL_Renderer **renderers;
const char *audiodriver;
SDL_AudioSpec audiospec;
int gl_red_size;
int gl_green_size;
int gl_blue_size;
int gl_alpha_size;
int gl_buffer_size;
int gl_depth_size;
int gl_stencil_size;
int gl_double_buffer;
int gl_accum_red_size;
int gl_accum_green_size;
int gl_accum_blue_size;
int gl_accum_alpha_size;
int gl_stereo;
int gl_multisamplebuffers;
int gl_multisamplesamples;
int gl_retained_backing;
int gl_accelerated;
int gl_major_version;
int gl_minor_version;
int gl_debug;
} SDLTest_CommonState;
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
void SDLTest_CommonQuit(SDLTest_CommonState * state);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,23 @@
#ifndef _SDL_test_compare_h
#define _SDL_test_compare_h
#include "SDL.h"
#include "SDL_test_images.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,44 @@
#ifndef _SDL_test_crc32_h
#define _SDL_test_crc32_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CrcUint32
#define CrcUint32 unsigned int
#endif
#ifndef CrcUint8
#define CrcUint8 unsigned char
#endif
#ifdef ORIGINAL_METHOD
#define CRC32_POLY 0x04c11db7
#else
#define CRC32_POLY 0xEDB88320
#endif
typedef struct {
CrcUint32 crc32_table[256];
} SDLTest_Crc32Context;
int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,19 @@
#ifndef _SDL_test_font_h
#define _SDL_test_font_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,69 @@
#ifndef _SDL_test_fuzzer_h
#define _SDL_test_fuzzer_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
void SDLTest_FuzzerInit(Uint64 execKey);
Uint8 SDLTest_RandomUint8();
Sint8 SDLTest_RandomSint8();
Uint16 SDLTest_RandomUint16();
Sint16 SDLTest_RandomSint16();
Sint32 SDLTest_RandomSint32();
Uint32 SDLTest_RandomUint32();
Uint64 SDLTest_RandomUint64();
Sint64 SDLTest_RandomSint64();
float SDLTest_RandomUnitFloat();
double SDLTest_RandomUnitDouble();
float SDLTest_RandomFloat();
double SDLTest_RandomDouble();
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
char * SDLTest_RandomAsciiString();
char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
char * SDLTest_RandomAsciiStringOfSize(int size);
int SDLTest_GetFuzzerInvocationCount();
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,67 @@
#ifndef _SDL_test_harness_h
#define _SDL_test_harness_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
//! Definitions for test case structures
#define TEST_ENABLED 1
#define TEST_DISABLED 0
//! Definition of all the possible test return values of the test case method
#define TEST_ABORTED -1
#define TEST_STARTED 0
#define TEST_COMPLETED 1
#define TEST_SKIPPED 2
//! Definition of all the possible test results for the harness
#define TEST_RESULT_PASSED 0
#define TEST_RESULT_FAILED 1
#define TEST_RESULT_NO_ASSERT 2
#define TEST_RESULT_SKIPPED 3
#define TEST_RESULT_SETUP_FAILURE 4
//!< Function pointer to a test case setup function (run before every test)
typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
//!< Function pointer to a test case function
typedef int (*SDLTest_TestCaseFp)(void *arg);
//!< Function pointer to a test case teardown function (run after every test)
typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
typedef struct SDLTest_TestCaseReference {
SDLTest_TestCaseFp testCase;
char *name;
char *description;
int enabled;
} SDLTest_TestCaseReference;
typedef struct SDLTest_TestSuiteReference {
char *name;
SDLTest_TestCaseSetUpFp testSetUp;
const SDLTest_TestCaseReference **testCases;
SDLTest_TestCaseTearDownFp testTearDown;
} SDLTest_TestSuiteReference;
int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,38 @@
#ifndef _SDL_test_images_h
#define _SDL_test_images_h
#include "SDL.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SDLTest_SurfaceImage_s {
int width;
int height;
unsigned int bytes_per_pixel;
const char *pixel_data;
} SDLTest_SurfaceImage_t;
SDL_Surface *SDLTest_ImageBlit();
SDL_Surface *SDLTest_ImageBlitColor();
SDL_Surface *SDLTest_ImageBlitAlpha();
SDL_Surface *SDLTest_ImageBlitBlendAdd();
SDL_Surface *SDLTest_ImageBlitBlend();
SDL_Surface *SDLTest_ImageBlitBlendMod();
SDL_Surface *SDLTest_ImageBlitBlendNone();
SDL_Surface *SDLTest_ImageBlitBlendAll();
SDL_Surface *SDLTest_ImageFace();
SDL_Surface *SDLTest_ImagePrimitives();
SDL_Surface *SDLTest_ImagePrimitivesBlend();
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,21 @@
#ifndef _SDL_test_log_h
#define _SDL_test_log_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
void SDLTest_Log(const char *fmt, ...);
void SDLTest_LogError(const char *fmt, ...);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,33 @@
#ifndef _SDL_test_md5_h
#define _SDL_test_md5_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned long int MD5UINT4;
typedef struct {
MD5UINT4 i[2];
MD5UINT4 buf[4];
unsigned char in[64];
unsigned char digest[16];
} SDLTest_Md5Context;
void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
unsigned int inLen);
void SDLTest_Md5Final(SDLTest_Md5Context * mdContext);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

@ -0,0 +1,34 @@
#ifndef _SDL_test_random_h
#define _SDL_test_random_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c))
typedef struct {
unsigned int a;
unsigned int x;
unsigned int c;
unsigned int ah;
unsigned int al;
} SDLTest_RandomContext;
void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
unsigned int ci);
void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

90
extern/sdlew/include/SDL2/SDL_thread.h vendored Normal file

@ -0,0 +1,90 @@
#ifndef _SDL_thread_h
#define _SDL_thread_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_atomic.h"
#include "SDL_mutex.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
struct SDL_Thread;
typedef struct SDL_Thread SDL_Thread;
typedef unsigned long SDL_threadID;
typedef unsigned int SDL_TLSID;
typedef enum {
SDL_THREAD_PRIORITY_LOW,
SDL_THREAD_PRIORITY_NORMAL,
SDL_THREAD_PRIORITY_HIGH
} SDL_ThreadPriority;
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
#if defined(__WIN32__) && !defined(HAVE_LIBC)
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#include <process.h>
typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *
func) (void
*),
void *arg, unsigned,
unsigned *threadID);
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
extern DECLSPEC SDL_Thread *SDLCALL
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
pfnSDL_CurrentBeginThread pfnBeginThread,
pfnSDL_CurrentEndThread pfnEndThread);
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
#else
extern DECLSPEC SDL_Thread *SDLCALL
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
#endif
typedef const char * SDLCALL tSDL_GetThreadName(SDL_Thread *thread);
typedef SDL_threadID SDLCALL tSDL_ThreadID(void);
typedef SDL_threadID SDLCALL tSDL_GetThreadID(SDL_Thread * thread);
typedef int SDLCALL tSDL_SetThreadPriority(SDL_ThreadPriority priority);
typedef void SDLCALL tSDL_WaitThread(SDL_Thread * thread, int *status);
typedef SDL_TLSID SDLCALL tSDL_TLSCreate(void);
typedef void * SDLCALL tSDL_TLSGet(SDL_TLSID id);
typedef int SDLCALL tSDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*));
extern tSDL_GetThreadName *SDL_GetThreadName;
extern tSDL_ThreadID *SDL_ThreadID;
extern tSDL_GetThreadID *SDL_GetThreadID;
extern tSDL_SetThreadPriority *SDL_SetThreadPriority;
extern tSDL_WaitThread *SDL_WaitThread;
extern tSDL_TLSCreate *SDL_TLSCreate;
extern tSDL_TLSGet *SDL_TLSGet;
extern tSDL_TLSSet *SDL_TLSSet;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

45
extern/sdlew/include/SDL2/SDL_timer.h vendored Normal file

@ -0,0 +1,45 @@
#ifndef _SDL_timer_h
#define _SDL_timer_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef Uint32 SDLCALL tSDL_GetTicks(void);
typedef Uint64 SDLCALL tSDL_GetPerformanceCounter(void);
typedef Uint64 SDLCALL tSDL_GetPerformanceFrequency(void);
typedef void SDLCALL tSDL_Delay(Uint32 ms);
typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
typedef int SDL_TimerID;
typedef SDL_TimerID SDLCALL tSDL_AddTimer(Uint32 interval,
SDL_TimerCallback callback,
void *param);
typedef SDL_bool SDLCALL tSDL_RemoveTimer(SDL_TimerID id);
extern tSDL_GetTicks *SDL_GetTicks;
extern tSDL_GetPerformanceCounter *SDL_GetPerformanceCounter;
extern tSDL_GetPerformanceFrequency *SDL_GetPerformanceFrequency;
extern tSDL_Delay *SDL_Delay;
extern tSDL_AddTimer *SDL_AddTimer;
extern tSDL_RemoveTimer *SDL_RemoveTimer;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

47
extern/sdlew/include/SDL2/SDL_touch.h vendored Normal file

@ -0,0 +1,47 @@
#ifndef _SDL_touch_h
#define _SDL_touch_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef Sint64 SDL_TouchID;
typedef Sint64 SDL_FingerID;
typedef struct SDL_Finger
{
SDL_FingerID id;
float x;
float y;
float pressure;
} SDL_Finger;
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
typedef int SDLCALL tSDL_GetNumTouchDevices(void);
typedef SDL_TouchID SDLCALL tSDL_GetTouchDevice(int index);
typedef int SDLCALL tSDL_GetNumTouchFingers(SDL_TouchID touchID);
typedef SDL_Finger * SDLCALL tSDL_GetTouchFinger(SDL_TouchID touchID, int index);
extern tSDL_GetNumTouchDevices *SDL_GetNumTouchDevices;
extern tSDL_GetTouchDevice *SDL_GetTouchDevice;
extern tSDL_GetNumTouchFingers *SDL_GetNumTouchFingers;
extern tSDL_GetTouchFinger *SDL_GetTouchFinger;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

2
extern/sdlew/include/SDL2/SDL_types.h vendored Normal file

@ -0,0 +1,2 @@
#include "SDL_stdinc.h"

56
extern/sdlew/include/SDL2/SDL_version.h vendored Normal file

@ -0,0 +1,56 @@
#ifndef _SDL_version_h
#define _SDL_version_h
#include "SDL_stdinc.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SDL_version
{
Uint8 major;
Uint8 minor;
Uint8 patch;
} SDL_version;
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 0
#define SDL_PATCHLEVEL 0
#define SDL_VERSION(x) \
{ \
(x)->major = SDL_MAJOR_VERSION; \
(x)->minor = SDL_MINOR_VERSION; \
(x)->patch = SDL_PATCHLEVEL; \
}
#define SDL_VERSIONNUM(X, Y, Z) \
((X)*1000 + (Y)*100 + (Z))
#define SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
#define SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
typedef void SDLCALL tSDL_GetVersion(SDL_version * ver);
typedef const char * SDLCALL tSDL_GetRevision(void);
typedef int SDLCALL tSDL_GetRevisionNumber(void);
extern tSDL_GetVersion *SDL_GetVersion;
extern tSDL_GetRevision *SDL_GetRevision;
extern tSDL_GetRevisionNumber *SDL_GetRevisionNumber;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

367
extern/sdlew/include/SDL2/SDL_video.h vendored Normal file

@ -0,0 +1,367 @@
#ifndef _SDL_video_h
#define _SDL_video_h
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_surface.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
Uint32 format;
int w;
int h;
int refresh_rate;
void *driverdata;
} SDL_DisplayMode;
typedef struct SDL_Window SDL_Window;
typedef enum
{
SDL_WINDOW_FULLSCREEN = 0x00000001,
SDL_WINDOW_OPENGL = 0x00000002,
SDL_WINDOW_SHOWN = 0x00000004,
SDL_WINDOW_HIDDEN = 0x00000008,
SDL_WINDOW_BORDERLESS = 0x00000010,
SDL_WINDOW_RESIZABLE = 0x00000020,
SDL_WINDOW_MINIMIZED = 0x00000040,
SDL_WINDOW_MAXIMIZED = 0x00000080,
SDL_WINDOW_INPUT_GRABBED = 0x00000100,
SDL_WINDOW_INPUT_FOCUS = 0x00000200,
SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
SDL_WINDOW_FOREIGN = 0x00000800
} SDL_WindowFlags;
#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000
#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
#define SDL_WINDOWPOS_ISUNDEFINED(X) \
(((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000
#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
#define SDL_WINDOWPOS_ISCENTERED(X) \
(((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
typedef enum
{
SDL_WINDOWEVENT_NONE,
SDL_WINDOWEVENT_SHOWN,
SDL_WINDOWEVENT_HIDDEN,
SDL_WINDOWEVENT_EXPOSED,
SDL_WINDOWEVENT_MOVED,
SDL_WINDOWEVENT_RESIZED,
SDL_WINDOWEVENT_SIZE_CHANGED,
SDL_WINDOWEVENT_MINIMIZED,
SDL_WINDOWEVENT_MAXIMIZED,
SDL_WINDOWEVENT_RESTORED,
SDL_WINDOWEVENT_ENTER,
SDL_WINDOWEVENT_LEAVE,
SDL_WINDOWEVENT_FOCUS_GAINED,
SDL_WINDOWEVENT_FOCUS_LOST,
SDL_WINDOWEVENT_CLOSE
} SDL_WindowEventID;
typedef void *SDL_GLContext;
typedef enum
{
SDL_GL_RED_SIZE,
SDL_GL_GREEN_SIZE,
SDL_GL_BLUE_SIZE,
SDL_GL_ALPHA_SIZE,
SDL_GL_BUFFER_SIZE,
SDL_GL_DOUBLEBUFFER,
SDL_GL_DEPTH_SIZE,
SDL_GL_STENCIL_SIZE,
SDL_GL_ACCUM_RED_SIZE,
SDL_GL_ACCUM_GREEN_SIZE,
SDL_GL_ACCUM_BLUE_SIZE,
SDL_GL_ACCUM_ALPHA_SIZE,
SDL_GL_STEREO,
SDL_GL_MULTISAMPLEBUFFERS,
SDL_GL_MULTISAMPLESAMPLES,
SDL_GL_ACCELERATED_VISUAL,
SDL_GL_RETAINED_BACKING,
SDL_GL_CONTEXT_MAJOR_VERSION,
SDL_GL_CONTEXT_MINOR_VERSION,
SDL_GL_CONTEXT_EGL,
SDL_GL_CONTEXT_FLAGS,
SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_SHARE_WITH_CURRENT_CONTEXT
} SDL_GLattr;
typedef enum
{
SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
SDL_GL_CONTEXT_PROFILE_ES = 0x0004
} SDL_GLprofile;
typedef enum
{
SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004,
SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
} SDL_GLcontextFlag;
typedef int SDLCALL tSDL_GetNumVideoDrivers(void);
typedef const char * SDLCALL tSDL_GetVideoDriver(int index);
typedef int SDLCALL tSDL_VideoInit(const char *driver_name);
typedef void SDLCALL tSDL_VideoQuit(void);
typedef const char * SDLCALL tSDL_GetCurrentVideoDriver(void);
typedef int SDLCALL tSDL_GetNumVideoDisplays(void);
typedef const char * SDLCALL tSDL_GetDisplayName(int displayIndex);
typedef int SDLCALL tSDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
typedef int SDLCALL tSDL_GetNumDisplayModes(int displayIndex);
typedef int SDLCALL tSDL_GetDisplayMode(int displayIndex, int modeIndex,
SDL_DisplayMode * mode);
typedef int SDLCALL tSDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
typedef int SDLCALL tSDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
typedef SDL_DisplayMode * SDLCALL tSDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
typedef int SDLCALL tSDL_GetWindowDisplayIndex(SDL_Window * window);
typedef int SDLCALL tSDL_SetWindowDisplayMode(SDL_Window * window,
const SDL_DisplayMode
* mode);
typedef int SDLCALL tSDL_GetWindowDisplayMode(SDL_Window * window,
SDL_DisplayMode * mode);
typedef Uint32 SDLCALL tSDL_GetWindowPixelFormat(SDL_Window * window);
typedef SDL_Window * SDLCALL tSDL_CreateWindow(const char *title,
int x, int y, int w,
int h, Uint32 flags);
typedef SDL_Window * SDLCALL tSDL_CreateWindowFrom(const void *data);
typedef Uint32 SDLCALL tSDL_GetWindowID(SDL_Window * window);
typedef SDL_Window * SDLCALL tSDL_GetWindowFromID(Uint32 id);
typedef Uint32 SDLCALL tSDL_GetWindowFlags(SDL_Window * window);
typedef void SDLCALL tSDL_SetWindowTitle(SDL_Window * window,
const char *title);
typedef const char * SDLCALL tSDL_GetWindowTitle(SDL_Window * window);
typedef void SDLCALL tSDL_SetWindowIcon(SDL_Window * window,
SDL_Surface * icon);
extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
const char *name,
void *userdata);
typedef void * SDLCALL tSDL_GetWindowData(SDL_Window * window,
const char *name);
typedef void SDLCALL tSDL_SetWindowPosition(SDL_Window * window,
int x, int y);
typedef void SDLCALL tSDL_GetWindowPosition(SDL_Window * window,
int *x, int *y);
typedef void SDLCALL tSDL_SetWindowSize(SDL_Window * window, int w,
int h);
typedef void SDLCALL tSDL_GetWindowSize(SDL_Window * window, int *w,
int *h);
typedef void SDLCALL tSDL_SetWindowMinimumSize(SDL_Window * window,
int min_w, int min_h);
typedef void SDLCALL tSDL_GetWindowMinimumSize(SDL_Window * window,
int *w, int *h);
typedef void SDLCALL tSDL_SetWindowMaximumSize(SDL_Window * window,
int max_w, int max_h);
typedef void SDLCALL tSDL_GetWindowMaximumSize(SDL_Window * window,
int *w, int *h);
typedef void SDLCALL tSDL_SetWindowBordered(SDL_Window * window,
SDL_bool bordered);
typedef void SDLCALL tSDL_ShowWindow(SDL_Window * window);
typedef void SDLCALL tSDL_HideWindow(SDL_Window * window);
typedef void SDLCALL tSDL_RaiseWindow(SDL_Window * window);
typedef void SDLCALL tSDL_MaximizeWindow(SDL_Window * window);
typedef void SDLCALL tSDL_MinimizeWindow(SDL_Window * window);
typedef void SDLCALL tSDL_RestoreWindow(SDL_Window * window);
typedef int SDLCALL tSDL_SetWindowFullscreen(SDL_Window * window,
Uint32 flags);
typedef SDL_Surface * SDLCALL tSDL_GetWindowSurface(SDL_Window * window);
typedef int SDLCALL tSDL_UpdateWindowSurface(SDL_Window * window);
typedef int SDLCALL tSDL_UpdateWindowSurfaceRects(SDL_Window * window,
const SDL_Rect * rects,
int numrects);
typedef void SDLCALL tSDL_SetWindowGrab(SDL_Window * window,
SDL_bool grabbed);
typedef SDL_bool SDLCALL tSDL_GetWindowGrab(SDL_Window * window);
typedef int SDLCALL tSDL_SetWindowBrightness(SDL_Window * window, float brightness);
typedef float SDLCALL tSDL_GetWindowBrightness(SDL_Window * window);
typedef int SDLCALL tSDL_SetWindowGammaRamp(SDL_Window * window,
const Uint16 * red,
const Uint16 * green,
const Uint16 * blue);
typedef int SDLCALL tSDL_GetWindowGammaRamp(SDL_Window * window,
Uint16 * red,
Uint16 * green,
Uint16 * blue);
typedef void SDLCALL tSDL_DestroyWindow(SDL_Window * window);
typedef SDL_bool SDLCALL tSDL_IsScreenSaverEnabled(void);
typedef void SDLCALL tSDL_EnableScreenSaver(void);
typedef void SDLCALL tSDL_DisableScreenSaver(void);
typedef int SDLCALL tSDL_GL_LoadLibrary(const char *path);
typedef void * SDLCALL tSDL_GL_GetProcAddress(const char *proc);
typedef void SDLCALL tSDL_GL_UnloadLibrary(void);
typedef SDL_bool SDLCALL tSDL_GL_ExtensionSupported(const char
*extension);
typedef int SDLCALL tSDL_GL_SetAttribute(SDL_GLattr attr, int value);
typedef int SDLCALL tSDL_GL_GetAttribute(SDL_GLattr attr, int *value);
typedef SDL_GLContext SDLCALL tSDL_GL_CreateContext(SDL_Window *
window);
typedef int SDLCALL tSDL_GL_MakeCurrent(SDL_Window * window,
SDL_GLContext context);
extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
typedef SDL_GLContext SDLCALL tSDL_GL_GetCurrentContext(void);
typedef int SDLCALL tSDL_GL_SetSwapInterval(int interval);
typedef int SDLCALL tSDL_GL_GetSwapInterval(void);
typedef void SDLCALL tSDL_GL_SwapWindow(SDL_Window * window);
typedef void SDLCALL tSDL_GL_DeleteContext(SDL_GLContext context);
extern tSDL_GetNumVideoDrivers *SDL_GetNumVideoDrivers;
extern tSDL_GetVideoDriver *SDL_GetVideoDriver;
extern tSDL_VideoInit *SDL_VideoInit;
extern tSDL_VideoQuit *SDL_VideoQuit;
extern tSDL_GetCurrentVideoDriver *SDL_GetCurrentVideoDriver;
extern tSDL_GetNumVideoDisplays *SDL_GetNumVideoDisplays;
extern tSDL_GetDisplayName *SDL_GetDisplayName;
extern tSDL_GetDisplayBounds *SDL_GetDisplayBounds;
extern tSDL_GetNumDisplayModes *SDL_GetNumDisplayModes;
extern tSDL_GetDisplayMode *SDL_GetDisplayMode;
extern tSDL_GetDesktopDisplayMode *SDL_GetDesktopDisplayMode;
extern tSDL_GetCurrentDisplayMode *SDL_GetCurrentDisplayMode;
extern tSDL_GetClosestDisplayMode *SDL_GetClosestDisplayMode;
extern tSDL_GetWindowDisplayIndex *SDL_GetWindowDisplayIndex;
extern tSDL_SetWindowDisplayMode *SDL_SetWindowDisplayMode;
extern tSDL_GetWindowDisplayMode *SDL_GetWindowDisplayMode;
extern tSDL_GetWindowPixelFormat *SDL_GetWindowPixelFormat;
extern tSDL_CreateWindow *SDL_CreateWindow;
extern tSDL_CreateWindowFrom *SDL_CreateWindowFrom;
extern tSDL_GetWindowID *SDL_GetWindowID;
extern tSDL_GetWindowFromID *SDL_GetWindowFromID;
extern tSDL_GetWindowFlags *SDL_GetWindowFlags;
extern tSDL_SetWindowTitle *SDL_SetWindowTitle;
extern tSDL_GetWindowTitle *SDL_GetWindowTitle;
extern tSDL_SetWindowIcon *SDL_SetWindowIcon;
extern tSDL_GetWindowData *SDL_GetWindowData;
extern tSDL_SetWindowPosition *SDL_SetWindowPosition;
extern tSDL_GetWindowPosition *SDL_GetWindowPosition;
extern tSDL_SetWindowSize *SDL_SetWindowSize;
extern tSDL_GetWindowSize *SDL_GetWindowSize;
extern tSDL_SetWindowMinimumSize *SDL_SetWindowMinimumSize;
extern tSDL_GetWindowMinimumSize *SDL_GetWindowMinimumSize;
extern tSDL_SetWindowMaximumSize *SDL_SetWindowMaximumSize;
extern tSDL_GetWindowMaximumSize *SDL_GetWindowMaximumSize;
extern tSDL_SetWindowBordered *SDL_SetWindowBordered;
extern tSDL_ShowWindow *SDL_ShowWindow;
extern tSDL_HideWindow *SDL_HideWindow;
extern tSDL_RaiseWindow *SDL_RaiseWindow;
extern tSDL_MaximizeWindow *SDL_MaximizeWindow;
extern tSDL_MinimizeWindow *SDL_MinimizeWindow;
extern tSDL_RestoreWindow *SDL_RestoreWindow;
extern tSDL_SetWindowFullscreen *SDL_SetWindowFullscreen;
extern tSDL_GetWindowSurface *SDL_GetWindowSurface;
extern tSDL_UpdateWindowSurface *SDL_UpdateWindowSurface;
extern tSDL_UpdateWindowSurfaceRects *SDL_UpdateWindowSurfaceRects;
extern tSDL_SetWindowGrab *SDL_SetWindowGrab;
extern tSDL_GetWindowGrab *SDL_GetWindowGrab;
extern tSDL_SetWindowBrightness *SDL_SetWindowBrightness;
extern tSDL_GetWindowBrightness *SDL_GetWindowBrightness;
extern tSDL_SetWindowGammaRamp *SDL_SetWindowGammaRamp;
extern tSDL_GetWindowGammaRamp *SDL_GetWindowGammaRamp;
extern tSDL_DestroyWindow *SDL_DestroyWindow;
extern tSDL_IsScreenSaverEnabled *SDL_IsScreenSaverEnabled;
extern tSDL_EnableScreenSaver *SDL_EnableScreenSaver;
extern tSDL_DisableScreenSaver *SDL_DisableScreenSaver;
extern tSDL_GL_LoadLibrary *SDL_GL_LoadLibrary;
extern tSDL_GL_GetProcAddress *SDL_GL_GetProcAddress;
extern tSDL_GL_UnloadLibrary *SDL_GL_UnloadLibrary;
extern tSDL_GL_ExtensionSupported *SDL_GL_ExtensionSupported;
extern tSDL_GL_SetAttribute *SDL_GL_SetAttribute;
extern tSDL_GL_GetAttribute *SDL_GL_GetAttribute;
extern tSDL_GL_CreateContext *SDL_GL_CreateContext;
extern tSDL_GL_MakeCurrent *SDL_GL_MakeCurrent;
extern tSDL_GL_GetCurrentContext *SDL_GL_GetCurrentContext;
extern tSDL_GL_SetSwapInterval *SDL_GL_SetSwapInterval;
extern tSDL_GL_GetSwapInterval *SDL_GL_GetSwapInterval;
extern tSDL_GL_SwapWindow *SDL_GL_SwapWindow;
extern tSDL_GL_DeleteContext *SDL_GL_DeleteContext;
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif

107
extern/sdlew/include/SDL2/begin_code.h vendored Normal file

@ -0,0 +1,107 @@
#ifdef _begin_code_h
#error Nested inclusion of begin_code.h
#endif
#define _begin_code_h
#ifndef DECLSPEC
# if defined(__BEOS__) || defined(__HAIKU__)
# if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC __declspec(export)
# endif
# elif defined(__WIN32__)
# ifdef __BORLANDC__
# ifdef BUILD_SDL
# define DECLSPEC
# else
# define DECLSPEC __declspec(dllimport)
# endif
# else
# define DECLSPEC __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && __GNUC__ >= 4
# define DECLSPEC __attribute__ ((visibility("default")))
# else
# define DECLSPEC
# endif
# endif
#endif
#ifndef SDLCALL
#if defined(__WIN32__) && !defined(__GNUC__)
#define SDLCALL __cdecl
#else
#define SDLCALL
#endif
#endif
#ifdef __SYMBIAN32__
#undef DECLSPEC
#define DECLSPEC
#endif
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
#ifdef _MSC_VER
#pragma warning(disable: 4103)
#endif
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#ifdef _M_X64
#pragma pack(push,8)
#else
#pragma pack(push,4)
#endif
#endif
#ifndef SDL_INLINE_OKAY
#ifdef __GNUC__
#define SDL_INLINE_OKAY
#else
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
defined(__DMC__) || defined(__SC__) || \
defined(__WATCOMC__) || defined(__LCC__) || \
defined(__DECC)
#ifndef __inline__
#define __inline__ __inline
#endif
#define SDL_INLINE_OKAY
#else
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
#ifndef __inline__
#define __inline__ inline
#endif
#define SDL_INLINE_OKAY
#endif
#endif
#endif
#endif
#ifndef SDL_INLINE_OKAY
#define __inline__
#endif
#ifndef SDL_FORCE_INLINE
#if defined(_MSC_VER)
#define SDL_FORCE_INLINE __forceinline
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
#define SDL_FORCE_INLINE __attribute__((always_inline)) static inline
#else
#define SDL_FORCE_INLINE static __inline__
#endif
#endif
#if !defined(__MACH__)
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#endif

@ -0,0 +1,9 @@
#undef _begin_code_h
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(pop)
#endif

37
extern/sdlew/include/sdlew.h vendored Normal file

@ -0,0 +1,37 @@
/*
* Copyright 2014 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
#ifndef __SDL_EW_H__
#define __SDL_EW_H__
#ifdef __cplusplus
extern "C" {
#endif
enum {
SDLEW_SUCCESS = 0,
SDLEW_ERROR_OPEN_FAILED = -1,
SDLEW_ERROR_ATEXIT_FAILED = -2,
SDLEW_ERROR_VERSION = -3,
};
int sdlewInit(void);
#ifdef __cplusplus
}
#endif
#endif /* __SDL_EW_H__ */

1095
extern/sdlew/src/sdlew.c vendored Normal file

File diff suppressed because it is too large Load Diff

7
extern/sdlew/src/sdlew.map vendored Normal file

@ -0,0 +1,7 @@
{
global:
*;
local:
*SDL*;
};

@ -75,6 +75,7 @@
#include "AUD_MutexLock.h"
#ifdef WITH_SDL
#include <SDL.h>
#include "AUD_SDLDevice.h"
#endif
@ -143,8 +144,14 @@ int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
break;
#ifdef WITH_SDL
case AUD_SDL_DEVICE:
dev = boost::shared_ptr<AUD_IDevice>(new AUD_SDLDevice(specs, buffersize));
break;
if (SDL_Init == (void *)0) {
printf("Warning: SDL libraries are not installed\n");
// No break, fall through to default, to return false
}
else {
dev = boost::shared_ptr<AUD_IDevice>(new AUD_SDLDevice(specs, buffersize));
break;
}
#endif
#ifdef WITH_OPENAL
case AUD_OPENAL_DEVICE:
@ -162,7 +169,7 @@ int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
else
#endif
if (!AUD_jack_supported()) {
printf("Warning: Jack cllient not installed\n");
printf("Warning: Jack client not installed\n");
// No break, fall through to default, to return false
}
else {

@ -122,6 +122,9 @@ if env['WITH_BF_CYCLES']:
defs.append('WITH_CYCLES_DEBUG')
if env['WITH_BF_SDL']:
if env['WITH_BF_SDL_DYNLOAD']:
defs.append('WITH_SDL_DYNLOAD')
incs += ' #extern/sdlew/include'
defs.append('WITH_SDL')
if env['WITH_BF_OPENAL']:

@ -241,6 +241,12 @@ if(WITH_MOD_OCEANSIM)
endif()
if(WITH_SDL)
if(WITH_SDL_DYNLOAD)
add_definitions(-DWITH_SDL_DYNLOAD)
list(APPEND INC
../../../../extern/sdlew/include
)
endif()
add_definitions(-DWITH_SDL)
endif()

@ -123,6 +123,9 @@ if env['WITH_BF_FFTW3']:
defs.append('WITH_FFTW3')
if env['WITH_BF_SDL']:
if env['WITH_BF_SDL_DYNLOAD']:
defs.append('WITH_SDL_DYNLOAD')
incs += ' #extern/sdlew/include'
defs.append('WITH_SDL')
if env['WITH_BF_OPENAL']:

@ -104,6 +104,10 @@ EnumPropertyItem navigation_mode_items[] = {
#include "BKE_addon.h"
#ifdef WITH_SDL_DYNLOAD
# include "sdlew.h"
#endif
static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
WM_main_add_notifier(NC_WINDOW, NULL);
@ -510,37 +514,38 @@ static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), P
static EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), bool *r_free)
{
#ifdef WITH_JACK
int jack_supported = sound_is_jack_supported();
int index = 0;
int totitem = 0;
EnumPropertyItem *item = NULL;
if (jack_supported) {
return audio_device_items;
}
else {
int index = 0;
int totitem = 0;
EnumPropertyItem *item = NULL;
/* NONE */
RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]);
/* NONE */
RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]);
#ifdef WITH_SDL
RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]);
# ifdef WITH_SDL_DYNLOAD
if (sdlewInit() == SDLEW_SUCCESS)
# endif
{
RNA_enum_item_add(&item, &totitem, &audio_device_items[index]);
}
index++;
#endif
#ifdef WITH_OPENAL
RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]);
RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]);
#endif
RNA_enum_item_end(&item, &totitem);
*r_free = true;
return item;
#ifdef WITH_JACK
if (sound_is_jack_supported()) {
RNA_enum_item_add(&item, &totitem, &audio_device_items[index]);
}
#else
(void)r_free;
return audio_device_items;
index++;
#endif
RNA_enum_item_end(&item, &totitem);
*r_free = true;
return item;
}
#ifdef WITH_INTERNATIONAL

@ -167,6 +167,7 @@ endif()
extern_wcwidth
extern_libmv
extern_glog
extern_sdlew
)
if(WITH_MOD_CLOTH_ELTOPO)

@ -81,6 +81,10 @@ if(WITH_GAMEENGINE)
endif()
if(WITH_SDL)
if(WITH_SDL_DYNLOAD)
add_definitions(-DWITH_SDL_DYNLOAD)
blender_include_dirs(../../extern/sdlew/include)
endif()
add_definitions(-DWITH_SDL)
endif()

@ -18,5 +18,6 @@ local:
NumNamedVarArgParams;
X86CompilationCallback*;
*boost*;
*SDL*;
};

@ -154,6 +154,10 @@
# include "CCL_api.h"
#endif
#ifdef WITH_SDL_DYNLOAD
# include "sdlew.h"
#endif
/* from buildinfo.c */
#ifdef BUILD_DATE
extern char build_date[];
@ -1586,6 +1590,10 @@ int main(
}
#endif
#ifdef WITH_SDL_DYNLOAD
sdlewInit();
#endif
C = CTX_create();
#ifdef WITH_PYTHON_MODULE

@ -41,6 +41,8 @@
#include "BLI_path_util.h"
#define SDL_CHECK(x) ((x) != (void*)0)
SCA_Joystick::SCA_Joystick(short int index)
:
m_joyindex(index),
@ -82,6 +84,9 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex )
#ifndef WITH_SDL
return NULL;
#else /* WITH_SDL */
if (!SDL_CHECK(SDL_InitSubSystem)) {
return NULL;
}
if (joyindex < 0 || joyindex >= JOYINDEX_MAX) {
JOYSTICK_ECHO("Error-invalid joystick index: " << joyindex);
return NULL;
@ -135,8 +140,10 @@ void SCA_Joystick::ReleaseInstance()
if (--m_refCount == 0)
{
#ifdef WITH_SDL
int i;
for (i=0; i<JOYINDEX_MAX; i++) {
if (!SDL_CHECK(SDL_QuitSubSystem)) {
return;
}
for (int i=0; i<JOYINDEX_MAX; i++) {
if (m_instance[i]) {
m_instance[i]->DestroyJoystickDevice();
delete m_instance[i];
@ -191,6 +198,9 @@ bool SCA_Joystick::aAxisIsPositive(int axis_single)
bool SCA_Joystick::aAnyButtonPressIsPositive(void)
{
#ifdef WITH_SDL
if (!SDL_CHECK(SDL_JoystickGetButton)) {
return false;
}
/* this is needed for the "all events" option
* so we know if there are no buttons pressed */
for (int i=0; i<m_buttonmax; i++)
@ -206,7 +216,7 @@ bool SCA_Joystick::aButtonPressIsPositive(int button)
return false;
#else
bool result;
SDL_JoystickGetButton(m_private->m_joystick, button)? result = true:result = false;
result = SDL_CHECK(SDL_JoystickGetButton) && SDL_JoystickGetButton(m_private->m_joystick, button);
return result;
#endif
}
@ -218,7 +228,7 @@ bool SCA_Joystick::aButtonReleaseIsPositive(int button)
return false;
#else
bool result;
SDL_JoystickGetButton(m_private->m_joystick, button)? result = false : result = true;
result = !(SDL_CHECK(SDL_JoystickGetButton) && SDL_JoystickGetButton(m_private->m_joystick, button));
return result;
#endif
}
@ -253,7 +263,7 @@ bool SCA_Joystick::CreateJoystickDevice(void)
m_axismax = m_buttonmax = m_hatmax = 0;
return false;
#else /* WITH_SDL */
if (m_isinit == false) {
if (m_isinit == false && SDL_CHECK(SDL_JoystickOpen)) {
if (m_joyindex>=m_joynum) {
/* don't print a message, because this is done anyway */
//JOYSTICK_ECHO("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)");
@ -293,9 +303,9 @@ void SCA_Joystick::DestroyJoystickDevice(void)
#ifdef WITH_SDL
if (m_isinit) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
if (SDL_JoystickGetAttached(m_private->m_joystick))
if (SDL_CHECK(SDL_JoystickGetAttached) && SDL_JoystickGetAttached(m_private->m_joystick))
#else
if (SDL_JoystickOpened(m_joyindex))
if (SDL_CHECK(SDL_JoystickOpened) && SDL_JoystickOpened(m_joyindex))
#endif
{
JOYSTICK_ECHO("Closing-joystick " << m_joyindex);
@ -309,13 +319,16 @@ void SCA_Joystick::DestroyJoystickDevice(void)
int SCA_Joystick::Connected(void)
{
#ifdef WITH_SDL
if (m_isinit
if (m_isinit &&
#if SDL_VERSION_ATLEAST(2, 0, 0)
&& SDL_JoystickGetAttached(m_private->m_joystick))
SDL_CHECK(SDL_JoystickGetAttached) && SDL_JoystickGetAttached(m_private->m_joystick)
#else
&& SDL_JoystickOpened(m_joyindex))
SDL_CHECK(SDL_JoystickOpened) && SDL_JoystickOpened(m_joyindex)
#endif
)
{
return 1;
}
#endif
return 0;
}
@ -353,9 +366,9 @@ const char *SCA_Joystick::GetName()
{
#ifdef WITH_SDL
#if SDL_VERSION_ATLEAST(2, 0, 0)
return SDL_JoystickName(m_private->m_joystick);
return (SDL_CHECK(SDL_JoystickName)) ? SDL_JoystickName(m_private->m_joystick) : "";
#else
return SDL_JoystickName(m_joyindex);
return (SDL_CHECK(SDL_JoystickName)) ? SDL_JoystickName(m_joyindex) : "";
#endif
#else /* WITH_SDL */
return "";

@ -85,7 +85,11 @@ void SCA_Joystick::OnNothing(SDL_Event* sdl_event)
void SCA_Joystick::HandleEvents(void)
{
SDL_Event sdl_event;
if (SDL_PollEvent == (void*)0) {
return;
}
int i;
for (i=0; i<m_joynum; i++) { /* could use JOYINDEX_MAX but no reason to */
if (SCA_Joystick::m_instance[i])

@ -91,4 +91,11 @@ if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
endif()
if(WITH_SDL AND WITH_SDL_DYNLOAD)
list(APPEND INC
../../../../extern/sdlew/include
)
add_definitions(-DWITH_SDL_DYNLOAD)
endif()
blender_add_lib_nolist(ge_player_ghost "${SRC}" "${INC}" "${INC_SYS}")

@ -114,6 +114,10 @@ extern char datatoc_bmonofont_ttf[];
#endif // !defined(DEBUG)
#endif // WIN32
#ifdef WITH_SDL_DYNLOAD
# include "sdlew.h"
#endif
const int kMinWindowWidth = 100;
const int kMinWindowHeight = 100;
@ -421,6 +425,11 @@ int main(int argc, char** argv)
signal (SIGFPE, SIG_IGN);
#endif /* __alpha__ */
#endif /* __linux__ */
#ifdef WITH_SDL_DYNLOAD
sdlewInit();
#endif
BLI_init_program_path(argv[0]);
BLI_temp_dir_init(NULL);

@ -87,4 +87,8 @@ if env['WITH_BF_FFMPEG']:
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_SDL'] and env['WITH_BF_SDL_DYNLOAD']:
defs.append('WITH_SDL_DYNLOAD')
incs += ['#extern/sdlew/include']
env.BlenderLib (libname='ge_player_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[0], cxx_compileflags=env['BGE_CXXFLAGS'])