diff --git a/CMakeLists.txt b/CMakeLists.txt index 00714e82..e63da585 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,7 @@ set(MEGA_LIBVORBIS_VER "1.3.3") set(MEGA_LIBTHEORA_VER "1.1") set(MEGA_MPG123_VER "1.15.3") set(MEGA_FREETYPE_VER "2.5.0.1") -set(MEGA_SDL2_VER "2.0.3-1c0f6952e65e") +set(MEGA_SDL2_VER "2.0.3-dba168c67bea") set(MEGA_OPENAL_VER "1.16.0") set(MEGA_MODPLUG_VER "0.8.8.4") diff --git a/libs/SDL2/.hg_archival.txt b/libs/SDL2/.hg_archival.txt new file mode 100644 index 00000000..60dfbd9e --- /dev/null +++ b/libs/SDL2/.hg_archival.txt @@ -0,0 +1,5 @@ +repo: 74212992fb0868a6929180cd74dd67e38507340a +node: dba168c67bea1ca1e046b0863ebbcbb96612d7f4 +branch: default +latesttag: release-2.0.3 +latesttagdistance: 1093 diff --git a/libs/SDL2/.hgignore b/libs/SDL2/.hgignore index c16de759..55c06679 100644 --- a/libs/SDL2/.hgignore +++ b/libs/SDL2/.hgignore @@ -8,6 +8,7 @@ Makefile sdl-config SDL2.spec build +Build # for Xcode *.orig @@ -17,20 +18,12 @@ build *~ *.o *.mode1* -*.model* -*.perspective* *.perspective* *.pbxuser (^|/)build($|/) .DS_Store -Xcode/SDL/SDL.xcodeproj/xcuserdata -Xcode/SDL/SDL.xcodeproj/project.xcworkspace -Xcode/SDLTest/SDLTest.xcodeproj/xcuserdata -Xcode/SDLTest/SDLTest.xcodeproj/project.xcworkspace -Xcode-iOS/SDL/SDL.xcodeproj/xcuserdata -Xcode-iOS/SDL/SDL.xcodeproj/project.xcworkspace -Xcode-iOS/Demos/Demos.xcodeproj/xcuserdata -Xcode-iOS/Demos/Demos.xcodeproj/project.xcworkspace +xcuserdata +*.xcworkspace # for Visual C++ Debug @@ -72,20 +65,26 @@ test/config.status test/Makefile test/SDL2.dll test/checkkeys +test/controllermap test/loopwave test/loopwavequeue test/testatomic +test/testaudiohotplug test/testaudioinfo test/testautomation test/testdraw2 +test/testdrawchessboard +test/testdropfile test/testerror test/testfile test/testgamecontroller test/testgesture test/testgl2 test/testgles +test/testgles2 test/testhaptic test/testhittesting +test/testhotplug test/testiconv test/testime test/testintersections @@ -115,8 +114,10 @@ test/teststreaming test/testthread test/testtimer test/testver +test/testviewport test/testwm2 test/torturethread +test/testdisplayinfo test/*.exe test/*.dSYM buildbot diff --git a/libs/SDL2/Android.mk b/libs/SDL2/Android.mk index 9d5b6e82..13d765f5 100644 --- a/libs/SDL2/Android.mk +++ b/libs/SDL2/Android.mk @@ -44,7 +44,7 @@ LOCAL_SRC_FILES := \ $(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \ $(wildcard $(LOCAL_PATH)/src/video/*.c) \ $(wildcard $(LOCAL_PATH)/src/video/android/*.c) \ - $(wildcard $(LOCAL_PATH)/src/test/*.c)) + $(wildcard $(LOCAL_PATH)/src/test/*.c)) LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid diff --git a/libs/SDL2/CMakeLists.txt b/libs/SDL2/CMakeLists.txt index 508cfafc..f1cf7aa9 100644 --- a/libs/SDL2/CMakeLists.txt +++ b/libs/SDL2/CMakeLists.txt @@ -118,9 +118,9 @@ else() endif() if (UNIX_OR_MAC_SYS AND NOT EMSCRIPTEN) # JavaScript does not yet have threading support, so disable pthreads when building for Emscripten. - set(PTHREADS_ENABLED_BY_DEFAULT ON) + set(SDL_PTHREADS_ENABLED_BY_DEFAULT ON) else() - set(PTHREADS_ENABLED_BY_DEFAULT OFF) + set(SDL_PTHREADS_ENABLED_BY_DEFAULT OFF) endif() # Default option knobs @@ -202,6 +202,7 @@ include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include) # All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so # you only need to have a platform override them if they are disabling. +set(OPT_DEF_ASM TRUE) if(EMSCRIPTEN) # Set up default values for the currently supported set of subsystems: # Emscripten/Javascript does not have assembly support, a dynamic library @@ -212,12 +213,16 @@ if(EMSCRIPTEN) set(SDL_THREADS_ENABLED_BY_DEFAULT OFF) set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF) set(SDL_CPUINFO_ENABLED_BY_DEFAULT OFF) - set(DLOPEN_ENABLED_BY_DEFAULT OFF) + set(SDL_DLOPEN_ENABLED_BY_DEFAULT OFF) +endif() + +if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT) + set(SDL_SHARED_ENABLED_BY_DEFAULT ON) endif() set(SDL_SUBSYSTEMS Atomic Audio Video Render Events Joystick Haptic Power Threads Timers - File Loadso CPUinfo Filesystem) + File Loadso CPUinfo Filesystem Dlopen) foreach(_SUB ${SDL_SUBSYSTEMS}) string(TOUPPER ${_SUB} _OPT) if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT) @@ -242,13 +247,13 @@ set_option(DUMMYAUDIO "Support the dummy audio driver" ON) set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF) dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF) set_option(FUSIONSOUND "Use FusionSound audio driver" OFF) -dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND_SHARED" OFF) +dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF) set_option(VIDEO_DUMMY "Use dummy video driver" ON) set_option(VIDEO_OPENGL "Include OpenGL support" ON) set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON) -set_option(PTHREADS "Use POSIX threads for multi-threading" ${PTHREADS_ENABLED_BY_DEFAULT}) +set_option(PTHREADS "Use POSIX threads for multi-threading" ${SDL_PTHREADS_ENABLED_BY_DEFAULT}) dep_option(PTHREADS_SEM "Use pthread semaphores" ON "PTHREADS" OFF) -set_option(SDL_DLOPEN "Use dlopen for shared object loading" ${DLOPEN_ENABLED_BY_DEFAULT}) +set_option(SDL_DLOPEN "Use dlopen for shared object loading" ${SDL_DLOPEN_ENABLED_BY_DEFAULT}) set_option(OSS "Support the OSS audio API" ${UNIX_SYS}) set_option(ALSA "Support the ALSA audio API" ${UNIX_SYS}) dep_option(ALSA_SHARED "Dynamically load ALSA audio support" ON "ALSA" OFF) @@ -266,7 +271,10 @@ set_option(CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" O set_option(INPUT_TSLIB "Use the Touchscreen library for input" ${UNIX_SYS}) set_option(VIDEO_X11 "Use X11 video driver" ${UNIX_SYS}) set_option(VIDEO_WAYLAND "Use Wayland video driver" ${UNIX_SYS}) +dep_option(WAYLAND_SHARED "Dynamically load Wayland support" ON "VIDEO_WAYLAND" OFF) +dep_option(VIDEO_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "VIDEO_WAYLAND" OFF) set_option(VIDEO_MIR "Use Mir video driver" ${UNIX_SYS}) +dep_option(MIR_SHARED "Dynamically load Mir support" ON "VIDEO_MIR" OFF) set_option(VIDEO_RPI "Use Raspberry Pi video driver" ${UNIX_SYS}) dep_option(X11_SHARED "Dynamically load X11 support" ON "VIDEO_X11" OFF) set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm) @@ -281,8 +289,8 @@ set_option(VIDEO_VIVANTE "Use Vivante EGL video driver" ${UNIX_SYS}) # TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here # The options below are for compatibility to configure's default behaviour. -set(SDL_SHARED ON CACHE BOOL "Build a shared version of the library") -set(SDL_STATIC OFF CACHE BOOL "Build a static version of the library") +set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library") +set(SDL_STATIC ON CACHE BOOL "Build a static version of the library") # General source files file(GLOB SOURCE_FILES @@ -585,7 +593,7 @@ if(LIBC) set(CMAKE_REQUIRED_LIBRARIES m) foreach(_FN atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin - sinf sqrt sqrtf tan tanf) + sinf sqrt sqrtf tan tanf acos asin) string(TOUPPER ${_FN} _UPPER) set(_HAVEVAR "HAVE_${_UPPER}") check_function_exists("${_FN}" ${_HAVEVAR}) @@ -597,6 +605,15 @@ if(LIBC) check_library_exists(iconv iconv_open "" HAVE_LIBICONV) if(HAVE_LIBICONV) list(APPEND EXTRA_LIBS iconv) + set(HAVE_ICONV 1) + endif() + + if(NOT APPLE) + check_include_file(alloca.h HAVE_ALLOCA_H) + check_function_exists(alloca HAVE_ALLOCA) + else() + set(HAVE_ALLOCA_H 1) + set(HAVE_ALLOCA 1) endif() check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION) @@ -883,31 +900,27 @@ elseif(WINDOWS) # Check for DirectX if(DIRECTX) - if("$ENV{DXSDK_DIR}" STREQUAL "") - message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set") + if(NOT CMAKE_COMPILER_IS_MINGW) + if("$ENV{DXSDK_DIR}" STREQUAL "") + message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set") + endif() + set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"") endif() - set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"") - - # xinput.h needs windows.h but doesn't include it itself. - check_c_source_compiles(" - #include - #include - int main(int argc, char **argv) { }" HAVE_XINPUT_H) - check_include_file(d3d9.h HAVE_D3D_H) check_include_file(d3d11_1.h HAVE_D3D11_H) check_include_file(ddraw.h HAVE_DDRAW_H) check_include_file(dsound.h HAVE_DSOUND_H) check_include_file(dinput.h HAVE_DINPUT_H) check_include_file(xaudio2.h HAVE_XAUDIO2_H) + check_include_file(xinput.h HAVE_XINPUT_H) check_include_file(dxgi.h HAVE_DXGI_H) if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H) set(HAVE_DIRECTX TRUE) + if(NOT CMAKE_COMPILER_IS_MINGW) # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks - set(SDL_LINK_DIR $ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}) - set(SDL_LINK_DIR ${SDL_LINK_DIR} PARENT_SCOPE) - link_directories(${SDL_LINK_DIR}) - include_directories($ENV{DXSDK_DIR}\\Include) + link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}) + include_directories($ENV{DXSDK_DIR}\\Include) + endif() endif() set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) endif() @@ -1011,7 +1024,12 @@ elseif(WINDOWS) set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) if(HAVE_DINPUT_H) set(SDL_JOYSTICK_DINPUT 1) - list(APPEND EXTRA_LIBS dinput8 dxguid dxerr) + list(APPEND EXTRA_LIBS dinput8 dxguid) + if(CMAKE_COMPILER_IS_MINGW) + list(APPEND EXTRA_LIBS dxerr8) + else() + list(APPEND EXTRA_LIBS dxerr) + endif() endif() if(HAVE_XINPUT_H) set(SDL_JOYSTICK_XINPUT 1) @@ -1022,14 +1040,19 @@ elseif(WINDOWS) set(HAVE_SDL_JOYSTICK TRUE) if(SDL_HAPTIC) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c) + if(HAVE_DINPUT_H OR HAVE_XINPUT_H) + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c) + if(HAVE_DINPUT_H) + set(SDL_HAPTIC_DINPUT 1) + endif() + if(HAVE_XINPUT_H) + set(SDL_HAPTIC_XINPUT 1) + endif() + else() + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) + set(SDL_HAPTIC_DUMMY 1) + endif() set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) - if(HAVE_DINPUT_H) - set(SDL_HAPTIC_DINPUT 1) - endif() - if(HAVE_XINPUT_H) - set(SDL_HAPTIC_XINPUT 1) - endif() set(HAVE_SDL_HAPTIC TRUE) endif() endif() @@ -1148,10 +1171,6 @@ elseif(APPLE) set(SDL_VIDEO_OPENGL 1) set(SDL_VIDEO_OPENGL_CGL 1) set(SDL_VIDEO_RENDER_OGL 1) - if(DARWIN) - find_library(OpenGL_LIBRARY OpenGL) - list(APPEND EXTRA_LIBRARIES ${OpenGL_LIBRARY}) - endif() set(HAVE_VIDEO_OPENGL TRUE) endif() endif() @@ -1356,7 +1375,6 @@ set(_INSTALL_LIBS "SDL2main") if(SDL_SHARED) add_library(SDL2 SHARED ${SOURCE_FILES}) - install(TARGETS SDL2 RUNTIME DESTINATION . LIBRARY DESTINATION .) if(UNIX) set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} @@ -1370,7 +1388,6 @@ if(SDL_SHARED) endif() set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC include) endif() if(SDL_STATIC) @@ -1389,14 +1406,10 @@ if(SDL_STATIC) endif() ##### Installation targets ##### - -if (MEGA) - return() -endif() - install(TARGETS ${_INSTALL_LIBS} LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}") + ARCHIVE DESTINATION "lib${LIB_SUFFIX}" + RUNTIME DESTINATION bin) file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) @@ -1424,10 +1437,6 @@ if(NOT WINDOWS OR CYGWIN) install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin) # TODO: what about the .spec file? Is it only needed for RPM creation? install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") -else() - if(SDL_SHARED) - install(TARGETS SDL2 RUNTIME DESTINATION bin) - endif() endif() ##### Uninstall target ##### diff --git a/libs/SDL2/CMakeLists.txt.orig b/libs/SDL2/CMakeLists.txt.orig deleted file mode 100644 index 7b93f47c..00000000 --- a/libs/SDL2/CMakeLists.txt.orig +++ /dev/null @@ -1,1256 +0,0 @@ -if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there") -endif() - -cmake_minimum_required(VERSION 2.6) -project(SDL2 C) -include(CheckFunctionExists) -include(CheckLibraryExists) -include(CheckIncludeFiles) -include(CheckIncludeFile) -include(CheckSymbolExists) -include(CheckCSourceRuns) -include(CheckCCompilerFlag) -include(CheckTypeSize) -include(CheckStructHasMember) -include(CMakeDependentOption) -include(FindPkgConfig) -set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") -include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) -include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) - -# General settings -# Edit include/SDL_version.h and change the version, then: -# SDL_MICRO_VERSION += 1; -# SDL_INTERFACE_AGE += 1; -# SDL_BINARY_AGE += 1; -# if any functions have been added, set SDL_INTERFACE_AGE to 0. -# if backwards compatibility has been broken, -# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0. -set(SDL_MAJOR_VERSION 2) -set(SDL_MINOR_VERSION 0) -set(SDL_MICRO_VERSION 1) -set(SDL_INTERFACE_AGE 0) -set(SDL_BINARY_AGE 1) -set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") - -# Calculate a libtool-like version number -math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}") -math(EXPR LT_AGE "${SDL_BINARY_AGE} - ${SDL_INTERFACE_AGE}") -set(LT_REVISION "${SDL_INTERFACE_AGE}") -set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}") -set(LT_VERSION "${LT_CURRENT}.${LT_REVISION}.${LT_AGE}") - -# General settings & flags -set(LIBRARY_OUTPUT_DIRECTORY "build") -# Check for 64 or 32 bit -set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P}) -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(ARCH_64 TRUE) - set(PROCESSOR_ARCH "x64") -else() - set(ARCH_64 FALSE) - set(PROCESSOR_ARCH "x86") -endif(CMAKE_SIZEOF_VOID_P EQUAL 8) -set(LIBNAME SDL2) -if(NOT LIBTYPE) - set(LIBTYPE SHARED) -endif(NOT LIBTYPE) - -# Get the platform -if(WIN32) - if(NOT WINDOWS) - set(WINDOWS TRUE) - endif(NOT WINDOWS) -elseif(UNIX AND NOT APPLE) - if(CMAKE_SYSTEM_NAME MATCHES ".*Linux") - set(LINUX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*") - set(FREEBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") - set(NETBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") - set(OPENBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*") - set(GNU TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") - set(BSDI TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") - set(FREEBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*") - set(SYSV5 TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*") - set(SOLARIS TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*") - set(HPUX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*") - set(AIX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*") - set(MINIX TRUE) - endif() -elseif(APPLE) - if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*") - set(DARWIN TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*") - set(MACOSX TRUE) - endif() - # TODO: iOS? -elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") - message_error("BeOS support has been removed as of SDL 2.0.2.") -elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*") - set(HAIKU TRUE) -endif() - -# Don't mistake osx for unix -if(UNIX AND NOT APPLE) - set(UNIX_SYS ON) -else() - set(UNIX_SYS OFF) -endif(UNIX AND NOT APPLE) - -if(UNIX OR APPLE) - set(UNIX_OR_MAC_SYS ON) -else() - set(UNIX_OR_MAC_SYS OFF) -endif(UNIX OR APPLE) - -# Default option knobs -if(APPLE OR ARCH_64) - set(OPT_DEF_SSEMATH ON) -endif() -if(UNIX OR MINGW OR MSYS) - set(OPT_DEF_LIBC ON) -endif(UNIX OR MINGW OR MSYS) - -# Compiler info -if(CMAKE_COMPILER_IS_GNUCC) - set(USE_GCC TRUE) - set(OPT_DEF_ASM TRUE) -elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(USE_CLANG TRUE) - set(OPT_DEF_ASM TRUE) -elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+ - set(OPT_DEF_ASM TRUE) - #set(CMAKE_C_FLAGS "/ZI /WX- / -else() - set(OPT_DEF_ASM FALSE) -endif(CMAKE_COMPILER_IS_GNUCC) - -# Default flags, if not set otherwise -if("$ENV{CFLAGS}" STREQUAL "") - if(USE_GCC OR USE_CLANG) - set(CMAKE_C_FLAGS "-g -O3") - endif(USE_GCC OR USE_CLANG) -else("$ENV{CFLAGS}" STREQUAL "") - set(CMAKE_C_FLAGS "$ENV{CFLAGS}") - list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}") -endif("$ENV{CFLAGS}" STREQUAL "") -if(NOT ("$ENV{CFLAGS}" STREQUAL "")) # Hackish, but does the trick on Win32 - list(APPEND EXTRA_LDFLAGS "$ENV{LDFLAGS}") -endif(NOT ("$ENV{CFLAGS}" STREQUAL "")) - -# Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config, -# etc. are created correctly. -set(SDL_LIBS "-lSDL2") -set(SDL_CFLAGS "") - -if(CYGWIN) - # We build SDL on cygwin without the UNIX emulation layer - include_directories("-I/usr/include/mingw") - set(CMAKE_REQUIRED_FLAGS "-mno-cygwin") - check_c_source_compiles("int main(int argc, char **argv) {}" - HAVE_GCC_NO_CYGWIN) - set(CMAKE_REQUIRED_FLAGS) - if(HAVE_GCC_NO_CYGWIN) - list(APPEND EXTRA_LDFLAGS "-mno-cygwin") - list(APPEND SDL_LIBS "-mno-cygwin") - endif(HAVE_GCC_NO_CYGWIN) - set(SDL_CFLAGS "${SDL_CFLAGS} -I/usr/include/mingw") -endif(CYGWIN) - -add_definitions(-DUSING_GENERATED_CONFIG_H) -# General includes -include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include) - -set(SDL_SUBSYSTEMS - Atomic Audio Video Render Events Joystick Haptic Power Threads Timers - File Loadso CPUinfo Filesystem) -foreach(_SUB ${SDL_SUBSYSTEMS}) - string(TOUPPER ${_SUB} _OPT) - option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON) -endforeach() - -option_string(ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto") -#set_option(DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON) -set_option(LIBC "Use the system C library" ${OPT_DEF_LIBC}) -set_option(GCC_ATOMICS "Use gcc builtin atomics" ${USE_GCC}) -set_option(ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM}) -set_option(SSEMATH "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH}) -set_option(MMX "Use MMX assembly routines" ${OPT_DEF_ASM}) -set_option(3DNOW "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM}) -set_option(SSE "Use SSE assembly routines" ${OPT_DEF_ASM}) -set_option(SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH}) -set_option(ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM}) -set_option(DISKAUDIO "Support the disk writer audio driver" ON) -set_option(DUMMYAUDIO "Support the dummy audio driver" ON) -set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF) -dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF) -set_option(FUSIONSOUND "Use FusionSound audio driver" OFF) -dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND_SHARED" OFF) -set_option(VIDEO_DUMMY "Use dummy video driver" ON) -set_option(VIDEO_OPENGL "Include OpenGL support" ON) -set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON) -set_option(PTHREADS "Use POSIX threads for multi-threading" ${UNIX_OR_MAC_SYS}) -dep_option(PTHREADS_SEM "Use pthread semaphores" ON "PTHREADS" OFF) -set_option(SDL_DLOPEN "Use dlopen for shared object loading" ON) -set_option(OSS "Support the OSS audio API" ${UNIX_SYS}) -set_option(ALSA "Support the ALSA audio API" ${UNIX_SYS}) -dep_option(ALSA_SHARED "Dynamically load ALSA audio support" ON "ALSA" OFF) -set_option(ESD "Support the Enlightened Sound Daemon" ${UNIX_SYS}) -dep_option(ESD_SHARED "Dynamically load ESD audio support" ON "ESD" OFF) -set_option(PULSEAUDIO "Use PulseAudio" ${UNIX_SYS}) -dep_option(PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "PULSEAUDIO" OFF) -set_option(ARTS "Support the Analog Real Time Synthesizer" ${UNIX_SYS}) -dep_option(ARTS_SHARED "Dynamically load aRts audio support" ON "ARTS" OFF) -set_option(NAS "Support the NAS audio API" ${UNIX_SYS}) -set_option(SNDIO "Support the sndio audio API" ${UNIX_SYS}) -set_option(RPATH "Use an rpath when linking SDL" ${UNIX_SYS}) -set_option(CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" OFF) -set_option(INPUT_TSLIB "Use the Touchscreen library for input" ${UNIX_SYS}) -set_option(VIDEO_X11 "Use X11 video driver" ${UNIX_SYS}) -dep_option(X11_SHARED "Dynamically load X11 support" ON "VIDEO_X11" OFF) -set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm) -foreach(_SUB ${SDL_X11_OPTIONS}) - string(TOUPPER "VIDEO_X11_${_SUB}" _OPT) - dep_option(${_OPT} "Enable ${_SUB} support" ON "VIDEO_X11" OFF) -endforeach() -set_option(VIDEO_COCOA "Use Cocoa video driver" ${APPLE}) -set_option(DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS}) -set_option(RENDER_D3D "Enable the Direct3D render driver" ${WINDOWS}) - -# TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here -# The options below are for compatibility to configure's default behaviour. -set(SDL_SHARED ON CACHE BOOL "Build a shared version of the library") -set(SDL_STATIC OFF CACHE BOOL "Build a static version of the library") - -# General source files -file(GLOB SOURCE_FILES - ${SDL2_SOURCE_DIR}/src/*.c - ${SDL2_SOURCE_DIR}/src/atomic/*.c - ${SDL2_SOURCE_DIR}/src/audio/*.c - ${SDL2_SOURCE_DIR}/src/cpuinfo/*.c - ${SDL2_SOURCE_DIR}/src/events/*.c - ${SDL2_SOURCE_DIR}/src/file/*.c - ${SDL2_SOURCE_DIR}/src/libm/*.c - ${SDL2_SOURCE_DIR}/src/render/*.c - ${SDL2_SOURCE_DIR}/src/render/*/*.c - ${SDL2_SOURCE_DIR}/src/stdlib/*.c - ${SDL2_SOURCE_DIR}/src/thread/*.c - ${SDL2_SOURCE_DIR}/src/timer/*.c - ${SDL2_SOURCE_DIR}/src/video/*.c) - - -if(ASSERTIONS STREQUAL "auto") - # Do nada - use optimization settings to determine the assertion level -elseif(ASSERTIONS STREQUAL "disabled") - set(SDL_DEFAULT_ASSERT_LEVEL 0) -elseif(ASSERTIONS STREQUAL "release") - set(SDL_DEFAULT_ASSERT_LEVEL 1) -elseif(ASSERTIONS STREQUAL "enabled") - set(SDL_DEFAULT_ASSERT_LEVEL 2) -elseif(ASSERTIONS STREQUAL "paranoid") - set(SDL_DEFAULT_ASSERT_LEVEL 3) -else() - message_error("unknown assertion level") -endif(ASSERTIONS STREQUAL "auto") -set(HAVE_ASSERTIONS ${ASSERTIONS}) - -# Compiler option evaluation -if(USE_GCC OR USE_CLANG) - if(DEPENDENCY_TRACKING) - check_c_source_compiles(" - #if !defined(__GNUC__) || __GNUC__ < 3 - #error Dependency tracking requires GCC 3.0 or newer - #endif - int main(int argc, char **argv) { }" HAVE_DEPENDENCY_TRACKING) - endif(DEPENDENCY_TRACKING) - - if(GCC_ATOMICS) - check_c_source_compiles("int main(int argc, char **argv) { - int a; - void *x, *y, *z; - __sync_lock_test_and_set(&a, 4); - __sync_lock_test_and_set(&x, y); - __sync_fetch_and_add(&a, 1); - __sync_bool_compare_and_swap(&a, 5, 10); - __sync_bool_compare_and_swap(&x, y, z); }" HAVE_GCC_ATOMICS) - if(NOT HAVE_GCC_ATOMICS) - check_c_source_compiles("int main(int argc, char **argv) { - int a; - __sync_lock_test_and_set(&a, 1); - __sync_lock_release(&a); }" HAVE_GCC_SYNC_LOCK_TEST_AND_SET) - endif(NOT HAVE_GCC_ATOMICS) - endif(GCC_ATOMICS) - - set(CMAKE_REQUIRED_FLAGS "-mpreferred-stack-boundary=2") - check_c_source_compiles("int x = 0; int main(int argc, char **argv) {}" - HAVE_GCC_PREFERRED_STACK_BOUNDARY) - set(CMAKE_REQUIRED_FLAGS) - - set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden -Werror") - check_c_source_compiles(" - #if !defined(__GNUC__) || __GNUC__ < 4 - #error SDL only uses visibility attributes in GCC 4 or newer - #endif - int main(int argc, char **argv) {}" HAVE_GCC_FVISIBILITY) - if(HAVE_GCC_FVISIBILITY) - list(APPEND EXTRA_CFLAGS "-fvisibility=hidden") - endif(HAVE_GCC_FVISIBILITY) - set(CMAKE_REQUIRED_FLAGS) - - check_c_compiler_flag(-Wall HAVE_GCC_WALL) - if(HAVE_GCC_WALL) - if(HAIKU) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar") - endif(HAIKU) - endif(HAVE_GCC_WALL) -endif(USE_GCC OR USE_CLANG) - -if(ASSEMBLY) - if(USE_GCC OR USE_CLANG) - set(SDL_ASSEMBLY_ROUTINES 1) - # TODO: Those all seem to be quite GCC specific - needs to be - # reworked for better compiler support - set(HAVE_ASSEMBLY TRUE) - if(MMX) - set(CMAKE_REQUIRED_FLAGS "-mmmx") - check_c_source_compiles(" - #ifdef __MINGW32__ - #include <_mingw.h> - #ifdef __MINGW64_VERSION_MAJOR - #include - #else - #include - #endif - #else - #include - #endif - #ifndef __MMX__ - #error Assembler CPP flag not enabled - #endif - int main(int argc, char **argv) { }" HAVE_MMX) - if(HAVE_MMX) - list(APPEND EXTRA_CFLAGS "-mmmx") - endif(HAVE_MMX) - set(CMAKE_REQUIRED_FLAGS) - endif(MMX) - - if(3DNOW) - set(CMAKE_REQUIRED_FLAGS "-m3dnow") - check_c_source_compiles(" - #include - #ifndef __3dNOW__ - #error Assembler CPP flag not enabled - #endif - int main(int argc, char **argv) { - void *p = 0; - _m_prefetch(p); - }" HAVE_3DNOW) - if(HAVE_3DNOW) - list(APPEND EXTRA_CFLAGS "-m3dnow") - endif(HAVE_3DNOW) - set(CMAKE_REQUIRED_FLAGS) - endif(3DNOW) - - if(SSE) - set(CMAKE_REQUIRED_FLAGS "-msse") - check_c_source_compiles(" - #ifdef __MINGW32__ - #include <_mingw.h> - #ifdef __MINGW64_VERSION_MAJOR - #include - #else - #include - #endif - #else - #include - #endif - #ifndef __SSE__ - #error Assembler CPP flag not enabled - #endif - int main(int argc, char **argv) { }" HAVE_SSE) - if(HAVE_SSE) - list(APPEND EXTRA_CFLAGS "-msse") - endif(HAVE_SSE) - set(CMAKE_REQUIRED_FLAGS) - endif(SSE) - - if(SSE2) - set(CMAKE_REQUIRED_FLAGS "-msse2") - check_c_source_compiles(" - #ifdef __MINGW32__ - #include <_mingw.h> - #ifdef __MINGW64_VERSION_MAJOR - #include - #else - #include - #endif - #else - #include - #endif - #ifndef __SSE2__ - #error Assembler CPP flag not enabled - #endif - int main(int argc, char **argv) { }" HAVE_SSE2) - if(HAVE_SSE2) - list(APPEND EXTRA_CFLAGS "-msse2") - endif(HAVE_SSE2) - set(CMAKE_REQUIRED_FLAGS) - endif(SSE2) - - if(SSEMATH) - if(SSE OR SSE2) - if(USE_GCC) - list(APPEND EXTRA_CFLAGS "-mfpmath=387") - endif(USE_GCC) - set(HAVE_SSEMATH TRUE) - endif(SSE OR SSE2) - endif(SSEMATH) - - if(ALTIVEC) - set(CMAKE_REQUIRED_FLAGS "-maltivec") - check_c_source_compiles(" - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - int main(int argc, char **argv) { }" HAVE_ALTIVEC_H_HDR) - check_c_source_compiles(" - vector unsigned int vzero() { - return vec_splat_u32(0); - } - int main(int argc, char **argv) { }" HAVE_ALTIVEC) - set(CMAKE_REQUIRED_FLAGS) - if(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR) - set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set - list(APPEND EXTRA_CFLAGS "-maltivec") - set(SDL_ALTIVEC_BLITTERS 1) - if(HAVE_ALTIVEC_H_HDR) - set(HAVE_ALTIVEC_H 1) - endif(HAVE_ALTIVEC_H_HDR) - endif(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR) - endif(ALTIVEC) - elseif(MSVC_VERSION GREATER 1500) - # TODO: SDL_cpuinfo.h needs to support the user's configuration wish - # for MSVC - right now it is always activated - if(NOT ARCH_64) - set(HAVE_MMX TRUE) - set(HAVE_3DNOW TRUE) - endif(NOT ARCH_64) - set(HAVE_SSE TRUE) - set(HAVE_SSE2 TRUE) - set(SDL_ASSEMBLY_ROUTINES 1) - endif(USE_GCC OR USE_CLANG) -# TODO: -#else(ASSEMBLY) -# if(USE_GCC OR USE_CLANG) -# list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx") -# endif(USE_GCC OR USE_CLANG) -endif(ASSEMBLY) - -# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define -# anything. -if(LIBC) - if(WINDOWS AND NOT MINGW) - set(HAVE_LIBC TRUE) - foreach(_HEADER stdio.h string.h ctype.h math.h) - string(TOUPPER "HAVE_${_HEADER}" _UPPER) - string(REPLACE "." "_" _HAVE_H ${_UPPER}) - set(${_HAVE_H} 1) - endforeach() - set(HAVE_SIGNAL_H 1) - foreach(_FN - malloc calloc realloc free qsort abs memset memcpy memmove memcmp - strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa - _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp - _stricmp _strnicmp sscanf atan atan2 ceil copysign cos cosf fabs - floor log pow scalbn sin sinf sqrt) - string(TOUPPER ${_FN} _UPPER) - set(HAVE_${_UPPER} 1) - endforeach() - if(NOT CYGWIN AND NOT MINGW) - set(HAVE_ALLOCA 1) - endif(NOT CYGWIN AND NOT MINGW) - set(HAVE_M_PI 1) - add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI - set(STDC_HEADERS 1) - else(WINDOWS AND NOT MINGW) - set(HAVE_LIBC TRUE) - check_include_file(sys/types.h HAVE_SYS_TYPES_H) - foreach(_HEADER - stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h - strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h) - string(TOUPPER "HAVE_${_HEADER}" _UPPER) - string(REPLACE "." "_" _HAVE_H ${_UPPER}) - check_include_file("${_HEADER}" ${_HAVE_H}) - endforeach() - - check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" STDC_HEADERS) - check_type_size("size_t" SIZEOF_SIZE_T) - check_symbol_exists(M_PI math.h HAVE_M_PI) - # TODO: refine the mprotect check - check_c_source_compiles("#include - #include - int main() { }" HAVE_MPROTECT) - foreach(_FN - strtod malloc calloc realloc free getenv setenv putenv unsetenv - qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat - strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa - _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull - atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp - sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp - nanosleep sysconf sysctlbyname - ) - string(TOUPPER ${_FN} _UPPER) - set(_HAVEVAR "HAVE_${_UPPER}") - check_function_exists("${_FN}" ${_HAVEVAR}) - endforeach() - - check_library_exists(m pow "" HAVE_LIBM) - if(HAVE_LIBM) - set(CMAKE_REQUIRED_LIBRARIES m) - foreach(_FN - atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin - sinf sqrt) - string(TOUPPER ${_FN} _UPPER) - set(_HAVEVAR "HAVE_${_UPPER}") - check_function_exists("${_FN}" ${_HAVEVAR}) - endforeach() - set(CMAKE_REQUIRED_LIBRARIES) - list(APPEND EXTRA_LIBS m) - endif(HAVE_LIBM) - - check_library_exists(iconv iconv_open "" HAVE_LIBICONV) - if(HAVE_LIBICONV) - list(APPEND EXTRA_LIBS iconv) - endif(HAVE_LIBICONV) - - check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION) - endif(WINDOWS AND NOT MINGW) -else(LIBC) - if(WINDOWS) - set(HAVE_STDARG_H 1) - set(HAVE_STDDEF_H 1) - endif(WINDOWS) -endif(LIBC) - - -# Enable/disable various subsystems of the SDL library -foreach(_SUB ${SDL_SUBSYSTEMS}) - string(TOUPPER ${_SUB} _OPT) - if(NOT SDL_${_OPT}) - set(SDL_${_OPT}_DISABLED 1) - endif(NOT SDL_${_OPT}) -endforeach() -if(SDL_JOYSTICK) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) -endif(SDL_JOYSTICK) -if(SDL_HAPTIC) - if(NOT SDL_JOYSTICK) - # Haptic requires some private functions from the joystick subsystem. - message_error("SDL_HAPTIC requires SDL_JOYSTICK, which is not enabled") - endif(NOT SDL_JOYSTICK) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) -endif(SDL_HAPTIC) -if(SDL_POWER) - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) -endif(SDL_POWER) -# TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird: -# if LOADSO is not wanted, SDL_LOADSO_DISABLED is set -# If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(), -# SDL_LOADSO_DISABLED will not be set, regardless of the LOADSO settings - -# General SDL subsystem options, valid for all platforms -if(SDL_AUDIO) - # CheckDummyAudio/CheckDiskAudio - valid for all platforms - if(DUMMYAUDIO) - set(SDL_AUDIO_DRIVER_DUMMY 1) - file(GLOB DUMMYAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${DUMMYAUDIO_SOURCES}) - set(HAVE_DUMMYAUDIO TRUE) - endif(DUMMYAUDIO) - if(DISKAUDIO) - set(SDL_AUDIO_DRIVER_DISK 1) - file(GLOB DISKAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/disk/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${DISKAUDIO_SOURCES}) - set(HAVE_DISKAUDIO TRUE) - endif(DISKAUDIO) -endif(SDL_AUDIO) - -if(SDL_DLOPEN) - # Relevant for Unix/Darwin only - if(UNIX OR APPLE) - CheckDLOPEN() - endif(UNIX OR APPLE) -endif(SDL_DLOPEN) - -if(SDL_VIDEO) - if(VIDEO_DUMMY) - set(SDL_VIDEO_DRIVER_DUMMY 1) - file(GLOB VIDEO_DUMMY_SOURCES ${SDL2_SOURCE_DIR}/src/video/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${VIDEO_DUMMY_SOURCES}) - set(HAVE_VIDEO_DUMMY TRUE) - set(HAVE_SDL_VIDEO TRUE) - endif(VIDEO_DUMMY) -endif(SDL_VIDEO) - -# Platform-specific options and settings -if(UNIX AND NOT APPLE) - if(SDL_AUDIO) - if(SYSV5 OR SOLARIS OR HPUX) - set(SDL_AUDIO_DRIVER_SUNAUDIO 1) - file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${SUN_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - elseif(NETBSD OR OPENBSD) - set(SDL_AUDIO_DRIVER_BSD 1) - file(GLOB BSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/bsd/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${BSD_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - elseif(AIX) - set(SDL_AUDIO_DRIVER_PAUDIO 1) - file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${AIX_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - endif() - CheckOSS() - CheckALSA() - CheckPulseAudio() - CheckESD() - CheckARTS() - CheckNAS() - CheckSNDIO() - CheckFusionSound() - endif(SDL_AUDIO) - - if(SDL_VIDEO) - CheckX11() - CheckDirectFB() - CheckOpenGLX11() - CheckOpenGLESX11() - endif(SDL_VIDEO) - - if(LINUX) - check_c_source_compiles(" - #include - #ifndef EVIOCGNAME - #error EVIOCGNAME() ioctl not available - #endif - int main(int argc, char** argv) {}" HAVE_INPUT_EVENTS) - - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/linux/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES}) - - if(HAVE_INPUT_EVENTS) - set(SDL_INPUT_LINUXEV 1) - endif(HAVE_INPUT_EVENTS) - - if(SDL_HAPTIC AND HAVE_INPUT_EVENTS) - set(SDL_HAPTIC_LINUX 1) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) - set(HAVE_SDL_HAPTIC TRUE) - endif(SDL_HAPTIC AND HAVE_INPUT_EVENTS) - - check_include_file("libudev.h" HAVE_LIBUDEV_H) - - # !!! FIXME: this needs pkg-config to find the include path, I think. - check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H) - endif(LINUX) - - if(INPUT_TSLIB) - check_c_source_compiles(" - #include \"tslib.h\" - int main(int argc, char** argv) { }" HAVE_INPUT_TSLIB) - if(HAVE_INPUT_TSLIB) - set(SDL_INPUT_TSLIB 1) - list(APPEND EXTRA_LIBS ts) - endif(HAVE_INPUT_TSLIB) - endif(INPUT_TSLIB) - - if(SDL_JOYSTICK) - CheckUSBHID() # seems to be BSD specific - limit the test to BSD only? - if(LINUX) - set(SDL_JOYSTICK_LINUX 1) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) - set(HAVE_SDL_JOYSTICK TRUE) - endif(LINUX) - endif(SDL_JOYSTICK) - - CheckPTHREAD() - - if(CLOCK_GETTIME) - check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME) - if(FOUND_CLOCK_GETTIME) - list(APPEND EXTRA_LIBS rt) - set(HAVE_CLOCK_GETTIME 1) - else(FOUND_CLOCK_GETTIME) - check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME) - if(FOUND_CLOCK_GETTIME) - set(HAVE_CLOCK_GETTIME 1) - endif(FOUND_CLOCK_GETTIME) - endif(HAVE_CLOCK_GETTIME) - endif(CLOCK_GETTIME) - - check_include_file(linux/version.h HAVE_LINUX_VERSION_H) - if(HAVE_LINUX_VERSION_H) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LINUX_VERSION_H") - endif(HAVE_LINUX_VERSION_H) - - if(SDL_POWER) - if(LINUX) - set(SDL_POWER_LINUX 1) - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/linux/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) - set(HAVE_SDL_POWER TRUE) - endif(LINUX) - endif(SDL_POWER) - - if(SDL_FILESYSTEM) - set(SDL_FILESYSTEM_UNIX 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/unix/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES}) - set(HAVE_SDL_FILESYSTEM TRUE) - endif(SDL_FILESYSTEM) - - if(SDL_TIMERS) - set(SDL_TIMER_UNIX 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) - set(HAVE_SDL_TIMERS TRUE) - endif(SDL_TIMERS) - - if(RPATH) - set(SDL_RLD_FLAGS "") - if(BSDI OR FREEBSD OR LINUX OR NETBSD) - set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}") - elseif(SOLARIS) - set(SDL_RLD_FLAGS "-R\${libdir}") - endif() - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - set(HAVE_RPATH TRUE) - endif(RPATH) - -elseif(WINDOWS) - find_program(WINDRES windres) - - check_c_source_compiles(" - #include - int main(int argc, char **argv) { }" HAVE_WIN32_CC) - - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES}) - - # Check for DirectX - if(DIRECTX) - if("$ENV{DXSDK_DIR}" STREQUAL "") - message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set") - endif("$ENV{DXSDK_DIR}" STREQUAL "") - set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"") - check_include_file(d3d9.h HAVE_D3D_H) - check_include_file(ddraw.h HAVE_DDRAW_H) - check_include_file(dsound.h HAVE_DSOUND_H) - check_include_file(dinput.h HAVE_DINPUT_H) - check_include_file(xaudio2.h HAVE_XAUDIO2_H) - if(HAVE_D3D_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H) - set(HAVE_DIRECTX TRUE) - # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks - set(SDL_LINK_DIR $ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}) - set(SDL_LINK_DIR ${SDL_LINK_DIR} PARENT_SCOPE) - link_directories(${SDL_LINK_DIR}) - include_directories($ENV{DXSDK_DIR}\\Include) - endif() - set(CMAKE_REQUIRED_FLAGS) - endif(DIRECTX) - - if(SDL_AUDIO) - set(SDL_AUDIO_DRIVER_WINMM 1) - file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${WINMM_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - - if(HAVE_DSOUND_H) - set(SDL_AUDIO_DRIVER_DSOUND 1) - file(GLOB DSOUND_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/directsound/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES}) - endif(HAVE_DSOUND_H) - - if(HAVE_XAUDIO2_H) - set(SDL_AUDIO_DRIVER_XAUDIO2 1) - file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES}) - endif(HAVE_XAUDIO2_H) - endif(SDL_AUDIO) - - if(SDL_VIDEO) - # requires SDL_LOADSO on Windows (IME, DX, etc.) - if(NOT SDL_LOADSO) - message_error("SDL_VIDEO requires SDL_LOADSO, which is not enabled") - endif(NOT SDL_LOADSO) - set(SDL_VIDEO_DRIVER_WINDOWS 1) - file(GLOB WIN_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/windows/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${WIN_VIDEO_SOURCES}) - - if(RENDER_D3D AND HAVE_D3D_H) - set(SDL_VIDEO_RENDER_D3D 1) - set(HAVE_RENDER_D3D TRUE) - endif(RENDER_D3D AND HAVE_D3D_H) - set(HAVE_SDL_VIDEO TRUE) - endif(SDL_VIDEO) - - if(SDL_THREADS) - set(SDL_THREAD_WINDOWS 1) - set(SOURCE_FILES ${SOURCE_FILES} - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syssem.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systhread.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c - ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c) - set(HAVE_SDL_THREADS TRUE) - endif(SDL_THREADS) - - if(SDL_POWER) - set(SDL_POWER_WINDOWS 1) - set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c) - set(HAVE_SDL_POWER TRUE) - endif(SDL_POWER) - - if(SDL_FILESYSTEM) - set(SDL_FILESYSTEM_WINDOWS 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesytem/windows/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES}) - set(HAVE_SDL_FILESYSTEM TRUE) - endif(SDL_FILESYSTEM) - - # Libraries for Win32 native and MinGW - list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid) - - # TODO: in configure.in the check for timers is set on - # cygwin | mingw32* - does this include mingw32CE? - if(SDL_TIMERS) - set(SDL_TIMER_WINDOWS 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/windows/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) - set(HAVE_SDL_TIMERS TRUE) - endif(SDL_TIMERS) - - if(SDL_LOADSO) - set(SDL_LOADSO_WINDOWS 1) - file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/windows/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES}) - set(HAVE_SDL_LOADSO TRUE) - endif(SDL_LOADSO) - - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES}) - - if(SDL_VIDEO) - if(VIDEO_OPENGL) - set(SDL_VIDEO_OPENGL 1) - set(SDL_VIDEO_OPENGL_WGL 1) - set(SDL_VIDEO_RENDER_OGL 1) - set(HAVE_VIDEO_OPENGL TRUE) - endif(VIDEO_OPENGL) - endif(SDL_VIDEO) - - if(SDL_JOYSTICK) - if(HAVE_DINPUT_H) - set(SDL_JOYSTICK_DINPUT 1) - set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_dxjoystick.c) - list(APPEND EXTRA_LIBS dinput8 dxguid dxerr) - else() - set(SDL_JOYSTICK_WINMM 1) - set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_mmjoystick.c) - endif(HAVE_DINPUT_H) - set(HAVE_SDL_JOYSTICK TRUE) - endif(SDL_JOYSTICK) - - if(SDL_HAPTIC AND HAVE_DINPUT_H) - set(SDL_HAPTIC_DINPUT 1) - set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/haptic/windows/SDL_syshaptic.c) - set(HAVE_SDL_HAPTIC TRUE) - endif(SDL_HAPTIC AND HAVE_DINPUT_H) - - file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc) - file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c) - if(MINGW OR CYGWIN) - list(APPEND EXTRA_LIBS mingw32) - list(APPEND EXTRA_LDFLAGS "-mwindows") - set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main") - list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows") - endif(MINGW OR CYGWIN) -elseif(APPLE) - # TODO: rework this for proper MacOS X, iOS and Darwin support - - # Requires the darwin file implementation - if(SDL_FILE) - file(GLOB EXTRA_SOURCES ${PROJECT_SOURCE_DIR}/src/file/cocoa/*.m) - set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES}) - set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C) - set(HAVE_SDL_FILE TRUE) - set(SDL_FRAMEWORK_COCOA 1) - else() - message_error("SDL_FILE must be enabled to build on MacOS X") - endif() - - if(SDL_AUDIO) - set(MACOSX_COREAUDIO 1) - file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - set(SDL_FRAMEWORK_COREAUDIO 1) - set(SDL_FRAMEWORK_AUDIOUNIT 1) - endif() - - if(SDL_JOYSTICK) - set(SDL_JOYSTICK_IOKIT 1) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) - set(HAVE_SDL_JOYSTICK TRUE) - set(SDL_FRAMEWORK_IOKIT 1) - set(SDL_FRAMEWORK_FF 1) - endif() - - if(SDL_HAPTIC) - set(SDL_HAPTIC_IOKIT 1) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) - set(HAVE_SDL_HAPTIC TRUE) - set(SDL_FRAMEWORK_IOKIT 1) - set(SDL_FRAMEWORK_FF 1) - if(NOT SDL_JOYSTICK) - message(FATAL_ERROR "SDL_HAPTIC requires SDL_JOYSTICK to be enabled") - endif() - endif() - - if(SDL_POWER) - set(SDL_POWER_MACOSX 1) - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) - set(HAVE_SDL_POWER TRUE) - set(SDL_FRAMEWORK_CARBON 1) - set(SDL_FRAMEWORK_IOKIT 1) - endif() - - if(SDL_FILESYSTEM) - set(SDL_FILESYSTEM_COCOA 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m) - set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES}) - set(HAVE_SDL_FILESYSTEM TRUE) - endif() - - # Actually load the frameworks at the end so we don't duplicate include. - if(SDL_FRAMEWORK_COCOA) - find_library(COCOA_LIBRARY Cocoa) - list(APPEND EXTRA_LIBS ${COCOA_LIBRARY}) - endif() - if(SDL_FRAMEWORK_IOKIT) - find_library(IOKIT IOKit) - list(APPEND EXTRA_LIBS ${IOKIT}) - endif() - if(SDL_FRAMEWORK_FF) - find_library(FORCEFEEDBACK ForceFeedback) - list(APPEND EXTRA_LIBS ${FORCEFEEDBACK}) - endif() - if(SDL_FRAMEWORK_CARBON) - find_library(CARBON_LIBRARY Carbon) - list(APPEND EXTRA_LIBS ${CARBON_LIBRARY}) - endif() - if(SDL_FRAMEWORK_COREAUDIO) - find_library(COREAUDIO CoreAudio) - list(APPEND EXTRA_LIBS ${COREAUDIO}) - endif() - if(SDL_FRAMEWORK_AUDIOUNIT) - find_library(AUDIOUNIT AudioUnit) - list(APPEND EXTRA_LIBS ${AUDIOUNIT}) - endif() - - # iOS hack needed - http://code.google.com/p/ios-cmake/ ? - if(SDL_VIDEO) - CheckCOCOA() - if(VIDEO_OPENGL) - set(SDL_VIDEO_OPENGL 1) - set(SDL_VIDEO_OPENGL_CGL 1) - set(SDL_VIDEO_RENDER_OGL 1) - if(DARWIN) - find_library(OpenGL_LIBRARY OpenGL) - list(APPEND EXTRA_LIBRARIES ${OpenGL_LIBRARY}) - endif(DARWIN) - set(HAVE_VIDEO_OPENGL TRUE) - endif(VIDEO_OPENGL) - endif(SDL_VIDEO) - - CheckPTHREAD() -elseif(HAIKU) - if(SDL_VIDEO) - set(SDL_VIDEO_DRIVER_HAIKU 1) - file(GLOB HAIKUVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/haiku/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${HAIKUVIDEO_SOURCES}) - set(HAVE_SDL_VIDEO TRUE) - - set(SDL_FILESYSTEM_HAIKU 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/haiku/*.cc) - set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES}) - set(HAVE_SDL_FILESYSTEM TRUE) - - if(VIDEO_OPENGL) - # TODO: Use FIND_PACKAGE(OpenGL) instead - set(SDL_VIDEO_OPENGL 1) - set(SDL_VIDEO_OPENGL_BGL 1) - set(SDL_VIDEO_RENDER_OGL 1) - list(APPEND EXTRA_LIBS GL) - set(HAVE_VIDEO_OPENGL TRUE) - endif(VIDEO_OPENGL) - endif(SDL_VIDEO) - - CheckPTHREAD() -endif() - -# Dummies -# configure.in does it differently: -# if not have X -# if enable_X { SDL_X_DISABLED = 1 } -# [add dummy sources] -# so it always adds a dummy, without checking, if it was actually requested. -# This leads to missing internal references on building, since the -# src/X/*.c does not get included. -if(NOT HAVE_SDL_JOYSTICK) - set(SDL_JOYSTICK_DISABLED 1) - if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX - - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) - endif() -endif(NOT HAVE_SDL_JOYSTICK) -if(NOT HAVE_SDL_HAPTIC) - set(SDL_HAPTIC_DISABLED 1) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) -endif(NOT HAVE_SDL_HAPTIC) -if(NOT HAVE_SDL_LOADSO) - set(SDL_LOADSO_DISABLED 1) - file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES}) -endif(NOT HAVE_SDL_LOADSO) -if(NOT HAVE_SDL_FILESYSTEM) - set(SDL_FILESYSTEM_DISABLED 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES}) -endif(NOT HAVE_SDL_FILESYSTEM) - -# We always need to have threads and timers around -if(NOT HAVE_SDL_THREADS) - set(SDL_THREADS_DISABLED 1) - file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${THREADS_SOURCES}) -endif(NOT HAVE_SDL_THREADS) -if(NOT HAVE_SDL_TIMERS) - set(SDL_TIMERS_DISABLED 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) -endif(NOT HAVE_SDL_TIMERS) - -if(NOT SDLMAIN_SOURCES) - file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c) -endif(NOT SDLMAIN_SOURCES) - -# Append the -MMD -MT flags -# if(DEPENDENCY_TRACKING) -# if(COMPILER_IS_GNUCC) -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MMD -MT \$@") -# endif(COMPILER_IS_GNUCC) -# endif(DEPENDENCY_TRACKING) - -configure_file("${SDL2_SOURCE_DIR}/include/SDL_config.h.cmake" - "${SDL2_BINARY_DIR}/include/SDL_config.h") - -# Prepare the flags and remove duplicates -if(EXTRA_LDFLAGS) - list(REMOVE_DUPLICATES EXTRA_LDFLAGS) -endif(EXTRA_LDFLAGS) -if(EXTRA_LIBS) - list(REMOVE_DUPLICATES EXTRA_LIBS) -endif(EXTRA_LIBS) -if(EXTRA_CFLAGS) - list(REMOVE_DUPLICATES EXTRA_CFLAGS) -endif(EXTRA_CFLAGS) -listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS) -set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) - -# Compat helpers for the configuration files -if(NOT WINDOWS OR CYGWIN) - # TODO: we need a Windows script, too - execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh) - - set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix "\${prefix}") - set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") - set(bindir "\${exec_prefix}/bin") - set(includedir "\${prefix}/include") - if(SDL_STATIC) - set(ENABLE_STATIC_TRUE "") - set(ENABLE_STATIC_FALSE "#") - else(SDL_STATIC) - set(ENABLE_STATIC_TRUE "#") - set(ENABLE_STATIC_FALSE "") - endif(SDL_STATIC) - if(SDL_SHARED) - set(ENABLE_SHARED_TRUE "") - set(ENABLE_SHARED_FALSE "#") - else(SDL_SHARED) - set(ENABLE_SHARED_TRUE "#") - set(ENABLE_SHARED_FALSE "") - endif(SDL_SHARED) - - # Clean up the different lists - listtostr(EXTRA_LIBS _EXTRA_LIBS "-l") - set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS}) - list(REMOVE_DUPLICATES SDL_STATIC_LIBS) - listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS) - set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS}) - listtostr(SDL_LIBS _SDL_LIBS) - set(SDL_LIBS ${_SDL_LIBS}) - - # MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}") - # MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}") - - configure_file("${SDL2_SOURCE_DIR}/sdl2.pc.in" - "${SDL2_BINARY_DIR}/sdl2.pc" @ONLY) - configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in" - "${SDL2_BINARY_DIR}/sdl2-config") - configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in" - "${SDL2_BINARY_DIR}/sdl2-config" @ONLY) - configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in" - "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY) -endif(NOT WINDOWS OR CYGWIN) - -##### Info output ##### -message(STATUS "") -message(STATUS "SDL2 was configured with the following options:") -message(STATUS "") -message(STATUS "Platform: ${CMAKE_SYSTEM}") -message(STATUS "64-bit: ${ARCH_64}") -message(STATUS "Compiler: ${CMAKE_C_COMPILER}") -message(STATUS "") -message(STATUS "Subsystems:") -foreach(_SUB ${SDL_SUBSYSTEMS}) - string(TOUPPER ${_SUB} _OPT) - message_bool_option(${_SUB} SDL_${_OPT}) -endforeach() -message(STATUS "") -message(STATUS "Options:") -list(SORT ALLOPTIONS) -foreach(_OPT ${ALLOPTIONS}) - # Longest option is VIDEO_X11_XSCREENSAVER = 22 characters - # Get the padding - string(LENGTH ${_OPT} _OPTLEN) - math(EXPR _PADLEN "23 - ${_OPTLEN}") - string(RANDOM LENGTH ${_PADLEN} ALPHABET " " _PADDING) - message_tested_option(${_OPT} ${_PADDING}) -endforeach() -message(STATUS "") -message(STATUS " CFLAGS: ${CMAKE_C_FLAGS}") -message(STATUS " EXTRA_CFLAGS: ${EXTRA_CFLAGS}") -message(STATUS " EXTRA_LDFLAGS: ${EXTRA_LDFLAGS}") -message(STATUS " EXTRA_LIBS: ${EXTRA_LIBS}") -message(STATUS "") -message(STATUS " Build Shared Library: ${SDL_SHARED}") -message(STATUS " Build Static Library: ${SDL_STATIC}") -message(STATUS "") -if(UNIX) - message(STATUS "Something was not detected, although your are sure that it") - message(STATUS "has been properly installed? Then make sure, you have set") - message(STATUS "the CFLAGS and LDFLAGS environment variables correctly.") - message(STATUS "") -endif(UNIX) - -# Ensure that the extra cflags are used at compile time -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - -# Always build SDLmain -add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -set(_INSTALL_LIBS "SDL2main") - -if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES}) - if(MEGA) - install(TARGETS SDL2 RUNTIME DESTINATION . LIBRARY DESTINATION .) - endif() - if(UNIX) - set_target_properties(SDL2 PROPERTIES - VERSION ${LT_VERSION} - SOVERSION ${LT_CURRENT} - OUTPUT_NAME "SDL2-${LT_RELEASE}") - else(UNIX) - set_target_properties(SDL2 PROPERTIES - VERSION ${SDL_VERSION} - SOVERSION ${LT_CURRENT} - OUTPUT_NAME "SDL2") - endif(UNIX) - set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) - target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC include) -endif(SDL_SHARED) - -if(SDL_STATIC) - add_library(SDL2-static STATIC ${SOURCE_FILES}) - set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") - # TODO: Win32 platforms keep the same suffix .lib for import and static - # libraries - do we need to consider this? - set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS}) - target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2-static PUBLIC include) -endif(SDL_STATIC) - -##### Installation targets ##### - -if (MEGA) - return() -endif() - -install(TARGETS ${_INSTALL_LIBS} - LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}") - -file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) -file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) -foreach(_FNAME ${BIN_INCLUDE_FILES}) - get_filename_component(_INCNAME ${_FNAME} NAME) - list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) -endforeach() -list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) -install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) - -if(SDL_SHARED) - install(CODE " - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - \"libSDL2-2.0.so\" \"libSDL2.so\")") - install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}") -endif(SDL_SHARED) - -if(NOT WINDOWS OR CYGWIN) - if(FREEBSD) - # FreeBSD uses ${PREFIX}/libdata/pkgconfig - install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig") - else(FREEBSD) - install(FILES ${SDL2_BINARY_DIR}/sdl2.pc - DESTINATION "lib${LIB_SUFFIX}/pkgconfig") - endif(FREEBSD) - install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin) - # TODO: what about the .spec file? Is it only needed for RPM creation? - install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") -endif(NOT WINDOWS OR CYGWIN) diff --git a/libs/SDL2/COPYING.txt b/libs/SDL2/COPYING.txt index e0d7cc43..5873af74 100644 --- a/libs/SDL2/COPYING.txt +++ b/libs/SDL2/COPYING.txt @@ -1,6 +1,6 @@ Simple DirectMedia Layer -Copyright (C) 1997-2014 Sam Lantinga +Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/Makefile.in b/libs/SDL2/Makefile.in index 62b9269e..b66e0f5e 100644 --- a/libs/SDL2/Makefile.in +++ b/libs/SDL2/Makefile.in @@ -39,7 +39,7 @@ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ SDLTEST_TARGET = libSDL2_test.a SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ -SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS +SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS GEN_DIST = SDL2.spec ifneq ($V,1) @@ -176,6 +176,8 @@ install-data: $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2 + $(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-bin: @@ -194,6 +196,7 @@ uninstall-lib: uninstall-data: rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4 rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc + rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake clean: rm -rf $(objects) diff --git a/libs/SDL2/SDL2.spec.in b/libs/SDL2/SDL2.spec.in index 628a9a0c..dba24003 100644 --- a/libs/SDL2/SDL2.spec.in +++ b/libs/SDL2/SDL2.spec.in @@ -68,7 +68,7 @@ rm -rf $RPM_BUILD_ROOT %files devel %{__defattr} -%doc README*.txt COPYING.txt CREDITS.txt BUGS.txt WhatsNew.txt +%doc docs/README*.md %{_bindir}/*-config %{_libdir}/lib*.a %{_libdir}/lib*.la @@ -78,6 +78,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/aclocal/* %changelog +* Thu Jun 04 2015 Ryan C. Gordon +- Fixed README paths. + * Sun Dec 07 2014 Simone Contini - Fixed changelog date issue and docs filenames diff --git a/libs/SDL2/VisualC/SDL.sln b/libs/SDL2/VisualC/SDL.sln new file mode 100644 index 00000000..5fc83458 --- /dev/null +++ b/libs/SDL2/VisualC/SDL.sln @@ -0,0 +1,269 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic.vcxproj", "{66B32F7E-5716-48D0-B5B9-D832FD052DD5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation.vcxproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture.vcxproj", "{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08304}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2.vcxproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget.vcxproj", "{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrumble", "tests\testrumble\testrumble.vcxproj", "{BFF40245-E9A6-4297-A425-A554E5D767E8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale.vcxproj", "{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape.vcxproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2.vcxproj", "{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\controllermap\controllermap.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08306}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.ActiveCfg = Debug|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.Build.0 = Debug|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.ActiveCfg = Debug|x64 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.Build.0 = Debug|x64 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.ActiveCfg = Release|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.Build.0 = Release|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.ActiveCfg = Release|x64 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.Build.0 = Release|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.ActiveCfg = Debug|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.Build.0 = Debug|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.ActiveCfg = Debug|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.Build.0 = Debug|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.ActiveCfg = Release|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.Build.0 = Release|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.Build.0 = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.Build.0 = Debug|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|x64 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.Build.0 = Debug|x64 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.ActiveCfg = Release|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.Build.0 = Release|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|x64 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.Build.0 = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.Build.0 = Release|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.Build.0 = Debug|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.ActiveCfg = Release|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.Build.0 = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.ActiveCfg = Debug|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.Build.0 = Debug|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.ActiveCfg = Debug|x64 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.Build.0 = Debug|x64 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.ActiveCfg = Release|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.Build.0 = Release|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.ActiveCfg = Release|x64 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.Build.0 = Release|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.ActiveCfg = Debug|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.Build.0 = Debug|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.ActiveCfg = Debug|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.Build.0 = Debug|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.ActiveCfg = Release|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.Build.0 = Release|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.ActiveCfg = Release|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.Build.0 = Release|x64 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.ActiveCfg = Debug|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.Build.0 = Debug|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.ActiveCfg = Debug|x64 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.Build.0 = Debug|x64 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.ActiveCfg = Release|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.Build.0 = Release|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.ActiveCfg = Release|x64 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.Build.0 = Release|x64 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.ActiveCfg = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.Build.0 = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|x64 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.Build.0 = Debug|x64 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.Build.0 = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|x64 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.Build.0 = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|x64.Build.0 = Release|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|Win32.ActiveCfg = Debug|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|Win32.Build.0 = Debug|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|x64.ActiveCfg = Debug|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|x64.Build.0 = Debug|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.ActiveCfg = Release|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.Build.0 = Release|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.ActiveCfg = Release|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {26828762-C95D-4637-9CB1-7F0979523813} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {55812185-D13C-4022-9C81-32E0F4A08304} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {26932B24-EFC6-4E3A-B277-ED653DA37968} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {BFF40245-E9A6-4297-A425-A554E5D767E8} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + EndGlobalSection +EndGlobal diff --git a/libs/SDL2/VisualC/SDL/SDL_VS2010.vcxproj b/libs/SDL2/VisualC/SDL/SDL.vcxproj similarity index 87% rename from libs/SDL2/VisualC/SDL/SDL_VS2010.vcxproj rename to libs/SDL2/VisualC/SDL/SDL.vcxproj index ec073402..ce58f114 100644 --- a/libs/SDL2/VisualC/SDL/SDL_VS2010.vcxproj +++ b/libs/SDL2/VisualC/SDL/SDL.vcxproj @@ -1,517 +1,511 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - SDL - - - - DynamicLibrary - false - - - DynamicLibrary - false - - - DynamicLibrary - false - - - DynamicLibrary - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - false - - - Level3 - true - EditAndContinue - Default - false - StreamingSIMDExtensions - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - true - Windows - false - $(DXSDK_DIR)\lib\x86 - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - false - - - Level3 - ProgramDatabase - false - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - true - Windows - false - $(DXSDK_DIR)\lib\x64 - false - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - false - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - false - true - - - Level3 - true - Default - false - ProgramDatabase - StreamingSIMDExtensions - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x86 - true - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - - - OnlyExplicitInline - false - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - false - true - - - Level3 - false - ProgramDatabase - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x64 - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + SDL + + + + DynamicLibrary + + + DynamicLibrary + + + DynamicLibrary + + + DynamicLibrary + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/SDL.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + OldStyle + true + OnlyExplicitInline + + + _DEBUG;%(PreprocessorDefinitions) + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/SDL.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + OldStyle + true + OnlyExplicitInline + + + _DEBUG;%(PreprocessorDefinitions) + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/SDL.tlb + + + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + ProgramDatabase + true + OnlyExplicitInline + + + NDEBUG;%(PreprocessorDefinitions) + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + true + true + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Release/SDL.tlb + + + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + ProgramDatabase + true + OnlyExplicitInline + + + NDEBUG;%(PreprocessorDefinitions) + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/SDL2/VisualC/SDL/SDL.vcxproj.filters b/libs/SDL2/VisualC/SDL/SDL.vcxproj.filters new file mode 100644 index 00000000..a2ba2cb5 --- /dev/null +++ b/libs/SDL2/VisualC/SDL/SDL.vcxproj.filters @@ -0,0 +1,444 @@ + + + + + {395b3af0-33d0-411b-b153-de1676bf1ef8} + + + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + API Headers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/SDL2/VisualC/SDL/SDL_VS2008.vcproj b/libs/SDL2/VisualC/SDL/SDL_VS2008.vcproj index bf33777c..3d3d3996 100644 --- a/libs/SDL2/VisualC/SDL/SDL_VS2008.vcproj +++ b/libs/SDL2/VisualC/SDL/SDL_VS2008.vcproj @@ -20,7 +20,7 @@ - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - SDL - - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - false - - - Level3 - true - EditAndContinue - Default - false - StreamingSIMDExtensions - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - true - Windows - false - $(DXSDK_DIR)\lib\x86 - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - false - - - Level3 - ProgramDatabase - false - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - true - Windows - false - $(DXSDK_DIR)\lib\x64 - false - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - false - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - false - true - - - Level3 - true - Default - false - ProgramDatabase - StreamingSIMDExtensions - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x86 - true - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - - - OnlyExplicitInline - false - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - false - true - - - Level3 - false - ProgramDatabase - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x64 - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/SDL/SDL_VS2013.vcxproj b/libs/SDL2/VisualC/SDL/SDL_VS2013.vcxproj deleted file mode 100644 index 89dbc00a..00000000 --- a/libs/SDL2/VisualC/SDL/SDL_VS2013.vcxproj +++ /dev/null @@ -1,521 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - SDL - - - - DynamicLibrary - false - v120 - - - DynamicLibrary - false - v120 - - - DynamicLibrary - false - v120 - - - DynamicLibrary - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - false - - - Level3 - true - EditAndContinue - Default - false - StreamingSIMDExtensions - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - true - Windows - false - $(DXSDK_DIR)\lib\x86 - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - false - - - Level3 - ProgramDatabase - false - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - true - Windows - false - $(DXSDK_DIR)\lib\x64 - false - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - false - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - false - true - - - Level3 - true - Default - false - ProgramDatabase - StreamingSIMDExtensions - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x86 - true - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - - - OnlyExplicitInline - false - ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - false - true - - - Level3 - false - ProgramDatabase - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x64 - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/SDL_VS2008.sln b/libs/SDL2/VisualC/SDL_VS2008.sln index 009df2c7..5398bfb2 100644 --- a/libs/SDL2/VisualC/SDL_VS2008.sln +++ b/libs/SDL2/VisualC/SDL_VS2008.sln @@ -4,8 +4,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2008.vcpr EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2008.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2008.vcproj", "{26828762-C95D-4637-9CB1-7F0979523813}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2008.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" @@ -42,6 +40,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2008.vcproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08305}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2_VS2008.vcproj", "{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\controllermap\controllermap_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08306}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -68,88 +74,140 @@ Global {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64 {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64 {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.ActiveCfg = Debug|Win32 {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.Build.0 = Debug|Win32 - {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.ActiveCfg = Debug|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.ActiveCfg = Debug|x64 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.Build.0 = Debug|x64 {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.ActiveCfg = Release|Win32 {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.Build.0 = Release|Win32 - {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.ActiveCfg = Release|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.ActiveCfg = Release|x64 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.Build.0 = Release|x64 {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.ActiveCfg = Debug|Win32 {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.Build.0 = Debug|Win32 - {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.ActiveCfg = Debug|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.ActiveCfg = Debug|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.Build.0 = Debug|x64 {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.ActiveCfg = Release|Win32 {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.Build.0 = Release|Win32 - {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.Build.0 = Release|x64 {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64 {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64 {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.ActiveCfg = Debug|Win32 {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.Build.0 = Debug|Win32 - {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|x64 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.Build.0 = Debug|x64 {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.ActiveCfg = Release|Win32 {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.Build.0 = Release|Win32 - {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|x64 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.Build.0 = Release|x64 {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.Build.0 = Release|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.Build.0 = Debug|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.ActiveCfg = Release|x64 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.Build.0 = Release|x64 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64 {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64 {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.ActiveCfg = Debug|Win32 {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.Build.0 = Debug|Win32 - {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.ActiveCfg = Debug|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.ActiveCfg = Debug|x64 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.Build.0 = Debug|x64 {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.ActiveCfg = Release|Win32 {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.Build.0 = Release|Win32 - {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.ActiveCfg = Release|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.ActiveCfg = Release|x64 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.Build.0 = Release|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.ActiveCfg = Debug|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.Build.0 = Debug|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.ActiveCfg = Debug|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.Build.0 = Debug|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.ActiveCfg = Release|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.Build.0 = Release|Win32 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.ActiveCfg = Release|x64 + {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.Build.0 = Release|x64 {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.ActiveCfg = Debug|Win32 {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.Build.0 = Debug|Win32 - {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.ActiveCfg = Debug|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.ActiveCfg = Debug|x64 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.Build.0 = Debug|x64 {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.ActiveCfg = Release|Win32 {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.Build.0 = Release|Win32 - {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.ActiveCfg = Release|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.ActiveCfg = Release|x64 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.Build.0 = Release|x64 {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.ActiveCfg = Debug|Win32 {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.Build.0 = Debug|Win32 - {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|x64 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.Build.0 = Debug|x64 {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.ActiveCfg = Release|Win32 {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.Build.0 = Release|Win32 - {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|x64 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.Build.0 = Release|x64 {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64 {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 @@ -158,45 +216,54 @@ Global {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|Win32 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|Win32 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.ActiveCfg = Release|Win32 - {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.Build.0 = Debug|Win32 - {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.ActiveCfg = Debug|Win32 - {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.ActiveCfg = Release|Win32 - {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.Build.0 = Release|Win32 - {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08305}.Release|x64.Build.0 = Release|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|Win32.ActiveCfg = Debug|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|Win32.Build.0 = Debug|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|x64.ActiveCfg = Debug|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|x64.Build.0 = Debug|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.ActiveCfg = Release|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.Build.0 = Release|Win32 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.ActiveCfg = Release|x64 + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08304} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {BFF40245-E9A6-4297-A425-A554E5D767E8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {55812185-D13C-4022-9C81-32E0F4A08304} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {26932B24-EFC6-4E3A-B277-ED653DA37968} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {BFF40245-E9A6-4297-A425-A554E5D767E8} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} + {26828762-C95D-4637-9CB1-7F0979523813} = {D69D5741-611F-4E14-8541-1FEE94F50B5A} EndGlobalSection EndGlobal diff --git a/libs/SDL2/VisualC/SDL_VS2010.sln b/libs/SDL2/VisualC/SDL_VS2010.sln deleted file mode 100644 index 9ae8f44f..00000000 --- a/libs/SDL2/VisualC/SDL_VS2010.sln +++ /dev/null @@ -1,416 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2010.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2010.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2010.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2010.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2010.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2010.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2010.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2010.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2010.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2010.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2010.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2010.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2010.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2010.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2010.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2010.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08AAD}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_static|Win32 = Debug_static|Win32 - Debug_static|x64 = Debug_static|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release_static|Win32 = Release_static|Win32 - Release_static|x64 = Release_static|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|Win32.ActiveCfg = Debug_static|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|Win32.Build.0 = Debug_static|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|x64.ActiveCfg = Debug_static|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|x64.Build.0 = Debug_static|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|Win32.ActiveCfg = Release_static|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|Win32.Build.0 = Release_static|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|x64.ActiveCfg = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|x64.Build.0 = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|Win32.Build.0 = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|x64.ActiveCfg = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|x64.Build.0 = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|Win32.Build.0 = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|x64.ActiveCfg = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|x64.Build.0 = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|Win32.Build.0 = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|x64.ActiveCfg = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|x64.Build.0 = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|Win32.ActiveCfg = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|x64.ActiveCfg = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|x64.Build.0 = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|Win32.Build.0 = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|x64.ActiveCfg = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|x64.Build.0 = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|Win32.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|x64.ActiveCfg = Release|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|x64.Build.0 = Release|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|Win32.Build.0 = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|x64.ActiveCfg = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|x64.Build.0 = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|Win32.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|x64.ActiveCfg = Release|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|x64.Build.0 = Release|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|Win32.Build.0 = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|x64.ActiveCfg = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|x64.Build.0 = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|Win32.ActiveCfg = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|Win32.Build.0 = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|x64.ActiveCfg = Release|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|x64.Build.0 = Release|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|Win32.Build.0 = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|x64.ActiveCfg = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|x64.Build.0 = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release_static|Win32.ActiveCfg = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release_static|Win32.Build.0 = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release_static|x64.ActiveCfg = Release|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release_static|x64.Build.0 = Release|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|Win32.Build.0 = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|x64.ActiveCfg = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|x64.Build.0 = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|Win32.ActiveCfg = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|Win32.Build.0 = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|x64.ActiveCfg = Release|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|x64.Build.0 = Release|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|Win32.Build.0 = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|x64.ActiveCfg = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|x64.Build.0 = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|Win32.ActiveCfg = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|Win32.Build.0 = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|x64.ActiveCfg = Release|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|x64.Build.0 = Release|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.Build.0 = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.Build.0 = Release|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|Win32.Build.0 = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|x64.ActiveCfg = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|x64.Build.0 = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|Win32.ActiveCfg = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|Win32.Build.0 = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|x64.ActiveCfg = Release|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|x64.Build.0 = Release|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|Win32.Build.0 = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|x64.ActiveCfg = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|x64.Build.0 = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|Win32.ActiveCfg = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|Win32.Build.0 = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|x64.ActiveCfg = Release|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|x64.Build.0 = Release|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|Win32.Build.0 = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|x64.ActiveCfg = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|x64.Build.0 = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|Win32.Build.0 = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|x64.ActiveCfg = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|x64.Build.0 = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|Win32.Build.0 = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|x64.ActiveCfg = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|x64.Build.0 = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|Win32.ActiveCfg = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|Win32.Build.0 = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|x64.ActiveCfg = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|x64.Build.0 = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug_static|Win32.Build.0 = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug_static|x64.ActiveCfg = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release_static|Win32.ActiveCfg = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release_static|Win32.Build.0 = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release_static|x64.ActiveCfg = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|Win32.Build.0 = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|x64.ActiveCfg = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|x64.Build.0 = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|Win32.ActiveCfg = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|Win32.Build.0 = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|x64.ActiveCfg = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|x64.Build.0 = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|Win32.Build.0 = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|x64.ActiveCfg = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|x64.Build.0 = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|Win32.ActiveCfg = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|Win32.Build.0 = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|x64.ActiveCfg = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|x64.Build.0 = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08AAD} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - EndGlobalSection -EndGlobal diff --git a/libs/SDL2/VisualC/SDL_VS2012.sln b/libs/SDL2/VisualC/SDL_VS2012.sln deleted file mode 100644 index cdf6bafc..00000000 --- a/libs/SDL2/VisualC/SDL_VS2012.sln +++ /dev/null @@ -1,313 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2012.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2012.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2012.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2012.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2012.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2012.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2012.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2012.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2012.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2012.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2012.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2012.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2012.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2012.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2012.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "visualtest", "visualtest\visualtest_VS2012.vcxproj", "{13DDF23A-4A8F-4AF9-9734-CC09D9157924}" - ProjectSection(ProjectDependencies) = postProject - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8} = {1D12C737-7C71-45CE-AE2C-AAB47B690BC8} - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {40FB7794-D3C3-4CFE-BCF4-A80C96635682} - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "visualtest", "visualtest", "{68C17E4D-1073-48DB-A96C-C36FE8705F1B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testquit", "visualtest\unittest\testquit\testquit_VS2012.vcxproj", "{1D12C737-7C71-45CE-AE2C-AAB47B690BC8}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.Build.0 = Debug|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.Build.0 = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Debug|Win32.ActiveCfg = Debug|Win32 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Debug|Win32.Build.0 = Debug|Win32 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Debug|x64.ActiveCfg = Debug|x64 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Debug|x64.Build.0 = Debug|x64 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Release|Win32.ActiveCfg = Release|Win32 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Release|Win32.Build.0 = Release|Win32 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Release|x64.ActiveCfg = Release|x64 - {13DDF23A-4A8F-4AF9-9734-CC09D9157924}.Release|x64.Build.0 = Release|x64 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Debug|Win32.ActiveCfg = Debug|Win32 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Debug|Win32.Build.0 = Debug|Win32 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Debug|x64.ActiveCfg = Debug|x64 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Debug|x64.Build.0 = Debug|x64 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Release|Win32.ActiveCfg = Release|Win32 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Release|Win32.Build.0 = Release|Win32 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Release|x64.ActiveCfg = Release|x64 - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {13DDF23A-4A8F-4AF9-9734-CC09D9157924} = {68C17E4D-1073-48DB-A96C-C36FE8705F1B} - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8} = {68C17E4D-1073-48DB-A96C-C36FE8705F1B} - EndGlobalSection -EndGlobal diff --git a/libs/SDL2/VisualC/SDL_VS2013.sln b/libs/SDL2/VisualC/SDL_VS2013.sln deleted file mode 100644 index 0804b5e2..00000000 --- a/libs/SDL2/VisualC/SDL_VS2013.sln +++ /dev/null @@ -1,338 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2013.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2013.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2013.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2013.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2013.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2013.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2013.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2013.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2013.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2013.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2013.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2013.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2013.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2013.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2013.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2013.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2013.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2013.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2013.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2_VS2013.vcxproj", "{E5287C64-0646-4BFA-A772-1DB5A649F35E}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2013.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08AAD}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrumble", "tests\testrumble\testrumble_VS2013.vcxproj", "{91B7737A-2A78-4020-820E-81A679DBEC72}" - ProjectSection(ProjectDependencies) = postProject - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64 - {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Deploy.0 = Debug|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.Build.0 = Release|Win32 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|x64 - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.Build.0 = Release|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.Build.0 = Debug|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|x64 - {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.Build.0 = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 - {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Debug|Win32.ActiveCfg = Debug|Win32 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Debug|Win32.Build.0 = Debug|Win32 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Debug|x64.ActiveCfg = Debug|x64 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Debug|x64.Build.0 = Debug|x64 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Release|Win32.ActiveCfg = Release|Win32 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Release|Win32.Build.0 = Release|Win32 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Release|x64.ActiveCfg = Release|x64 - {E5287C64-0646-4BFA-A772-1DB5A649F35E}.Release|x64.Build.0 = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.ActiveCfg = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.Build.0 = Debug|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.ActiveCfg = Release|x64 - {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.Build.0 = Release|x64 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Debug|Win32.ActiveCfg = Debug|Win32 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Debug|Win32.Build.0 = Debug|Win32 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Debug|x64.ActiveCfg = Debug|x64 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Debug|x64.Build.0 = Debug|x64 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Release|Win32.ActiveCfg = Release|Win32 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Release|Win32.Build.0 = Release|Win32 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Release|x64.ActiveCfg = Release|x64 - {91B7737A-2A78-4020-820E-81A679DBEC72}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {E5287C64-0646-4BFA-A772-1DB5A649F35E} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {55812185-D13C-4022-9C81-32E0F4A08AAD} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {91B7737A-2A78-4020-820E-81A679DBEC72} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - EndGlobalSection -EndGlobal diff --git a/libs/SDL2/VisualC/SDLmain/SDLmain_VS2010.vcxproj b/libs/SDL2/VisualC/SDLmain/SDLmain.vcxproj similarity index 65% rename from libs/SDL2/VisualC/SDLmain/SDLmain_VS2010.vcxproj rename to libs/SDL2/VisualC/SDLmain/SDLmain.vcxproj index 711f08ac..0a994af3 100644 --- a/libs/SDL2/VisualC/SDLmain/SDLmain_VS2010.vcxproj +++ b/libs/SDL2/VisualC/SDLmain/SDLmain.vcxproj @@ -1,168 +1,158 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2main - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - - - - StaticLibrary - false - - - StaticLibrary - false - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - - - - - \ No newline at end of file + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2main + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + SDLmain + + + + StaticLibrary + + + StaticLibrary + + + StaticLibrary + + + StaticLibrary + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + + + + + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + OldStyle + true + + + + + X64 + + + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + OldStyle + true + + + + + + + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + OldStyle + true + + + + + X64 + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + false + StreamingSIMDExtensions + Level3 + OldStyle + true + + + + + + + + + diff --git a/libs/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj b/libs/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj index 33c24171..65dd31d3 100644 --- a/libs/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj +++ b/libs/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj @@ -20,7 +20,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2main - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - MultiByte - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/SDLmain/SDLmain_VS2013.vcxproj b/libs/SDL2/VisualC/SDLmain/SDLmain_VS2013.vcxproj deleted file mode 100644 index 3b90f23f..00000000 --- a/libs/SDL2/VisualC/SDLmain/SDLmain_VS2013.vcxproj +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2main - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/SDLtest/SDLtest_VS2010.vcxproj b/libs/SDL2/VisualC/SDLtest/SDLtest.vcxproj similarity index 67% rename from libs/SDL2/VisualC/SDLtest/SDLtest_VS2010.vcxproj rename to libs/SDL2/VisualC/SDLtest/SDLtest.vcxproj index 9433ff88..db92a49c 100644 --- a/libs/SDL2/VisualC/SDLtest/SDLtest_VS2010.vcxproj +++ b/libs/SDL2/VisualC/SDLtest/SDLtest.vcxproj @@ -21,24 +21,20 @@ SDL2test {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + SDLtest StaticLibrary - false StaticLibrary - false StaticLibrary - false - MultiByte StaticLibrary - false @@ -61,81 +57,80 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + - + + + + - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true MultiThreadedDLL - true - - + false + StreamingSIMDExtensions Level3 - true - Default OldStyle - false true - - true - X64 - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true MultiThreadedDLL - true - - + false + StreamingSIMDExtensions Level3 - true - Default OldStyle - false true - - true - - + + + + Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL + false + StreamingSIMDExtensions Level3 - true OldStyle - Default - false true - - true - @@ -143,52 +138,33 @@ Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL + false + StreamingSIMDExtensions Level3 - true OldStyle - Default - false true - - true - - - - - - - - - - - - - - - + - - - - + + + diff --git a/libs/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj b/libs/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj index ccaabe2d..8a22d0fc 100644 --- a/libs/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj +++ b/libs/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj @@ -20,7 +20,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2test - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - MultiByte - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/SDLtest/SDLtest_VS2013.vcxproj b/libs/SDL2/VisualC/SDLtest/SDLtest_VS2013.vcxproj deleted file mode 100644 index a515ab08..00000000 --- a/libs/SDL2/VisualC/SDLtest/SDLtest_VS2013.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2test - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - OldStyle - false - true - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - false - true - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/clean.sh b/libs/SDL2/VisualC/clean.sh index f90a11e9..fd16f9a1 100644 --- a/libs/SDL2/VisualC/clean.sh +++ b/libs/SDL2/VisualC/clean.sh @@ -1,5 +1,4 @@ -find . -type d -name 'Debug' -exec rm -rv {} \; -find . -type d -name 'Release' -exec rm -rv {} \; -find . -type f -name '*.user' -exec rm -v {} \; -find . -type f -name '*.ncb' -exec rm -v {} \; -find . -type f -name '*.suo' -exec rm -v {} \; +#!/bin/sh +find . -type f \( -name '*.user' -o -name '*.sdf' -o -name '*.ncb' -o -name '*.suo' \) -print -delete +find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -delete +find . -depth -type d \( -name Win32 -o -name x64 \) -exec rm -rv {} \; diff --git a/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2012.vcxproj b/libs/SDL2/VisualC/tests/checkkeys/checkkeys.vcxproj similarity index 61% rename from libs/SDL2/VisualC/tests/testplatform/testplatform_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/checkkeys/checkkeys.vcxproj index e1e93fe1..46e25773 100644 --- a/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/checkkeys/checkkeys.vcxproj @@ -19,66 +19,64 @@ - testplatform - testplatform - {26932B24-EFC6-4E3A-B277-ED653DA37968} + {26828762-C95D-4637-9CB1-7F0979523813} + checkkeys Application - false - v110 - - - Application - false - v110 Application - false - v110 + + + Application Application - false - MultiByte - v110 - - - - - + - + + + + + - + - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,59 +84,51 @@ true true Win32 + .\Debug/checkkeys.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL + MultiThreadedDLL Level3 - true - EditAndContinue + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - - true - _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/checkkeys.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level3 - true - ProgramDatabase + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - - true - @@ -146,86 +136,79 @@ true true Win32 - .\Release/testplatform.tlb - - + .\Release/checkkeys.tlb - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - $(IntDir) - $(IntDir) - $(IntDir)vc$(PlatformToolsetVersion).pdb + + + .\Release/checkkeys.pch Level3 - true NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - - true - NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/checkkeys.tlb - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true + + + .\Release/checkkeys.pch Level3 - true NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - - true - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + + $(SolutionDir)$(Platform)\$(Configuration);%(AdditionalIncludeDirectories) + $(Platform)\$(Configuration)\;%(AdditionalUsingDirectories) + %(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + $(SolutionDir)$(Platform)\$(Configuration);%(AdditionalIncludeDirectories) + $(Platform)\$(Configuration)\;%(AdditionalUsingDirectories) + $(SolutionDir)$(Platform)\$(Configuration);%(AdditionalIncludeDirectories) + $(Platform)\$(Configuration)\;%(AdditionalUsingDirectories) + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj b/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj index de0be502..b02c4cfa 100644 --- a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj b/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj deleted file mode 100644 index 76c573a7..00000000 --- a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj +++ /dev/null @@ -1,241 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - checkkeys - checkkeys - {26828762-C95D-4637-9CB1-7F0979523813} - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj b/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj deleted file mode 100644 index f9ba52a7..00000000 --- a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - checkkeys - checkkeys - {26828762-C95D-4637-9CB1-7F0979523813} - - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2013.vcxproj b/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2013.vcxproj deleted file mode 100644 index e02d5a00..00000000 --- a/libs/SDL2/VisualC/tests/checkkeys/checkkeys_VS2013.vcxproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - checkkeys - checkkeys - {26828762-C95D-4637-9CB1-7F0979523813} - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj b/libs/SDL2/VisualC/tests/controllermap/controllermap.vcxproj similarity index 67% rename from libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/controllermap/controllermap.vcxproj index 4fa5e266..fedaf6cc 100644 --- a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/controllermap/controllermap.vcxproj @@ -19,27 +19,21 @@ - testgamecontroller - testgamecontroller - {55812185-D13C-4022-9C81-32E0F4A08336} + {55812185-D13C-4022-9C81-32E0F4A08306} + controllermap Application - false - - - Application - false - MultiByte Application - false + + + Application Application - false @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,26 +84,20 @@ true true Win32 + .\Release/controllermap.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -110,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/controllermap.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -139,28 +130,24 @@ true true Win32 + .\Debug/controllermap.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -168,86 +155,101 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/controllermap.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/controllermap/controllermap_VS2008.vcproj b/libs/SDL2/VisualC/tests/controllermap/controllermap_VS2008.vcproj new file mode 100644 index 00000000..1ecce673 --- /dev/null +++ b/libs/SDL2/VisualC/tests/controllermap/controllermap_VS2008.vcproj @@ -0,0 +1,480 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2012.vcxproj b/libs/SDL2/VisualC/tests/loopwave/loopwave.vcxproj similarity index 67% rename from libs/SDL2/VisualC/tests/loopwave/loopwave_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/loopwave/loopwave.vcxproj index 800d1dac..182a38bc 100644 --- a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/loopwave/loopwave.vcxproj @@ -19,31 +19,21 @@ - loopwave - loopwave {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} + loopwave Application - false - v110 - - - Application - false - MultiByte - v110 Application - false - v110 + + + Application Application - false - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,26 +84,23 @@ true true Win32 + .\Release/loopwave.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true + .\Release/loopwave.pch Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -114,26 +109,24 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/loopwave.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true + .\Release/loopwave.pch Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -143,28 +136,24 @@ true true Win32 + .\Debug/loopwave.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -172,59 +161,65 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/loopwave.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + + - Document - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj b/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj index 1a80c413..1cbf89a8 100644 --- a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -232,6 +379,16 @@ Outputs="$(ProjectDir)\$(InputFileName)" /> + + + diff --git a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2010.vcxproj b/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2010.vcxproj deleted file mode 100644 index e2e60e5f..00000000 --- a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2010.vcxproj +++ /dev/null @@ -1,226 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - loopwave - loopwave - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} - - - - Application - false - - - Application - false - MultiByte - - - Application - false - - - Application - false - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - Document - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2013.vcxproj b/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2013.vcxproj deleted file mode 100644 index 591d587b..00000000 --- a/libs/SDL2/VisualC/tests/loopwave/loopwave_VS2013.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - loopwave - loopwave - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - Document - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - $(ProjectDir)\%(Filename)%(Extension) - Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) - Copying %(Filename)%(Extension) - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testatomic/testatomic.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testatomic/testatomic_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testatomic/testatomic.vcxproj index 632b8bf8..f66dee8a 100644 --- a/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testatomic/testatomic.vcxproj @@ -19,31 +19,21 @@ - testatomic - {2271060E-98B4-4596-8172-A041E4B2EC7A} + {66B32F7E-5716-48D0-B5B9-D832FD052DD5} testatomic Application - false - v110 - - - Application - false - v110 Application - false - v110 + + + Application Application - false - MultiByte - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,28 +84,24 @@ true true Win32 + .\Debug/testatomic.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -115,28 +109,25 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testatomic.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -145,26 +136,20 @@ true true Win32 + .\Release/testatomic.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -173,41 +158,42 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testatomic.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj b/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj index 8d15bfcb..5f4452b5 100644 --- a/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testatomic - {2271060E-98B4-4596-8172-A041E4B2EC7A} - testatomic - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2013.vcxproj deleted file mode 100644 index 8fa361f0..00000000 --- a/libs/SDL2/VisualC/tests/testatomic/testatomic_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testatomic - {2271060E-98B4-4596-8172-A041E4B2EC7A} - testatomic - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testautomation/testautomation.vcxproj similarity index 60% rename from libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testautomation/testautomation.vcxproj index 18bf9281..e5ce6a3c 100644 --- a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testautomation/testautomation.vcxproj @@ -19,93 +19,137 @@ - testsprite2 - testsprite2 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} + testautomation - - Application - false - v110 - - - Application - false - MultiByte - v110 - Application - false - v110 + + + Application Application - false - v110 + + + Application - - - - - - - - + + + + + + + + - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/testautomation.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/testautomation.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + NDEBUG;%(PreprocessorDefinitions) true true Win32 + .\Release/testautomation.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -114,119 +158,69 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testautomation.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj b/libs/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj index b4875a3b..dc1bec0f 100644 --- a/libs/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testautomation - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} - testautomation - Win32Proj - - - - Application - Unicode - true - - - Application - Unicode - true - - - Application - Unicode - - - Application - MultiByte - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - true - Windows - MachineX86 - false - - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - true - Windows - false - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testautomation/testautomation_vs2012.vcxproj b/libs/SDL2/VisualC/tests/testautomation/testautomation_vs2012.vcxproj deleted file mode 100644 index dc2d8102..00000000 --- a/libs/SDL2/VisualC/tests/testautomation/testautomation_vs2012.vcxproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testautomation - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} - testautomation - Win32Proj - - - - Application - Unicode - true - v110 - - - Application - Unicode - true - v110 - - - Application - Unicode - v110 - - - Application - MultiByte - v110 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - true - Windows - MachineX86 - false - - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - true - Windows - false - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testautomation/testautomation_vs2013.vcxproj b/libs/SDL2/VisualC/tests/testautomation/testautomation_vs2013.vcxproj deleted file mode 100644 index 3c7e3615..00000000 --- a/libs/SDL2/VisualC/tests/testautomation/testautomation_vs2013.vcxproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testautomation - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} - testautomation - Win32Proj - - - - Application - Unicode - true - v120 - - - Application - Unicode - true - v120 - - - Application - Unicode - v120 - - - Application - MultiByte - v120 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - true - Windows - MachineX86 - false - - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - true - Windows - false - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testdraw2/testdraw2.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testdraw2/testdraw2.vcxproj index d8cb3bb9..c6dd9119 100644 --- a/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testdraw2/testdraw2.vcxproj @@ -19,31 +19,21 @@ - testdraw2 - testdraw2 {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} + testdraw2 Application - false - v110 - - - Application - false - MultiByte - v110 Application - false - v110 + + + Application Application - false - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,26 +84,20 @@ true true Win32 + .\Release/testdraw2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -114,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testdraw2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -143,28 +130,24 @@ true true Win32 + .\Debug/testdraw2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -172,45 +155,51 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testdraw2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj b/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj index d1ddec6c..16612aea 100644 --- a/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testdraw2 - testdraw2 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} - - - - Application - false - - - Application - false - MultiByte - - - Application - false - - - Application - false - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2013.vcxproj deleted file mode 100644 index db05bc18..00000000 --- a/libs/SDL2/VisualC/tests/testdraw2/testdraw2_VS2013.vcxproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testdraw2 - testdraw2 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testfile/testfile_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testfile/testfile.vcxproj similarity index 69% rename from libs/SDL2/VisualC/tests/testfile/testfile_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testfile/testfile.vcxproj index 0eaea935..d4967d76 100644 --- a/libs/SDL2/VisualC/tests/testfile/testfile_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testfile/testfile.vcxproj @@ -19,31 +19,21 @@ - testfile - testfile {CAE4F1D0-314F-4B10-805B-0EFD670133A0} + testfile Application - false - v110 - - - Application - false - v110 Application - false - v110 + + + Application Application - false - MultiByte - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,28 +84,24 @@ true true Win32 + .\Debug/testfile.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -115,28 +109,25 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testfile.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -145,26 +136,20 @@ true true Win32 + .\Release/testfile.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -173,41 +158,42 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testfile.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj b/libs/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj index 2544d7b7..46f796a4 100644 --- a/libs/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testfile - testfile - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testfile/testfile_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testfile/testfile_VS2013.vcxproj deleted file mode 100644 index 3a0e8cb8..00000000 --- a/libs/SDL2/VisualC/tests/testfile/testfile_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testfile - testfile - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj index 21301a49..1b91b877 100644 --- a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj @@ -19,31 +19,21 @@ - testgamecontroller + {55812185-D13C-4022-9C81-32E0F4A08305} testgamecontroller - {55812185-D13C-4022-9C81-32E0F4A08336} Application - false - v110 - - - Application - false - MultiByte - v110 Application - false - v110 + + + Application Application - false - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,26 +84,20 @@ true true Win32 + .\Release/testgamecontroller.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -114,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testgamecontroller.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -143,28 +130,24 @@ true true Win32 + .\Debug/testgamecontroller.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -172,86 +155,101 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testgamecontroller.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2008.vcproj b/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2008.vcproj new file mode 100644 index 00000000..1b31f57b --- /dev/null +++ b/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2008.vcproj @@ -0,0 +1,480 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2013.vcxproj deleted file mode 100644 index b7763fd2..00000000 --- a/libs/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2013.vcxproj +++ /dev/null @@ -1,257 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgamecontroller - testgamecontroller - {55812185-D13C-4022-9C81-32E0F4A08336} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testgesture/testgesture.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testgesture/testgesture_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testgesture/testgesture.vcxproj index c600615c..30800e0b 100644 --- a/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testgesture/testgesture.vcxproj @@ -19,89 +19,137 @@ - testgesture + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} testgesture - {55812185-D13C-4022-9C81-32E0F4A08996} - - Application - false - - - Application - false - MultiByte - Application - false + + + Application Application - false + + + Application - - - - - - - - + + + + + + + + - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/testgesture.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/testgesture.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + NDEBUG;%(PreprocessorDefinitions) true true Win32 + .\Release/testgesture.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -110,100 +158,42 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testgesture.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj b/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj index fbab93f8..4fff2273 100644 --- a/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgesture - testgesture - {55812185-D13C-4022-9C81-32E0F4A08996} - - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - Application - false - v110 - - - Application - false - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2013.vcxproj deleted file mode 100644 index 754c5950..00000000 --- a/libs/SDL2/VisualC/tests/testgesture/testgesture_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgesture - testgesture - {55812185-D13C-4022-9C81-32E0F4A08996} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testgl2/testgl2.vcxproj similarity index 69% rename from libs/SDL2/VisualC/tests/testgl2/testgl2_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testgl2/testgl2.vcxproj index 84b81283..3e504965 100644 --- a/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testgl2/testgl2.vcxproj @@ -19,31 +19,21 @@ - testgl2 - testgl2 {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} + testgl2 Application - false - v110 - - - Application - false - v110 Application - false - v110 + + + Application Application - false - MultiByte - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,18 +84,16 @@ true true Win32 + .\Debug/testgl2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) @@ -105,10 +101,8 @@ opengl32.lib;%(AdditionalDependencies) - true true Windows - false @@ -116,18 +110,17 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testgl2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) @@ -135,10 +128,8 @@ opengl32.lib;%(AdditionalDependencies) - true true Windows - false @@ -147,19 +138,14 @@ true true Win32 + .\Release/testgl2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) @@ -167,7 +153,6 @@ opengl32.lib;%(AdditionalDependencies) - true Windows @@ -176,19 +161,15 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testgl2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) @@ -196,25 +177,33 @@ opengl32.lib;%(AdditionalDependencies) - true Windows - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj b/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj index a99d68c6..0c42dc72 100644 --- a/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgl2 - testgl2 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;%(AdditionalDependencies) - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;%(AdditionalDependencies) - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;%(AdditionalDependencies) - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - opengl32.lib;%(AdditionalDependencies) - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testgles2/testgles2.vcxproj similarity index 69% rename from libs/SDL2/VisualC/tests/testgl2/testgl2_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testgles2/testgles2.vcxproj index 48d9e14e..186f6aff 100644 --- a/libs/SDL2/VisualC/tests/testgl2/testgl2_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testgles2/testgles2.vcxproj @@ -19,27 +19,21 @@ - testgl2 - testgl2 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} + {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} + testgles2 Application - false - - - Application - false Application - false + + + Application Application - false - MultiByte @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,18 +84,15 @@ true true Win32 + .\Debug/testgles2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) @@ -101,10 +100,8 @@ opengl32.lib;%(AdditionalDependencies) - true true Windows - false @@ -112,18 +109,16 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testgles2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) @@ -131,10 +126,8 @@ opengl32.lib;%(AdditionalDependencies) - true true Windows - false @@ -143,19 +136,13 @@ true true Win32 + .\Release/testgles2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) @@ -163,7 +150,6 @@ opengl32.lib;%(AdditionalDependencies) - true Windows @@ -172,19 +158,14 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testgles2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) @@ -192,25 +173,27 @@ opengl32.lib;%(AdditionalDependencies) - true Windows - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2008.vcproj b/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2008.vcproj index a357ca25..b70a1371 100644 --- a/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2008.vcproj @@ -2,23 +2,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgles2 - testgles2 - {E5287C64-0646-4BFA-A772-1DB5A649F35E} - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2012.vcxproj deleted file mode 100644 index df5dd0ee..00000000 --- a/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2012.vcxproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgles2 - testgles2 - {E5287C64-0646-4BFA-A772-1DB5A649F35E} - - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2013.vcxproj deleted file mode 100644 index bc3970a2..00000000 --- a/libs/SDL2/VisualC/tests/testgles2/testgles2_VS2013.vcxproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgles2 - testgles2 - {E5287C64-0646-4BFA-A772-1DB5A649F35E} - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_WINDOWS;HAVE_OPENGLES2;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - %(AdditionalDependencies) - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testjoystick/testjoystick.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testjoystick/testjoystick.vcxproj index 1828c576..b1c909f4 100644 --- a/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testjoystick/testjoystick.vcxproj @@ -19,27 +19,21 @@ - testjoystick + {55812185-D13C-4022-9C81-32E0F4A08304} testjoystick - {55812185-D13C-4022-9C81-32E0F4A08BCC} Application - false - - - Application - false - MultiByte Application - false + + + Application Application - false @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,26 +84,20 @@ true true Win32 + .\Release/testjoystick.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -110,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testjoystick.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -139,28 +130,24 @@ true true Win32 + .\Debug/testjoystick.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -168,42 +155,45 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testjoystick.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj b/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj index 92b3cf55..eb1a19fa 100644 --- a/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testjoystick - testjoystick - {55812185-D13C-4022-9C81-32E0F4A08BCC} - - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - Application - false - v110 - - - Application - false - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2013.vcxproj deleted file mode 100644 index dd56e167..00000000 --- a/libs/SDL2/VisualC/tests/testjoystick/testjoystick_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testjoystick - testjoystick - {55812185-D13C-4022-9C81-32E0F4A08BCC} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testoverlay2/testoverlay2.vcxproj index ae7b729e..b17f64c0 100644 --- a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2.vcxproj @@ -19,31 +19,21 @@ - testoverlay2 + {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} testoverlay2 - {55812185-D13C-4022-9C81-32E0F4A08AAD} Application - false - v110 - - - Application - false - MultiByte - v110 Application - false - v110 + + + Application Application - false - v110 @@ -52,11 +42,11 @@ - + - + @@ -66,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -86,26 +84,20 @@ true true Win32 + .\Release/testoverlay2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -114,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testoverlay2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -143,28 +130,24 @@ true true Win32 + .\Debug/testoverlay2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -172,59 +155,65 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testoverlay2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true - Document - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + + + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj b/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj index d7d48e87..578a7c34 100644 --- a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -224,7 +367,17 @@ + + + diff --git a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj deleted file mode 100644 index e4557563..00000000 --- a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj +++ /dev/null @@ -1,226 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testoverlay2 - testoverlay2 - {55812185-D13C-4022-9C81-32E0F4A08AAD} - - - - Application - false - - - Application - false - MultiByte - - - Application - false - - - Application - false - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - Document - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - - diff --git a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2013.vcxproj deleted file mode 100644 index 339a14c2..00000000 --- a/libs/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2013.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testoverlay2 - testoverlay2 - {55812185-D13C-4022-9C81-32E0F4A08AAD} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - Document - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testplatform/testplatform.vcxproj similarity index 64% rename from libs/SDL2/VisualC/tests/testplatform/testplatform_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testplatform/testplatform.vcxproj index 61c3ea36..db3b7e9e 100644 --- a/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testplatform/testplatform.vcxproj @@ -19,27 +19,21 @@ - testplatform - testplatform {26932B24-EFC6-4E3A-B277-ED653DA37968} + testplatform Application - false - - - Application - false Application - false + + + Application Application - false - MultiByte @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,29 +84,31 @@ true true Win32 + .\Debug/testplatform.tlb + + Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL + MultiThreadedDLL + .\Debug/testplatform.pch Level3 - true - EditAndContinue + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false true + .\Debug/testplatform.bsc @@ -112,28 +116,32 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testplatform.tlb + + Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL + .\Debug/testplatform.pch Level3 - true - ProgramDatabase + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false true + .\Debug/testplatform.bsc @@ -147,29 +155,23 @@ - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - $(IntDir) - $(IntDir) - $(IntDir)vc$(PlatformToolsetVersion).pdb + .\Release/testplatform.pch Level3 - true NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows true + .\Release/testplatform.bsc @@ -177,51 +179,49 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testplatform.tlb + + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true + .\Release/testplatform.pch Level3 - true NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows true + .\Release/testplatform.bsc - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj b/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj index 580f4e1a..014faeea 100644 --- a/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testplatform - testplatform - {26932B24-EFC6-4E3A-B277-ED653DA37968} - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL - Level3 - true - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - true - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - Level3 - true - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/testplatform.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - $(IntDir) - $(IntDir) - $(IntDir)vc$(PlatformToolsetVersion).pdb - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - true - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testpower/testpower_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testpower/testpower.vcxproj similarity index 69% rename from libs/SDL2/VisualC/tests/testpower/testpower_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testpower/testpower.vcxproj index 5624ff88..63e01683 100644 --- a/libs/SDL2/VisualC/tests/testpower/testpower_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testpower/testpower.vcxproj @@ -19,27 +19,21 @@ - testpower {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} testpower Application - false - - - Application - false Application - false + + + Application Application - false - MultiByte @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,28 +84,24 @@ true true Win32 + .\Debug/testpower.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -111,28 +109,25 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testpower.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -141,26 +136,20 @@ true true Win32 + .\Release/testpower.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -169,41 +158,42 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testpower.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj b/libs/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj index 7194270d..e140e6b9 100644 --- a/libs/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testpower - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} - testpower - - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testpower/testpower_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testpower/testpower_VS2013.vcxproj deleted file mode 100644 index 4055b766..00000000 --- a/libs/SDL2/VisualC/tests/testpower/testpower_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testpower - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} - testpower - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget.vcxproj similarity index 67% rename from libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testrendertarget/testrendertarget.vcxproj index 59c5d45f..b186ee99 100644 --- a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget.vcxproj @@ -19,151 +19,85 @@ - testrendertarget - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} testrendertarget - - Application - false - v110 - - - Application - false - v110 - Application - false - v110 + + + Application Application - false - v110 + + + Application - - - - - - - - + + + + + + + + - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - NDEBUG;%(PreprocessorDefinitions) true true Win32 + .\Release/testrendertarget.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -172,74 +106,138 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testrendertarget.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true true + Win32 + .\Debug/testrendertarget.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/testrendertarget.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true Windows - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + + + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj b/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj index 9c96c26c..d13432ac 100644 --- a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -231,7 +374,17 @@ + + + @@ -245,7 +398,17 @@ + + + @@ -255,7 +418,17 @@ + + + diff --git a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj deleted file mode 100644 index 23247e5c..00000000 --- a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj +++ /dev/null @@ -1,241 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testrendertarget - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} - testrendertarget - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - - diff --git a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2013.vcxproj deleted file mode 100644 index ad1a477c..00000000 --- a/libs/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2013.vcxproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testrendertarget - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} - testrendertarget - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testrumble/testrumble.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testrumble/testrumble_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testrumble/testrumble.vcxproj index b5b571f1..81e6b9f2 100644 --- a/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testrumble/testrumble.vcxproj @@ -19,27 +19,21 @@ - testrumble - {91B7737A-2A78-4020-820E-81A679DBEC72} + {BFF40245-E9A6-4297-A425-A554E5D767E8} testrumble Application - false - - - Application - false Application - false + + + Application Application - false - MultiByte @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,28 +84,24 @@ true true Win32 + .\Debug/testrumble.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -111,28 +109,25 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testrumble.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -141,26 +136,20 @@ true true Win32 + .\Release/testrumble.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -169,41 +158,42 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testrumble.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2008.vcproj b/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2008.vcproj index 07851577..ea4a8583 100644 --- a/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testrumble - {91B7737A-2A78-4020-820E-81A679DBEC72} - testrumble - - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2013.vcxproj deleted file mode 100644 index 384c4f69..00000000 --- a/libs/SDL2/VisualC/tests/testrumble/testrumble_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testrumble - {91B7737A-2A78-4020-820E-81A679DBEC72} - testrumble - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testscale/testscale_VS2012.vcxproj b/libs/SDL2/VisualC/tests/testscale/testscale.vcxproj similarity index 67% rename from libs/SDL2/VisualC/tests/testscale/testscale_VS2012.vcxproj rename to libs/SDL2/VisualC/tests/testscale/testscale.vcxproj index 482d5797..64ce50db 100644 --- a/libs/SDL2/VisualC/tests/testscale/testscale_VS2012.vcxproj +++ b/libs/SDL2/VisualC/tests/testscale/testscale.vcxproj @@ -19,152 +19,85 @@ - testscale - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} testscale - - Application - false - v110 - - - Application - false - v110 - Application - false - v110 + + + Application Application - false - MultiByte - v110 + + + Application - - - - - - - - + + + + + + + + - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - NDEBUG;%(PreprocessorDefinitions) true true Win32 + .\Release/testscale.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -173,74 +106,138 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testscale.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true true + Win32 + .\Debug/testscale.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/testscale.tlb + + + Disabled + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + OldStyle + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true Windows - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + + + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj b/libs/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj index b0ab25d9..5a15fccf 100644 --- a/libs/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -231,7 +374,17 @@ + + + @@ -245,7 +398,17 @@ + + + @@ -255,7 +418,17 @@ + + + diff --git a/libs/SDL2/VisualC/tests/testscale/testscale_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testscale/testscale_VS2010.vcxproj deleted file mode 100644 index d0caa69a..00000000 --- a/libs/SDL2/VisualC/tests/testscale/testscale_VS2010.vcxproj +++ /dev/null @@ -1,242 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testscale - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} - testscale - - - - Application - false - - - Application - false - - - Application - false - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - - diff --git a/libs/SDL2/VisualC/tests/testscale/testscale_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testscale/testscale_VS2013.vcxproj deleted file mode 100644 index 5d2f5937..00000000 --- a/libs/SDL2/VisualC/tests/testscale/testscale_VS2013.vcxproj +++ /dev/null @@ -1,246 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testscale - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} - testscale - - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testshape/testshape_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testshape/testshape.vcxproj similarity index 68% rename from libs/SDL2/VisualC/tests/testshape/testshape_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testshape/testshape.vcxproj index 1e6d769f..81938c33 100644 --- a/libs/SDL2/VisualC/tests/testshape/testshape_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testshape/testshape.vcxproj @@ -19,27 +19,21 @@ - testshape + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} testshape - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} Application - false - - - Application - false - MultiByte Application - false + + + Application Application - false @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,26 +84,20 @@ true true Win32 + .\Release/testshape.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -110,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testshape.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -139,28 +130,24 @@ true true Win32 + .\Debug/testshape.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -168,42 +155,45 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testshape.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj b/libs/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj index e2e163ab..73db7893 100644 --- a/libs/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testshape - testshape - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} - - - - Application - false - v110 - - - Application - false - MultiByte - v110 - - - Application - false - v110 - - - Application - false - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/libs/SDL2/VisualC/tests/testshape/testshape_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testshape/testshape_VS2013.vcxproj deleted file mode 100644 index 2c4ce12a..00000000 --- a/libs/SDL2/VisualC/tests/testshape/testshape_VS2013.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testshape - testshape - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj b/libs/SDL2/VisualC/tests/testsprite2/testsprite2.vcxproj similarity index 67% rename from libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj rename to libs/SDL2/VisualC/tests/testsprite2/testsprite2.vcxproj index e38038ad..7af6e1ee 100644 --- a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj +++ b/libs/SDL2/VisualC/tests/testsprite2/testsprite2.vcxproj @@ -19,27 +19,21 @@ - testsprite2 - testsprite2 {40FB7794-D3C3-4CFE-BCF4-A80C96635682} + testsprite2 Application - false - - - Application - false - MultiByte Application - false + + + Application Application - false @@ -48,11 +42,11 @@ - + - + @@ -62,19 +56,27 @@ - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - true - true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + @@ -82,26 +84,20 @@ true true Win32 + .\Release/testsprite2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -110,26 +106,21 @@ NDEBUG;%(PreprocessorDefinitions) true true + X64 + .\Release/testsprite2.tlb - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true MultiThreadedDLL - true - - Level3 - true - Default NDEBUG;%(PreprocessorDefinitions) 0x0409 - true Windows @@ -139,28 +130,24 @@ true true Win32 + .\Debug/testsprite2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - + MultiThreadedDLL Level3 - true - EditAndContinue - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false @@ -168,61 +155,71 @@ _DEBUG;%(PreprocessorDefinitions) true true + X64 + .\Debug/testsprite2.tlb Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) + $(SolutionDir)/../include;%(AdditionalIncludeDirectories) + %(AdditionalUsingDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - Level3 - true - ProgramDatabase - Default + OldStyle _DEBUG;%(PreprocessorDefinitions) 0x0409 - true true Windows - false - + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + false + false + true + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + false + false + true + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + - copy %(FullPath) $(ProjectDir)\ Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) + Copying %(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) + copy %(FullPath) $(ProjectDir)\ + + $(ProjectDir)\%(Filename)%(Extension);%(Outputs) - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - + - + \ No newline at end of file diff --git a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj b/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj index 7caa579e..7236ecc4 100644 --- a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj +++ b/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj @@ -11,13 +11,16 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -231,7 +374,17 @@ + + + diff --git a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2013.vcxproj b/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2013.vcxproj deleted file mode 100644 index 299a9bd0..00000000 --- a/libs/SDL2/VisualC/tests/testsprite2/testsprite2_VS2013.vcxproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testsprite2 - testsprite2 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} - - - - Application - false - v120 - - - Application - false - MultiByte - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - copy %(FullPath) $(ProjectDir)\ - Copying %(Filename)%(Extension) - $(ProjectDir)\%(Filename)%(Extension) - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/libs/SDL2/WhatsNew.txt b/libs/SDL2/WhatsNew.txt index 48209e85..75719eee 100644 --- a/libs/SDL2/WhatsNew.txt +++ b/libs/SDL2/WhatsNew.txt @@ -6,10 +6,82 @@ This is a list of major changes in SDL's version history. --------------------------------------------------------------------------- General: -* Added an event SDL_RENDER_DEVICE_RESET that is sent from the D3D renderers - when the D3D device is lost, and from Android's event loop when the GLES - context had to be re created. -* Native Client backend +* Added support for web applications using Emscripten, see docs/README-emscripten.md for more information +* Added support for web applications using Native Client (NaCl), see docs/README-nacl.md for more information +* Added an API to queue audio instead of using the audio callback: + SDL_QueueAudio(), SDL_GetQueuedAudioSize(), SDL_ClearQueuedAudio() +* Added events for audio device hot plug support: + SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED +* Added SDL_PointInRect() +* Added SDL_HasAVX2() to detect CPUs with AVX2 support +* Added SDL_SetWindowHitTest() to let apps treat parts of their SDL window like traditional window decorations (drag areas, resize areas) +* Added SDL_GetGrabbedWindow() to get the window that currently has input grab, if any +* Added SDL_RenderIsClipEnabled() to tell whether clipping is currently enabled in a renderer +* Added SDL_CaptureMouse() to capture the mouse to get events while the mouse is not in your window +* Added SDL_WarpMouseGlobal() to warp the mouse cursor in global screen space +* Added SDL_GetGlobalMouseState() to get the current mouse state outside of an SDL window +* Added a direction field to mouse wheel events to tell whether they are flipped (natural) or not +* Added GL_CONTEXT_RELEASE_BEHAVIOR GL attribute (maps to [WGL|GLX]_ARB_context_flush_control extension) +* Added EGL_KHR_create_context support to allow OpenGL ES version selection on some platforms +* Added NV12 and NV21 YUV texture support for OpenGL and OpenGL ES 2.0 renderers +* Added a Vivante video driver that is used on various SoC platforms +* Added an event SDL_RENDER_DEVICE_RESET that is sent from the D3D renderers when the D3D device is lost, and from Android's event loop when the GLES context had to be recreated +* Added a hint SDL_HINT_NO_SIGNAL_HANDLERS to disable SDL's built in signal handling +* Added a hint SDL_HINT_THREAD_STACK_SIZE to set the stack size of SDL's threads +* Added SDL_sqrtf(), SDL_tan(), and SDL_tanf() to the stdlib routines +* Improved support for WAV and BMP files with unusual chunks in them +* Renamed SDL_assert_data to SDL_AssertData and SDL_assert_state to SDL_AssertState +* Added a hint SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN to prevent window interaction while cursor is hidden + +Windows: +* Added support for Windows Phone 8.1 +* Timer resolution is now 1 ms by default, adjustable with the SDL_HINT_TIMER_RESOLUTION hint +* SDLmain no longer depends on the C runtime, so you can use the same .lib in both Debug and Release builds +* Added SDL_SetWindowsMessageHook() to set a function to be called for every windows message before TranslateMessage() +* Added a hint SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP to control whether SDL_PumpEvents() processes the Windows message loop +* You can distinguish between real mouse and touch events by looking for SDL_TOUCH_MOUSEID in the mouse event "which" field +* SDL_SysWMinfo now contains the window HDC +* Added support for Unicode command line options +* Prevent beeping when Alt-key combos are pressed +* SDL_SetTextInputRect() re-positions the OS-rendered IME +* Added a hint SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to prevent generating SDL_WINDOWEVENT_CLOSE events when Alt-F4 is pressed +* Added a hint SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING to use the old axis and button mapping for XInput devices (deprecated) + +Mac OS X: +* Implemented drag-and-drop support +* Improved joystick hot-plug detection +* The SDL_WINDOWEVENT_EXPOSED window event is triggered in the appropriate situations +* Fixed relative mouse mode when the application loses/regains focus +* Fixed bugs related to transitioning to and from Spaces-aware fullscreen-desktop mode +* Fixed the refresh rate of display modes +* SDL_SysWMInfo is now ARC-compatible +* Added a hint SDL_HINT_MAC_BACKGROUND_APP to prevent forcing the application to become a foreground process + +Linux: +* Enabled building with Mir and Wayland support by default. +* Added IBus IME support +* Added a hint SDL_HINT_IME_INTERNAL_EDITING to control whether IBus should handle text editing internally instead of sending SDL_TEXTEDITING events +* Added support for multiple audio devices when using Pulseaudio +* Fixed duplicate mouse events when using relative mouse motion + +iOS: +* Added support for iOS 8 +* Added support for the hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK +* Added sRGB OpenGL ES context support on iOS 7+ +* Added native resolution support for the iPhone 6 Plus +* The SDL_WINDOW_ALLOW_HIGHDPI window flag now enables high-dpi support, and SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() gets the window resolution in pixels +* SDL_GetWindowSize() and display mode sizes are in the "DPI-independent points" coordinate space rather than pixels (matches OS X behavior) +* SDL_SysWMinfo now contains the OpenGL ES framebuffer and color renderbuffer objects used by the window's active GLES view +* Fixed various rotation and orientation issues +* Fixed memory leaks + +Android: +* Added a hint SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH to prevent mouse events from being registered as touch events +* Added hints SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION and SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION + +Raspberry Pi: +* Added support for the Raspberry Pi 2 + --------------------------------------------------------------------------- 2.0.3: diff --git a/libs/SDL2/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/libs/SDL2/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj index 5cff3547..aa649282 100644 --- a/libs/SDL2/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +++ b/libs/SDL2/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj @@ -571,7 +571,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0630; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Demos" */; compatibilityVersion = "Xcode 3.2"; @@ -818,6 +818,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ../../include; + ONLY_ACTIVE_ARCH = YES; PRELINK_LIBS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/libs/SDL2/Xcode-iOS/Demos/src/fireworks.c b/libs/SDL2/Xcode-iOS/Demos/src/fireworks.c index 6c60dd12..a5beada9 100644 --- a/libs/SDL2/Xcode-iOS/Demos/src/fireworks.c +++ b/libs/SDL2/Xcode-iOS/Demos/src/fireworks.c @@ -387,6 +387,9 @@ main(int argc, char *argv[]) SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 0); SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + /* create main window and renderer */ window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL | diff --git a/libs/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/libs/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj index 44055cae..d680b494 100644 --- a/libs/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +++ b/libs/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj @@ -1082,7 +1082,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0630; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */; compatibilityVersion = "Xcode 3.2"; @@ -1253,7 +1253,8 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1265,7 +1266,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1274,7 +1275,13 @@ FD6526640DE8FCCB002AD96B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; COPY_PHASE_STRIP = NO; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = SDL2; SKIP_INSTALL = YES; @@ -1284,7 +1291,13 @@ FD6526650DE8FCCB002AD96B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; COPY_PHASE_STRIP = YES; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = SDL2; SKIP_INSTALL = YES; diff --git a/libs/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/libs/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj index 6bcdec04..c57f0ee5 100644 --- a/libs/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +++ b/libs/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj @@ -1238,7 +1238,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0630; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */; compatibilityVersion = "Xcode 3.2"; @@ -1774,6 +1774,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ../../include; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; diff --git a/libs/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/libs/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 6c618b4e..9fc2a501 100644 --- a/libs/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/libs/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -2248,7 +2248,6 @@ BECDF62A0761BA81005FE872 /* Resources */, BECDF62C0761BA81005FE872 /* Sources */, BECDF6680761BA81005FE872 /* Frameworks */, - AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */, ); buildRules = ( ); @@ -2324,7 +2323,15 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0630; + TargetAttributes = { + BECDF5FE0761BA81005FE872 = { + DevelopmentTeam = EH385AYQ6F; + }; + BECDF6BB0761BA81005FE872 = { + DevelopmentTeam = EH385AYQ6F; + }; + }; }; buildConfigurationList = 0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */; compatibilityVersion = "Xcode 3.2"; @@ -2377,20 +2384,6 @@ /* End PBXRezBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Sign Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [ \"$USER\" = \"slouken\" ]; then\n CODE_SIGN_IDENTITY=\"Mac Developer: Sam Lantinga (84TP7N5TA4)\" pkg-support/codesign-frameworks.sh || exit 1\nfi"; - }; BECDF6BD0761BA81005FE872 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; @@ -2398,7 +2391,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nxcrun CpMac -r $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp"; + shellScript = "# Sign framework\nif [ \"$SDL_CODESIGN_IDENTITY\" != \"\" ]; then\n codesign --force --deep --sign \"$SDL_CODESIGN_IDENTITY\" $TARGET_BUILD_DIR/SDL2.framework/Versions/A\nfi\n\n# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nxcrun CpMac -r $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp"; }; /* End PBXShellScriptBuildPhase section */ @@ -2774,7 +2767,6 @@ 00CFA621106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; DEPLOYMENT_POSTPROCESSING = YES; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; @@ -2792,6 +2784,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; + COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1.0.0; DYLIB_CURRENT_VERSION = 5.0.0; FRAMEWORK_VERSION = A; @@ -2800,6 +2793,7 @@ INSTALL_PATH = "@rpath"; OTHER_LDFLAGS = "-liconv"; PRODUCT_NAME = SDL2; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = framework; }; name = Release; @@ -2807,6 +2801,7 @@ 00CFA623106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(GCC_PREPROCESSOR_DEFINITIONS)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", @@ -2825,19 +2820,20 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "Standard DMG"; + PROVISIONING_PROFILE = ""; }; name = Release; }; 00CFA627106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; GCC_ENABLE_SSE3_EXTENSIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; STRIP_INSTALLED_PRODUCT = NO; }; @@ -2847,6 +2843,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; + COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1.0.0; DYLIB_CURRENT_VERSION = 5.0.0; FRAMEWORK_VERSION = A; @@ -2855,6 +2852,7 @@ INSTALL_PATH = "@rpath"; OTHER_LDFLAGS = "-liconv"; PRODUCT_NAME = SDL2; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = framework; }; name = Debug; @@ -2862,6 +2860,7 @@ 00CFA629106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(GCC_PREPROCESSOR_DEFINITIONS)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", @@ -2880,12 +2879,14 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "Standard DMG"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; DB31407517554B71006C0E22 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; EXECUTABLE_PREFIX = lib; GCC_PREPROCESSOR_DEFINITIONS = ( "$(GCC_PREPROCESSOR_DEFINITIONS)", @@ -2905,6 +2906,7 @@ DB31407617554B71006C0E22 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; EXECUTABLE_PREFIX = lib; GCC_PREPROCESSOR_DEFINITIONS = ( "$(GCC_PREPROCESSOR_DEFINITIONS)", diff --git a/libs/SDL2/Xcode/SDL/pkg-support/codesign-frameworks.sh b/libs/SDL2/Xcode/SDL/pkg-support/codesign-frameworks.sh deleted file mode 100644 index 1e184b08..00000000 --- a/libs/SDL2/Xcode/SDL/pkg-support/codesign-frameworks.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY! - -# Verify that $CODE_SIGN_IDENTITY is set -if [ -z "$CODE_SIGN_IDENTITY" ] ; then - echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!" - - if [ "$CONFIGURATION" = "Release" ] ; then - exit 1 - else - # Codesigning is optional for non-release builds. - exit 0 - fi -fi - -FRAMEWORK_DIR="${TARGET_BUILD_DIR}" - -# Loop through all frameworks -FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sort -r` -RESULT=$? -if [[ $RESULT != 0 ]] ; then - exit 1 -fi - -for FRAMEWORK in $FRAMEWORKS; -do - if [[ "$CONFIGURATION" = "Release" ]]; then - echo "Stripping '${FRAMEWORK}'" - NAME=$(basename "${FRAMEWORK}" .framework) - xcrun strip -x "${FRAMEWORK}/${NAME}" - RESULT=$? - if [[ $RESULT != 0 ]] ; then - exit 1 - fi - fi - echo "Signing '${FRAMEWORK}'" - codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}" - RESULT=$? - if [[ $RESULT != 0 ]] ; then - exit 1 - fi -done diff --git a/libs/SDL2/Xcode/SDL/pkg-support/resources/License.txt b/libs/SDL2/Xcode/SDL/pkg-support/resources/License.txt index 4b6f777e..e6a9ef84 100644 --- a/libs/SDL2/Xcode/SDL/pkg-support/resources/License.txt +++ b/libs/SDL2/Xcode/SDL/pkg-support/resources/License.txt @@ -1,6 +1,6 @@ Simple DirectMedia Layer -Copyright (C) 1997-2014 Sam Lantinga +Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/acinclude/libtool.m4 b/libs/SDL2/acinclude/libtool.m4 index c444a5ed..0eb07c8a 100644 --- a/libs/SDL2/acinclude/libtool.m4 +++ b/libs/SDL2/acinclude/libtool.m4 @@ -2186,13 +2186,20 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2 or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi diff --git a/libs/SDL2/android-project/AndroidManifest.xml b/libs/SDL2/android-project/AndroidManifest.xml index dc8450a6..5dbb5486 100644 --- a/libs/SDL2/android-project/AndroidManifest.xml +++ b/libs/SDL2/android-project/AndroidManifest.xml @@ -8,6 +8,15 @@ android:versionName="1.0" android:installLocation="auto"> + + + + + + + + + + - - - - - - - - diff --git a/libs/SDL2/android-project/src/org/libsdl/app/SDLActivity.java b/libs/SDL2/android-project/src/org/libsdl/app/SDLActivity.java index a39d05ef..8ad878c4 100644 --- a/libs/SDL2/android-project/src/org/libsdl/app/SDLActivity.java +++ b/libs/SDL2/android-project/src/org/libsdl/app/SDLActivity.java @@ -27,6 +27,7 @@ import android.graphics.*; import android.graphics.drawable.Drawable; import android.media.*; import android.hardware.*; +import android.content.pm.ActivityInfo; /** SDL Activity @@ -41,6 +42,10 @@ public class SDLActivity extends Activity { /** If shared libraries (e.g. SDL or the native application) could not be loaded. */ public static boolean mBrokenLibraries; + // If we want to separate mouse and touch events. + // This is only toggled in native code when a hint is set! + public static boolean mSeparateMouseAndTouch; + // Main components protected static SDLActivity mSingleton; protected static SDLSurface mSurface; @@ -50,7 +55,7 @@ public class SDLActivity extends Activity { // This is what SDL runs in. It invokes SDL_main(), eventually protected static Thread mSDLThread; - + // Audio protected static AudioTrack mAudioTrack; @@ -79,7 +84,7 @@ public class SDLActivity extends Activity { System.loadLibrary(lib); } } - + /** * This method is called by SDL before starting the native application thread. * It can be overridden to provide the arguments after the application name. @@ -89,7 +94,7 @@ public class SDLActivity extends Activity { protected String[] getArguments() { return new String[0]; } - + public static void initialize() { // The static nature of the singleton and Android quirkyness force us to initialize everything here // Otherwise, when exiting the app and returning to it, these variables *keep* their pre exit values @@ -110,9 +115,11 @@ public class SDLActivity extends Activity { // Setup @Override protected void onCreate(Bundle savedInstanceState) { - Log.v("SDL", "onCreate():" + mSingleton); + Log.v(TAG, "Device: " + android.os.Build.DEVICE); + Log.v(TAG, "Model: " + android.os.Build.MODEL); + Log.v(TAG, "onCreate(): " + mSingleton); super.onCreate(savedInstanceState); - + SDLActivity.initialize(); // So we can call stuff from static callbacks mSingleton = this; @@ -155,7 +162,7 @@ public class SDLActivity extends Activity { // Set up the surface mSurface = new SDLSurface(getApplication()); - + if(Build.VERSION.SDK_INT >= 12) { mJoystickHandler = new SDLJoystickHandler_API12(); } @@ -167,12 +174,23 @@ public class SDLActivity extends Activity { mLayout.addView(mSurface); setContentView(mLayout); + + // Get filename from "Open with" of another application + Intent intent = getIntent(); + + if (intent != null && intent.getData() != null) { + String filename = intent.getData().getPath(); + if (filename != null) { + Log.v(TAG, "Got filename: " + filename); + SDLActivity.onNativeDropFile(filename); + } + } } // Events @Override protected void onPause() { - Log.v("SDL", "onPause()"); + Log.v(TAG, "onPause()"); super.onPause(); if (SDLActivity.mBrokenLibraries) { @@ -184,7 +202,7 @@ public class SDLActivity extends Activity { @Override protected void onResume() { - Log.v("SDL", "onResume()"); + Log.v(TAG, "onResume()"); super.onResume(); if (SDLActivity.mBrokenLibraries) { @@ -198,7 +216,7 @@ public class SDLActivity extends Activity { @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); - Log.v("SDL", "onWindowFocusChanged(): " + hasFocus); + Log.v(TAG, "onWindowFocusChanged(): " + hasFocus); if (SDLActivity.mBrokenLibraries) { return; @@ -212,7 +230,7 @@ public class SDLActivity extends Activity { @Override public void onLowMemory() { - Log.v("SDL", "onLowMemory()"); + Log.v(TAG, "onLowMemory()"); super.onLowMemory(); if (SDLActivity.mBrokenLibraries) { @@ -224,7 +242,7 @@ public class SDLActivity extends Activity { @Override protected void onDestroy() { - Log.v("SDL", "onDestroy()"); + Log.v(TAG, "onDestroy()"); if (SDLActivity.mBrokenLibraries) { super.onDestroy(); @@ -242,13 +260,13 @@ public class SDLActivity extends Activity { try { SDLActivity.mSDLThread.join(); } catch(Exception e) { - Log.v("SDL", "Problem stopping thread: " + e); + Log.v(TAG, "Problem stopping thread: " + e); } SDLActivity.mSDLThread = null; - //Log.v("SDL", "Finished waiting for SDL thread"); + //Log.v(TAG, "Finished waiting for SDL thread"); } - + super.onDestroy(); // Reset everything in case the user re opens the app SDLActivity.initialize(); @@ -297,7 +315,7 @@ public class SDLActivity extends Activity { mSurface.handleResume(); } } - + /* The native thread has finished */ public static void handleNativeExit() { SDLActivity.mSDLThread = null; @@ -391,6 +409,7 @@ public class SDLActivity extends Activity { public static native void nativeQuit(); public static native void nativePause(); public static native void nativeResume(); + public static native void onNativeDropFile(String filename); public static native void onNativeResize(int x, int y, int format, float rate); public static native int onNativePadDown(int device_id, int keycode); public static native int onNativePadUp(int device_id, int keycode); @@ -401,15 +420,16 @@ public class SDLActivity extends Activity { public static native void onNativeKeyDown(int keycode); public static native void onNativeKeyUp(int keycode); public static native void onNativeKeyboardFocusLost(); + public static native void onNativeMouse(int button, int action, float x, float y); public static native void onNativeTouch(int touchDevId, int pointerFingerId, - int action, float x, + int action, float x, float y, float p); public static native void onNativeAccel(float x, float y, float z); public static native void onNativeSurfaceChanged(); public static native void onNativeSurfaceDestroyed(); public static native void nativeFlipBuffers(); - public static native int nativeAddJoystick(int device_id, String name, - int is_accelerometer, int nbuttons, + public static native int nativeAddJoystick(int device_id, String name, + int is_accelerometer, int nbuttons, int naxes, int nhats, int nballs); public static native int nativeRemoveJoystick(int device_id); public static native String nativeGetHint(String name); @@ -534,33 +554,33 @@ public class SDLActivity extends Activity { int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO; int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT; int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1); - - Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer"); - + + Log.v(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer"); + // Let the user pick a larger buffer if they really want -- but ye // gods they probably shouldn't, the minimums are horrifyingly high // latency already desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize); - + if (mAudioTrack == null) { mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM); - + // Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid // Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java // Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState() - + if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) { - Log.e("SDL", "Failed during initialization of Audio Track"); + Log.e(TAG, "Failed during initialization of Audio Track"); mAudioTrack = null; return -1; } - + mAudioTrack.play(); } - - Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer"); - + + Log.v(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer"); + return 0; } @@ -579,7 +599,7 @@ public class SDLActivity extends Activity { // Nom nom } } else { - Log.w("SDL", "SDL audio: error return from write(short)"); + Log.w(TAG, "SDL audio: error return from write(short)"); return; } } @@ -600,7 +620,7 @@ public class SDLActivity extends Activity { // Nom nom } } else { - Log.w("SDL", "SDL audio: error return from write(byte)"); + Log.w(TAG, "SDL audio: error return from write(byte)"); return; } } @@ -920,11 +940,11 @@ class SDLMain implements Runnable { /** SDLSurface. This is what we draw on, so we need to know when it's created - in order to do anything useful. + in order to do anything useful. Because of this, that's where we set up the SDL thread */ -class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, +class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener { // Sensors @@ -934,20 +954,20 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, // Keep track of the surface size to normalize touch events protected static float mWidth, mHeight; - // Startup + // Startup public SDLSurface(Context context) { super(context); - getHolder().addCallback(this); - + getHolder().addCallback(this); + setFocusable(true); setFocusableInTouchMode(true); requestFocus(); - setOnKeyListener(this); - setOnTouchListener(this); + setOnKeyListener(this); + setOnTouchListener(this); mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); - + if(Build.VERSION.SDK_INT >= 12) { setOnGenericMotionListener(new SDLGenericMotionListener_API12()); } @@ -956,7 +976,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mWidth = 1.0f; mHeight = 1.0f; } - + public void handleResume() { setFocusable(true); setFocusableInTouchMode(true); @@ -965,7 +985,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, setOnTouchListener(this); enableSensor(Sensor.TYPE_ACCELEROMETER, true); } - + public Surface getNativeSurface() { return getHolder().getSurface(); } @@ -1041,7 +1061,43 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mWidth = width; mHeight = height; SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate()); - Log.v("SDL", "Window size:" + width + "x"+height); + Log.v("SDL", "Window size: " + width + "x" + height); + + + boolean skip = false; + int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation(); + + if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) + { + // Accept any + } + else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) + { + if (mWidth > mHeight) { + skip = true; + } + } else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { + if (mWidth < mHeight) { + skip = true; + } + } + + // Special Patch for Square Resolution: Black Berry Passport + if (skip) { + double min = Math.min(mWidth, mHeight); + double max = Math.max(mWidth, mHeight); + + if (max / min < 1.20) { + Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution."); + skip = false; + } + } + + if (skip) { + Log.v("SDL", "Skip .. Surface is not ready."); + return; + } + // Set mIsSurfaceReady to 'true' *before* making a call to handleResume SDLActivity.mIsSurfaceReady = true; @@ -1055,7 +1111,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, final Thread sdlThread = new Thread(new SDLMain(), "SDLThread"); enableSensor(Sensor.TYPE_ACCELEROMETER, true); sdlThread.start(); - + // Set up a listener thread to catch when the native thread ends SDLActivity.mSDLThread = new Thread(new Runnable(){ @Override @@ -1064,7 +1120,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, sdlThread.join(); } catch(Exception e){} - finally{ + finally{ // Native thread has finished if (! SDLActivity.mExitCalledFromJava) { SDLActivity.handleNativeExit(); @@ -1074,6 +1130,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, }, "SDLThreadListener"); SDLActivity.mSDLThread.start(); } + + if (SDLActivity.mHasFocus) { + SDLActivity.handleResume(); + } } // unused @@ -1087,8 +1147,8 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, // Dispatch the different events depending on where they come from // Some SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD // So, we try to process them as DPAD or GAMEPAD events first, if that fails we try them as KEYBOARD - - if ( (event.getSource() & 0x00000401) != 0 || /* API 12: SOURCE_GAMEPAD */ + + if ( (event.getSource() & InputDevice.SOURCE_GAMEPAD) != 0 || (event.getSource() & InputDevice.SOURCE_DPAD) != 0 ) { if (event.getAction() == KeyEvent.ACTION_DOWN) { if (SDLActivity.onNativePadDown(event.getDeviceId(), keyCode) == 0) { @@ -1100,7 +1160,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, } } } - + if( (event.getSource() & InputDevice.SOURCE_KEYBOARD) != 0) { if (event.getAction() == KeyEvent.ACTION_DOWN) { //Log.v("SDL", "key down: " + keyCode); @@ -1113,7 +1173,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, return true; } } - + return false; } @@ -1125,68 +1185,98 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, final int pointerCount = event.getPointerCount(); int action = event.getActionMasked(); int pointerFingerId; + int mouseButton; int i = -1; float x,y,p; - - switch(action) { - case MotionEvent.ACTION_MOVE: - for (i = 0; i < pointerCount; i++) { - pointerFingerId = event.getPointerId(i); - x = event.getX(i) / mWidth; - y = event.getY(i) / mHeight; - p = event.getPressure(i); - SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); - } - break; - - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_DOWN: - // Primary pointer up/down, the index is always zero - i = 0; - case MotionEvent.ACTION_POINTER_UP: - case MotionEvent.ACTION_POINTER_DOWN: - // Non primary pointer up/down - if (i == -1) { - i = event.getActionIndex(); - } - - pointerFingerId = event.getPointerId(i); - x = event.getX(i) / mWidth; - y = event.getY(i) / mHeight; - p = event.getPressure(i); - SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); - break; - - case MotionEvent.ACTION_CANCEL: - for (i = 0; i < pointerCount; i++) { - pointerFingerId = event.getPointerId(i); - x = event.getX(i) / mWidth; - y = event.getY(i) / mHeight; - p = event.getPressure(i); - SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p); - } - break; - default: - break; + // !!! FIXME: dump this SDK check after 2.0.4 ships and require API14. + if (event.getSource() == InputDevice.SOURCE_MOUSE && SDLActivity.mSeparateMouseAndTouch) { + if (Build.VERSION.SDK_INT < 14) { + mouseButton = 1; // For Android==12 all mouse buttons are the left button + } else { + try { + mouseButton = (Integer) event.getClass().getMethod("getButtonState").invoke(event); + } catch(Exception e) { + mouseButton = 1; // oh well. + } + } + SDLActivity.onNativeMouse(mouseButton, action, event.getX(0), event.getY(0)); + } else { + switch(action) { + case MotionEvent.ACTION_MOVE: + for (i = 0; i < pointerCount; i++) { + pointerFingerId = event.getPointerId(i); + x = event.getX(i) / mWidth; + y = event.getY(i) / mHeight; + p = event.getPressure(i); + if (p > 1.0f) { + // may be larger than 1.0f on some devices + // see the documentation of getPressure(i) + p = 1.0f; + } + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); + } + break; + + case MotionEvent.ACTION_UP: + case MotionEvent.ACTION_DOWN: + // Primary pointer up/down, the index is always zero + i = 0; + case MotionEvent.ACTION_POINTER_UP: + case MotionEvent.ACTION_POINTER_DOWN: + // Non primary pointer up/down + if (i == -1) { + i = event.getActionIndex(); + } + + pointerFingerId = event.getPointerId(i); + x = event.getX(i) / mWidth; + y = event.getY(i) / mHeight; + p = event.getPressure(i); + if (p > 1.0f) { + // may be larger than 1.0f on some devices + // see the documentation of getPressure(i) + p = 1.0f; + } + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); + break; + + case MotionEvent.ACTION_CANCEL: + for (i = 0; i < pointerCount; i++) { + pointerFingerId = event.getPointerId(i); + x = event.getX(i) / mWidth; + y = event.getY(i) / mHeight; + p = event.getPressure(i); + if (p > 1.0f) { + // may be larger than 1.0f on some devices + // see the documentation of getPressure(i) + p = 1.0f; + } + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p); + } + break; + + default: + break; + } } return true; - } + } // Sensor events public void enableSensor(int sensortype, boolean enabled) { // TODO: This uses getDefaultSensor - what if we have >1 accels? if (enabled) { - mSensorManager.registerListener(this, - mSensorManager.getDefaultSensor(sensortype), + mSensorManager.registerListener(this, + mSensorManager.getDefaultSensor(sensortype), SensorManager.SENSOR_DELAY_GAME, null); } else { - mSensorManager.unregisterListener(this, + mSensorManager.unregisterListener(this, mSensorManager.getDefaultSensor(sensortype)); } } - + @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { // TODO @@ -1218,7 +1308,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, y / SensorManager.GRAVITY_EARTH, event.values[2] / SensorManager.GRAVITY_EARTH - 1); } - } + } } /* This is a fake invisible editor view that receives the input and defines the @@ -1260,7 +1350,7 @@ class DummyEdit extends View implements View.OnKeyListener { return false; } - + // @Override public boolean onKeyPreIme (int keyCode, KeyEvent event) { @@ -1339,7 +1429,7 @@ class SDLInputConnection extends BaseInputConnection { public native void nativeSetComposingText(String text, int newCursorPosition); @Override - public boolean deleteSurroundingText(int beforeLength, int afterLength) { + public boolean deleteSurroundingText(int beforeLength, int afterLength) { // Workaround to capture backspace key. Ref: http://stackoverflow.com/questions/14560344/android-backspace-in-webview-baseinputconnection if (beforeLength == 1 && afterLength == 0) { // backspace @@ -1353,7 +1443,7 @@ class SDLInputConnection extends BaseInputConnection { /* A null joystick handler for API level < 12 devices (the accelerometer is handled separately) */ class SDLJoystickHandler { - + /** * Handles given MotionEvent. * @param event the event to be handled. @@ -1385,11 +1475,11 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { return arg0.getAxis() - arg1.getAxis(); } } - + private ArrayList mJoysticks; - + public SDLJoystickHandler_API12() { - + mJoysticks = new ArrayList(); } @@ -1400,18 +1490,24 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { // For example, in the case of the XBox 360 wireless dongle, // so the first controller seen by SDL matches what the receiver // considers to be the first controller - + for(int i=deviceIds.length-1; i>-1; i--) { SDLJoystick joystick = getJoystick(deviceIds[i]); if (joystick == null) { joystick = new SDLJoystick(); InputDevice joystickDevice = InputDevice.getDevice(deviceIds[i]); - if( (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { + + if ( + (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 + || + (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_BUTTON) != 0 + ) + { joystick.device_id = deviceIds[i]; joystick.name = joystickDevice.getName(); joystick.axes = new ArrayList(); joystick.hats = new ArrayList(); - + List ranges = joystickDevice.getMotionRanges(); Collections.sort(ranges, new RangeComparator()); for (InputDevice.MotionRange range : ranges ) { @@ -1425,14 +1521,14 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { } } } - + mJoysticks.add(joystick); - SDLActivity.nativeAddJoystick(joystick.device_id, joystick.name, 0, -1, + SDLActivity.nativeAddJoystick(joystick.device_id, joystick.name, 0, -1, joystick.axes.size(), joystick.hats.size()/2, 0); } } } - + /* Check removed devices */ ArrayList removedDevices = new ArrayList(); for(int i=0; i < mJoysticks.size(); i++) { @@ -1445,7 +1541,7 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { removedDevices.add(Integer.valueOf(device_id)); } } - + for(int i=0; i < removedDevices.size(); i++) { int device_id = removedDevices.get(i).intValue(); SDLActivity.nativeRemoveJoystick(device_id); @@ -1455,9 +1551,9 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { break; } } - } + } } - + protected SDLJoystick getJoystick(int device_id) { for(int i=0; i < mJoysticks.size(); i++) { if (mJoysticks.get(i).device_id == device_id) { @@ -1465,9 +1561,9 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { } } return null; - } - - @Override + } + + @Override public boolean handleMotionEvent(MotionEvent event) { if ( (event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) { int actionPointerIndex = event.getActionIndex(); @@ -1481,7 +1577,7 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { /* Normalize the value to -1...1 */ float value = ( event.getAxisValue( range.getAxis(), actionPointerIndex) - range.getMin() ) / range.getRange() * 2.0f - 1.0f; SDLActivity.onNativeJoy(joystick.device_id, i, value ); - } + } for (int i = 0; i < joystick.hats.size(); i+=2) { int hatX = Math.round(event.getAxisValue( joystick.hats.get(i).getAxis(), actionPointerIndex ) ); int hatY = Math.round(event.getAxisValue( joystick.hats.get(i+1).getAxis(), actionPointerIndex ) ); @@ -1494,14 +1590,49 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { } } return true; - } + } } class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener { // Generic Motion (mouse hover, joystick...) events go here - // We only have joysticks yet @Override public boolean onGenericMotion(View v, MotionEvent event) { - return SDLActivity.handleJoystickMotionEvent(event); + float x, y; + int mouseButton; + int action; + + switch ( event.getSource() ) { + case InputDevice.SOURCE_JOYSTICK: + case InputDevice.SOURCE_GAMEPAD: + case InputDevice.SOURCE_DPAD: + SDLActivity.handleJoystickMotionEvent(event); + return true; + + case InputDevice.SOURCE_MOUSE: + action = event.getActionMasked(); + switch (action) { + case MotionEvent.ACTION_SCROLL: + x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0); + y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0); + SDLActivity.onNativeMouse(0, action, x, y); + return true; + + case MotionEvent.ACTION_HOVER_MOVE: + x = event.getX(0); + y = event.getY(0); + + SDLActivity.onNativeMouse(0, action, x, y); + return true; + + default: + break; + } + + default: + break; + } + + // Event was not managed + return false; } } diff --git a/libs/SDL2/build-scripts/androidbuild.sh b/libs/SDL2/build-scripts/androidbuild.sh index ea6e6b1b..8ca3c916 100644 --- a/libs/SDL2/build-scripts/androidbuild.sh +++ b/libs/SDL2/build-scripts/androidbuild.sh @@ -115,7 +115,7 @@ echo "public class $ACTIVITY extends SDLActivity {}" >> "$ACTIVITY.java" # Update project and build cd $BUILDPATH -android update project --path $BUILDPATH +$ANDROID update project --path $BUILDPATH $NDKBUILD -j $NCPUS $NDKARGS $ANT debug diff --git a/libs/SDL2/build-scripts/config.guess b/libs/SDL2/build-scripts/config.guess index ddb36220..68c1be32 100644 --- a/libs/SDL2/build-scripts/config.guess +++ b/libs/SDL2/build-scripts/config.guess @@ -898,6 +898,7 @@ EOF else case `sed -n '/^Hardware/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in BCM2708) MANUFACTURER=raspberry;; + BCM2709) MANUFACTURER=raspberry;; *) MANUFACTURER=unknown;; esac if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ diff --git a/libs/SDL2/build-scripts/g++-fat.sh b/libs/SDL2/build-scripts/g++-fat.sh index b6fe7bb4..29b04302 100644 --- a/libs/SDL2/build-scripts/g++-fat.sh +++ b/libs/SDL2/build-scripts/g++-fat.sh @@ -6,7 +6,7 @@ DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer" -# Intel 32-bit compiler flags (10.6 runtime compatibility) +# Intel 32-bit compiler flags (10.5 runtime compatibility) GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.5 \ -I/usr/local/include" diff --git a/libs/SDL2/build-scripts/update-copyright.sh b/libs/SDL2/build-scripts/update-copyright.sh new file mode 100644 index 00000000..fdfb5ca9 --- /dev/null +++ b/libs/SDL2/build-scripts/update-copyright.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +find . -type f -exec grep -Il "Copyright" {} \; \ +| grep -v \.hg \ +| while read i; \ +do \ + sed -ie "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$i"; \ + rm "${i}e"; \ +done diff --git a/libs/SDL2/build-scripts/winrtbuild.ps1 b/libs/SDL2/build-scripts/winrtbuild.ps1 index 2b118699..3b0d31af 100644 --- a/libs/SDL2/build-scripts/winrtbuild.ps1 +++ b/libs/SDL2/build-scripts/winrtbuild.ps1 @@ -163,7 +163,7 @@ function Build-SDL-WinRT-Variant # # Build the VS Project: # - cmd.exe /c " ""$BatchFileForMSBuildEnv"" x86 & msbuild ""$VSProjectPath"" /p:Platform=$Platform /p:OutDir=""$OutDir\\"" /p:IntDir=""$IntermediateDir\\""" | Out-Host + cmd.exe /c " ""$BatchFileForMSBuildEnv"" x86 & msbuild ""$VSProjectPath"" /p:Configuration=Release /p:Platform=$Platform /p:OutDir=""$OutDir\\"" /p:IntDir=""$IntermediateDir\\""" | Out-Host $BuildResult = $? # diff --git a/libs/SDL2/cmake/macros.cmake b/libs/SDL2/cmake/macros.cmake index c234a566..96a7ce8b 100644 --- a/libs/SDL2/cmake/macros.cmake +++ b/libs/SDL2/cmake/macros.cmake @@ -66,7 +66,7 @@ endmacro() macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR) set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}") - set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}") + set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}") CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR}) set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}") endmacro() diff --git a/libs/SDL2/cmake/sdlchecks.cmake b/libs/SDL2/cmake/sdlchecks.cmake index e8d746f9..7ff0985f 100644 --- a/libs/SDL2/cmake/sdlchecks.cmake +++ b/libs/SDL2/cmake/sdlchecks.cmake @@ -409,14 +409,6 @@ macro(CheckX11) set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1) endif() - check_c_source_compiles(" - #include - extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len); - int main(int argc, char **argv) {}" HAVE_CONST_XDATA32) - if(HAVE_CONST_XDATA32) - set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1) - endif() - check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM) if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H) @@ -505,8 +497,13 @@ macro(CheckX11) endif() endmacro() +# Requires: +# - EGL +# - PkgCheckModules +# Optional: +# - MIR_SHARED opt +# - HAVE_DLOPEN opt macro(CheckMir) -# !!! FIXME: hook up dynamic loading here. if(VIDEO_MIR) find_library(MIR_LIB mirclient mircommon egl) pkg_check_modules(MIR_TOOLKIT mirclient mircommon) @@ -522,15 +519,31 @@ macro(CheckMir) set(SDL_VIDEO_DRIVER_MIR 1) list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CLFAGS} ${XKB_CLFLAGS}) - list(APPEND EXTRA_LDFLAGS ${MIR_TOOLKIT_LDFLAGS} ${EGL_LDLAGS} ${XKB_LDLAGS}) - endif (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND) + + if(MIR_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic Mir loading") + else() + FindLibraryAndSONAME(mirclient) + FindLibraryAndSONAME(xkbcommon) + set(SDL_VIDEO_DRIVER_MIR_DYNAMIC "\"${MIRCLIENT_LIB_SONAME}\"") + set(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"") + set(HAVE_MIR_SHARED TRUE) + endif() + else() + set(EXTRA_LIBS ${MIR_TOOLKIT_LIBRARIES} ${EXTRA_LIBS}) + endif() + endif() endif() endmacro() # Requires: # - EGL +# - PkgCheckModules +# Optional: +# - WAYLAND_SHARED opt +# - HAVE_DLOPEN opt macro(CheckWayland) -# !!! FIXME: hook up dynamic loading here. if(VIDEO_WAYLAND) pkg_check_modules(WAYLAND wayland-client wayland-cursor wayland-egl egl xkbcommon) if(WAYLAND_FOUND) @@ -540,12 +553,34 @@ macro(CheckWayland) include_directories( ${WAYLAND_INCLUDE_DIRS} ) - set(EXTRA_LIBS ${WAYLAND_LIBRARIES} ${EXTRA_LIBS}) set(HAVE_VIDEO_WAYLAND TRUE) set(HAVE_SDL_VIDEO TRUE) file(GLOB WAYLAND_SOURCES ${SDL2_SOURCE_DIR}/src/video/wayland/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${WAYLAND_SOURCES}) + + if(VIDEO_WAYLAND_QT_TOUCH) + set(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 1) + endif() + + if(WAYLAND_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic Wayland loading") + else() + FindLibraryAndSONAME(wayland-client) + FindLibraryAndSONAME(wayland-egl) + FindLibraryAndSONAME(wayland-cursor) + FindLibraryAndSONAME(xkbcommon) + set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC "\"${WAYLAND_CLIENT_LIB_SONAME}\"") + set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL "\"${WAYLAND_EGL_LIB_SONAME}\"") + set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR "\"${WAYLAND_CURSOR_LIB_SONAME}\"") + set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"") + set(HAVE_WAYLAND_SHARED TRUE) + endif() + else() + set(EXTRA_LIBS ${WAYLAND_LIBRARIES} ${EXTRA_LIBS}) + endif() + set(SDL_VIDEO_DRIVER_WAYLAND 1) endif() endif() @@ -682,7 +717,7 @@ macro(CheckOpenGLESX11) endif() endmacro() -# Rquires: +# Requires: # - nada # Optional: # - THREADS opt @@ -733,13 +768,17 @@ macro(CheckPTHREAD) # Run some tests set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}") - check_c_source_runs(" + if(CMAKE_CROSSCOMPILING) + set(HAVE_PTHREADS 1) + else() + check_c_source_runs(" #include int main(int argc, char** argv) { pthread_attr_t type; pthread_attr_init(&type); return 0; }" HAVE_PTHREADS) + endif() if(HAVE_PTHREADS) set(SDL_THREAD_PTHREAD 1) list(APPEND EXTRA_CFLAGS ${PTHREAD_CFLAGS}) @@ -788,8 +827,8 @@ macro(CheckPTHREAD) #include #include int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H) - check_function_exists(pthread_setname_np HAVE_PTHREAD_setNAME_NP) - check_function_exists(pthread_set_name_np HAVE_PTHREAD_set_NAME_NP) + check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP) + check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP) set(CMAKE_REQUIRED_FLAGS) set(SOURCE_FILES ${SOURCE_FILES} diff --git a/libs/SDL2/configure b/libs/SDL2/configure index 81e6b24b..5d6f922f 100644 --- a/libs/SDL2/configure +++ b/libs/SDL2/configure @@ -826,6 +826,7 @@ enable_video_x11 with_x enable_x11_shared enable_video_x11_xcursor +enable_video_x11_xdbe enable_video_x11_xinerama enable_video_x11_xinput enable_video_x11_xrandr @@ -1551,6 +1552,7 @@ Optional Features: --enable-x11-shared dynamically load X11 support [[default=maybe]] --enable-video-x11-xcursor enable X11 Xcursor support [[default=yes]] + --enable-video-x11-xdbe enable X11 Xdbe support [[default=yes]] --enable-video-x11-xinerama enable X11 Xinerama support [[default=yes]] --enable-video-x11-xinput @@ -9912,13 +9914,20 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2 or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi @@ -18692,43 +18701,6 @@ $as_echo "$need_gcc_Wno_multichar" >&6; } fi } -CheckWarnShadow() -{ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wshadow option" >&5 -$as_echo_n "checking for GCC -Wshadow option... " >&6; } - have_gcc_Wshadow=no - - save_CFLAGS="$CFLAGS" - CFLAGS="$save_CFLAGS -Wshadow" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - int x = 0; - -int -main () -{ - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - have_gcc_Wshadow=yes - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_Wshadow" >&5 -$as_echo "$have_gcc_Wshadow" >&6; } - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_Wshadow = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow" - fi -} - CheckWayland() { # Check whether --enable-video-wayland was given. @@ -19928,35 +19900,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_XextAddDisplay" >&5 $as_echo "$have_const_param_XextAddDisplay" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const parameter to _XData32" >&5 -$as_echo_n "checking for const parameter to _XData32... " >&6; } - have_const_param_xdata32=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len); - -int -main () -{ - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - have_const_param_xdata32=yes - $as_echo "#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1" >>confdefs.h - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_xdata32" >&5 -$as_echo "$have_const_param_xdata32" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGenericEvent" >&5 $as_echo_n "checking for XGenericEvent... " >&6; } have_XGenericEvent=no @@ -20116,6 +20059,31 @@ $as_echo "#define SDL_VIDEO_DRIVER_X11_XCURSOR 1" >>confdefs.h SUMMARY_video_x11="${SUMMARY_video_x11} xcursor" fi + # Check whether --enable-video-x11-xdbe was given. +if test "${enable_video_x11_xdbe+set}" = set; then : + enableval=$enable_video_x11_xdbe; +else + enable_video_x11_xdbe=yes +fi + + if test x$enable_video_x11_xdbe = xyes; then + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xdbe.h" "ac_cv_header_X11_extensions_Xdbe_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_Xdbe_h" = xyes; then : + have_dbe_h_hdr=yes +else + have_dbe_h_hdr=no +fi + + + if test x$have_dbe_h_hdr = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XDBE 1" >>confdefs.h + + SUMMARY_video_x11="${SUMMARY_video_x11} xdbe" + fi + fi # Check whether --enable-video-x11-xinerama was given. if test "${enable_video_x11_xinerama+set}" = set; then : enableval=$enable_video_x11_xinerama; @@ -21901,7 +21869,6 @@ $as_echo "#define SDL_THREAD_PTHREAD 1" >>confdefs.h EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags" EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib" SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" - SDL_LIBS="$SDL_LIBS $pthread_lib" # Save the original compiler flags and libraries ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" @@ -21916,6 +21883,7 @@ $as_echo_n "checking for recursive mutexes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #define _GNU_SOURCE 1 #include int @@ -21929,7 +21897,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : has_recursive_mutexes=yes @@ -21937,12 +21905,14 @@ $as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi if test x$has_recursive_mutexes = xno; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #define _GNU_SOURCE 1 #include int @@ -21956,7 +21926,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : has_recursive_mutexes=yes @@ -21964,7 +21934,8 @@ $as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_recursive_mutexes" >&5 $as_echo "$has_recursive_mutexes" >&6; } @@ -22937,7 +22908,9 @@ case "$host" in if test x$enable_video = xyes; then SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c" + # FIXME: confdefs? Not AC_DEFINE? $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h + SUMMARY_video="${SUMMARY_video} rpi" fi ;; *-*-androideabi*) @@ -22951,6 +22924,7 @@ case "$host" in if test x$enable_video = xyes; then SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c" + # FIXME: confdefs? Not AC_DEFINE? $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h SUMMARY_video="${SUMMARY_video} android" fi @@ -22994,8 +22968,12 @@ case "$host" in CheckLibUDev CheckDBus CheckIBus - CheckInputEvents - CheckInputKD + case $ARCH in + linux) + CheckInputEvents + CheckInputKD + ;; + esac CheckTslib CheckUSBHID CheckPTHREAD @@ -23275,7 +23253,7 @@ $as_echo "#define SDL_LOADSO_WINDOWS 1" >>confdefs.h else LIBUUID=-luuid fi - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -XCClinker -static-libgcc" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc" # The Windows platform requires special setup VERSION_SOURCES="$srcdir/src/main/windows/*.rc" SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" @@ -23637,7 +23615,6 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h esac CheckWarnAll -CheckWarnShadow # Verify that we have all the platform specific files we need @@ -23787,7 +23764,7 @@ $SDLMAIN_DEPENDS $SDLTEST_DEPENDS __EOF__ -ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl2-config SDL2.spec sdl2.pc" +ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc" ac_config_commands="$ac_config_commands sdl2_config" @@ -24906,6 +24883,7 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:Makefile.in:Makefile.rules" ;; "sdl2-config") CONFIG_FILES="$CONFIG_FILES sdl2-config" ;; + "sdl2-config.cmake") CONFIG_FILES="$CONFIG_FILES sdl2-config.cmake" ;; "SDL2.spec") CONFIG_FILES="$CONFIG_FILES SDL2.spec" ;; "sdl2.pc") CONFIG_FILES="$CONFIG_FILES sdl2.pc" ;; "sdl2_config") CONFIG_COMMANDS="$CONFIG_COMMANDS sdl2_config" ;; diff --git a/libs/SDL2/configure.in b/libs/SDL2/configure.in index a2ad20a6..4e9cb96e 100644 --- a/libs/SDL2/configure.in +++ b/libs/SDL2/configure.in @@ -1159,28 +1159,6 @@ CheckWarnAll() fi } -dnl See if GCC's -Wshadow is supported. -CheckWarnShadow() -{ - AC_MSG_CHECKING(for GCC -Wshadow option) - have_gcc_Wshadow=no - - save_CFLAGS="$CFLAGS" - CFLAGS="$save_CFLAGS -Wshadow" - AC_TRY_COMPILE([ - int x = 0; - ],[ - ],[ - have_gcc_Wshadow=yes - ]) - AC_MSG_RESULT($have_gcc_Wshadow) - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_Wshadow = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow" - fi -} - dnl Check for Wayland CheckWayland() { @@ -1492,18 +1470,6 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma ]) AC_MSG_RESULT($have_const_param_XextAddDisplay) - AC_MSG_CHECKING(for const parameter to _XData32) - have_const_param_xdata32=no - AC_TRY_COMPILE([ - #include - extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len); - ],[ - ],[ - have_const_param_xdata32=yes - AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32) - ]) - AC_MSG_RESULT($have_const_param_xdata32) - dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent])) AC_MSG_CHECKING([for XGenericEvent]) have_XGenericEvent=no @@ -1552,6 +1518,20 @@ AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[defau AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ]) SUMMARY_video_x11="${SUMMARY_video_x11} xcursor" fi + AC_ARG_ENABLE(video-x11-xdbe, +AC_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]), + , enable_video_x11_xdbe=yes) + if test x$enable_video_x11_xdbe = xyes; then + AC_CHECK_HEADER(X11/extensions/Xdbe.h, + have_dbe_h_hdr=yes, + have_dbe_h_hdr=no, + [#include + ]) + if test x$have_dbe_h_hdr = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ]) + SUMMARY_video_x11="${SUMMARY_video_x11} xdbe" + fi + fi AC_ARG_ENABLE(video-x11-xinerama, AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]), , enable_video_x11_xinerama=yes) @@ -2413,7 +2393,6 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags" EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib" SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" - SDL_LIBS="$SDL_LIBS $pthread_lib" # Save the original compiler flags and libraries ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" @@ -2424,7 +2403,8 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) AC_MSG_CHECKING(for recursive mutexes) has_recursive_mutexes=no if test x$has_recursive_mutexes = xno; then - AC_TRY_COMPILE([ + AC_TRY_LINK([ + #define _GNU_SOURCE 1 #include ],[ pthread_mutexattr_t attr; @@ -2435,7 +2415,8 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) ]) fi if test x$has_recursive_mutexes = xno; then - AC_TRY_COMPILE([ + AC_TRY_LINK([ + #define _GNU_SOURCE 1 #include ],[ pthread_mutexattr_t attr; @@ -2835,7 +2816,9 @@ case "$host" in if test x$enable_video = xyes; then SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c" + # FIXME: confdefs? Not AC_DEFINE? $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h + SUMMARY_video="${SUMMARY_video} rpi" fi ;; *-*-androideabi*) @@ -2849,6 +2832,7 @@ case "$host" in if test x$enable_video = xyes; then SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c" + # FIXME: confdefs? Not AC_DEFINE? $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h SUMMARY_video="${SUMMARY_video} android" fi @@ -2892,8 +2876,12 @@ case "$host" in CheckLibUDev CheckDBus CheckIBus - CheckInputEvents - CheckInputKD + case $ARCH in + linux) + CheckInputEvents + CheckInputKD + ;; + esac CheckTslib CheckUSBHID CheckPTHREAD @@ -3113,7 +3101,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau else LIBUUID=-luuid fi - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -XCClinker -static-libgcc" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc" # The Windows platform requires special setup VERSION_SOURCES="$srcdir/src/main/windows/*.rc" SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" @@ -3405,7 +3393,6 @@ esac dnl Do this on all platforms, after everything else. CheckWarnAll -CheckWarnShadow # Verify that we have all the platform specific files we need @@ -3546,7 +3533,7 @@ $SDLTEST_DEPENDS __EOF__ AC_CONFIG_FILES([ - Makefile:Makefile.in:Makefile.rules sdl2-config SDL2.spec sdl2.pc + Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc ]) AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config]) diff --git a/libs/SDL2/debian/copyright b/libs/SDL2/debian/copyright index 53254644..31860bbe 100644 --- a/libs/SDL2/debian/copyright +++ b/libs/SDL2/debian/copyright @@ -4,7 +4,7 @@ Upstream-Contact: Sam Lantinga Source: http://www.libsdl.org/ Files: * -Copyright: 1997-2014 Sam Lantinga +Copyright: 1997-2015 Sam Lantinga License: zlib/libpng Files: src/libm/* @@ -12,7 +12,7 @@ Copyright: 1993 by Sun Microsystems, Inc. All rights reserved. License: SunPro Files: src/main/windows/SDL_windows_main.c -Copyright: 1998 Sam Lantinga +Copyright: 2015 Sam Lantinga License: PublicDomain_Sam_Lantinga Comment: SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 @@ -36,7 +36,7 @@ Copyright: 1998 Gareth McCaughan License: Gareth_McCaughan Files: src/test/SDL_test_md5.c -Copyright: 1997-2014 Sam Lantinga +Copyright: 1997-2015 Sam Lantinga 1990 RSA Data Security, Inc. License: zlib/libpng and RSA_Data_Security @@ -50,12 +50,12 @@ Copyright: 1994-2003 The XFree86 Project, Inc. License: MIT/X11 Files: test/testhaptic.c -Copyright: 1997-2014 Sam Lantinga +Copyright: 1997-2015 Sam Lantinga 2008 Edgar Simo Serra License: BSD_3_clause Files: test/testrumble.c -Copyright: 1997-2014 Sam Lantinga +Copyright: 1997-2015 Sam Lantinga 2011 Edgar Simo Serra License: BSD_3_clause @@ -173,7 +173,7 @@ License: BSD_3_clause (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Comment: - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga . This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/docs/README-dynapi.md b/libs/SDL2/docs/README-dynapi.md index 5669fd76..bfaecb34 100644 --- a/libs/SDL2/docs/README-dynapi.md +++ b/libs/SDL2/docs/README-dynapi.md @@ -1,6 +1,7 @@ Dynamic API ================================================================================ -Originally posted by Ryan at https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U +Originally posted by Ryan at: + https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U Background: @@ -119,7 +120,7 @@ To which I would point out that the extra function call through the jump table probably wouldn't even show up in a profile, but lucky you: this can all be disabled. You can build SDL without this if you absolutely must, but we would encourage you not to do that. However, on heavily locked down platforms like -iOS, or maybe when debugging, it makes sense to disable it. The way this is +iOS, or maybe when debugging, it makes sense to disable it. The way this is designed in SDL, you just have to change one #define, and the entire system vaporizes out, and SDL functions exactly like it always did. Most of it is macro magic, so the system is contained to one C file and a few headers. diff --git a/libs/SDL2/docs/README-emscripten.md b/libs/SDL2/docs/README-emscripten.md index ca9b35b1..62012db7 100644 --- a/libs/SDL2/docs/README-emscripten.md +++ b/libs/SDL2/docs/README-emscripten.md @@ -3,13 +3,17 @@ Emscripten Build: - $ emconfigure ./configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2" + $ mkdir build + $ cd build + $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2" $ emmake make Or with cmake: - $ emconfigure cmake .. - $ make + $ mkdir build + $ cd build + $ emcmake cmake .. + $ emmake make To build one of the tests: @@ -22,7 +26,7 @@ tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere): -SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/) +SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/): $ EMCONFIGURE_JS=1 emconfigure ../configure build as usual... diff --git a/libs/SDL2/docs/README-gesture.md b/libs/SDL2/docs/README-gesture.md index 7b90b54d..7e9f95bc 100644 --- a/libs/SDL2/docs/README-gesture.md +++ b/libs/SDL2/docs/README-gesture.md @@ -1,6 +1,6 @@ Dollar Gestures =========================================================================== -SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures. +SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures. Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. diff --git a/libs/SDL2/docs/README-ios.md b/libs/SDL2/docs/README-ios.md index af33e03b..69c35d6f 100644 --- a/libs/SDL2/docs/README-ios.md +++ b/libs/SDL2/docs/README-ios.md @@ -1,14 +1,14 @@ -iOS -====== - +iOS +====== + ============================================================================== -Building the Simple DirectMedia Layer for iPhone OS 5.1 +Building the Simple DirectMedia Layer for iOS 5.1+ ============================================================================== -Requirements: Mac OS X v10.5 or later and the iPhone SDK. +Requirements: Mac OS X 10.8 or later and the iOS 7+ SDK. Instructions: -1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in XCode. +1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in Xcode. 2. Select your desired target, and hit build. There are three build targets: @@ -134,13 +134,21 @@ The main thing to note when using the accelerometer with SDL is that while the i Notes -- OpenGL ES ============================================================================== -Your SDL application for iPhone uses OpenGL ES for video by default. +Your SDL application for iOS uses OpenGL ES for video by default. -OpenGL ES for iPhone supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute. +OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute. If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. -Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 1. +Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0. + +OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this: + +- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow is called. +- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow is called. +- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called. + +The above objects can be obtained via SDL_GetWindowWMInfo (in SDL_syswm.h). ============================================================================== Notes -- Keyboard @@ -189,7 +197,7 @@ Textures: The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats. Loading Shared Objects: - This is disabled by default since it seems to break the terms of the iPhone SDK agreement. It can be re-enabled in SDL_config_iphoneos.h. + This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h. ============================================================================== Game Center diff --git a/libs/SDL2/docs/README-macosx.md b/libs/SDL2/docs/README-macosx.md index 768a33e3..747e1e60 100644 --- a/libs/SDL2/docs/README-macosx.md +++ b/libs/SDL2/docs/README-macosx.md @@ -17,13 +17,17 @@ process: You can also build SDL as a Universal library (a single binary for both 32-bit and 64-bit Intel architectures), on Mac OS X 10.7 and newer, by using -the fatbuild.sh script in build-scripts: - sh build-scripts/fatbuild.sh - sudo build-scripts/fatbuild.sh install +the gcc-fat.sh script in build-scripts: + + mkdir mybuild + cd mybuild + CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++fat.sh ../configure + make + sudo make install + This script builds SDL with 10.5 ABI compatibility on i386 and 10.6 ABI compatibility on x86_64 architectures. For best compatibility you -should compile your application the same way. A script which wraps -gcc to make this easy is provided in test/gcc-fat.sh +should compile your application the same way. Please note that building SDL requires at least Xcode 4.6 and the 10.7 SDK (even if you target back to 10.5 systems). PowerPC support for Mac OS X has diff --git a/libs/SDL2/docs/README-porting.md b/libs/SDL2/docs/README-porting.md index cf2d3eac..f13f83b8 100644 --- a/libs/SDL2/docs/README-porting.md +++ b/libs/SDL2/docs/README-porting.md @@ -43,6 +43,7 @@ There are two basic ways of building SDL at the moment: src/video/*.c src/audio/disk/*.c src/audio/dummy/*.c + src/filesystem/dummy/*.c src/video/dummy/*.c src/haptic/dummy/*.c src/joystick/dummy/*.c diff --git a/libs/SDL2/docs/README-raspberrypi.md b/libs/SDL2/docs/README-raspberrypi.md index fd6cdf82..ade3c81c 100644 --- a/libs/SDL2/docs/README-raspberrypi.md +++ b/libs/SDL2/docs/README-raspberrypi.md @@ -74,7 +74,7 @@ The final step is compiling SDL itself. export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux" cd mkdir -p build;cd build - ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd + LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd make make install @@ -154,19 +154,19 @@ this determining the CAPS LOCK behavior: OpenGL problems ================================================================================ -If you have desktop OpenGL headers installed at build time in your RPi or cross -compilation environment, support for it will be built in. However, the chipset -does not actually have support for it, which causes issues in certain SDL apps -since the presence of OpenGL support supersedes the ES/ES2 variants. -The workaround is to disable OpenGL at configuration time: +If you have desktop OpenGL headers installed at build time in your RPi or cross +compilation environment, support for it will be built in. However, the chipset +does not actually have support for it, which causes issues in certain SDL apps +since the presence of OpenGL support supersedes the ES/ES2 variants. +The workaround is to disable OpenGL at configuration time: ./configure --disable-video-opengl - -Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER -environment variable: - - export SDL_RENDER_DRIVER=opengles2 - + +Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER +environment variable: + + export SDL_RENDER_DRIVER=opengles2 + ================================================================================ Notes ================================================================================ diff --git a/libs/SDL2/docs/README-winrt.md b/libs/SDL2/docs/README-winrt.md index e188d779..75cd7cd2 100644 --- a/libs/SDL2/docs/README-winrt.md +++ b/libs/SDL2/docs/README-winrt.md @@ -90,10 +90,12 @@ Here is a rough list of what works, and what doens't: * keyboard input. Most of WinRT's documented virtual keys are supported, as well as many keys with documented hardware scancodes. * OpenGL. Experimental support for OpenGL ES 2 is available via the ANGLE - project, using either MS Open Technologies' repository, at - https://github.com/msopentech/angle (both the "winrt" and "future-dev" - branches are supported), or the official ANGLE repository, at - https://chromium.googlesource.com/angle/angle + project, using either: + * MS Open Technologies' "ms-master" repository, at https://github.com/MSOpenTech/angle + (for use with Windows 8.1+ or Windows Phone 8.1+) + * MS Open Technologies' "angle-win8.0" repository, at https://github.com/MSOpenTech/angle-win8.0 + (for Windows 8.0 only!) + * Google's main ANGLE repository, at https://chromium.googlesource.com/angle/angle * SDLmain. WinRT uses a different signature for each app's main() function. SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp (in `SDL\src\main\winrt\`) directly in order for their C-style main() diff --git a/libs/SDL2/docs/doxyfile b/libs/SDL2/docs/doxyfile index f17838d1..baf1c98d 100644 --- a/libs/SDL2/docs/doxyfile +++ b/libs/SDL2/docs/doxyfile @@ -639,6 +639,7 @@ EXCLUDE = ../include/SDL_opengles2_gl2ext.h \ ../include/SDL_opengles2.h \ ../include/SDL_opengles.h \ ../include/SDL_opengl.h \ + ../include/SDL_egl.h \ # The EXCLUDE_SYMLINKS tag can be used select whether or not files or diff --git a/libs/SDL2/include/SDL.h b/libs/SDL2/include/SDL.h index 703dc3d9..9d1ede33 100644 --- a/libs/SDL2/include/SDL.h +++ b/libs/SDL2/include/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_assert.h b/libs/SDL2/include/SDL_assert.h index 0be90470..6889514d 100644 --- a/libs/SDL2/include/SDL_assert.h +++ b/libs/SDL2/include/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -86,8 +86,10 @@ This also solves the problem of... disable assertions. */ +/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking + this condition isn't constant. And looks like an owl's face! */ #ifdef _MSC_VER /* stupid /W4 warnings. */ -#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__) +#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) #else #define SDL_NULL_WHILE_LOOP_CONDITION (0) #endif diff --git a/libs/SDL2/include/SDL_atomic.h b/libs/SDL2/include/SDL_atomic.h index 09e78de7..bb01eb9e 100644 --- a/libs/SDL2/include/SDL_atomic.h +++ b/libs/SDL2/include/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_audio.h b/libs/SDL2/include/SDL_audio.h index 5c04b0bf..359005d0 100644 --- a/libs/SDL2/include/SDL_audio.h +++ b/libs/SDL2/include/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_bits.h b/libs/SDL2/include/SDL_bits.h index 341524fd..c62766d9 100644 --- a/libs/SDL2/include/SDL_bits.h +++ b/libs/SDL2/include/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_blendmode.h b/libs/SDL2/include/SDL_blendmode.h index 25d65b65..c7fa09f7 100644 --- a/libs/SDL2/include/SDL_blendmode.h +++ b/libs/SDL2/include/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_clipboard.h b/libs/SDL2/include/SDL_clipboard.h index 74e2b32f..3ad20548 100644 --- a/libs/SDL2/include/SDL_clipboard.h +++ b/libs/SDL2/include/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config.h b/libs/SDL2/include/SDL_config.h index 9a2e51c5..eda76602 100644 --- a/libs/SDL2/include/SDL_config.h +++ b/libs/SDL2/include/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config.h.cmake b/libs/SDL2/include/SDL_config.h.cmake index 327875f5..34599f25 100644 --- a/libs/SDL2/include/SDL_config.h.cmake +++ b/libs/SDL2/include/SDL_config.h.cmake @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -232,6 +232,7 @@ #cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ #cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ +#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@ #cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ #cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ @@ -243,6 +244,7 @@ #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ #cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ +#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ /* Enable various shared object loading systems */ #cmakedefine SDL_LOADSO_HAIKU @SDL_LOADSO_HAIKU@ @@ -276,14 +278,11 @@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ -#if 0 -/* !!! FIXME: in configure script version, missing here: */ -#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR -#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON -#endif +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@ #cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@ #cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@ @@ -299,6 +298,7 @@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@ #cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@ #cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@ #cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@ #cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@ @@ -307,7 +307,6 @@ #cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@ #cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@ #cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ -#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32@ #cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@ #cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ diff --git a/libs/SDL2/include/SDL_config.h.in b/libs/SDL2/include/SDL_config.h.in index 925bfaa1..2c74868b 100644 --- a/libs/SDL2/include/SDL_config.h.in +++ b/libs/SDL2/include/SDL_config.h.in @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -299,6 +299,7 @@ #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE #undef SDL_VIDEO_DRIVER_X11_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_XDBE #undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XINPUT2 #undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @@ -307,7 +308,6 @@ #undef SDL_VIDEO_DRIVER_X11_XSHAPE #undef SDL_VIDEO_DRIVER_X11_XVIDMODE #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS -#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM #undef SDL_VIDEO_DRIVER_NACL diff --git a/libs/SDL2/include/SDL_config_android.h b/libs/SDL2/include/SDL_config_android.h index 569ff1d5..8d5f1e5f 100644 --- a/libs/SDL2/include/SDL_config_android.h +++ b/libs/SDL2/include/SDL_config_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,7 +43,6 @@ #define HAVE_STDINT_H 1 #define HAVE_CTYPE_H 1 #define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -76,7 +75,6 @@ #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 @@ -103,10 +101,10 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 -#define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 #define HAVE_SYSCONF 1 +#define HAVE_CLOCK_GETTIME 1 #define SIZEOF_VOIDP 4 diff --git a/libs/SDL2/include/SDL_config_iphoneos.h b/libs/SDL2/include/SDL_config_iphoneos.h index 4e3eb2c9..a605b707 100644 --- a/libs/SDL2/include/SDL_config_iphoneos.h +++ b/libs/SDL2/include/SDL_config_iphoneos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -145,6 +145,9 @@ /* enable iPhone keyboard support */ #define SDL_IPHONE_KEYBOARD 1 +/* enable iOS extended launch screen */ +#define SDL_IPHONE_LAUNCHSCREEN 1 + /* enable joystick subsystem */ #define SDL_JOYSTICK_DISABLED 0 diff --git a/libs/SDL2/include/SDL_config_macosx.h b/libs/SDL2/include/SDL_config_macosx.h index b6af492d..e4ce82fc 100644 --- a/libs/SDL2/include/SDL_config_macosx.h +++ b/libs/SDL2/include/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -139,6 +139,7 @@ #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 diff --git a/libs/SDL2/include/SDL_config_minimal.h b/libs/SDL2/include/SDL_config_minimal.h index 1bddafea..7721abc9 100644 --- a/libs/SDL2/include/SDL_config_minimal.h +++ b/libs/SDL2/include/SDL_config_minimal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config_pandora.h b/libs/SDL2/include/SDL_config_pandora.h index aead1ff9..530e78f1 100644 --- a/libs/SDL2/include/SDL_config_pandora.h +++ b/libs/SDL2/include/SDL_config_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config_psp.h b/libs/SDL2/include/SDL_config_psp.h index 617d691f..26bf9d1a 100644 --- a/libs/SDL2/include/SDL_config_psp.h +++ b/libs/SDL2/include/SDL_config_psp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config_windows.h b/libs/SDL2/include/SDL_config_windows.h index 8bc7ffe0..067d7f31 100644 --- a/libs/SDL2/include/SDL_config_windows.h +++ b/libs/SDL2/include/SDL_config_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config_winrt.h b/libs/SDL2/include/SDL_config_winrt.h index ff84f096..0a33993f 100644 --- a/libs/SDL2/include/SDL_config_winrt.h +++ b/libs/SDL2/include/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_config_wiz.h b/libs/SDL2/include/SDL_config_wiz.h index 9204567c..4b3c5a2a 100644 --- a/libs/SDL2/include/SDL_config_wiz.h +++ b/libs/SDL2/include/SDL_config_wiz.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_copying.h b/libs/SDL2/include/SDL_copying.h index 0964da84..6fd65219 100644 --- a/libs/SDL2/include/SDL_copying.h +++ b/libs/SDL2/include/SDL_copying.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_cpuinfo.h b/libs/SDL2/include/SDL_cpuinfo.h index 5b2c7a45..30d09cce 100644 --- a/libs/SDL2/include/SDL_cpuinfo.h +++ b/libs/SDL2/include/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_egl.h b/libs/SDL2/include/SDL_egl.h index ed49a92f..358d869b 100644 --- a/libs/SDL2/include/SDL_egl.h +++ b/libs/SDL2/include/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -478,14 +478,15 @@ typedef khronos_int32_t EGLint; #endif /* __eglplatform_h */ -/* -*- mode: c; tab-width: 8; -*- */ -/* vi: set sw=4 ts=8: */ -/* Reference version of egl.h for EGL 1.4. -* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ -*/ +#ifndef __egl_h_ +#define __egl_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif /* -** Copyright (c) 2007-2009 The Khronos Group Inc. +** Copyright (c) 2013-2015 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -506,301 +507,272 @@ typedef khronos_int32_t EGLint; ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ - -#ifndef __egl_h_ -#define __egl_h_ - -/* All platform-dependent types and macro boilerplate (such as EGLAPI -* and EGLAPIENTRY) should go in eglplatform.h. +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ */ + /*#include */ -#ifdef __cplusplus -extern "C" { -#endif +/* Generated on date 20150623 */ - /* EGL Types */ - /* EGLint is defined in eglplatform.h */ - typedef unsigned int EGLBoolean; - typedef unsigned int EGLenum; - typedef void *EGLConfig; - typedef void *EGLContext; - typedef void *EGLDisplay; - typedef void *EGLSurface; - typedef void *EGLClientBuffer; +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ - /* EGL Versioning */ -#define EGL_VERSION_1_0 1 -#define EGL_VERSION_1_1 1 -#define EGL_VERSION_1_2 1 -#define EGL_VERSION_1_3 1 -#define EGL_VERSION_1_4 1 +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BLUE_SIZE 0x3022 +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_CORE_NATIVE_ENGINE 0x305B +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_DONT_CARE ((EGLint)-1) +#define EGL_DRAW 0x3059 +#define EGL_EXTENSIONS 0x3055 +#define EGL_FALSE 0 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_HEIGHT 0x3056 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_NONE 0x3038 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_READ 0x305A +#define EGL_RED_SIZE 0x3024 +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_SUCCESS 0x3000 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRUE 1 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_WIDTH 0x3057 +#define EGL_WINDOW_BIT 0x0004 +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); +EGLAPI EGLint EGLAPIENTRY eglGetError (void); +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); +EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); +#endif /* EGL_VERSION_1_0 */ - /* EGL Enumerants. Bitmasks and other exceptional cases aside, most - * enums are assigned unique values starting at 0x3000. - */ +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 +#define EGL_BACK_BUFFER 0x3084 +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_CONTEXT_LOST 0x300E +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_TARGET 0x3081 +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); +#endif /* EGL_VERSION_1_1 */ - /* EGL aliases */ -#define EGL_FALSE 0 -#define EGL_TRUE 1 +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_CLIENT_APIS 0x308D +#define EGL_COLORSPACE 0x3087 +#define EGL_COLORSPACE_sRGB 0x3089 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_DISPLAY_SCALING 10000 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_RGB_BUFFER 0x308E +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_UNKNOWN ((EGLint)-1) +#define EGL_VERTICAL_RESOLUTION 0x3091 +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); +#endif /* EGL_VERSION_1_2 */ - /* Out-of-band handle values */ -#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) -#define EGL_NO_CONTEXT ((EGLContext)0) -#define EGL_NO_DISPLAY ((EGLDisplay)0) -#define EGL_NO_SURFACE ((EGLSurface)0) +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 +#define EGL_CONFORMANT 0x3042 +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_COLORSPACE_sRGB 0x3089 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#endif /* EGL_VERSION_1_3 */ - /* Out-of-band attribute value */ -#define EGL_DONT_CARE ((EGLint)-1) +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 +#define EGL_OPENGL_BIT 0x0008 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); +#endif /* EGL_VERSION_1_4 */ - /* Errors / GetError return values */ -#define EGL_SUCCESS 0x3000 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300A -#define EGL_BAD_NATIVE_WINDOW 0x300B -#define EGL_BAD_PARAMETER 0x300C -#define EGL_BAD_SURFACE 0x300D -#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ - - /* Reserved 0x300F-0x301F for additional errors */ - - /* Config attributes */ -#define EGL_BUFFER_SIZE 0x3020 -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BLUE_SIZE 0x3022 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_RED_SIZE 0x3024 -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_CONFIG_CAVEAT 0x3027 -#define EGL_CONFIG_ID 0x3028 -#define EGL_LEVEL 0x3029 -#define EGL_MAX_PBUFFER_HEIGHT 0x302A -#define EGL_MAX_PBUFFER_PIXELS 0x302B -#define EGL_MAX_PBUFFER_WIDTH 0x302C -#define EGL_NATIVE_RENDERABLE 0x302D -#define EGL_NATIVE_VISUAL_ID 0x302E -#define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_SAMPLES 0x3031 -#define EGL_SAMPLE_BUFFERS 0x3032 -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_TRANSPARENT_TYPE 0x3034 -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 -#define EGL_TRANSPARENT_RED_VALUE 0x3037 -#define EGL_NONE 0x3038 /* Attrib list terminator */ -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A -#define EGL_MIN_SWAP_INTERVAL 0x303B -#define EGL_MAX_SWAP_INTERVAL 0x303C -#define EGL_LUMINANCE_SIZE 0x303D -#define EGL_ALPHA_MASK_SIZE 0x303E -#define EGL_COLOR_BUFFER_TYPE 0x303F -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ -#define EGL_CONFORMANT 0x3042 - - /* Reserved 0x3041-0x304F for additional config attributes */ - - /* Config attribute values */ -#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ -#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ -#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ -#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ -#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ - - /* More config attribute values, for EGL_TEXTURE_FORMAT */ -#define EGL_NO_TEXTURE 0x305C -#define EGL_TEXTURE_RGB 0x305D -#define EGL_TEXTURE_RGBA 0x305E -#define EGL_TEXTURE_2D 0x305F - - /* Config attribute mask bits */ -#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ - -#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ -#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ -#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ -#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ - - /* QueryString targets */ -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_EXTENSIONS 0x3055 -#define EGL_CLIENT_APIS 0x308D - - /* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ -#define EGL_HEIGHT 0x3056 -#define EGL_WIDTH 0x3057 -#define EGL_LARGEST_PBUFFER 0x3058 -#define EGL_TEXTURE_FORMAT 0x3080 -#define EGL_TEXTURE_TARGET 0x3081 -#define EGL_MIPMAP_TEXTURE 0x3082 -#define EGL_MIPMAP_LEVEL 0x3083 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_VG_COLORSPACE 0x3087 -#define EGL_VG_ALPHA_FORMAT 0x3088 -#define EGL_HORIZONTAL_RESOLUTION 0x3090 -#define EGL_VERTICAL_RESOLUTION 0x3091 -#define EGL_PIXEL_ASPECT_RATIO 0x3092 -#define EGL_SWAP_BEHAVIOR 0x3093 -#define EGL_MULTISAMPLE_RESOLVE 0x3099 - - /* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ -#define EGL_BACK_BUFFER 0x3084 -#define EGL_SINGLE_BUFFER 0x3085 - - /* OpenVG color spaces */ -#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ -#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ - - /* OpenVG alpha formats */ -#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ -#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ - - /* Constant scale factor by which fractional display resolutions & - * aspect ratio are scaled when queried as integer values. - */ -#define EGL_DISPLAY_SCALING 10000 - - /* Unknown display resolution/aspect ratio */ -#define EGL_UNKNOWN ((EGLint)-1) - - /* Back buffer swap behaviors */ -#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ -#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ - - /* CreatePbufferFromClientBuffer buffer types */ -#define EGL_OPENVG_IMAGE 0x3096 - - /* QueryContext targets */ -#define EGL_CONTEXT_CLIENT_TYPE 0x3097 - - /* CreateContext attributes */ -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 - - /* Multisample resolution behaviors */ -#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ -#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ - - /* BindAPI/QueryAPI targets */ -#define EGL_OPENGL_ES_API 0x30A0 -#define EGL_OPENVG_API 0x30A1 -#define EGL_OPENGL_API 0x30A2 - - /* GetCurrentSurface targets */ -#define EGL_DRAW 0x3059 -#define EGL_READ 0x305A - - /* WaitNative engines */ -#define EGL_CORE_NATIVE_ENGINE 0x305B - - /* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ -#define EGL_COLORSPACE EGL_VG_COLORSPACE -#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT -#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB -#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR -#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE -#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE - - /* EGL extensions must request enum blocks from the Khronos - * API Registrar, who maintains the enumerant registry. Submit - * a bug in Khronos Bugzilla against task "Registry". - */ - - - - /* EGL Functions */ - - EGLAPI EGLint EGLAPIENTRY eglGetError(void); - - EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); - EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); - EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); - - EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); - - EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, - EGLint config_size, EGLint *num_config); - EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, - EGLConfig *configs, EGLint config_size, - EGLint *num_config); - EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, - EGLint attribute, EGLint *value); - - EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, - EGLNativeWindowType win, - const EGLint *attrib_list); - EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, - const EGLint *attrib_list); - EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, - EGLNativePixmapType pixmap, - const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); - EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, - EGLint attribute, EGLint *value); - - EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); - EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); - - EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); - - EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); - - EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( - EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, - EGLConfig config, const EGLint *attrib_list); - - EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, - EGLint attribute, EGLint value); - EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); - EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); - - - EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); - - - EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, - EGLContext share_context, - const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); - EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, - EGLSurface read, EGLContext ctx); - - EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); - EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); - EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); - EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, - EGLint attribute, EGLint *value); - - EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); - EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); - EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); - EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, - EGLNativePixmapType target); - - /* This is a generic function pointer type, whose name indicates it must - * be cast to the proper type *and calling convention* before use. - */ - typedef void(*__eglMustCastToProperFunctionPointerType)(void); - - /* Now, define eglGetProcAddress using the generic function ptr. type */ - EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY - eglGetProcAddress(const char *procname); +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_NO_SYNC ((EGLSync)0) +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_NO_IMAGE ((EGLImage)0) +EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); +EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); +#endif /* EGL_VERSION_1_5 */ #ifdef __cplusplus } @@ -810,581 +782,886 @@ extern "C" { - #ifndef __eglext_h_ -#define __eglext_h_ +#define __eglext_h_ 1 #ifdef __cplusplus extern "C" { #endif - /* - ** Copyright (c) 2007-2013 The Khronos Group Inc. - ** - ** Permission is hereby granted, free of charge, to any person obtaining a - ** copy of this software and/or associated documentation files (the - ** "Materials"), to deal in the Materials without restriction, including - ** without limitation the rights to use, copy, modify, merge, publish, - ** distribute, sublicense, and/or sell copies of the Materials, and to - ** permit persons to whom the Materials are furnished to do so, subject to - ** the following conditions: - ** - ** The above copyright notice and this permission notice shall be included - ** in all copies or substantial portions of the Materials. - ** - ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - */ +/* +** Copyright (c) 2013-2015 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ +*/ -/* #include */ +/*#include */ - /*************************************************************/ +#define EGL_EGLEXT_VERSION 20150623 - /* Header file version number */ - /* Current version at http://www.khronos.org/registry/egl/ */ - /* $Revision: 21254 $ on $Date: 2013-04-25 03:11:55 -0700 (Thu, 25 Apr 2013) $ */ -#define EGL_EGLEXT_VERSION 16 +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: _nomatch_^ + * Default extensions included: egl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF +#endif /* EGL_KHR_cl_event */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); +#endif +#endif /* EGL_KHR_cl_event2 */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 +#endif /* EGL_KHR_client_get_all_proc_addresses */ #ifndef EGL_KHR_config_attribs #define EGL_KHR_config_attribs 1 -#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */ -#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */ -#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */ -#endif - -#ifndef EGL_KHR_lock_surface -#define EGL_KHR_lock_surface 1 -#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ -#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ -#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */ -#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */ -#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */ -#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */ -#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */ -#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */ -#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */ -#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */ -#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */ -#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */ -#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */ -#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */ -#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */ -#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */ -#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */ -#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */ -#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */ -#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */ -#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */ -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLBoolean(EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface); -#endif - -#ifndef EGL_KHR_image -#define EGL_KHR_image 1 -#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */ - typedef void *EGLImageKHR; -#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLImageKHR(EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); -#endif - -#ifndef EGL_KHR_vg_parent_image -#define EGL_KHR_vg_parent_image 1 -#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */ -#endif - -#ifndef EGL_KHR_gl_texture_2D_image -#define EGL_KHR_gl_texture_2D_image 1 -#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */ -#endif - -#ifndef EGL_KHR_gl_texture_cubemap_image -#define EGL_KHR_gl_texture_cubemap_image 1 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */ -#endif - -#ifndef EGL_KHR_gl_texture_3D_image -#define EGL_KHR_gl_texture_3D_image 1 -#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */ -#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */ -#endif - -#ifndef EGL_KHR_gl_renderbuffer_image -#define EGL_KHR_gl_renderbuffer_image 1 -#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ -#endif - -#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */ -#ifndef EGL_KHR_reusable_sync -#define EGL_KHR_reusable_sync 1 - - typedef void* EGLSyncKHR; - typedef khronos_utime_nanoseconds_t EGLTimeKHR; - -#define EGL_SYNC_STATUS_KHR 0x30F1 -#define EGL_SIGNALED_KHR 0x30F2 -#define EGL_UNSIGNALED_KHR 0x30F3 -#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 -#define EGL_CONDITION_SATISFIED_KHR 0x30F6 -#define EGL_SYNC_TYPE_KHR 0x30F7 -#define EGL_SYNC_REUSABLE_KHR 0x30FA -#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR bitfield */ -#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull -#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); - EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); - EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); - EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLSyncKHR(EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); - typedef EGLint(EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#endif -#endif - -#ifndef EGL_KHR_image_base -#define EGL_KHR_image_base 1 - /* Most interfaces defined by EGL_KHR_image_pixmap above */ -#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */ -#endif - -#ifndef EGL_KHR_image_pixmap -#define EGL_KHR_image_pixmap 1 - /* Interfaces defined by EGL_KHR_image above */ -#endif - -#ifndef EGL_IMG_context_priority -#define EGL_IMG_context_priority 1 -#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 -#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 -#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 -#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 -#endif - -#ifndef EGL_KHR_lock_surface2 -#define EGL_KHR_lock_surface2 1 -#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 -#endif - -#ifndef EGL_NV_coverage_sample -#define EGL_NV_coverage_sample 1 -#define EGL_COVERAGE_BUFFERS_NV 0x30E0 -#define EGL_COVERAGE_SAMPLES_NV 0x30E1 -#endif - -#ifndef EGL_NV_depth_nonlinear -#define EGL_NV_depth_nonlinear 1 -#define EGL_DEPTH_ENCODING_NV 0x30E2 -#define EGL_DEPTH_ENCODING_NONE_NV 0 -#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 -#endif - -#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */ -#ifndef EGL_NV_sync -#define EGL_NV_sync 1 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 -#define EGL_SYNC_STATUS_NV 0x30E7 -#define EGL_SIGNALED_NV 0x30E8 -#define EGL_UNSIGNALED_NV 0x30E9 -#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 -#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull -#define EGL_ALREADY_SIGNALED_NV 0x30EA -#define EGL_TIMEOUT_EXPIRED_NV 0x30EB -#define EGL_CONDITION_SATISFIED_NV 0x30EC -#define EGL_SYNC_TYPE_NV 0x30ED -#define EGL_SYNC_CONDITION_NV 0x30EE -#define EGL_SYNC_FENCE_NV 0x30EF -#define EGL_NO_SYNC_NV ((EGLSyncNV)0) - typedef void* EGLSyncNV; - typedef khronos_utime_nanoseconds_t EGLTimeNV; -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV(EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV(EGLSyncNV sync); - EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV(EGLSyncNV sync); - EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV(EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); - EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV(EGLSyncNV sync, EGLenum mode); - EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV(EGLSyncNV sync, EGLint attribute, EGLint *value); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLSyncNV(EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); - typedef EGLint(EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); -#endif -#endif - -#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */ -#ifndef EGL_KHR_fence_sync -#define EGL_KHR_fence_sync 1 - /* Reuses most tokens and entry points from EGL_KHR_reusable_sync */ -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 -#define EGL_SYNC_CONDITION_KHR 0x30F8 -#define EGL_SYNC_FENCE_KHR 0x30F9 -#endif -#endif - -#ifndef EGL_HI_clientpixmap -#define EGL_HI_clientpixmap 1 - - /* Surface Attribute */ -#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 - /* - * Structure representing a client pixmap - * (pixmap's data is in client-space memory). - */ - struct EGLClientPixmapHI - { - void* pData; - EGLint iWidth; - EGLint iHeight; - EGLint iStride; - }; -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); -#endif /* EGL_HI_clientpixmap */ - -#ifndef EGL_HI_colorformats -#define EGL_HI_colorformats 1 - /* Config Attribute */ -#define EGL_COLOR_FORMAT_HI 0x8F70 - /* Color Formats */ -#define EGL_COLOR_RGB_HI 0x8F71 -#define EGL_COLOR_RGBA_HI 0x8F72 -#define EGL_COLOR_ARGB_HI 0x8F73 -#endif /* EGL_HI_colorformats */ - -#ifndef EGL_MESA_drm_image -#define EGL_MESA_drm_image 1 -#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */ -#define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */ -#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */ -#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */ -#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 -#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */ -#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */ -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLImageKHR(EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#endif - -#ifndef EGL_NV_post_sub_buffer -#define EGL_NV_post_sub_buffer 1 -#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLBoolean(EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#endif - -#ifndef EGL_ANGLE_query_surface_pointer -#define EGL_ANGLE_query_surface_pointer 1 -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#endif - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#endif - -#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle -#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 -#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 -#endif - -#ifndef EGL_NV_coverage_sample_resolve -#define EGL_NV_coverage_sample_resolve 1 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 -#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 -#endif - -#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */ -#ifndef EGL_NV_system_time -#define EGL_NV_system_time 1 - typedef khronos_utime_nanoseconds_t EGLuint64NV; -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); - EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLuint64NV(EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); - typedef EGLuint64NV(EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); -#endif -#endif - -#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */ -#ifndef EGL_KHR_stream -#define EGL_KHR_stream 1 - typedef void* EGLStreamKHR; - typedef khronos_uint64_t EGLuint64KHR; -#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) -#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 -#define EGL_PRODUCER_FRAME_KHR 0x3212 -#define EGL_CONSUMER_FRAME_KHR 0x3213 -#define EGL_STREAM_STATE_KHR 0x3214 -#define EGL_STREAM_STATE_CREATED_KHR 0x3215 -#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 -#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 -#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 -#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 -#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A -#define EGL_BAD_STREAM_KHR 0x321B -#define EGL_BAD_STATE_KHR 0x321C -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list); - EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream); - EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); - EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); - EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLStreamKHR(EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#endif -#endif - -#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ -#ifndef EGL_KHR_stream_consumer_gltexture -#define EGL_KHR_stream_consumer_gltexture 1 -#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream); - EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream); - EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif - -#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ -#ifndef EGL_KHR_stream_producer_eglsurface -#define EGL_KHR_stream_producer_eglsurface 1 -#define EGL_STREAM_BIT_KHR 0x0800 -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#endif -#endif - -#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ -#ifndef EGL_KHR_stream_producer_aldatalocator -#define EGL_KHR_stream_producer_aldatalocator 1 -#endif -#endif - -#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ -#ifndef EGL_KHR_stream_fifo -#define EGL_KHR_stream_fifo 1 - /* reuse EGLTimeKHR */ -#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC -#define EGL_STREAM_TIME_NOW_KHR 0x31FD -#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE -#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#endif -#endif - -#ifndef EGL_EXT_create_context_robustness -#define EGL_EXT_create_context_robustness 1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 -#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF -#endif - -#ifndef EGL_ANGLE_d3d_share_handle_client_buffer -#define EGL_ANGLE_d3d_share_handle_client_buffer 1 - /* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */ -#endif +#define EGL_CONFORMANT_KHR 0x3042 +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#endif /* EGL_KHR_config_attribs */ #ifndef EGL_KHR_create_context #define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif /* EGL_KHR_create_context */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 +#endif /* EGL_KHR_create_context_no_error */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); #endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_fence_sync */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 +#endif /* EGL_KHR_get_all_proc_addresses */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 +#define EGL_GL_COLORSPACE_KHR 0x309D +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#endif /* EGL_KHR_gl_colorspace */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 +#endif /* EGL_KHR_gl_renderbuffer_image */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC +#endif /* EGL_KHR_gl_texture_2D_image */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD +#endif /* EGL_KHR_gl_texture_3D_image */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 +typedef void *EGLImageKHR; +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 +#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); +#endif +#endif /* EGL_KHR_image */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 +#endif /* EGL_KHR_image_base */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 +#endif /* EGL_KHR_image_pixmap */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); +#endif +#endif /* EGL_KHR_lock_surface */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 +#endif /* EGL_KHR_lock_surface2 */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); +#endif +#endif /* EGL_KHR_lock_surface3 */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 +#define EGL_BUFFER_AGE_KHR 0x313D +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_KHR_partial_update */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 +#define EGL_PLATFORM_ANDROID_KHR 0x3141 +#endif /* EGL_KHR_platform_android */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 +#define EGL_PLATFORM_GBM_KHR 0x31D7 +#endif /* EGL_KHR_platform_gbm */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 +#endif /* EGL_KHR_platform_wayland */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 +#endif /* EGL_KHR_platform_x11 */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_reusable_sync */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_stream */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 +#ifdef EGL_KHR_stream +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_consumer_gltexture */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 +typedef int EGLNativeFileDescriptorKHR; +#ifdef EGL_KHR_stream +#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) +typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_cross_process_fd */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 +#ifdef EGL_KHR_stream +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_fifo */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 +#ifdef EGL_KHR_stream +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 +#ifdef EGL_KHR_stream +#define EGL_STREAM_BIT_KHR 0x0800 +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_producer_eglsurface */ #ifndef EGL_KHR_surfaceless_context #define EGL_KHR_surfaceless_context 1 - /* No tokens/entry points, just relaxes an error condition */ -#endif +#endif /* EGL_KHR_surfaceless_context */ -#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ -#ifndef EGL_KHR_stream_cross_process_fd -#define EGL_KHR_stream_cross_process_fd 1 - typedef int EGLNativeFileDescriptorKHR; -#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream); - EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLNativeFileDescriptorKHR(EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); - typedef EGLStreamKHR(EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#endif +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #endif +#endif /* EGL_KHR_swap_buffers_with_damage */ -#ifndef EGL_EXT_multiview_window -#define EGL_EXT_multiview_window 1 -#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 -#endif +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA +#endif /* EGL_KHR_vg_parent_image */ #ifndef EGL_KHR_wait_sync #define EGL_KHR_wait_sync 1 +typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); #ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLint(EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif - -#ifndef EGL_NV_post_convert_rounding -#define EGL_NV_post_convert_rounding 1 - /* No tokens or entry points, just relaxes behavior of SwapBuffers */ -#endif - -#ifndef EGL_NV_native_query -#define EGL_NV_native_query 1 -#ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV(EGLDisplay dpy, EGLNativeDisplayType* display_id); - EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType* window); - EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType* pixmap); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC)(EGLDisplay dpy, EGLNativeDisplayType *display_id); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); - typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#endif - -#ifndef EGL_NV_3dvision_surface -#define EGL_NV_3dvision_surface 1 -#define EGL_AUTO_STEREO_NV 0x3136 -#endif - -#ifndef EGL_ANDROID_framebuffer_target -#define EGL_ANDROID_framebuffer_target 1 -#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 +EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); #endif +#endif /* EGL_KHR_wait_sync */ #ifndef EGL_ANDROID_blob_cache #define EGL_ANDROID_blob_cache 1 - typedef khronos_ssize_t EGLsizeiANDROID; - typedef void(*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); - typedef EGLsizeiANDROID(*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); #ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); +EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); #endif +#endif /* EGL_ANDROID_blob_cache */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 +#endif /* EGL_ANDROID_framebuffer_target */ #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_ANDROID 0x3140 -#endif +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 +#endif /* EGL_ANDROID_image_native_buffer */ #ifndef EGL_ANDROID_native_fence_sync #define EGL_ANDROID_native_fence_sync 1 -#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 -#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 -#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 -#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 +#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 +typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); #ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLint(EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, EGLSyncKHR); +EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); #endif +#endif /* EGL_ANDROID_native_fence_sync */ #ifndef EGL_ANDROID_recordable #define EGL_ANDROID_recordable 1 -#define EGL_RECORDABLE_ANDROID 0x3142 -#endif +#define EGL_RECORDABLE_ANDROID 0x3142 +#endif /* EGL_ANDROID_recordable */ -#ifndef EGL_EXT_buffer_age -#define EGL_EXT_buffer_age 1 -#define EGL_BUFFER_AGE_EXT 0x313D -#endif +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ -#ifndef EGL_EXT_image_dma_buf_import -#define EGL_EXT_image_dma_buf_import 1 -#define EGL_LINUX_DMA_BUF_EXT 0x3270 -#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 -#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 -#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 -#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 -#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 -#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 -#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 -#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 -#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 -#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A -#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B -#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C -#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D -#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E -#define EGL_ITU_REC601_EXT 0x327F -#define EGL_ITU_REC709_EXT 0x3280 -#define EGL_ITU_REC2020_EXT 0x3281 -#define EGL_YUV_FULL_RANGE_EXT 0x3282 -#define EGL_YUV_NARROW_RANGE_EXT 0x3283 -#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 -#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 +#endif /* EGL_ANGLE_device_d3d */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); #endif +#endif /* EGL_ANGLE_query_surface_pointer */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 +#define EGL_FIXED_SIZE_ANGLE 0x3201 +#endif /* EGL_ANGLE_window_fixed_size */ #ifndef EGL_ARM_pixmap_multisample_discard #define EGL_ARM_pixmap_multisample_discard 1 -#define EGL_DISCARD_SAMPLES_ARM 0x3286 +#define EGL_DISCARD_SAMPLES_ARM 0x3286 +#endif /* EGL_ARM_pixmap_multisample_discard */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 +#define EGL_BUFFER_AGE_EXT 0x313D +#endif /* EGL_EXT_buffer_age */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 +#endif /* EGL_EXT_client_extensions */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF +#endif /* EGL_EXT_create_context_robustness */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 +typedef void *EGLDeviceEXT; +#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); #endif +#endif /* EGL_EXT_device_base */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 +#endif /* EGL_EXT_device_drm */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 +#endif /* EGL_EXT_device_enumeration */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 +#endif /* EGL_EXT_device_openwf */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 +#endif /* EGL_EXT_device_query */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 +#endif /* EGL_EXT_image_dma_buf_import */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 +#endif /* EGL_EXT_multiview_window */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) +#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); +EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); +EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); +#endif +#endif /* EGL_EXT_output_base */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 +#endif /* EGL_EXT_output_drm */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 +#endif /* EGL_EXT_output_openwf */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); +#endif +#endif /* EGL_EXT_platform_base */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 +#define EGL_PLATFORM_DEVICE_EXT 0x313F +#endif /* EGL_EXT_platform_device */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 +#endif /* EGL_EXT_platform_wayland */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 +#endif /* EGL_EXT_platform_x11 */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 +#endif /* EGL_EXT_protected_surface */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); +#endif +#endif /* EGL_EXT_stream_consumer_egloutput */ #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES - EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif /* EGL_EGLEXT_PROTOTYPES */ - typedef EGLBoolean(EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #endif +#endif /* EGL_EXT_swap_buffers_with_damage */ -/* #include */ +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D +#endif /* EGL_EXT_yuv_surface */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 +struct EGLClientPixmapHI { + void *pData; + EGLint iWidth; + EGLint iHeight; + EGLint iStride; +}; +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); +#endif +#endif /* EGL_HI_clientpixmap */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 +#endif /* EGL_HI_colorformats */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#endif /* EGL_IMG_context_priority */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif +#endif /* EGL_MESA_drm_image */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); +#endif +#endif /* EGL_MESA_image_dma_buf_export */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 +#define EGL_PLATFORM_GBM_MESA 0x31D7 +#endif /* EGL_MESA_platform_gbm */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#endif +#endif /* EGL_NOK_swap_region */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#endif +#endif /* EGL_NOK_swap_region2 */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 +#define EGL_Y_INVERTED_NOK 0x307F +#endif /* EGL_NOK_texture_from_pixmap */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 +#define EGL_AUTO_STEREO_NV 0x3136 +#endif /* EGL_NV_3dvision_surface */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif /* EGL_NV_coverage_sample */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 +#endif /* EGL_NV_coverage_sample_resolve */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D +#endif /* EGL_NV_cuda_event */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif /* EGL_NV_depth_nonlinear */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 +#define EGL_CUDA_DEVICE_NV 0x323A +#endif /* EGL_NV_device_cuda */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); +#endif +#endif /* EGL_NV_native_query */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 +#endif /* EGL_NV_post_convert_rounding */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#endif +#endif /* EGL_NV_post_sub_buffer */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 +#define EGL_SYNC_NEW_FRAME_NV 0x321F +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); +#endif +#endif /* EGL_NV_stream_sync */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_NO_SYNC_NV ((EGLSyncNV)0) +typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); +EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_NV_sync */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 +typedef khronos_utime_nanoseconds_t EGLuint64NV; +#ifdef KHRONOS_SUPPORT_INT64 +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_NV_system_time */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 +#endif /* EGL_TIZEN_image_native_buffer */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 +#endif /* EGL_TIZEN_image_native_surface */ #ifdef __cplusplus } @@ -1393,5 +1670,4 @@ extern "C" { #endif /* __eglext_h_ */ - #endif /* _MSC_VER */ diff --git a/libs/SDL2/include/SDL_endian.h b/libs/SDL2/include/SDL_endian.h index 161c418d..ec7841c4 100644 --- a/libs/SDL2/include/SDL_endian.h +++ b/libs/SDL2/include/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,7 +42,7 @@ #ifdef __linux__ #include #define SDL_BYTEORDER __BYTE_ORDER -#else /* __linux __ */ +#else /* __linux__ */ #if defined(__hppa__) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MISPEB__)) || \ @@ -52,7 +52,7 @@ #else #define SDL_BYTEORDER SDL_LIL_ENDIAN #endif -#endif /* __linux __ */ +#endif /* __linux__ */ #endif /* !SDL_BYTEORDER */ diff --git a/libs/SDL2/include/SDL_error.h b/libs/SDL2/include/SDL_error.h index 001abb0f..1720c43f 100644 --- a/libs/SDL2/include/SDL_error.h +++ b/libs/SDL2/include/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_events.h b/libs/SDL2/include/SDL_events.h index 09ab9c2f..2ccb1013 100644 --- a/libs/SDL2/include/SDL_events.h +++ b/libs/SDL2/include/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -134,6 +134,10 @@ typedef enum /* Drag and drop events */ SDL_DROPFILE = 0x1000, /**< The system requests a file open */ + /* Audio hotplug events */ + SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ + SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ + /* Render events */ SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ @@ -382,6 +386,20 @@ typedef struct SDL_ControllerDeviceEvent Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; +/** + * \brief Audio device event structure (event.adevice.*) + */ +typedef struct SDL_AudioDeviceEvent +{ + Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ + Uint32 timestamp; + Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ + Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; +} SDL_AudioDeviceEvent; + /** * \brief Touch finger event structure (event.tfinger.*) @@ -394,8 +412,8 @@ typedef struct SDL_TouchFingerEvent SDL_FingerID fingerId; float x; /**< Normalized in the range 0...1 */ float y; /**< Normalized in the range 0...1 */ - float dx; /**< Normalized in the range 0...1 */ - float dy; /**< Normalized in the range 0...1 */ + float dx; /**< Normalized in the range -1...1 */ + float dy; /**< Normalized in the range -1...1 */ float pressure; /**< Normalized in the range 0...1 */ } SDL_TouchFingerEvent; @@ -422,7 +440,7 @@ typedef struct SDL_MultiGestureEvent */ typedef struct SDL_DollarGestureEvent { - Uint32 type; /**< ::SDL_DOLLARGESTURE */ + Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ Uint32 timestamp; SDL_TouchID touchId; /**< The touch device id */ SDL_GestureID gestureId; @@ -435,8 +453,8 @@ typedef struct SDL_DollarGestureEvent /** * \brief An event used to request a file open by the system (event.drop.*) - * This event is disabled by default, you can enable it with SDL_EventState() - * \note If you enable this event, you must free the filename in the event. + * This event is enabled by default, you can disable it with SDL_EventState(). + * \note If this event is enabled, you must free the filename in the event. */ typedef struct SDL_DropEvent { @@ -516,6 +534,7 @@ typedef union SDL_Event SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ SDL_QuitEvent quit; /**< Quit request event data */ SDL_UserEvent user; /**< Custom event data */ SDL_SysWMEvent syswm; /**< System dependent window event data */ diff --git a/libs/SDL2/include/SDL_filesystem.h b/libs/SDL2/include/SDL_filesystem.h index 3dc94dce..15bda498 100644 --- a/libs/SDL2/include/SDL_filesystem.h +++ b/libs/SDL2/include/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_gamecontroller.h b/libs/SDL2/include/SDL_gamecontroller.h index 5c9082ce..72fba60b 100644 --- a/libs/SDL2/include/SDL_gamecontroller.h +++ b/libs/SDL2/include/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -163,8 +163,9 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_ /** * Open a game controller for use. * The index passed as an argument refers to the N'th game controller on the system. - * This index is the value which will identify this controller in future controller - * events. + * This index is not the value which will identify this controller in future + * controller events. The joystick's instance id (::SDL_JoystickID) will be + * used there instead. * * \return A controller identifier, or NULL if an error occurred. */ diff --git a/libs/SDL2/include/SDL_gesture.h b/libs/SDL2/include/SDL_gesture.h index dbc16924..44983486 100644 --- a/libs/SDL2/include/SDL_gesture.h +++ b/libs/SDL2/include/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_haptic.h b/libs/SDL2/include/SDL_haptic.h index b6671120..0e6f523b 100644 --- a/libs/SDL2/include/SDL_haptic.h +++ b/libs/SDL2/include/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -102,11 +102,6 @@ * return 0; // Success * } * \endcode - * - * You can also find out more information on my blog: - * http://bobbens.dyndns.org/journal/2010/sdl_haptic/ - * - * \author Edgar Simo Serra */ #ifndef _SDL_haptic_h @@ -900,7 +895,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); /** * \brief Opens a Haptic device for usage from a Joystick device. * - * You must still close the haptic device seperately. It will not be closed + * You must still close the haptic device separately. It will not be closed * with the joystick. * * When opening from a joystick you should first close the haptic device before @@ -957,7 +952,7 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); /** - * \brief Gets the haptic devices supported features in bitwise matter. + * \brief Gets the haptic device's supported features in bitwise manner. * * Example: * \code diff --git a/libs/SDL2/include/SDL_hints.h b/libs/SDL2/include/SDL_hints.h index a3508ff0..4e3089bf 100644 --- a/libs/SDL2/include/SDL_hints.h +++ b/libs/SDL2/include/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -243,6 +243,9 @@ extern "C" { * this is problematic. This functionality can be disabled by setting this * hint. * + * As of SDL 2.0.4, SDL_EnableScreenSaver and SDL_DisableScreenSaver accomplish + * the same thing on iOS. They should be preferred over this hint. + * * This variable can be set to the following values: * "0" - Enable idle timer * "1" - Disable idle timer @@ -261,8 +264,9 @@ extern "C" { #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" /** - * \brief A variable controlling whether an Android built-in accelerometer should be - * listed as a joystick device, rather than listing actual joysticks only. + * \brief A variable controlling whether the Android / iOS built-in + * accelerometer should be listed as a joystick device, rather than listing + * actual joysticks only. * * This variable can be set to the following values: * "0" - List only real joysticks and accept input from them @@ -344,8 +348,19 @@ extern "C" { #define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" + /** - * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac) +* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size +* +* Use this hint in case you need to set SDL's threads stack size to other than the default. +* This is specially useful if you build SDL against a non glibc libc library (such as musl) which +* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). +* Support for this hint is currently available only in the pthread backend. +*/ +#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" + +/** + * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) */ #define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" @@ -510,6 +525,14 @@ extern "C" { */ #define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" +/** +* \brief When set don't force the SDL app to become a foreground process +* +* This hint only applies to Mac OS X. +* +*/ +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" + /** * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. */ @@ -532,6 +555,18 @@ extern "C" { */ #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" + /** + * \brief A variable to control whether mouse and touch events are to be treated together or separately + * + * The variable can be set to the following values: + * "0" - Mouse events will be handled as touch events, and touch will raise fake mouse + * events. This is the behaviour of SDL <= 2.0.3. (default) + * "1" - Mouse events will be handled separately from pure touch events. + * + * The value of this hint is used at runtime, so it can be changed at any time. + */ +#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH" + /** * \brief override the binding element for keyboard inputs for Emscripten builds * @@ -546,6 +581,27 @@ extern "C" { */ #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +/** + * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. + * + * This hint only applies to Unix-like platforms. + * + * The variable can be set to the following values: + * "0" - SDL will install a SIGINT and SIGTERM handler, and when it + * catches a signal, convert it into an SDL_QUIT event. + * "1" - SDL will not install a signal handler at all. + */ +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. + * + * The variable can be set to the following values: + * "0" - SDL will generate a window-close event when it sees Alt+F4. + * "1" - SDL will only do normal key handling for Alt+F4. + */ +#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" + /** * \brief An enumeration of hint priorities */ diff --git a/libs/SDL2/include/SDL_joystick.h b/libs/SDL2/include/SDL_joystick.h index f26bb921..cad06a86 100644 --- a/libs/SDL2/include/SDL_joystick.h +++ b/libs/SDL2/include/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,8 +88,9 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); /** * Open a joystick for use. * The index passed as an argument refers to the N'th joystick on the system. - * This index is the value which will identify this joystick in future joystick - * events. + * This index is not the value which will identify this joystick in future + * joystick events. The joystick's instance id (::SDL_JoystickID) will be used + * there instead. * * \return A joystick identifier, or NULL if an error occurred. */ @@ -189,7 +190,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, */ /* @{ */ #define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 +#define SDL_HAT_UP 0x01 #define SDL_HAT_RIGHT 0x02 #define SDL_HAT_DOWN 0x04 #define SDL_HAT_LEFT 0x08 diff --git a/libs/SDL2/include/SDL_keyboard.h b/libs/SDL2/include/SDL_keyboard.h index 586a26cf..1ad58ee3 100644 --- a/libs/SDL2/include/SDL_keyboard.h +++ b/libs/SDL2/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_keycode.h b/libs/SDL2/include/SDL_keycode.h index d5f5dd0a..66980cef 100644 --- a/libs/SDL2/include/SDL_keycode.h +++ b/libs/SDL2/include/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_loadso.h b/libs/SDL2/include/SDL_loadso.h index 0359eae1..db7493ad 100644 --- a/libs/SDL2/include/SDL_loadso.h +++ b/libs/SDL2/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_log.h b/libs/SDL2/include/SDL_log.h index ef4d443c..6ffbfc99 100644 --- a/libs/SDL2/include/SDL_log.h +++ b/libs/SDL2/include/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_main.h b/libs/SDL2/include/SDL_main.h index 347a44d0..c5168ba6 100644 --- a/libs/SDL2/include/SDL_main.h +++ b/libs/SDL2/include/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -143,7 +143,7 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); * * \param mainFunction The SDL app's C-style main(). * \param reserved Reserved for future use; should be NULL - * \ret 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more + * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more * information on the failure. */ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved); diff --git a/libs/SDL2/include/SDL_messagebox.h b/libs/SDL2/include/SDL_messagebox.h index 6004da0f..44d458f4 100644 --- a/libs/SDL2/include/SDL_messagebox.h +++ b/libs/SDL2/include/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_mouse.h b/libs/SDL2/include/SDL_mouse.h index dd084279..1ae31269 100644 --- a/libs/SDL2/include/SDL_mouse.h +++ b/libs/SDL2/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -137,10 +137,11 @@ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, * * \param x The x coordinate * \param y The y coordinate + * \return 0 on success, -1 on error (usually: unsupported by a platform). * * \note This function generates a mouse motion event */ -extern DECLSPEC void SDLCALL SDL_WarpMouseGlobal(int x, int y); +extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); /** * \brief Set relative mouse mode. diff --git a/libs/SDL2/include/SDL_mutex.h b/libs/SDL2/include/SDL_mutex.h index 3e8b4dbe..2765210a 100644 --- a/libs/SDL2/include/SDL_mutex.h +++ b/libs/SDL2/include/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_name.h b/libs/SDL2/include/SDL_name.h index 719666ff..b6a413a2 100644 --- a/libs/SDL2/include/SDL_name.h +++ b/libs/SDL2/include/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_opengl.h b/libs/SDL2/include/SDL_opengl.h index 35e9f308..aebe30eb 100644 --- a/libs/SDL2/include/SDL_opengl.h +++ b/libs/SDL2/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_opengl_glext.h b/libs/SDL2/include/SDL_opengl_glext.h index 7e840f72..cd3869fe 100644 --- a/libs/SDL2/include/SDL_opengl_glext.h +++ b/libs/SDL2/include/SDL_opengl_glext.h @@ -2988,6 +2988,11 @@ GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); #define GL_ARB_framebuffer_sRGB 1 #endif /* GL_ARB_framebuffer_sRGB */ +#ifndef GL_KHR_context_flush_control +#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC +#endif /* GL_KHR_context_flush_control */ + #ifndef GL_ARB_geometry_shader4 #define GL_ARB_geometry_shader4 1 #define GL_LINES_ADJACENCY_ARB 0x000A diff --git a/libs/SDL2/include/SDL_opengles.h b/libs/SDL2/include/SDL_opengles.h index d88e1573..49c709c1 100644 --- a/libs/SDL2/include/SDL_opengles.h +++ b/libs/SDL2/include/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_opengles2.h b/libs/SDL2/include/SDL_opengles2.h index d245b8eb..13ebd9dc 100644 --- a/libs/SDL2/include/SDL_opengles2.h +++ b/libs/SDL2/include/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_pixels.h b/libs/SDL2/include/SDL_pixels.h index 61e97c8d..ba24a47d 100644 --- a/libs/SDL2/include/SDL_pixels.h +++ b/libs/SDL2/include/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -86,6 +86,8 @@ enum }; /** Array component order, low byte -> high byte. */ +/* !!! FIXME: in 2.1, make these not overlap differently with + !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ enum { SDL_ARRAYORDER_NONE, @@ -134,12 +136,31 @@ enum (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) -#define SDL_ISPIXELFORMAT_ALPHA(format) \ +#define SDL_ISPIXELFORMAT_PACKED(format) \ (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) + +#define SDL_ISPIXELFORMAT_ARRAY(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) + +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + ((SDL_ISPIXELFORMAT_PACKED(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))) + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ + (SDL_ISPIXELFORMAT_ARRAY(format) && \ + ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) /* The flag is set to 1 because 0x1? is not in the printable ASCII range */ #define SDL_ISPIXELFORMAT_FOURCC(format) \ diff --git a/libs/SDL2/include/SDL_platform.h b/libs/SDL2/include/SDL_platform.h index adafde52..75e4c653 100644 --- a/libs/SDL2/include/SDL_platform.h +++ b/libs/SDL2/include/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_power.h b/libs/SDL2/include/SDL_power.h index cf71c982..89eb1718 100644 --- a/libs/SDL2/include/SDL_power.h +++ b/libs/SDL2/include/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_quit.h b/libs/SDL2/include/SDL_quit.h index 8a786445..0108ff04 100644 --- a/libs/SDL2/include/SDL_quit.h +++ b/libs/SDL2/include/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_rect.h b/libs/SDL2/include/SDL_rect.h index 6bfce311..ebe51674 100644 --- a/libs/SDL2/include/SDL_rect.h +++ b/libs/SDL2/include/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_render.h b/libs/SDL2/include/SDL_render.h index 12da6f8b..de2749cc 100644 --- a/libs/SDL2/include/SDL_render.h +++ b/libs/SDL2/include/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -229,7 +229,7 @@ extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, * \param w The width of the texture in pixels. * \param h The height of the texture in pixels. * - * \return The created texture is returned, or 0 if no rendering context was + * \return The created texture is returned, or NULL if no rendering context was * active, the format was unsupported, or the width or height were out * of range. * @@ -248,7 +248,7 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, * \param renderer The renderer. * \param surface The surface containing pixel data used to fill the texture. * - * \return The created texture is returned, or 0 on error. + * \return The created texture is returned, or NULL on error. * * \note The surface is not modified or freed by this function. * diff --git a/libs/SDL2/include/SDL_rwops.h b/libs/SDL2/include/SDL_rwops.h index b007fb63..c8b024be 100644 --- a/libs/SDL2/include/SDL_rwops.h +++ b/libs/SDL2/include/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_scancode.h b/libs/SDL2/include/SDL_scancode.h index 4b3be28f..4bf86180 100644 --- a/libs/SDL2/include/SDL_scancode.h +++ b/libs/SDL2/include/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_shape.h b/libs/SDL2/include/SDL_shape.h index 53029306..157d6127 100644 --- a/libs/SDL2/include/SDL_shape.h +++ b/libs/SDL2/include/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_stdinc.h b/libs/SDL2/include/SDL_stdinc.h index 7cf02084..c1f2b6dd 100644 --- a/libs/SDL2/include/SDL_stdinc.h +++ b/libs/SDL2/include/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -226,7 +226,7 @@ typedef uint64_t Uint64; #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) #else -#if _MSC_VER >= 1600 /* VS 2010 and above */ +#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ #include #define SDL_IN_BYTECAP(x) _In_bytecount_(x) diff --git a/libs/SDL2/include/SDL_surface.h b/libs/SDL2/include/SDL_surface.h index aa8d8217..3634f7d3 100644 --- a/libs/SDL2/include/SDL_surface.h +++ b/libs/SDL2/include/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_system.h b/libs/SDL2/include/SDL_system.h index 65d37865..bdc4f968 100644 --- a/libs/SDL2/include/SDL_system.h +++ b/libs/SDL2/include/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,6 +42,12 @@ extern "C" { /* Platform specific functions for Windows */ #ifdef __WIN32__ + +/** + \brief Set a function that is called for every windows message, before TranslateMessage() +*/ +typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); +extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); /** \brief Returns the D3D9 adapter index that matches the specified display index. @@ -73,7 +79,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *a /* Platform specific functions for iOS */ #if defined(__IPHONEOS__) && __IPHONEOS__ +#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); + +#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); #endif /* __IPHONEOS__ */ diff --git a/libs/SDL2/include/SDL_syswm.h b/libs/SDL2/include/SDL_syswm.h index 03c3b025..a3441fdc 100644 --- a/libs/SDL2/include/SDL_syswm.h +++ b/libs/SDL2/include/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -98,6 +98,7 @@ typedef struct _NSWindow NSWindow; typedef struct _UIWindow UIWindow; typedef struct _UIViewController UIViewController; #endif +typedef Uint32 GLuint; #endif #if defined(SDL_VIDEO_DRIVER_ANDROID) @@ -162,6 +163,7 @@ struct SDL_SysWMmsg #if defined(SDL_VIDEO_DRIVER_UIKIT) struct { + int dummy; /* No UIKit window events yet */ } uikit; #endif @@ -186,6 +188,7 @@ struct SDL_SysWMinfo struct { HWND window; /**< The window handle */ + HDC hdc; /**< The window device context */ } win; #endif #if defined(SDL_VIDEO_DRIVER_WINRT) @@ -227,6 +230,9 @@ struct SDL_SysWMinfo #else UIWindow *window; /* The UIKit window */ #endif + GLuint framebuffer; /* The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ + GLuint colorbuffer; /* The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ + GLuint resolveFramebuffer; /* The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ } uikit; #endif #if defined(SDL_VIDEO_DRIVER_WAYLAND) diff --git a/libs/SDL2/include/SDL_test.h b/libs/SDL2/include/SDL_test.h index ae649a42..77b350bd 100644 --- a/libs/SDL2/include/SDL_test.h +++ b/libs/SDL2/include/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -52,7 +52,7 @@ extern "C" { /* Global definitions */ /* - * Note: Maximum size of SDLTest log message is less than SDLs limit + * Note: Maximum size of SDLTest log message is less than SDL's limit * to ensure we can fit additional information such as the timestamp. */ #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 diff --git a/libs/SDL2/include/SDL_test_assert.h b/libs/SDL2/include/SDL_test_assert.h index 6a843a9e..a800a384 100644 --- a/libs/SDL2/include/SDL_test_assert.h +++ b/libs/SDL2/include/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_common.h b/libs/SDL2/include/SDL_test_common.h index 45c9edaf..bb671fa5 100644 --- a/libs/SDL2/include/SDL_test_common.h +++ b/libs/SDL2/include/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_compare.h b/libs/SDL2/include/SDL_test_compare.h index 0649ee35..bc121336 100644 --- a/libs/SDL2/include/SDL_test_compare.h +++ b/libs/SDL2/include/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_crc32.h b/libs/SDL2/include/SDL_test_crc32.h index f0e80e64..cf9ea23d 100644 --- a/libs/SDL2/include/SDL_test_crc32.h +++ b/libs/SDL2/include/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_font.h b/libs/SDL2/include/SDL_test_font.h index 8d51d4a9..42696d74 100644 --- a/libs/SDL2/include/SDL_test_font.h +++ b/libs/SDL2/include/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_fuzzer.h b/libs/SDL2/include/SDL_test_fuzzer.h index 61d7e357..59c89a50 100644 --- a/libs/SDL2/include/SDL_test_fuzzer.h +++ b/libs/SDL2/include/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_harness.h b/libs/SDL2/include/SDL_test_harness.h index 2c1e2ade..b3389315 100644 --- a/libs/SDL2/include/SDL_test_harness.h +++ b/libs/SDL2/include/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_images.h b/libs/SDL2/include/SDL_test_images.h index 05627996..9b9f979b 100644 --- a/libs/SDL2/include/SDL_test_images.h +++ b/libs/SDL2/include/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_log.h b/libs/SDL2/include/SDL_test_log.h index 2157954b..968d9b32 100644 --- a/libs/SDL2/include/SDL_test_log.h +++ b/libs/SDL2/include/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_md5.h b/libs/SDL2/include/SDL_test_md5.h index 7bc39b22..52ea2c9a 100644 --- a/libs/SDL2/include/SDL_test_md5.h +++ b/libs/SDL2/include/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_test_random.h b/libs/SDL2/include/SDL_test_random.h index 6c5660d8..925205df 100644 --- a/libs/SDL2/include/SDL_test_random.h +++ b/libs/SDL2/include/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_thread.h b/libs/SDL2/include/SDL_thread.h index 9e534141..797767f8 100644 --- a/libs/SDL2/include/SDL_thread.h +++ b/libs/SDL2/include/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_timer.h b/libs/SDL2/include/SDL_timer.h index a48e0466..1f2a0206 100644 --- a/libs/SDL2/include/SDL_timer.h +++ b/libs/SDL2/include/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,7 +88,7 @@ typedef int SDL_TimerID; /** * \brief Add a new timer to the pool of timers already running. * - * \return A timer ID, or NULL when an error occurs. + * \return A timer ID, or 0 when an error occurs. */ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, diff --git a/libs/SDL2/include/SDL_touch.h b/libs/SDL2/include/SDL_touch.h index 017deb28..68ff1714 100644 --- a/libs/SDL2/include/SDL_touch.h +++ b/libs/SDL2/include/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_types.h b/libs/SDL2/include/SDL_types.h index cd3ba33c..1a1877fa 100644 --- a/libs/SDL2/include/SDL_types.h +++ b/libs/SDL2/include/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_version.h b/libs/SDL2/include/SDL_version.h index b74e24c9..0b364d07 100644 --- a/libs/SDL2/include/SDL_version.h +++ b/libs/SDL2/include/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/include/SDL_video.h b/libs/SDL2/include/SDL_video.h index 4a2fb045..f466165b 100644 --- a/libs/SDL2/include/SDL_video.h +++ b/libs/SDL2/include/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -189,7 +189,8 @@ typedef enum SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR } SDL_GLattr; typedef enum @@ -207,6 +208,12 @@ typedef enum SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 } SDL_GLcontextFlag; +typedef enum +{ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 +} SDL_GLcontextReleaseFlag; + /* Function prototypes */ @@ -289,6 +296,18 @@ extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); */ extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); +/** + * \brief Get the dots/pixels-per-inch for a display + * + * \note Diagonal, horizontal and vertical DPI can all be optionally + * returned if the parameter is non-NULL. + * + * \return 0 on success, or -1 if no DPI information is available or the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); + /** * \brief Returns the number of available display modes. * @@ -715,6 +734,9 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, * \param window The window for which the input grab mode should be set. * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. * + * If the caller enables a grab while another window is currently grabbed, + * the other window loses its grab in favor of the caller's window. + * * \sa SDL_GetWindowGrab() */ extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, @@ -729,6 +751,15 @@ extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, */ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); +/** + * \brief Get the window that currently has an input grab enabled. + * + * \return This returns the window if input is grabbed, and NULL otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); + /** * \brief Set the brightness (gamma correction) for a window. * diff --git a/libs/SDL2/include/begin_code.h b/libs/SDL2/include/begin_code.h index b058bf36..c032400f 100644 --- a/libs/SDL2/include/begin_code.h +++ b/libs/SDL2/include/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -64,8 +64,6 @@ # else # if defined(__GNUC__) && __GNUC__ >= 4 # define DECLSPEC __attribute__ ((visibility("default"))) -# elif defined(__GNUC__) && __GNUC__ >= 2 -# define DECLSPEC __declspec(dllexport) # else # define DECLSPEC # endif diff --git a/libs/SDL2/include/close_code.h b/libs/SDL2/include/close_code.h index 9826f147..73f6c818 100644 --- a/libs/SDL2/include/close_code.h +++ b/libs/SDL2/include/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/Linux/SDL_config_premake.h b/libs/SDL2/premake/Linux/SDL_config_premake.h index 01a13580..c865684b 100644 --- a/libs/SDL2/premake/Linux/SDL_config_premake.h +++ b/libs/SDL2/premake/Linux/SDL_config_premake.h @@ -1,7 +1,7 @@ /* include/SDL_config.h. Generated from SDL_config.h.in by configure. */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -229,6 +229,9 @@ #ifndef SDL_VIDEO_DRIVER_X11_XCURSOR #define SDL_VIDEO_DRIVER_X11_XCURSOR 1 #endif +#ifndef SDL_VIDEO_DRIVER_X11_XDBE +#define SDL_VIDEO_DRIVER_X11_XDBE 1 +#endif #ifndef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 #endif diff --git a/libs/SDL2/premake/MinGW/SDL_config_premake.h b/libs/SDL2/premake/MinGW/SDL_config_premake.h index 6df21585..7ec79a3b 100644 --- a/libs/SDL2/premake/MinGW/SDL_config_premake.h +++ b/libs/SDL2/premake/MinGW/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/VisualC/VS2008/SDL_config_premake.h b/libs/SDL2/premake/VisualC/VS2008/SDL_config_premake.h index d570b015..7139c23c 100644 --- a/libs/SDL2/premake/VisualC/VS2008/SDL_config_premake.h +++ b/libs/SDL2/premake/VisualC/VS2008/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/VisualC/VS2010/SDL_config_premake.h b/libs/SDL2/premake/VisualC/VS2010/SDL_config_premake.h index d570b015..7139c23c 100644 --- a/libs/SDL2/premake/VisualC/VS2010/SDL_config_premake.h +++ b/libs/SDL2/premake/VisualC/VS2010/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/VisualC/VS2012/SDL_config_premake.h b/libs/SDL2/premake/VisualC/VS2012/SDL_config_premake.h index d570b015..7139c23c 100644 --- a/libs/SDL2/premake/VisualC/VS2012/SDL_config_premake.h +++ b/libs/SDL2/premake/VisualC/VS2012/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/Xcode-iOS/SDL_config_premake.h b/libs/SDL2/premake/Xcode-iOS/SDL_config_premake.h index e0a86417..47b47ef7 100644 --- a/libs/SDL2/premake/Xcode-iOS/SDL_config_premake.h +++ b/libs/SDL2/premake/Xcode-iOS/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -126,6 +126,9 @@ #ifndef SDL_IPHONE_KEYBOARD #define SDL_IPHONE_KEYBOARD 1 #endif +#ifndef SDL_IPHONE_LAUNCHSCREEN +#define SDL_IPHONE_LAUNCHSCREEN 1 +#endif #ifndef SDL_POWER_UIKIT #define SDL_POWER_UIKIT 1 #endif diff --git a/libs/SDL2/premake/Xcode/Xcode3/SDL_config_premake.h b/libs/SDL2/premake/Xcode/Xcode3/SDL_config_premake.h index e48e8797..878b3c20 100644 --- a/libs/SDL2/premake/Xcode/Xcode3/SDL_config_premake.h +++ b/libs/SDL2/premake/Xcode/Xcode3/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -162,6 +162,7 @@ #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 diff --git a/libs/SDL2/premake/Xcode/Xcode4/SDL_config_premake.h b/libs/SDL2/premake/Xcode/Xcode4/SDL_config_premake.h index e48e8797..878b3c20 100644 --- a/libs/SDL2/premake/Xcode/Xcode4/SDL_config_premake.h +++ b/libs/SDL2/premake/Xcode/Xcode4/SDL_config_premake.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -162,6 +162,7 @@ #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 diff --git a/libs/SDL2/premake/config/SDL_config_cygwin.template.h b/libs/SDL2/premake/config/SDL_config_cygwin.template.h index 651989eb..8f38d44c 100644 --- a/libs/SDL2/premake/config/SDL_config_cygwin.template.h +++ b/libs/SDL2/premake/config/SDL_config_cygwin.template.h @@ -1,7 +1,7 @@ /* include/SDL_config.h. Generated from SDL_config.h.in by configure. */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/config/SDL_config_iphoneos.template.h b/libs/SDL2/premake/config/SDL_config_iphoneos.template.h index 227c3768..2a965947 100644 --- a/libs/SDL2/premake/config/SDL_config_iphoneos.template.h +++ b/libs/SDL2/premake/config/SDL_config_iphoneos.template.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/config/SDL_config_linux.template.h b/libs/SDL2/premake/config/SDL_config_linux.template.h index 8a62fdb9..d35037cf 100644 --- a/libs/SDL2/premake/config/SDL_config_linux.template.h +++ b/libs/SDL2/premake/config/SDL_config_linux.template.h @@ -1,7 +1,7 @@ /* include/SDL_config.h. Generated from SDL_config.h.in by configure. */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/config/SDL_config_macosx.template.h b/libs/SDL2/premake/config/SDL_config_macosx.template.h index 9264681f..1a4d8d56 100644 --- a/libs/SDL2/premake/config/SDL_config_macosx.template.h +++ b/libs/SDL2/premake/config/SDL_config_macosx.template.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -118,6 +118,7 @@ #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 diff --git a/libs/SDL2/premake/config/SDL_config_minimal.template.h b/libs/SDL2/premake/config/SDL_config_minimal.template.h index d7c62db2..adf60ed9 100644 --- a/libs/SDL2/premake/config/SDL_config_minimal.template.h +++ b/libs/SDL2/premake/config/SDL_config_minimal.template.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/config/SDL_config_windows.template.h b/libs/SDL2/premake/config/SDL_config_windows.template.h index 58726909..9274f620 100644 --- a/libs/SDL2/premake/config/SDL_config_windows.template.h +++ b/libs/SDL2/premake/config/SDL_config_windows.template.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/premake4.lua b/libs/SDL2/premake/premake4.lua index 1ebbaf5d..eb2dfcd1 100644 --- a/libs/SDL2/premake/premake4.lua +++ b/libs/SDL2/premake/premake4.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/SDL2.lua b/libs/SDL2/premake/projects/SDL2.lua index 0eaab6bb..1452164b 100644 --- a/libs/SDL2/premake/projects/SDL2.lua +++ b/libs/SDL2/premake/projects/SDL2.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages @@ -293,6 +293,7 @@ SDL_project "SDL2" ["SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS"] = '"libXss.so"', ["SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE"] = '"libXxf86vm.so"', ["SDL_VIDEO_DRIVER_X11_XCURSOR"] = 1, + ["SDL_VIDEO_DRIVER_X11_XDBE"] = 1, ["SDL_VIDEO_DRIVER_X11_XINERAMA"] = 1, ["SDL_VIDEO_DRIVER_X11_XINPUT2"] = 1, ["SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH"] = 1, diff --git a/libs/SDL2/premake/projects/SDL2main.lua b/libs/SDL2/premake/projects/SDL2main.lua index 5cc59d4d..771a169c 100644 --- a/libs/SDL2/premake/projects/SDL2main.lua +++ b/libs/SDL2/premake/projects/SDL2main.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/SDL2test.lua b/libs/SDL2/premake/projects/SDL2test.lua index 2b9c652a..0ac6382c 100644 --- a/libs/SDL2/premake/projects/SDL2test.lua +++ b/libs/SDL2/premake/projects/SDL2test.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/accelerometer.lua b/libs/SDL2/premake/projects/accelerometer.lua index 93cffb5c..df24a7ba 100644 --- a/libs/SDL2/premake/projects/accelerometer.lua +++ b/libs/SDL2/premake/projects/accelerometer.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/checkkeys.lua b/libs/SDL2/premake/projects/checkkeys.lua index 7907c5e3..e1709403 100644 --- a/libs/SDL2/premake/projects/checkkeys.lua +++ b/libs/SDL2/premake/projects/checkkeys.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/fireworks.lua b/libs/SDL2/premake/projects/fireworks.lua index d5a69a1f..110c6547 100644 --- a/libs/SDL2/premake/projects/fireworks.lua +++ b/libs/SDL2/premake/projects/fireworks.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/happy.lua b/libs/SDL2/premake/projects/happy.lua index b6104c64..b2764801 100644 --- a/libs/SDL2/premake/projects/happy.lua +++ b/libs/SDL2/premake/projects/happy.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/keyboard.lua b/libs/SDL2/premake/projects/keyboard.lua index 88f7567b..6cd31d1b 100644 --- a/libs/SDL2/premake/projects/keyboard.lua +++ b/libs/SDL2/premake/projects/keyboard.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/loopwave.lua b/libs/SDL2/premake/projects/loopwave.lua index d267ed9e..391dbdad 100644 --- a/libs/SDL2/premake/projects/loopwave.lua +++ b/libs/SDL2/premake/projects/loopwave.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/mixer.lua b/libs/SDL2/premake/projects/mixer.lua index 9a8fd02c..bfcd5e64 100644 --- a/libs/SDL2/premake/projects/mixer.lua +++ b/libs/SDL2/premake/projects/mixer.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/rectangles.lua b/libs/SDL2/premake/projects/rectangles.lua index aa46ff4c..071f8383 100644 --- a/libs/SDL2/premake/projects/rectangles.lua +++ b/libs/SDL2/premake/projects/rectangles.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testatomic.lua b/libs/SDL2/premake/projects/testatomic.lua index 816f46ef..ecf5adb4 100644 --- a/libs/SDL2/premake/projects/testatomic.lua +++ b/libs/SDL2/premake/projects/testatomic.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testaudioinfo.lua b/libs/SDL2/premake/projects/testaudioinfo.lua index a43b1261..9ee89f48 100644 --- a/libs/SDL2/premake/projects/testaudioinfo.lua +++ b/libs/SDL2/premake/projects/testaudioinfo.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testautomation.lua b/libs/SDL2/premake/projects/testautomation.lua index de6c45b7..43e6dd83 100644 --- a/libs/SDL2/premake/projects/testautomation.lua +++ b/libs/SDL2/premake/projects/testautomation.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testdraw2.lua b/libs/SDL2/premake/projects/testdraw2.lua index 99f4cda4..2431484f 100644 --- a/libs/SDL2/premake/projects/testdraw2.lua +++ b/libs/SDL2/premake/projects/testdraw2.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testdrawchessboard.lua b/libs/SDL2/premake/projects/testdrawchessboard.lua index de9d78cb..b074d7f4 100644 --- a/libs/SDL2/premake/projects/testdrawchessboard.lua +++ b/libs/SDL2/premake/projects/testdrawchessboard.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testerror.lua b/libs/SDL2/premake/projects/testerror.lua index 6e53f8b1..17b7638f 100644 --- a/libs/SDL2/premake/projects/testerror.lua +++ b/libs/SDL2/premake/projects/testerror.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testfile.lua b/libs/SDL2/premake/projects/testfile.lua index c791041a..8ed28188 100644 --- a/libs/SDL2/premake/projects/testfile.lua +++ b/libs/SDL2/premake/projects/testfile.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testfilesystem.lua b/libs/SDL2/premake/projects/testfilesystem.lua index 5128d528..f135bbd4 100644 --- a/libs/SDL2/premake/projects/testfilesystem.lua +++ b/libs/SDL2/premake/projects/testfilesystem.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testgamecontroller.lua b/libs/SDL2/premake/projects/testgamecontroller.lua index 53a9358b..322654f6 100644 --- a/libs/SDL2/premake/projects/testgamecontroller.lua +++ b/libs/SDL2/premake/projects/testgamecontroller.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testgesture.lua b/libs/SDL2/premake/projects/testgesture.lua index 6c216682..2a8ca3dc 100644 --- a/libs/SDL2/premake/projects/testgesture.lua +++ b/libs/SDL2/premake/projects/testgesture.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testgl2.lua b/libs/SDL2/premake/projects/testgl2.lua index 69e93336..b2a4e64a 100644 --- a/libs/SDL2/premake/projects/testgl2.lua +++ b/libs/SDL2/premake/projects/testgl2.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testgles.lua b/libs/SDL2/premake/projects/testgles.lua index ea77c1f7..de180d47 100644 --- a/libs/SDL2/premake/projects/testgles.lua +++ b/libs/SDL2/premake/projects/testgles.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testhaptic.lua b/libs/SDL2/premake/projects/testhaptic.lua index 70aeb3af..a230f923 100644 --- a/libs/SDL2/premake/projects/testhaptic.lua +++ b/libs/SDL2/premake/projects/testhaptic.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testiconv.lua b/libs/SDL2/premake/projects/testiconv.lua index db60ab75..db4ca57c 100644 --- a/libs/SDL2/premake/projects/testiconv.lua +++ b/libs/SDL2/premake/projects/testiconv.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testime.lua b/libs/SDL2/premake/projects/testime.lua index 6744d1d1..dbcc7d18 100644 --- a/libs/SDL2/premake/projects/testime.lua +++ b/libs/SDL2/premake/projects/testime.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testintersection.lua b/libs/SDL2/premake/projects/testintersection.lua index 11cdfe1b..0e910285 100644 --- a/libs/SDL2/premake/projects/testintersection.lua +++ b/libs/SDL2/premake/projects/testintersection.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testjoystick.lua b/libs/SDL2/premake/projects/testjoystick.lua index c4abcb0e..d6c6ca3c 100644 --- a/libs/SDL2/premake/projects/testjoystick.lua +++ b/libs/SDL2/premake/projects/testjoystick.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testkeys.lua b/libs/SDL2/premake/projects/testkeys.lua index d95b458d..33753f2e 100644 --- a/libs/SDL2/premake/projects/testkeys.lua +++ b/libs/SDL2/premake/projects/testkeys.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testloadso.lua b/libs/SDL2/premake/projects/testloadso.lua index 99621eea..cc38996c 100644 --- a/libs/SDL2/premake/projects/testloadso.lua +++ b/libs/SDL2/premake/projects/testloadso.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testlock.lua b/libs/SDL2/premake/projects/testlock.lua index 94ef0223..22afa3ef 100644 --- a/libs/SDL2/premake/projects/testlock.lua +++ b/libs/SDL2/premake/projects/testlock.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testmessage.lua b/libs/SDL2/premake/projects/testmessage.lua index 1c71bd6c..4bcc976a 100644 --- a/libs/SDL2/premake/projects/testmessage.lua +++ b/libs/SDL2/premake/projects/testmessage.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testmultiaudio.lua b/libs/SDL2/premake/projects/testmultiaudio.lua index cd761f97..ef7c86df 100644 --- a/libs/SDL2/premake/projects/testmultiaudio.lua +++ b/libs/SDL2/premake/projects/testmultiaudio.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testnative.lua b/libs/SDL2/premake/projects/testnative.lua index 4354d385..b9b22d74 100644 --- a/libs/SDL2/premake/projects/testnative.lua +++ b/libs/SDL2/premake/projects/testnative.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testoverlay2.lua b/libs/SDL2/premake/projects/testoverlay2.lua index 4d4049af..00d1c4e2 100644 --- a/libs/SDL2/premake/projects/testoverlay2.lua +++ b/libs/SDL2/premake/projects/testoverlay2.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testplatform.lua b/libs/SDL2/premake/projects/testplatform.lua index 3db191e8..4715fd75 100644 --- a/libs/SDL2/premake/projects/testplatform.lua +++ b/libs/SDL2/premake/projects/testplatform.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testpower.lua b/libs/SDL2/premake/projects/testpower.lua index cc993530..391f9503 100644 --- a/libs/SDL2/premake/projects/testpower.lua +++ b/libs/SDL2/premake/projects/testpower.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testrelative.lua b/libs/SDL2/premake/projects/testrelative.lua index 69104d06..c72c5e1a 100644 --- a/libs/SDL2/premake/projects/testrelative.lua +++ b/libs/SDL2/premake/projects/testrelative.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testrendercopyex.lua b/libs/SDL2/premake/projects/testrendercopyex.lua index 15f3b596..768e7ff0 100644 --- a/libs/SDL2/premake/projects/testrendercopyex.lua +++ b/libs/SDL2/premake/projects/testrendercopyex.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testrendertarget.lua b/libs/SDL2/premake/projects/testrendertarget.lua index 6bee7061..4a2968e4 100644 --- a/libs/SDL2/premake/projects/testrendertarget.lua +++ b/libs/SDL2/premake/projects/testrendertarget.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testresample.lua b/libs/SDL2/premake/projects/testresample.lua index 703d3dd6..beb379ce 100644 --- a/libs/SDL2/premake/projects/testresample.lua +++ b/libs/SDL2/premake/projects/testresample.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testrumble.lua b/libs/SDL2/premake/projects/testrumble.lua index 60dffec5..30eecf7e 100644 --- a/libs/SDL2/premake/projects/testrumble.lua +++ b/libs/SDL2/premake/projects/testrumble.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testscale.lua b/libs/SDL2/premake/projects/testscale.lua index 9e25e6a5..7508e5b1 100644 --- a/libs/SDL2/premake/projects/testscale.lua +++ b/libs/SDL2/premake/projects/testscale.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testsem.lua b/libs/SDL2/premake/projects/testsem.lua index 29995e94..b53a68ea 100644 --- a/libs/SDL2/premake/projects/testsem.lua +++ b/libs/SDL2/premake/projects/testsem.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testshader.lua b/libs/SDL2/premake/projects/testshader.lua index 08cec95a..cda0baaa 100644 --- a/libs/SDL2/premake/projects/testshader.lua +++ b/libs/SDL2/premake/projects/testshader.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testshape.lua b/libs/SDL2/premake/projects/testshape.lua index ca5ecefb..b78de30a 100644 --- a/libs/SDL2/premake/projects/testshape.lua +++ b/libs/SDL2/premake/projects/testshape.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testsprite2.lua b/libs/SDL2/premake/projects/testsprite2.lua index 3f1d284d..5096f3f3 100644 --- a/libs/SDL2/premake/projects/testsprite2.lua +++ b/libs/SDL2/premake/projects/testsprite2.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testspriteminimal.lua b/libs/SDL2/premake/projects/testspriteminimal.lua index c51c213e..847d8bb4 100644 --- a/libs/SDL2/premake/projects/testspriteminimal.lua +++ b/libs/SDL2/premake/projects/testspriteminimal.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/teststreaming.lua b/libs/SDL2/premake/projects/teststreaming.lua index ad3e426a..a3410134 100644 --- a/libs/SDL2/premake/projects/teststreaming.lua +++ b/libs/SDL2/premake/projects/teststreaming.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testthread.lua b/libs/SDL2/premake/projects/testthread.lua index 2b223163..f1404f99 100644 --- a/libs/SDL2/premake/projects/testthread.lua +++ b/libs/SDL2/premake/projects/testthread.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testtimer.lua b/libs/SDL2/premake/projects/testtimer.lua index 5bf92fba..039dff96 100644 --- a/libs/SDL2/premake/projects/testtimer.lua +++ b/libs/SDL2/premake/projects/testtimer.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testver.lua b/libs/SDL2/premake/projects/testver.lua index 346dcc4f..70aba2dd 100644 --- a/libs/SDL2/premake/projects/testver.lua +++ b/libs/SDL2/premake/projects/testver.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/testwm2.lua b/libs/SDL2/premake/projects/testwm2.lua index 65fd3123..12e62457 100644 --- a/libs/SDL2/premake/projects/testwm2.lua +++ b/libs/SDL2/premake/projects/testwm2.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/torturethread.lua b/libs/SDL2/premake/projects/torturethread.lua index 864f49af..eca1b044 100644 --- a/libs/SDL2/premake/projects/torturethread.lua +++ b/libs/SDL2/premake/projects/torturethread.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/projects/touch.lua b/libs/SDL2/premake/projects/touch.lua index c871ce60..da9f98dc 100644 --- a/libs/SDL2/premake/projects/touch.lua +++ b/libs/SDL2/premake/projects/touch.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_check_compile.lua b/libs/SDL2/premake/util/sdl_check_compile.lua index a8a8fc7c..668754a5 100644 --- a/libs/SDL2/premake/util/sdl_check_compile.lua +++ b/libs/SDL2/premake/util/sdl_check_compile.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_dependency_checkers.lua b/libs/SDL2/premake/util/sdl_dependency_checkers.lua index dc5d9b7f..2e8e7fcd 100644 --- a/libs/SDL2/premake/util/sdl_dependency_checkers.lua +++ b/libs/SDL2/premake/util/sdl_dependency_checkers.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_depends.lua b/libs/SDL2/premake/util/sdl_depends.lua index 254eb587..c7367971 100644 --- a/libs/SDL2/premake/util/sdl_depends.lua +++ b/libs/SDL2/premake/util/sdl_depends.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_file.lua b/libs/SDL2/premake/util/sdl_file.lua index e4fb156c..74a15e57 100644 --- a/libs/SDL2/premake/util/sdl_file.lua +++ b/libs/SDL2/premake/util/sdl_file.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_gen_config.lua b/libs/SDL2/premake/util/sdl_gen_config.lua index a0150ac5..0e030c46 100644 --- a/libs/SDL2/premake/util/sdl_gen_config.lua +++ b/libs/SDL2/premake/util/sdl_gen_config.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_projects.lua b/libs/SDL2/premake/util/sdl_projects.lua index 7bc752cd..ec26fbf3 100644 --- a/libs/SDL2/premake/util/sdl_projects.lua +++ b/libs/SDL2/premake/util/sdl_projects.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/premake/util/sdl_string.lua b/libs/SDL2/premake/util/sdl_string.lua index 470d7cd9..aa3b5895 100644 --- a/libs/SDL2/premake/util/sdl_string.lua +++ b/libs/SDL2/premake/util/sdl_string.lua @@ -1,4 +1,4 @@ --- Copyright (C) 1997-2014 Sam Lantinga +-- Copyright (C) 1997-2015 Sam Lantinga -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/sdl2-config.cmake.in b/libs/SDL2/sdl2-config.cmake.in new file mode 100644 index 00000000..c054767f --- /dev/null +++ b/libs/SDL2/sdl2-config.cmake.in @@ -0,0 +1,10 @@ +# sdl2 cmake project-config input for ./configure scripts + +set(prefix "@prefix@") +set(exec_prefix "@exec_prefix@") +set(libdir "@libdir") +set(SDL2_PREFIX "@prefix@") +set(SDL2_EXEC_PREFIX "@prefix@") +set(SDL2_LIBDIR "@libdir@") +set(SDL2_INCLUDE_DIRS "@includedir@/SDL2") +set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@") diff --git a/libs/SDL2/src/SDL.c b/libs/SDL2/src/SDL.c index 0e351200..6318bbe6 100644 --- a/libs/SDL2/src/SDL.c +++ b/libs/SDL2/src/SDL.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/SDL_assert.c b/libs/SDL2/src/SDL_assert.c index 98e75844..e1d267a9 100644 --- a/libs/SDL2/src/SDL_assert.c +++ b/libs/SDL2/src/SDL_assert.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/SDL_assert_c.h b/libs/SDL2/src/SDL_assert_c.h index f94b24c2..6f05c925 100644 --- a/libs/SDL2/src/SDL_assert_c.h +++ b/libs/SDL2/src/SDL_assert_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/SDL_error.c b/libs/SDL2/src/SDL_error.c index 2df29aa1..79e9347a 100644 --- a/libs/SDL2/src/SDL_error.c +++ b/libs/SDL2/src/SDL_error.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -111,7 +111,7 @@ SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); /* If we are in debug mode, print out an error message */ - SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError()); + SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError()); return -1; } @@ -120,7 +120,7 @@ SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) so that it supports internationalization and thread-safe errors. */ static char * -SDL_GetErrorMsg(char *errstr, unsigned int maxlen) +SDL_GetErrorMsg(char *errstr, int maxlen) { SDL_error *error; @@ -163,37 +163,55 @@ SDL_GetErrorMsg(char *errstr, unsigned int maxlen) len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_i); - msg += len; - maxlen -= len; + if (len > 0) { + msg += len; + maxlen -= len; + } break; + case 'f': len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_f); - msg += len; - maxlen -= len; + if (len > 0) { + msg += len; + maxlen -= len; + } break; + case 'p': len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_ptr); - msg += len; - maxlen -= len; + if (len > 0) { + msg += len; + maxlen -= len; + } break; + case 's': len = SDL_snprintf(msg, maxlen, tmp, SDL_LookupString(error->args[argi++]. buf)); - msg += len; - maxlen -= len; + if (len > 0) { + msg += len; + maxlen -= len; + } break; + } } else { *msg++ = *fmt++; maxlen -= 1; } } + + /* slide back if we've overshot the end of our buffer. */ + if (maxlen < 0) { + msg -= (-maxlen) + 1; + } + *msg = 0; /* NULL terminate the string */ } return (errstr); diff --git a/libs/SDL2/src/SDL_error_c.h b/libs/SDL2/src/SDL_error_c.h index 98c20c49..946281d2 100644 --- a/libs/SDL2/src/SDL_error_c.h +++ b/libs/SDL2/src/SDL_error_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/SDL_hints.c b/libs/SDL2/src/SDL_hints.c index ec5ed5b8..7026ac5d 100644 --- a/libs/SDL2/src/SDL_hints.c +++ b/libs/SDL2/src/SDL_hints.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/SDL_internal.h b/libs/SDL2/src/SDL_internal.h index cb66abd8..a3ccb363 100644 --- a/libs/SDL2/src/SDL_internal.h +++ b/libs/SDL2/src/SDL_internal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/SDL_log.c b/libs/SDL2/src/SDL_log.c index 5ebab015..b5ab601e 100644 --- a/libs/SDL2/src/SDL_log.c +++ b/libs/SDL2/src/SDL_log.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -371,9 +371,9 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, if (consoleAttached == 1) { if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) { OutputDebugString(TEXT("Error calling WriteConsole\r\n")); - } - if (charsWritten == ERROR_NOT_ENOUGH_MEMORY) { - OutputDebugString(TEXT("Insufficient heap memory to write message\r\n")); + if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { + OutputDebugString(TEXT("Insufficient heap memory to write message\r\n")); + } } } #endif /* ifndef __WINRT__ */ diff --git a/libs/SDL2/src/atomic/SDL_atomic.c b/libs/SDL2/src/atomic/SDL_atomic.c index c6029c2c..30b4ccca 100644 --- a/libs/SDL2/src/atomic/SDL_atomic.c +++ b/libs/SDL2/src/atomic/SDL_atomic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/atomic/SDL_spinlock.c b/libs/SDL2/src/atomic/SDL_spinlock.c index 29b5190e..1681aa78 100644 --- a/libs/SDL2/src/atomic/SDL_spinlock.c +++ b/libs/SDL2/src/atomic/SDL_spinlock.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_audio.c b/libs/SDL2/src/audio/SDL_audio.c index 1caac1fa..04f1e7ec 100644 --- a/libs/SDL2/src/audio/SDL_audio.c +++ b/libs/SDL2/src/audio/SDL_audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -161,8 +161,16 @@ get_audio_device(SDL_AudioDeviceID id) /* stubs for audio drivers that don't need a specific entry point... */ static void -SDL_AudioDetectDevices_Default(int iscapture, SDL_AddAudioDevice addfn) -{ /* no-op. */ +SDL_AudioDetectDevices_Default(void) +{ + /* you have to write your own implementation if these assertions fail. */ + SDL_assert(current_audio.impl.OnlyHasDefaultOutputDevice); + SDL_assert(current_audio.impl.OnlyHasDefaultInputDevice || !current_audio.impl.HasCaptureSupport); + + SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, (void *) ((size_t) 0x1)); + if (current_audio.impl.HasCaptureSupport) { + SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, (void *) ((size_t) 0x2)); + } } static void @@ -207,10 +215,16 @@ SDL_AudioDeinitialize_Default(void) { /* no-op. */ } +static void +SDL_AudioFreeDeviceHandle_Default(void *handle) +{ /* no-op. */ +} + + static int -SDL_AudioOpenDevice_Default(_THIS, const char *devname, int iscapture) +SDL_AudioOpenDevice_Default(_THIS, void *handle, const char *devname, int iscapture) { - return -1; + return SDL_Unsupported(); } static SDL_INLINE SDL_bool @@ -267,71 +281,139 @@ finalize_audio_entry_points(void) FILL_STUB(CloseDevice); FILL_STUB(LockDevice); FILL_STUB(UnlockDevice); + FILL_STUB(FreeDeviceHandle); FILL_STUB(Deinitialize); #undef FILL_STUB } -#if 0 /* !!! FIXME: rewrite/remove this streamer code. */ -/* Streaming functions (for when the input and output buffer sizes are different) */ -/* Write [length] bytes from buf into the streamer */ -static void -SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length) -{ - int i; - for (i = 0; i < length; ++i) { - stream->buffer[stream->write_pos] = buf[i]; - ++stream->write_pos; - } -} - -/* Read [length] bytes out of the streamer into buf */ -static void -SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length) -{ - int i; - - for (i = 0; i < length; ++i) { - buf[i] = stream->buffer[stream->read_pos]; - ++stream->read_pos; - } -} +/* device hotplug support... */ static int -SDL_StreamLength(SDL_AudioStreamer * stream) +add_audio_device(const char *name, void *handle, SDL_AudioDeviceItem **devices, int *devCount) { - return (stream->write_pos - stream->read_pos) % stream->max_len; -} - -/* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */ -#if 0 -static int -SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence) -{ - /* First try to allocate the buffer */ - stream->buffer = (Uint8 *) SDL_malloc(max_len); - if (stream->buffer == NULL) { + int retval = -1; + const size_t size = sizeof (SDL_AudioDeviceItem) + SDL_strlen(name) + 1; + SDL_AudioDeviceItem *item = (SDL_AudioDeviceItem *) SDL_malloc(size); + if (item == NULL) { return -1; } - stream->max_len = max_len; - stream->read_pos = 0; - stream->write_pos = 0; + SDL_assert(handle != NULL); /* we reserve NULL, audio backends can't use it. */ - /* Zero out the buffer */ - SDL_memset(stream->buffer, silence, max_len); + item->handle = handle; + SDL_strlcpy(item->name, name, size - sizeof (SDL_AudioDeviceItem)); - return 0; + SDL_LockMutex(current_audio.detectionLock); + item->next = *devices; + *devices = item; + retval = (*devCount)++; + SDL_UnlockMutex(current_audio.detectionLock); + + return retval; } -#endif -/* Deinitialize the stream simply by freeing the buffer */ -static void -SDL_StreamDeinit(SDL_AudioStreamer * stream) +static SDL_INLINE int +add_capture_device(const char *name, void *handle) { - SDL_free(stream->buffer); + /* !!! FIXME: add this later. SDL_assert(current_audio.impl.HasCaptureSupport);*/ + return add_audio_device(name, handle, ¤t_audio.inputDevices, ¤t_audio.inputDeviceCount); } -#endif + +static SDL_INLINE int +add_output_device(const char *name, void *handle) +{ + return add_audio_device(name, handle, ¤t_audio.outputDevices, ¤t_audio.outputDeviceCount); +} + +static void +free_device_list(SDL_AudioDeviceItem **devices, int *devCount) +{ + SDL_AudioDeviceItem *item, *next; + for (item = *devices; item != NULL; item = next) { + next = item->next; + if (item->handle != NULL) { + current_audio.impl.FreeDeviceHandle(item->handle); + } + SDL_free(item); + } + *devices = NULL; + *devCount = 0; +} + + +/* The audio backends call this when a new device is plugged in. */ +void +SDL_AddAudioDevice(const int iscapture, const char *name, void *handle) +{ + const int device_index = iscapture ? add_capture_device(name, handle) : add_output_device(name, handle); + if (device_index != -1) { + /* Post the event, if desired */ + if (SDL_GetEventState(SDL_AUDIODEVICEADDED) == SDL_ENABLE) { + SDL_Event event; + SDL_zero(event); + event.adevice.type = SDL_AUDIODEVICEADDED; + event.adevice.which = device_index; + event.adevice.iscapture = iscapture; + SDL_PushEvent(&event); + } + } +} + +/* The audio backends call this when a currently-opened device is lost. */ +void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device) +{ + SDL_assert(get_audio_device(device->id) == device); + + if (!device->enabled) { + return; + } + + /* Ends the audio callback and mark the device as STOPPED, but the + app still needs to close the device to free resources. */ + current_audio.impl.LockDevice(device); + device->enabled = 0; + current_audio.impl.UnlockDevice(device); + + /* Post the event, if desired */ + if (SDL_GetEventState(SDL_AUDIODEVICEREMOVED) == SDL_ENABLE) { + SDL_Event event; + SDL_zero(event); + event.adevice.type = SDL_AUDIODEVICEREMOVED; + event.adevice.which = device->id; + event.adevice.iscapture = device->iscapture ? 1 : 0; + SDL_PushEvent(&event); + } +} + +static void +mark_device_removed(void *handle, SDL_AudioDeviceItem *devices, SDL_bool *removedFlag) +{ + SDL_AudioDeviceItem *item; + SDL_assert(handle != NULL); + for (item = devices; item != NULL; item = item->next) { + if (item->handle == handle) { + item->handle = NULL; + *removedFlag = SDL_TRUE; + return; + } + } +} + +/* The audio backends call this when a device is removed from the system. */ +void +SDL_RemoveAudioDevice(const int iscapture, void *handle) +{ + SDL_LockMutex(current_audio.detectionLock); + if (iscapture) { + mark_device_removed(handle, current_audio.inputDevices, ¤t_audio.captureDevicesRemoved); + } else { + mark_device_removed(handle, current_audio.outputDevices, ¤t_audio.outputDevicesRemoved); + } + SDL_UnlockMutex(current_audio.detectionLock); + current_audio.impl.FreeDeviceHandle(handle); +} + /* buffer queueing support... */ @@ -508,26 +590,17 @@ SDL_ClearQueuedAudio(SDL_AudioDeviceID devid) } -#if defined(__ANDROID__) -#include -#endif - /* The general mixing thread function */ int SDLCALL SDL_RunAudio(void *devicep) { SDL_AudioDevice *device = (SDL_AudioDevice *) devicep; + const int silence = (int) device->spec.silence; + const Uint32 delay = ((device->spec.samples * 1000) / device->spec.freq); + const int stream_len = (device->convert.needed) ? device->convert.len : device->spec.size; Uint8 *stream; - int stream_len; - void *udata; - void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len); - Uint32 delay; - -#if 0 /* !!! FIXME: rewrite/remove this streamer code. */ - /* For streaming when the buffer sizes don't match up */ - Uint8 *istream; - int istream_len = 0; -#endif + void *udata = device->spec.userdata; + void (SDLCALL *fill) (void *, Uint8 *, int) = device->spec.callback; /* The audio mixing is always a high priority thread */ SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH); @@ -536,196 +609,59 @@ SDL_RunAudio(void *devicep) device->threadid = SDL_ThreadID(); current_audio.impl.ThreadInit(device); - /* Set up the mixing function */ - fill = device->spec.callback; - udata = device->spec.userdata; - - /* By default do not stream */ - device->use_streamer = 0; - - if (device->convert.needed) { -#if 0 /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */ - /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */ - if (device->convert.len_mult != 1 || device->convert.len_div != 1) { - /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */ - stream_max_len = 2 * device->spec.size; - if (device->convert.len_mult > device->convert.len_div) { - stream_max_len *= device->convert.len_mult; - stream_max_len /= device->convert.len_div; - } - if (SDL_StreamInit(&device->streamer, stream_max_len, silence) < - 0) - return -1; - device->use_streamer = 1; - - /* istream_len should be the length of what we grab from the callback and feed to conversion, - so that we get close to spec_size. I.e. we want device.spec_size = istream_len * u / d - */ - istream_len = - device->spec.size * device->convert.len_div / - device->convert.len_mult; + /* Loop, filling the audio buffers */ + while (!device->shutdown) { + /* Fill the current buffer with sound */ + if (device->convert.needed) { + stream = device->convert.buf; + } else if (device->enabled) { + stream = current_audio.impl.GetDeviceBuf(device); + } else { + /* if the device isn't enabled, we still write to the + fake_stream, so the app's callback will fire with + a regular frequency, in case they depend on that + for timing or progress. They can use hotplug + now to know if the device failed. */ + stream = NULL; } -#endif - stream_len = device->convert.len; - } else { - stream_len = device->spec.size; - } - - /* Calculate the delay while paused */ - delay = ((device->spec.samples * 1000) / device->spec.freq); - - /* Determine if the streamer is necessary here */ -#if 0 /* !!! FIXME: rewrite/remove this streamer code. */ - if (device->use_streamer == 1) { - /* This code is almost the same as the old code. The difference is, instead of reading - directly from the callback into "stream", then converting and sending the audio off, - we go: callback -> "istream" -> (conversion) -> streamer -> stream -> device. - However, reading and writing with streamer are done separately: - - We only call the callback and write to the streamer when the streamer does not - contain enough samples to output to the device. - - We only read from the streamer and tell the device to play when the streamer - does have enough samples to output. - This allows us to perform resampling in the conversion step, where the output of the - resampling process can be any number. We will have to see what a good size for the - stream's maximum length is, but I suspect 2*max(len_cvt, stream_len) is a good figure. - */ - while (device->enabled) { - - if (device->paused) { - SDL_Delay(delay); - continue; - } - - /* Only read in audio if the streamer doesn't have enough already (if it does not have enough samples to output) */ - if (SDL_StreamLength(&device->streamer) < stream_len) { - /* Set up istream */ - if (device->convert.needed) { - if (device->convert.buf) { - istream = device->convert.buf; - } else { - continue; - } - } else { -/* FIXME: Ryan, this is probably wrong. I imagine we don't want to get - * a device buffer both here and below in the stream output. - */ - istream = current_audio.impl.GetDeviceBuf(device); - if (istream == NULL) { - istream = device->fake_stream; - } - } - - /* Read from the callback into the _input_ stream */ - SDL_LockMutex(device->mixer_lock); - (*fill) (udata, istream, istream_len); - SDL_UnlockMutex(device->mixer_lock); - - /* Convert the audio if necessary and write to the streamer */ - if (device->convert.needed) { - SDL_ConvertAudio(&device->convert); - if (istream == NULL) { - istream = device->fake_stream; - } - /* SDL_memcpy(istream, device->convert.buf, device->convert.len_cvt); */ - SDL_StreamWrite(&device->streamer, device->convert.buf, - device->convert.len_cvt); - } else { - SDL_StreamWrite(&device->streamer, istream, istream_len); - } - } - - /* Only output audio if the streamer has enough to output */ - if (SDL_StreamLength(&device->streamer) >= stream_len) { - /* Set up the output stream */ - if (device->convert.needed) { - if (device->convert.buf) { - stream = device->convert.buf; - } else { - continue; - } - } else { - stream = current_audio.impl.GetDeviceBuf(device); - if (stream == NULL) { - stream = device->fake_stream; - } - } - - /* Now read from the streamer */ - SDL_StreamRead(&device->streamer, stream, stream_len); - - /* Ready current buffer for play and change current buffer */ - if (stream != device->fake_stream) { - current_audio.impl.PlayDevice(device); - /* Wait for an audio buffer to become available */ - current_audio.impl.WaitDevice(device); - } else { - SDL_Delay(delay); - } - } + if (stream == NULL) { + stream = device->fake_stream; } - } else -#endif - { - /* Otherwise, do not use the streamer. This is the old code. */ - const int silence = (int) device->spec.silence; - /* Loop, filling the audio buffers */ - while (device->enabled) { + /* !!! FIXME: this should be LockDevice. */ + SDL_LockMutex(device->mixer_lock); + if (device->paused) { + SDL_memset(stream, silence, stream_len); + } else { + (*fill) (udata, stream, stream_len); + } + SDL_UnlockMutex(device->mixer_lock); - /* Fill the current buffer with sound */ - if (device->convert.needed) { - if (device->convert.buf) { - stream = device->convert.buf; - } else { - continue; - } + /* Convert the audio if necessary */ + if (device->enabled && device->convert.needed) { + SDL_ConvertAudio(&device->convert); + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; } else { - stream = current_audio.impl.GetDeviceBuf(device); - if (stream == NULL) { - stream = device->fake_stream; - } - } - - SDL_LockMutex(device->mixer_lock); - if (device->paused) { - SDL_memset(stream, silence, stream_len); - } else { - (*fill) (udata, stream, stream_len); - } - SDL_UnlockMutex(device->mixer_lock); - - /* Convert the audio if necessary */ - if (device->convert.needed) { - SDL_ConvertAudio(&device->convert); - stream = current_audio.impl.GetDeviceBuf(device); - if (stream == NULL) { - stream = device->fake_stream; - } SDL_memcpy(stream, device->convert.buf, device->convert.len_cvt); } + } - /* Ready current buffer for play and change current buffer */ - if (stream != device->fake_stream) { - current_audio.impl.PlayDevice(device); - /* Wait for an audio buffer to become available */ - current_audio.impl.WaitDevice(device); - } else { - SDL_Delay(delay); - } + /* Ready current buffer for play and change current buffer */ + if (stream == device->fake_stream) { + SDL_Delay(delay); + } else { + current_audio.impl.PlayDevice(device); + current_audio.impl.WaitDevice(device); } } - /* Wait for the audio to drain.. */ + /* Wait for the audio to drain. */ current_audio.impl.WaitDone(device); - /* If necessary, deinit the streamer */ -#if 0 /* !!! FIXME: rewrite/remove this streamer code. */ - if (device->use_streamer == 1) - SDL_StreamDeinit(&device->streamer); -#endif - return 0; } @@ -782,8 +718,8 @@ SDL_AudioInit(const char *driver_name) SDL_AudioQuit(); /* shutdown driver if already running. */ } - SDL_memset(¤t_audio, '\0', sizeof(current_audio)); - SDL_memset(open_devices, '\0', sizeof(open_devices)); + SDL_zero(current_audio); + SDL_zero(open_devices); /* Select the proper audio driver */ if (driver_name == NULL) { @@ -799,7 +735,7 @@ SDL_AudioInit(const char *driver_name) } tried_to_init = 1; - SDL_memset(¤t_audio, 0, sizeof(current_audio)); + SDL_zero(current_audio); current_audio.name = backend->name; current_audio.desc = backend->desc; initialized = backend->init(¤t_audio.impl); @@ -815,12 +751,17 @@ SDL_AudioInit(const char *driver_name) } } - SDL_memset(¤t_audio, 0, sizeof(current_audio)); + SDL_zero(current_audio); return -1; /* No driver was available, so fail. */ } + current_audio.detectionLock = SDL_CreateMutex(); + finalize_audio_entry_points(); + /* Make sure we have a list of devices available at startup. */ + current_audio.impl.DetectDevices(); + return 0; } @@ -833,50 +774,32 @@ SDL_GetCurrentAudioDriver() return current_audio.name; } +/* Clean out devices that we've removed but had to keep around for stability. */ static void -free_device_list(char ***devices, int *devCount) +clean_out_device_list(SDL_AudioDeviceItem **devices, int *devCount, SDL_bool *removedFlag) { - int i = *devCount; - if ((i > 0) && (*devices != NULL)) { - while (i--) { - SDL_free((*devices)[i]); + SDL_AudioDeviceItem *item = *devices; + SDL_AudioDeviceItem *prev = NULL; + int total = 0; + + while (item) { + SDL_AudioDeviceItem *next = item->next; + if (item->handle != NULL) { + total++; + prev = item; + } else { + if (prev) { + prev->next = next; + } else { + *devices = next; + } + SDL_free(item); } + item = next; } - SDL_free(*devices); - - *devices = NULL; - *devCount = 0; -} - -static -void SDL_AddCaptureAudioDevice(const char *_name) -{ - char *name = NULL; - void *ptr = SDL_realloc(current_audio.inputDevices, - (current_audio.inputDeviceCount+1) * sizeof(char*)); - if (ptr == NULL) { - return; /* oh well. */ - } - - current_audio.inputDevices = (char **) ptr; - name = SDL_strdup(_name); /* if this returns NULL, that's okay. */ - current_audio.inputDevices[current_audio.inputDeviceCount++] = name; -} - -static -void SDL_AddOutputAudioDevice(const char *_name) -{ - char *name = NULL; - void *ptr = SDL_realloc(current_audio.outputDevices, - (current_audio.outputDeviceCount+1) * sizeof(char*)); - if (ptr == NULL) { - return; /* oh well. */ - } - - current_audio.outputDevices = (char **) ptr; - name = SDL_strdup(_name); /* if this returns NULL, that's okay. */ - current_audio.outputDevices[current_audio.outputDeviceCount++] = name; + *devCount = total; + *removedFlag = SDL_FALSE; } @@ -889,29 +812,18 @@ SDL_GetNumAudioDevices(int iscapture) return -1; } - if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { - return 0; + SDL_LockMutex(current_audio.detectionLock); + if (iscapture && current_audio.captureDevicesRemoved) { + clean_out_device_list(¤t_audio.inputDevices, ¤t_audio.inputDeviceCount, ¤t_audio.captureDevicesRemoved); } - if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { - return 1; + if (!iscapture && current_audio.outputDevicesRemoved) { + clean_out_device_list(¤t_audio.outputDevices, ¤t_audio.outputDeviceCount, ¤t_audio.outputDevicesRemoved); + current_audio.outputDevicesRemoved = SDL_FALSE; } - if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { - return 1; - } - - if (iscapture) { - free_device_list(¤t_audio.inputDevices, - ¤t_audio.inputDeviceCount); - current_audio.impl.DetectDevices(iscapture, SDL_AddCaptureAudioDevice); - retval = current_audio.inputDeviceCount; - } else { - free_device_list(¤t_audio.outputDevices, - ¤t_audio.outputDeviceCount); - current_audio.impl.DetectDevices(iscapture, SDL_AddOutputAudioDevice); - retval = current_audio.outputDeviceCount; - } + retval = iscapture ? current_audio.inputDeviceCount : current_audio.outputDeviceCount; + SDL_UnlockMutex(current_audio.detectionLock); return retval; } @@ -920,6 +832,8 @@ SDL_GetNumAudioDevices(int iscapture) const char * SDL_GetAudioDeviceName(int index, int iscapture) { + const char *retval = NULL; + if (!SDL_WasInit(SDL_INIT_AUDIO)) { SDL_SetError("Audio subsystem is not initialized"); return NULL; @@ -930,39 +844,28 @@ SDL_GetAudioDeviceName(int index, int iscapture) return NULL; } - if (index < 0) { - goto no_such_device; + if (index >= 0) { + SDL_AudioDeviceItem *item; + int i; + + SDL_LockMutex(current_audio.detectionLock); + item = iscapture ? current_audio.inputDevices : current_audio.outputDevices; + i = iscapture ? current_audio.inputDeviceCount : current_audio.outputDeviceCount; + if (index < i) { + for (i--; i > index; i--, item = item->next) { + SDL_assert(item != NULL); + } + SDL_assert(item != NULL); + retval = item->name; + } + SDL_UnlockMutex(current_audio.detectionLock); } - if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { - if (index > 0) { - goto no_such_device; - } - return DEFAULT_INPUT_DEVNAME; + if (retval == NULL) { + SDL_SetError("No such device"); } - if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { - if (index > 0) { - goto no_such_device; - } - return DEFAULT_OUTPUT_DEVNAME; - } - - if (iscapture) { - if (index >= current_audio.inputDeviceCount) { - goto no_such_device; - } - return current_audio.inputDevices[index]; - } else { - if (index >= current_audio.outputDeviceCount) { - goto no_such_device; - } - return current_audio.outputDevices[index]; - } - -no_such_device: - SDL_SetError("No such device"); - return NULL; + return retval; } @@ -970,6 +873,7 @@ static void close_audio_device(SDL_AudioDevice * device) { device->enabled = 0; + device->shutdown = 1; if (device->thread != NULL) { SDL_WaitThread(device->thread, NULL); } @@ -1063,6 +967,8 @@ open_audio_device(const char *devname, int iscapture, SDL_AudioSpec _obtained; SDL_AudioDevice *device; SDL_bool build_cvt; + void *handle = NULL; + Uint32 stream_len; int i = 0; if (!SDL_WasInit(SDL_INIT_AUDIO)) { @@ -1075,6 +981,18 @@ open_audio_device(const char *devname, int iscapture, return 0; } + /* Find an available device ID... */ + for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) { + if (open_devices[id] == NULL) { + break; + } + } + + if (id == SDL_arraysize(open_devices)) { + SDL_SetError("Too many open audio devices"); + return 0; + } + if (!obtained) { obtained = &_obtained; } @@ -1110,9 +1028,7 @@ open_audio_device(const char *devname, int iscapture, return 0; } } - } - - if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + } else if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { if ((devname) && (SDL_strcmp(devname, DEFAULT_OUTPUT_DEVNAME) != 0)) { SDL_SetError("No such device"); return 0; @@ -1125,6 +1041,30 @@ open_audio_device(const char *devname, int iscapture, return 0; } } + } else if (devname != NULL) { + /* if the app specifies an exact string, we can pass the backend + an actual device handle thingey, which saves them the effort of + figuring out what device this was (such as, reenumerating + everything again to find the matching human-readable name). + It might still need to open a device based on the string for, + say, a network audio server, but this optimizes some cases. */ + SDL_AudioDeviceItem *item; + SDL_LockMutex(current_audio.detectionLock); + for (item = iscapture ? current_audio.inputDevices : current_audio.outputDevices; item; item = item->next) { + if ((item->handle != NULL) && (SDL_strcmp(item->name, devname) == 0)) { + handle = item->handle; + break; + } + } + SDL_UnlockMutex(current_audio.detectionLock); + } + + if (!current_audio.impl.AllowsArbitraryDeviceNames) { + /* has to be in our device list, or the default device. */ + if ((handle == NULL) && (devname != NULL)) { + SDL_SetError("No such device."); + return 0; + } } device = (SDL_AudioDevice *) SDL_AllocAudioMem(sizeof(SDL_AudioDevice)); @@ -1133,12 +1073,13 @@ open_audio_device(const char *devname, int iscapture, return 0; } SDL_zerop(device); + device->id = id + 1; device->spec = *obtained; device->enabled = 1; device->paused = 1; device->iscapture = iscapture; - /* Create a semaphore for locking the sound buffers */ + /* Create a mutex for locking the sound buffers */ if (!current_audio.impl.SkipMixerLock) { device->mixer_lock = SDL_CreateMutex(); if (device->mixer_lock == NULL) { @@ -1148,26 +1089,12 @@ open_audio_device(const char *devname, int iscapture, } } - /* force a device detection if we haven't done one yet. */ - if ( ((iscapture) && (current_audio.inputDevices == NULL)) || - ((!iscapture) && (current_audio.outputDevices == NULL)) ) { - SDL_GetNumAudioDevices(iscapture); - } - - if (current_audio.impl.OpenDevice(device, devname, iscapture) < 0) { + if (current_audio.impl.OpenDevice(device, handle, devname, iscapture) < 0) { close_audio_device(device); return 0; } device->opened = 1; - /* Allocate a fake audio memory buffer */ - device->fake_stream = (Uint8 *)SDL_AllocAudioMem(device->spec.size); - if (device->fake_stream == NULL) { - close_audio_device(device); - SDL_OutOfMemory(); - return 0; - } - /* See if we need to do any conversion */ build_cvt = SDL_FALSE; if (obtained->freq != device->spec.freq) { @@ -1226,6 +1153,19 @@ open_audio_device(const char *devname, int iscapture, } } + /* Allocate a fake audio memory buffer */ + stream_len = (device->convert.needed) ? device->convert.len_cvt : 0; + if (device->spec.size > stream_len) { + stream_len = device->spec.size; + } + SDL_assert(stream_len > 0); + device->fake_stream = (Uint8 *)SDL_AllocAudioMem(stream_len); + if (device->fake_stream == NULL) { + close_audio_device(device); + SDL_OutOfMemory(); + return 0; + } + if (device->spec.callback == NULL) { /* use buffer queueing? */ /* pool a few packets to start. Enough for two callbacks. */ const int packetlen = SDL_AUDIOBUFFERQUEUE_PACKETLEN; @@ -1245,25 +1185,14 @@ open_audio_device(const char *devname, int iscapture, device->spec.userdata = device; } - /* Find an available device ID and store the structure... */ - for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) { - if (open_devices[id] == NULL) { - open_devices[id] = device; - break; - } - } - - if (id == SDL_arraysize(open_devices)) { - SDL_SetError("Too many open audio devices"); - close_audio_device(device); - return 0; - } + /* add it to our list of open devices. */ + open_devices[id] = device; /* Start the audio thread if necessary */ if (!current_audio.impl.ProvidesOwnCallbackThread) { /* Start the audio thread */ char name[64]; - SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) (id + 1)); + SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) device->id); /* !!! FIXME: this is nasty. */ #if defined(__WIN32__) && !defined(HAVE_LIBC) #undef SDL_CreateThread @@ -1276,13 +1205,13 @@ open_audio_device(const char *devname, int iscapture, device->thread = SDL_CreateThread(SDL_RunAudio, name, device); #endif if (device->thread == NULL) { - SDL_CloseAudioDevice(id + 1); + SDL_CloseAudioDevice(device->id); SDL_SetError("Couldn't create audio thread"); return 0; } } - return id + 1; + return device->id; } @@ -1427,14 +1356,16 @@ SDL_AudioQuit(void) } } + free_device_list(¤t_audio.outputDevices, ¤t_audio.outputDeviceCount); + free_device_list(¤t_audio.inputDevices, ¤t_audio.inputDeviceCount); + /* Free the driver data */ current_audio.impl.Deinitialize(); - free_device_list(¤t_audio.outputDevices, - ¤t_audio.outputDeviceCount); - free_device_list(¤t_audio.inputDevices, - ¤t_audio.inputDeviceCount); - SDL_memset(¤t_audio, '\0', sizeof(current_audio)); - SDL_memset(open_devices, '\0', sizeof(open_devices)); + + SDL_DestroyMutex(current_audio.detectionLock); + + SDL_zero(current_audio); + SDL_zero(open_devices); } #define NUM_FORMATS 10 diff --git a/libs/SDL2/src/audio/SDL_audio_c.h b/libs/SDL2/src/audio/SDL_audio_c.h index 2ea4e148..b1fab65f 100644 --- a/libs/SDL2/src/audio/SDL_audio_c.h +++ b/libs/SDL2/src/audio/SDL_audio_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_audiocvt.c b/libs/SDL2/src/audio/SDL_audiocvt.c index 518735bf..092839b8 100644 --- a/libs/SDL2/src/audio/SDL_audiocvt.c +++ b/libs/SDL2/src/audio/SDL_audiocvt.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_audiodev.c b/libs/SDL2/src/audio/SDL_audiodev.c index e9af6211..dd89af74 100644 --- a/libs/SDL2/src/audio/SDL_audiodev.c +++ b/libs/SDL2/src/audio/SDL_audiodev.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -46,18 +46,21 @@ #define _PATH_DEV_AUDIO "/dev/audio" #endif -static SDL_INLINE void -test_device(const char *fname, int flags, int (*test) (int fd), - SDL_AddAudioDevice addfn) +static void +test_device(const int iscapture, const char *fname, int flags, int (*test) (int fd)) { struct stat sb; if ((stat(fname, &sb) == 0) && (S_ISCHR(sb.st_mode))) { const int audio_fd = open(fname, flags, 0); if (audio_fd >= 0) { - if (test(audio_fd)) { - addfn(fname); - } + const int okay = test(audio_fd); close(audio_fd); + if (okay) { + static size_t dummyhandle = 0; + dummyhandle++; + SDL_assert(dummyhandle != 0); + SDL_AddAudioDevice(iscapture, fname, (void *) dummyhandle); + } } } } @@ -68,11 +71,10 @@ test_stub(int fd) return 1; } -void -SDL_EnumUnixAudioDevices(int iscapture, int classic, int (*test)(int fd), - SDL_AddAudioDevice addfn) +static void +SDL_EnumUnixAudioDevices_Internal(const int iscapture, const int classic, int (*test)(int)) { - const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + const int flags = iscapture ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT; const char *audiodev; char audiopath[1024]; @@ -97,17 +99,25 @@ SDL_EnumUnixAudioDevices(int iscapture, int classic, int (*test)(int fd), } } } - test_device(audiodev, flags, test, addfn); + test_device(iscapture, audiodev, flags, test); if (SDL_strlen(audiodev) < (sizeof(audiopath) - 3)) { int instance = 0; while (instance++ <= 64) { SDL_snprintf(audiopath, SDL_arraysize(audiopath), "%s%d", audiodev, instance); - test_device(audiopath, flags, test, addfn); + test_device(iscapture, audiopath, flags, test); } } } +void +SDL_EnumUnixAudioDevices(const int classic, int (*test)(int)) +{ + SDL_EnumUnixAudioDevices_Internal(SDL_TRUE, classic, test); + SDL_EnumUnixAudioDevices_Internal(SDL_FALSE, classic, test); +} + #endif /* Audio driver selection */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/audio/SDL_audiodev_c.h b/libs/SDL2/src/audio/SDL_audiodev_c.h index 1ad0dc10..2208d9c4 100644 --- a/libs/SDL2/src/audio/SDL_audiodev_c.h +++ b/libs/SDL2/src/audio/SDL_audiodev_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,6 @@ #define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) #endif -void SDL_EnumUnixAudioDevices(int iscapture, int classic, - int (*test) (int fd), SDL_AddAudioDevice addfn); +extern void SDL_EnumUnixAudioDevices(const int classic, int (*test)(int)); /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/audio/SDL_audiomem.h b/libs/SDL2/src/audio/SDL_audiomem.h index 3711ac94..a65b44b7 100644 --- a/libs/SDL2/src/audio/SDL_audiomem.h +++ b/libs/SDL2/src/audio/SDL_audiomem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_audiotypecvt.c b/libs/SDL2/src/audio/SDL_audiotypecvt.c index 6f07d628..1e3a6447 100644 --- a/libs/SDL2/src/audio/SDL_audiotypecvt.c +++ b/libs/SDL2/src/audio/SDL_audiotypecvt.c @@ -1,7 +1,7 @@ /* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_mixer.c b/libs/SDL2/src/audio/SDL_mixer.c index 42a1c687..38fda0bf 100644 --- a/libs/SDL2/src/audio/SDL_mixer.c +++ b/libs/SDL2/src/audio/SDL_mixer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_sysaudio.h b/libs/SDL2/src/audio/SDL_sysaudio.h index 4f933205..c220f582 100644 --- a/libs/SDL2/src/audio/SDL_sysaudio.h +++ b/libs/SDL2/src/audio/SDL_sysaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,8 +30,21 @@ typedef struct SDL_AudioDevice SDL_AudioDevice; #define _THIS SDL_AudioDevice *_this -/* Used by audio targets during DetectDevices() */ -typedef void (*SDL_AddAudioDevice)(const char *name); +/* Audio targets should call this as devices are added to the system (such as + a USB headset being plugged in), and should also be called for + for every device found during DetectDevices(). */ +extern void SDL_AddAudioDevice(const int iscapture, const char *name, void *handle); + +/* Audio targets should call this as devices are removed, so SDL can update + its list of available devices. */ +extern void SDL_RemoveAudioDevice(const int iscapture, void *handle); + +/* Audio targets should call this if an opened audio device is lost while + being used. This can happen due to i/o errors, or a device being unplugged, + etc. If the device is totally gone, please also call SDL_RemoveAudioDevice() + as appropriate so SDL's list of devices is accurate. */ +extern void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device); + /* This is the size of a packet when using SDL_QueueAudio(). We allocate these as necessary and pool them, under the assumption that we'll @@ -55,8 +68,8 @@ typedef struct SDL_AudioBufferQueue typedef struct SDL_AudioDriverImpl { - void (*DetectDevices) (int iscapture, SDL_AddAudioDevice addfn); - int (*OpenDevice) (_THIS, const char *devname, int iscapture); + void (*DetectDevices) (void); + int (*OpenDevice) (_THIS, void *handle, const char *devname, int iscapture); void (*ThreadInit) (_THIS); /* Called by audio thread at start */ void (*WaitDevice) (_THIS); void (*PlayDevice) (_THIS); @@ -66,19 +79,34 @@ typedef struct SDL_AudioDriverImpl void (*CloseDevice) (_THIS); void (*LockDevice) (_THIS); void (*UnlockDevice) (_THIS); + void (*FreeDeviceHandle) (void *handle); /**< SDL is done with handle from SDL_AddAudioDevice() */ void (*Deinitialize) (void); /* !!! FIXME: add pause(), so we can optimize instead of mixing silence. */ /* Some flags to push duplicate code into the core and reduce #ifdefs. */ + /* !!! FIXME: these should be SDL_bool */ int ProvidesOwnCallbackThread; int SkipMixerLock; /* !!! FIXME: do we need this anymore? */ int HasCaptureSupport; int OnlyHasDefaultOutputDevice; int OnlyHasDefaultInputDevice; + int AllowsArbitraryDeviceNames; } SDL_AudioDriverImpl; +typedef struct SDL_AudioDeviceItem +{ + void *handle; + struct SDL_AudioDeviceItem *next; + #if (defined(__GNUC__) && (__GNUC__ <= 2)) + char name[1]; /* actually variable length. */ + #else + char name[]; + #endif +} SDL_AudioDeviceItem; + + typedef struct SDL_AudioDriver { /* * * */ @@ -91,11 +119,14 @@ typedef struct SDL_AudioDriver SDL_AudioDriverImpl impl; - char **outputDevices; + /* A mutex for device detection */ + SDL_mutex *detectionLock; + SDL_bool captureDevicesRemoved; + SDL_bool outputDevicesRemoved; int outputDeviceCount; - - char **inputDevices; int inputDeviceCount; + SDL_AudioDeviceItem *outputDevices; + SDL_AudioDeviceItem *inputDevices; } SDL_AudioDriver; @@ -113,6 +144,7 @@ struct SDL_AudioDevice { /* * * */ /* Data common to all devices */ + SDL_AudioDeviceID id; /* The current audio specification (shared with audio thread) */ SDL_AudioSpec spec; @@ -125,15 +157,17 @@ struct SDL_AudioDevice SDL_AudioStreamer streamer; /* Current state flags */ + /* !!! FIXME: should be SDL_bool */ int iscapture; - int enabled; + int enabled; /* true if device is functioning and connected. */ + int shutdown; /* true if we are signaling the play thread to end. */ int paused; int opened; /* Fake audio buffer for when the audio hardware is busy */ Uint8 *fake_stream; - /* A semaphore for locking the mixing buffers */ + /* A mutex for locking the mixing buffers */ SDL_mutex *mixer_lock; /* A thread to feed the audio device */ diff --git a/libs/SDL2/src/audio/SDL_wave.c b/libs/SDL2/src/audio/SDL_wave.c index 988e4b72..e898115c 100644 --- a/libs/SDL2/src/audio/SDL_wave.c +++ b/libs/SDL2/src/audio/SDL_wave.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/SDL_wave.h b/libs/SDL2/src/audio/SDL_wave.h index 6c20c60f..ccfa0448 100644 --- a/libs/SDL2/src/audio/SDL_wave.h +++ b/libs/SDL2/src/audio/SDL_wave.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/alsa/SDL_alsa_audio.c b/libs/SDL2/src/audio/alsa/SDL_alsa_audio.c index 1f3def3f..fac51978 100644 --- a/libs/SDL2/src/audio/alsa/SDL_alsa_audio.c +++ b/libs/SDL2/src/audio/alsa/SDL_alsa_audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -320,7 +320,7 @@ ALSA_PlayDevice(_THIS) /* Hmm, not much we can do - abort */ fprintf(stderr, "ALSA write failed (unrecoverable): %s\n", ALSA_snd_strerror(status)); - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); return; } continue; @@ -465,7 +465,7 @@ ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params, int override) } static int -ALSA_OpenDevice(_THIS, const char *devname, int iscapture) +ALSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { int status = 0; snd_pcm_t *pcm_handle = NULL; diff --git a/libs/SDL2/src/audio/alsa/SDL_alsa_audio.h b/libs/SDL2/src/audio/alsa/SDL_alsa_audio.h index 45353883..c5d3aeee 100644 --- a/libs/SDL2/src/audio/alsa/SDL_alsa_audio.h +++ b/libs/SDL2/src/audio/alsa/SDL_alsa_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/android/SDL_androidaudio.c b/libs/SDL2/src/audio/android/SDL_androidaudio.c index fe66763b..f35878cd 100644 --- a/libs/SDL2/src/audio/android/SDL_androidaudio.c +++ b/libs/SDL2/src/audio/android/SDL_androidaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,7 +35,7 @@ static SDL_AudioDevice* audioDevice = NULL; static int -AndroidAUD_OpenDevice(_THIS, const char *devname, int iscapture) +AndroidAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { SDL_AudioFormat test_format; diff --git a/libs/SDL2/src/audio/android/SDL_androidaudio.h b/libs/SDL2/src/audio/android/SDL_androidaudio.h index 77bb219d..38bb1905 100644 --- a/libs/SDL2/src/audio/android/SDL_androidaudio.h +++ b/libs/SDL2/src/audio/android/SDL_androidaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/arts/SDL_artsaudio.c b/libs/SDL2/src/audio/arts/SDL_artsaudio.c index 72fba70c..ca97c0af 100644 --- a/libs/SDL2/src/audio/arts/SDL_artsaudio.c +++ b/libs/SDL2/src/audio/arts/SDL_artsaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -151,7 +151,7 @@ ARTS_WaitDevice(_THIS) /* Check every 10 loops */ if (this->hidden->parent && (((++cnt) % 10) == 0)) { if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } } } @@ -179,7 +179,7 @@ ARTS_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if (written < 0) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", written); @@ -229,7 +229,7 @@ ARTS_Suspend(void) } static int -ARTS_OpenDevice(_THIS, const char *devname, int iscapture) +ARTS_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { int rc = 0; int bits = 0, frag_spec = 0; diff --git a/libs/SDL2/src/audio/arts/SDL_artsaudio.h b/libs/SDL2/src/audio/arts/SDL_artsaudio.h index fb7706fc..54b86f6b 100644 --- a/libs/SDL2/src/audio/arts/SDL_artsaudio.h +++ b/libs/SDL2/src/audio/arts/SDL_artsaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/bsd/SDL_bsdaudio.c b/libs/SDL2/src/audio/bsd/SDL_bsdaudio.c index f415fe04..b684f9eb 100644 --- a/libs/SDL2/src/audio/bsd/SDL_bsdaudio.c +++ b/libs/SDL2/src/audio/bsd/SDL_bsdaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -51,9 +51,9 @@ static void -BSDAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +BSDAUDIO_DetectDevices(void) { - SDL_EnumUnixAudioDevices(iscapture, 0, NULL, addfn); + SDL_EnumUnixAudioDevices(0, NULL); } @@ -150,7 +150,7 @@ BSDAUDIO_WaitDevice(_THIS) the user know what happened. */ fprintf(stderr, "SDL: %s\n", message); - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); /* Don't try to close - may hang */ this->hidden->audio_fd = -1; #ifdef DEBUG_AUDIO @@ -195,7 +195,7 @@ BSDAUDIO_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if (written < 0) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", written); @@ -224,7 +224,7 @@ BSDAUDIO_CloseDevice(_THIS) } static int -BSDAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +BSDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); SDL_AudioFormat format = 0; @@ -348,6 +348,8 @@ BSDAUDIO_Init(SDL_AudioDriverImpl * impl) impl->GetDeviceBuf = BSDAUDIO_GetDeviceBuf; impl->CloseDevice = BSDAUDIO_CloseDevice; + impl->AllowsArbitraryDeviceNames = 1; + return 1; /* this audio target is available. */ } diff --git a/libs/SDL2/src/audio/bsd/SDL_bsdaudio.h b/libs/SDL2/src/audio/bsd/SDL_bsdaudio.h index 625bdb54..7eee944f 100644 --- a/libs/SDL2/src/audio/bsd/SDL_bsdaudio.h +++ b/libs/SDL2/src/audio/bsd/SDL_bsdaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.c b/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.c index a263ae44..f75bc784 100644 --- a/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.c +++ b/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,31 +40,48 @@ static void COREAUDIO_CloseDevice(_THIS); } #if MACOSX_COREAUDIO -typedef void (*addDevFn)(const char *name, AudioDeviceID devId, void *data); +static const AudioObjectPropertyAddress devlist_address = { + kAudioHardwarePropertyDevices, + kAudioObjectPropertyScopeGlobal, + kAudioObjectPropertyElementMaster +}; -static void -addToDevList(const char *name, AudioDeviceID devId, void *data) +typedef void (*addDevFn)(const char *name, const int iscapture, AudioDeviceID devId, void *data); + +typedef struct AudioDeviceList { - SDL_AddAudioDevice addfn = (SDL_AddAudioDevice) data; - addfn(name); + AudioDeviceID devid; + SDL_bool alive; + struct AudioDeviceList *next; +} AudioDeviceList; + +static AudioDeviceList *output_devs = NULL; +static AudioDeviceList *capture_devs = NULL; + +static SDL_bool +add_to_internal_dev_list(const int iscapture, AudioDeviceID devId) +{ + AudioDeviceList *item = (AudioDeviceList *) SDL_malloc(sizeof (AudioDeviceList)); + if (item == NULL) { + return SDL_FALSE; + } + item->devid = devId; + item->alive = SDL_TRUE; + item->next = iscapture ? capture_devs : output_devs; + if (iscapture) { + capture_devs = item; + } else { + output_devs = item; + } + + return SDL_TRUE; } -typedef struct -{ - const char *findname; - AudioDeviceID devId; - int found; -} FindDevIdData; - static void -findDevId(const char *name, AudioDeviceID devId, void *_data) +addToDevList(const char *name, const int iscapture, AudioDeviceID devId, void *data) { - FindDevIdData *data = (FindDevIdData *) _data; - if (!data->found) { - if (SDL_strcmp(name, data->findname) == 0) { - data->found = 1; - data->devId = devId; - } + if (add_to_internal_dev_list(iscapture, devId)) { + SDL_AddAudioDevice(iscapture, name, (void *) ((size_t) devId)); } } @@ -77,14 +94,8 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata) UInt32 i = 0; UInt32 max = 0; - AudioObjectPropertyAddress addr = { - kAudioHardwarePropertyDevices, - kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster - }; - - result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &addr, - 0, NULL, &size); + result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, + &devlist_address, 0, NULL, &size); if (result != kAudioHardwareNoError) return; @@ -92,8 +103,8 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata) if (devs == NULL) return; - result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, - 0, NULL, &size, devs); + result = AudioObjectGetPropertyData(kAudioObjectSystemObject, + &devlist_address, 0, NULL, &size, devs); if (result != kAudioHardwareNoError) return; @@ -105,10 +116,17 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata) AudioBufferList *buflist = NULL; int usable = 0; CFIndex len = 0; + const AudioObjectPropertyAddress addr = { + kAudioDevicePropertyStreamConfiguration, + iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput, + kAudioObjectPropertyElementMaster + }; - addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : - kAudioDevicePropertyScopeOutput; - addr.mSelector = kAudioDevicePropertyStreamConfiguration; + const AudioObjectPropertyAddress nameaddr = { + kAudioObjectPropertyName, + iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput, + kAudioObjectPropertyElementMaster + }; result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size); if (result != noErr) @@ -136,9 +154,9 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata) if (!usable) continue; - addr.mSelector = kAudioObjectPropertyName; + size = sizeof (CFStringRef); - result = AudioObjectGetPropertyData(dev, &addr, 0, NULL, &size, &cfstr); + result = AudioObjectGetPropertyData(dev, &nameaddr, 0, NULL, &size, &cfstr); if (result != kAudioHardwareNoError) continue; @@ -169,79 +187,84 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata) ((iscapture) ? "capture" : "output"), (int) *devCount, ptr, (int) dev); #endif - addfn(ptr, dev, addfndata); + addfn(ptr, iscapture, dev, addfndata); } SDL_free(ptr); /* addfn() would have copied the string. */ } } static void -COREAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +free_audio_device_list(AudioDeviceList **list) { - build_device_list(iscapture, addToDevList, addfn); + AudioDeviceList *item = *list; + while (item) { + AudioDeviceList *next = item->next; + SDL_free(item); + item = next; + } + *list = NULL; } -static int -find_device_by_name(_THIS, const char *devname, int iscapture) +static void +COREAUDIO_DetectDevices(void) { - AudioDeviceID devid = 0; - OSStatus result = noErr; - UInt32 size = 0; - UInt32 alive = 0; - pid_t pid = 0; + build_device_list(SDL_TRUE, addToDevList, NULL); + build_device_list(SDL_FALSE, addToDevList, NULL); +} - AudioObjectPropertyAddress addr = { - 0, - kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster - }; - - if (devname == NULL) { - size = sizeof (AudioDeviceID); - addr.mSelector = - ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : - kAudioHardwarePropertyDefaultOutputDevice); - result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, - 0, NULL, &size, &devid); - CHECK_RESULT("AudioHardwareGetProperty (default device)"); - } else { - FindDevIdData data; - SDL_zero(data); - data.findname = devname; - build_device_list(iscapture, findDevId, &data); - if (!data.found) { - SDL_SetError("CoreAudio: No such audio device."); - return 0; +static void +build_device_change_list(const char *name, const int iscapture, AudioDeviceID devId, void *data) +{ + AudioDeviceList **list = (AudioDeviceList **) data; + AudioDeviceList *item; + for (item = *list; item != NULL; item = item->next) { + if (item->devid == devId) { + item->alive = SDL_TRUE; + return; } - devid = data.devId; } - addr.mSelector = kAudioDevicePropertyDeviceIsAlive; - addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : - kAudioDevicePropertyScopeOutput; + add_to_internal_dev_list(iscapture, devId); /* new device, add it. */ + SDL_AddAudioDevice(iscapture, name, (void *) ((size_t) devId)); +} - size = sizeof (alive); - result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive); - CHECK_RESULT - ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); - - if (!alive) { - SDL_SetError("CoreAudio: requested device exists, but isn't alive."); - return 0; +static void +reprocess_device_list(const int iscapture, AudioDeviceList **list) +{ + AudioDeviceList *item; + AudioDeviceList *prev = NULL; + for (item = *list; item != NULL; item = item->next) { + item->alive = SDL_FALSE; } - addr.mSelector = kAudioDevicePropertyHogMode; - size = sizeof (pid); - result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid); + build_device_list(iscapture, build_device_change_list, list); - /* some devices don't support this property, so errors are fine here. */ - if ((result == noErr) && (pid != -1)) { - SDL_SetError("CoreAudio: requested device is being hogged."); - return 0; + /* free items in the list that aren't still alive. */ + item = *list; + while (item != NULL) { + AudioDeviceList *next = item->next; + if (item->alive) { + prev = item; + } else { + SDL_RemoveAudioDevice(iscapture, (void *) ((size_t) item->devid)); + if (prev) { + prev->next = item->next; + } else { + *list = item->next; + } + SDL_free(item); + } + item = next; } +} - this->hidden->deviceID = devid; - return 1; +/* this is called when the system's list of available audio devices changes. */ +static OSStatus +device_list_changed(AudioObjectID systemObj, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) +{ + reprocess_device_list(SDL_TRUE, &capture_devs); + reprocess_device_list(SDL_FALSE, &output_devs); + return 0; } #endif @@ -317,11 +340,54 @@ inputCallback(void *inRefCon, } +#if MACOSX_COREAUDIO +static const AudioObjectPropertyAddress alive_address = +{ + kAudioDevicePropertyDeviceIsAlive, + kAudioObjectPropertyScopeGlobal, + kAudioObjectPropertyElementMaster +}; + +static OSStatus +device_unplugged(AudioObjectID devid, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) +{ + SDL_AudioDevice *this = (SDL_AudioDevice *) data; + SDL_bool dead = SDL_FALSE; + UInt32 isAlive = 1; + UInt32 size = sizeof (isAlive); + OSStatus error; + + if (!this->enabled) { + return 0; /* already known to be dead. */ + } + + error = AudioObjectGetPropertyData(this->hidden->deviceID, &alive_address, + 0, NULL, &size, &isAlive); + + if (error == kAudioHardwareBadDeviceError) { + dead = SDL_TRUE; /* device was unplugged. */ + } else if ((error == kAudioHardwareNoError) && (!isAlive)) { + dead = SDL_TRUE; /* device died in some other way. */ + } + + if (dead) { + SDL_OpenedAudioDeviceDisconnected(this); + } + + return 0; +} +#endif + static void COREAUDIO_CloseDevice(_THIS) { if (this->hidden != NULL) { if (this->hidden->audioUnitOpened) { + #if MACOSX_COREAUDIO + /* Unregister our disconnect callback. */ + AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this); + #endif + AURenderCallbackStruct callback; const AudioUnitElement output_bus = 0; const AudioUnitElement input_bus = 1; @@ -355,9 +421,63 @@ COREAUDIO_CloseDevice(_THIS) } } +#if MACOSX_COREAUDIO +static int +prepare_device(_THIS, void *handle, int iscapture) +{ + AudioDeviceID devid = (AudioDeviceID) ((size_t) handle); + OSStatus result = noErr; + UInt32 size = 0; + UInt32 alive = 0; + pid_t pid = 0; + + AudioObjectPropertyAddress addr = { + 0, + kAudioObjectPropertyScopeGlobal, + kAudioObjectPropertyElementMaster + }; + + if (handle == NULL) { + size = sizeof (AudioDeviceID); + addr.mSelector = + ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : + kAudioHardwarePropertyDefaultOutputDevice); + result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, + 0, NULL, &size, &devid); + CHECK_RESULT("AudioHardwareGetProperty (default device)"); + } + + addr.mSelector = kAudioDevicePropertyDeviceIsAlive; + addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : + kAudioDevicePropertyScopeOutput; + + size = sizeof (alive); + result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive); + CHECK_RESULT + ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); + + if (!alive) { + SDL_SetError("CoreAudio: requested device exists, but isn't alive."); + return 0; + } + + addr.mSelector = kAudioDevicePropertyHogMode; + size = sizeof (pid); + result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid); + + /* some devices don't support this property, so errors are fine here. */ + if ((result == noErr) && (pid != -1)) { + SDL_SetError("CoreAudio: requested device is being hogged."); + return 0; + } + + this->hidden->deviceID = devid; + return 1; +} +#endif static int -prepare_audiounit(_THIS, const char *devname, int iscapture, +prepare_audiounit(_THIS, void *handle, int iscapture, const AudioStreamBasicDescription * strdesc) { OSStatus result = noErr; @@ -376,8 +496,7 @@ prepare_audiounit(_THIS, const char *devname, int iscapture, kAudioUnitScope_Input); #if MACOSX_COREAUDIO - if (!find_device_by_name(this, devname, iscapture)) { - SDL_SetError("Couldn't find requested CoreAudio device"); + if (!prepare_device(this, handle, iscapture)) { return 0; } #endif @@ -454,13 +573,18 @@ prepare_audiounit(_THIS, const char *devname, int iscapture, result = AudioOutputUnitStart(this->hidden->audioUnit); CHECK_RESULT("AudioOutputUnitStart"); +#if MACOSX_COREAUDIO + /* Fire a callback if the device stops being "alive" (disconnected, etc). */ + AudioObjectAddPropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this); +#endif + /* We're running! */ return 1; } static int -COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { AudioStreamBasicDescription strdesc; SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); @@ -519,7 +643,7 @@ COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) strdesc.mBytesPerPacket = strdesc.mBytesPerFrame * strdesc.mFramesPerPacket; - if (!prepare_audiounit(this, devname, iscapture, &strdesc)) { + if (!prepare_audiounit(this, handle, iscapture, &strdesc)) { COREAUDIO_CloseDevice(this); return -1; /* prepare_audiounit() will call SDL_SetError()... */ } @@ -527,15 +651,27 @@ COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) return 0; /* good to go. */ } +static void +COREAUDIO_Deinitialize(void) +{ +#if MACOSX_COREAUDIO + AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL); + free_audio_device_list(&capture_devs); + free_audio_device_list(&output_devs); +#endif +} + static int COREAUDIO_Init(SDL_AudioDriverImpl * impl) { /* Set the function pointers */ impl->OpenDevice = COREAUDIO_OpenDevice; impl->CloseDevice = COREAUDIO_CloseDevice; + impl->Deinitialize = COREAUDIO_Deinitialize; #if MACOSX_COREAUDIO impl->DetectDevices = COREAUDIO_DetectDevices; + AudioObjectAddPropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL); #else impl->OnlyHasDefaultOutputDevice = 1; diff --git a/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.h b/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.h index 41e8cea2..119d2582 100644 --- a/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.h +++ b/libs/SDL2/src/audio/coreaudio/SDL_coreaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/directsound/SDL_directsound.c b/libs/SDL2/src/audio/directsound/SDL_directsound.c index 067683cc..10c32f83 100644 --- a/libs/SDL2/src/audio/directsound/SDL_directsound.c +++ b/libs/SDL2/src/audio/directsound/SDL_directsound.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -144,15 +144,22 @@ SetDSerror(const char *function, int code) return SDL_SetError("%s", errbuf); } +static void +DSOUND_FreeDeviceHandle(void *handle) +{ + SDL_free(handle); +} static BOOL CALLBACK FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data) { - SDL_AddAudioDevice addfn = (SDL_AddAudioDevice) data; + const int iscapture = (int) ((size_t) data); if (guid != NULL) { /* skip default device */ char *str = WIN_StringToUTF8(desc); if (str != NULL) { - addfn(str); + LPGUID cpyguid = (LPGUID) SDL_malloc(sizeof (GUID)); + SDL_memcpy(cpyguid, guid, sizeof (GUID)); + SDL_AddAudioDevice(iscapture, str, cpyguid); SDL_free(str); /* addfn() makes a copy of this string. */ } } @@ -160,13 +167,10 @@ FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data) } static void -DSOUND_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +DSOUND_DetectDevices(void) { - if (iscapture) { - pDirectSoundCaptureEnumerateW(FindAllDevs, addfn); - } else { - pDirectSoundEnumerateW(FindAllDevs, addfn); - } + pDirectSoundCaptureEnumerateW(FindAllDevs, (void *) ((size_t) 1)); + pDirectSoundEnumerateW(FindAllDevs, (void *) ((size_t) 0)); } @@ -419,53 +423,14 @@ CreateSecondary(_THIS, HWND focus) return (numchunks); } -typedef struct FindDevGUIDData -{ - const char *devname; - GUID guid; - int found; -} FindDevGUIDData; - -static BOOL CALLBACK -FindDevGUID(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID _data) -{ - if (guid != NULL) { /* skip the default device. */ - FindDevGUIDData *data = (FindDevGUIDData *) _data; - char *str = WIN_StringToUTF8(desc); - const int match = (SDL_strcmp(str, data->devname) == 0); - SDL_free(str); - if (match) { - data->found = 1; - SDL_memcpy(&data->guid, guid, sizeof (data->guid)); - return FALSE; /* found it! stop enumerating. */ - } - } - return TRUE; /* keep enumerating. */ -} - static int -DSOUND_OpenDevice(_THIS, const char *devname, int iscapture) +DSOUND_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { HRESULT result; SDL_bool valid_format = SDL_FALSE; SDL_bool tried_format = SDL_FALSE; SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); - FindDevGUIDData devguid; - LPGUID guid = NULL; - - if (devname != NULL) { - devguid.found = 0; - devguid.devname = devname; - if (iscapture) - pDirectSoundCaptureEnumerateW(FindDevGUID, &devguid); - else - pDirectSoundEnumerateW(FindDevGUID, &devguid); - - if (!devguid.found) { - return SDL_SetError("DirectSound: Requested device not found"); - } - guid = &devguid.guid; - } + LPGUID guid = (LPGUID) handle; /* Initialize all variables that we clean on shutdown */ this->hidden = (struct SDL_PrivateAudioData *) @@ -536,6 +501,8 @@ DSOUND_Init(SDL_AudioDriverImpl * impl) impl->WaitDone = DSOUND_WaitDone; impl->GetDeviceBuf = DSOUND_GetDeviceBuf; impl->CloseDevice = DSOUND_CloseDevice; + impl->FreeDeviceHandle = DSOUND_FreeDeviceHandle; + impl->Deinitialize = DSOUND_Deinitialize; return 1; /* this audio target is available. */ diff --git a/libs/SDL2/src/audio/directsound/SDL_directsound.h b/libs/SDL2/src/audio/directsound/SDL_directsound.h index ae7faa45..718cbab3 100644 --- a/libs/SDL2/src/audio/directsound/SDL_directsound.h +++ b/libs/SDL2/src/audio/directsound/SDL_directsound.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/disk/SDL_diskaudio.c b/libs/SDL2/src/audio/disk/SDL_diskaudio.c index cc4e3efc..ef8bc0dc 100644 --- a/libs/SDL2/src/audio/disk/SDL_diskaudio.c +++ b/libs/SDL2/src/audio/disk/SDL_diskaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -71,7 +71,7 @@ DISKAUD_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if (written != this->hidden->mixlen) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", written); @@ -100,10 +100,11 @@ DISKAUD_CloseDevice(_THIS) } static int -DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) +DISKAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { + /* handle != NULL means "user specified the placeholder name on the fake detected device list" */ + const char *fname = DISKAUD_GetOutputFilename(handle ? NULL : devname); const char *envr = SDL_getenv(DISKENVR_WRITEDELAY); - const char *fname = DISKAUD_GetOutputFilename(devname); this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); @@ -141,6 +142,13 @@ DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) return 0; } +static void +DISKAUD_DetectDevices(void) +{ + /* !!! FIXME: stole this literal string from DEFAULT_OUTPUT_DEVNAME in SDL_audio.c */ + SDL_AddAudioDevice(SDL_FALSE, "System audio output device", (void *) 0x1); +} + static int DISKAUD_Init(SDL_AudioDriverImpl * impl) { @@ -150,6 +158,9 @@ DISKAUD_Init(SDL_AudioDriverImpl * impl) impl->PlayDevice = DISKAUD_PlayDevice; impl->GetDeviceBuf = DISKAUD_GetDeviceBuf; impl->CloseDevice = DISKAUD_CloseDevice; + impl->DetectDevices = DISKAUD_DetectDevices; + + impl->AllowsArbitraryDeviceNames = 1; return 1; /* this audio target is available. */ } diff --git a/libs/SDL2/src/audio/disk/SDL_diskaudio.h b/libs/SDL2/src/audio/disk/SDL_diskaudio.h index 9c5a7afa..0c1af3a5 100644 --- a/libs/SDL2/src/audio/disk/SDL_diskaudio.h +++ b/libs/SDL2/src/audio/disk/SDL_diskaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/dsp/SDL_dspaudio.c b/libs/SDL2/src/audio/dsp/SDL_dspaudio.c index eea5a5f8..678c74fe 100644 --- a/libs/SDL2/src/audio/dsp/SDL_dspaudio.c +++ b/libs/SDL2/src/audio/dsp/SDL_dspaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -51,9 +51,9 @@ static void -DSP_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +DSP_DetectDevices(void) { - SDL_EnumUnixAudioDevices(iscapture, 0, NULL, addfn); + SDL_EnumUnixAudioDevices(0, NULL); } @@ -74,7 +74,7 @@ DSP_CloseDevice(_THIS) static int -DSP_OpenDevice(_THIS, const char *devname, int iscapture) +DSP_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); int format; @@ -270,7 +270,7 @@ DSP_PlayDevice(_THIS) const int mixlen = this->hidden->mixlen; if (write(this->hidden->audio_fd, mixbuf, mixlen) == -1) { perror("Audio write"); - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen); @@ -293,6 +293,8 @@ DSP_Init(SDL_AudioDriverImpl * impl) impl->GetDeviceBuf = DSP_GetDeviceBuf; impl->CloseDevice = DSP_CloseDevice; + impl->AllowsArbitraryDeviceNames = 1; + return 1; /* this audio target is available. */ } diff --git a/libs/SDL2/src/audio/dsp/SDL_dspaudio.h b/libs/SDL2/src/audio/dsp/SDL_dspaudio.h index 5cbb563b..054c4d9a 100644 --- a/libs/SDL2/src/audio/dsp/SDL_dspaudio.h +++ b/libs/SDL2/src/audio/dsp/SDL_dspaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/dummy/SDL_dummyaudio.c b/libs/SDL2/src/audio/dummy/SDL_dummyaudio.c index 671e222c..ec9c40fa 100644 --- a/libs/SDL2/src/audio/dummy/SDL_dummyaudio.c +++ b/libs/SDL2/src/audio/dummy/SDL_dummyaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "SDL_dummyaudio.h" static int -DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture) +DUMMYAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { return 0; /* always succeeds. */ } diff --git a/libs/SDL2/src/audio/dummy/SDL_dummyaudio.h b/libs/SDL2/src/audio/dummy/SDL_dummyaudio.h index 18540111..9415c122 100644 --- a/libs/SDL2/src/audio/dummy/SDL_dummyaudio.h +++ b/libs/SDL2/src/audio/dummy/SDL_dummyaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.c b/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.c index f1ae929f..792f12c1 100644 --- a/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.c +++ b/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -151,7 +151,7 @@ Emscripten_CloseDevice(_THIS) } static int -Emscripten_OpenDevice(_THIS, const char *devname, int iscapture) +Emscripten_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { SDL_bool valid_format = SDL_FALSE; SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); @@ -263,6 +263,10 @@ Emscripten_Init(SDL_AudioDriverImpl * impl) return 0; }); + if (!available) { + SDL_SetError("No audio context available"); + } + return available; } diff --git a/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.h b/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.h index 2cec72b1..c3da6a02 100644 --- a/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.h +++ b/libs/SDL2/src/audio/emscripten/SDL_emscriptenaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/esd/SDL_esdaudio.c b/libs/SDL2/src/audio/esd/SDL_esdaudio.c index e675272d..906728cb 100644 --- a/libs/SDL2/src/audio/esd/SDL_esdaudio.c +++ b/libs/SDL2/src/audio/esd/SDL_esdaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -129,7 +129,7 @@ ESD_WaitDevice(_THIS) /* Check every 10 loops */ if (this->hidden->parent && (((++cnt) % 10) == 0)) { if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } } } @@ -161,7 +161,7 @@ ESD_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if (written < 0) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } } @@ -215,7 +215,7 @@ get_progname(void) static int -ESD_OpenDevice(_THIS, const char *devname, int iscapture) +ESD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { esd_format_t format = (ESD_STREAM | ESD_PLAY); SDL_AudioFormat test_format = 0; diff --git a/libs/SDL2/src/audio/esd/SDL_esdaudio.h b/libs/SDL2/src/audio/esd/SDL_esdaudio.h index e0d5d4cd..ad8159ee 100644 --- a/libs/SDL2/src/audio/esd/SDL_esdaudio.h +++ b/libs/SDL2/src/audio/esd/SDL_esdaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.c b/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.c index b8367715..6bab5a78 100644 --- a/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.c +++ b/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -143,7 +143,7 @@ SDL_FS_PlayDevice(_THIS) this->hidden->mixsamples); /* If we couldn't write, assume fatal error for now */ if (ret) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); @@ -186,7 +186,7 @@ SDL_FS_CloseDevice(_THIS) static int -SDL_FS_OpenDevice(_THIS, const char *devname, int iscapture) +SDL_FS_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { int bytes; SDL_AudioFormat test_format = 0, format = 0; diff --git a/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.h b/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.h index 1f9d6bd2..aa2ae192 100644 --- a/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.h +++ b/libs/SDL2/src/audio/fusionsound/SDL_fsaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/haiku/SDL_haikuaudio.cc b/libs/SDL2/src/audio/haiku/SDL_haikuaudio.cc index dddb7792..c4765e37 100644 --- a/libs/SDL2/src/audio/haiku/SDL_haikuaudio.cc +++ b/libs/SDL2/src/audio/haiku/SDL_haikuaudio.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -111,7 +111,7 @@ UnmaskSignals(sigset_t * omask) static int -HAIKUAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +HAIKUAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { int valid_datatype = 0; media_raw_audio_format format; diff --git a/libs/SDL2/src/audio/haiku/SDL_haikuaudio.h b/libs/SDL2/src/audio/haiku/SDL_haikuaudio.h index c6c019e9..21418618 100644 --- a/libs/SDL2/src/audio/haiku/SDL_haikuaudio.h +++ b/libs/SDL2/src/audio/haiku/SDL_haikuaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/nacl/SDL_naclaudio.c b/libs/SDL2/src/audio/nacl/SDL_naclaudio.c index 741cb139..5c5b0bcf 100644 --- a/libs/SDL2/src/audio/nacl/SDL_naclaudio.c +++ b/libs/SDL2/src/audio/nacl/SDL_naclaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,7 +43,7 @@ #define SAMPLE_FRAME_COUNT 4096 /* Audio driver functions */ -static int NACLAUD_OpenDevice(_THIS, const char *devname, int iscapture); +static int NACLAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture); static void NACLAUD_CloseDevice(_THIS); static void nacl_audio_callback(void* samples, uint32_t buffer_size, PP_TimeDelta latency, void* data); @@ -85,7 +85,7 @@ static void NACLAUD_CloseDevice(SDL_AudioDevice *device) { } static int -NACLAUD_OpenDevice(_THIS, const char *devname, int iscapture) { +NACLAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { PP_Instance instance = PSGetInstanceId(); const PPB_Audio *ppb_audio = PSInterfaceAudio(); const PPB_AudioConfig *ppb_audiocfg = PSInterfaceAudioConfig(); @@ -130,9 +130,7 @@ NACLAUD_Init(SDL_AudioDriverImpl * impl) /* Set the function pointers */ impl->OpenDevice = NACLAUD_OpenDevice; impl->CloseDevice = NACLAUD_CloseDevice; - impl->HasCaptureSupport = 0; impl->OnlyHasDefaultOutputDevice = 1; - impl->OnlyHasDefaultInputDevice = 1; impl->ProvidesOwnCallbackThread = 1; /* * impl->WaitDevice = NACLAUD_WaitDevice; diff --git a/libs/SDL2/src/audio/nacl/SDL_naclaudio.h b/libs/SDL2/src/audio/nacl/SDL_naclaudio.h index 4683c785..c2636f0c 100644 --- a/libs/SDL2/src/audio/nacl/SDL_naclaudio.h +++ b/libs/SDL2/src/audio/nacl/SDL_naclaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/nas/SDL_nasaudio.c b/libs/SDL2/src/audio/nas/SDL_nasaudio.c index a41a480f..596ca752 100644 --- a/libs/SDL2/src/audio/nas/SDL_nasaudio.c +++ b/libs/SDL2/src/audio/nas/SDL_nasaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -276,7 +276,7 @@ find_device(_THIS, int nch) } static int -NAS_OpenDevice(_THIS, const char *devname, int iscapture) +NAS_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { AuElement elms[3]; int buffer_size; diff --git a/libs/SDL2/src/audio/nas/SDL_nasaudio.h b/libs/SDL2/src/audio/nas/SDL_nasaudio.h index e1ee6a52..715f1fb2 100644 --- a/libs/SDL2/src/audio/nas/SDL_nasaudio.h +++ b/libs/SDL2/src/audio/nas/SDL_nasaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/paudio/SDL_paudio.c b/libs/SDL2/src/audio/paudio/SDL_paudio.c index 032d8d2c..79c71645 100644 --- a/libs/SDL2/src/audio/paudio/SDL_paudio.c +++ b/libs/SDL2/src/audio/paudio/SDL_paudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -111,7 +111,7 @@ OpenAudioPath(char *path, int maxlen, int flags, int classic) if (stat(audiopath, &sb) == 0) { fd = open(audiopath, flags, 0); - if (fd > 0) { + if (fd >= 0) { if (path != NULL) { SDL_strlcpy(path, audiopath, maxlen); } @@ -176,7 +176,7 @@ PAUDIO_WaitDevice(_THIS) * the user know what happened. */ fprintf(stderr, "SDL: %s - %s\n", strerror(errno), message); - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); /* Don't try to close - may hang */ this->hidden->audio_fd = -1; #ifdef DEBUG_AUDIO @@ -212,7 +212,7 @@ PAUDIO_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if (written < 0) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", written); @@ -241,7 +241,7 @@ PAUDIO_CloseDevice(_THIS) } static int -PAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +PAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { const char *workaround = SDL_getenv("SDL_DSP_NOSELECT"); char audiodev[1024]; diff --git a/libs/SDL2/src/audio/paudio/SDL_paudio.h b/libs/SDL2/src/audio/paudio/SDL_paudio.h index 5a1a6488..2bcb706c 100644 --- a/libs/SDL2/src/audio/paudio/SDL_paudio.h +++ b/libs/SDL2/src/audio/paudio/SDL_paudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/psp/SDL_pspaudio.c b/libs/SDL2/src/audio/psp/SDL_pspaudio.c index 36039116..60b7993a 100644 --- a/libs/SDL2/src/audio/psp/SDL_pspaudio.c +++ b/libs/SDL2/src/audio/psp/SDL_pspaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,7 +43,7 @@ #define PSPAUD_DRIVER_NAME "psp" static int -PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture) +PSPAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { int format, mixlen, i; this->hidden = (struct SDL_PrivateAudioData *) diff --git a/libs/SDL2/src/audio/psp/SDL_pspaudio.h b/libs/SDL2/src/audio/psp/SDL_pspaudio.h index 3b7ffb0a..c6332744 100644 --- a/libs/SDL2/src/audio/psp/SDL_pspaudio.h +++ b/libs/SDL2/src/audio/psp/SDL_pspaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c b/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c index c3e1238b..30ca984e 100644 --- a/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,6 +26,7 @@ Stéphan Kochen: stephan .a.t. kochen.nl */ #include "../../SDL_internal.h" +#include "SDL_assert.h" #if SDL_AUDIO_DRIVER_PULSEAUDIO @@ -38,7 +39,6 @@ #include #include #include -#include #include "SDL_timer.h" #include "SDL_audio.h" @@ -66,16 +66,14 @@ static SDL_INLINE int PA_STREAM_IS_GOOD(pa_stream_state_t x) { static const char *(*PULSEAUDIO_pa_get_library_version) (void); -static pa_simple *(*PULSEAUDIO_pa_simple_new) (const char *, const char *, - pa_stream_direction_t, const char *, const char *, const pa_sample_spec *, - const pa_channel_map *, const pa_buffer_attr *, int *); -static void (*PULSEAUDIO_pa_simple_free) (pa_simple *); static pa_channel_map *(*PULSEAUDIO_pa_channel_map_init_auto) ( pa_channel_map *, unsigned, pa_channel_map_def_t); static const char * (*PULSEAUDIO_pa_strerror) (int); static pa_mainloop * (*PULSEAUDIO_pa_mainloop_new) (void); static pa_mainloop_api * (*PULSEAUDIO_pa_mainloop_get_api) (pa_mainloop *); static int (*PULSEAUDIO_pa_mainloop_iterate) (pa_mainloop *, int, int *); +static int (*PULSEAUDIO_pa_mainloop_run) (pa_mainloop *, int *); +static void (*PULSEAUDIO_pa_mainloop_quit) (pa_mainloop *, int); static void (*PULSEAUDIO_pa_mainloop_free) (pa_mainloop *); static pa_operation_state_t (*PULSEAUDIO_pa_operation_get_state) ( @@ -87,7 +85,13 @@ static pa_context * (*PULSEAUDIO_pa_context_new) (pa_mainloop_api *, const char *); static int (*PULSEAUDIO_pa_context_connect) (pa_context *, const char *, pa_context_flags_t, const pa_spawn_api *); +static pa_operation * (*PULSEAUDIO_pa_context_get_sink_info_list) (pa_context *, pa_sink_info_cb_t, void *); +static pa_operation * (*PULSEAUDIO_pa_context_get_source_info_list) (pa_context *, pa_source_info_cb_t, void *); +static pa_operation * (*PULSEAUDIO_pa_context_get_sink_info_by_index) (pa_context *, uint32_t, pa_sink_info_cb_t, void *); +static pa_operation * (*PULSEAUDIO_pa_context_get_source_info_by_index) (pa_context *, uint32_t, pa_source_info_cb_t, void *); static pa_context_state_t (*PULSEAUDIO_pa_context_get_state) (pa_context *); +static pa_operation * (*PULSEAUDIO_pa_context_subscribe) (pa_context *, pa_subscription_mask_t, pa_context_success_cb_t, void *); +static void (*PULSEAUDIO_pa_context_set_subscribe_callback) (pa_context *, pa_context_subscribe_cb_t, void *); static void (*PULSEAUDIO_pa_context_disconnect) (pa_context *); static void (*PULSEAUDIO_pa_context_unref) (pa_context *); @@ -179,18 +183,24 @@ static int load_pulseaudio_syms(void) { SDL_PULSEAUDIO_SYM(pa_get_library_version); - SDL_PULSEAUDIO_SYM(pa_simple_new); - SDL_PULSEAUDIO_SYM(pa_simple_free); SDL_PULSEAUDIO_SYM(pa_mainloop_new); SDL_PULSEAUDIO_SYM(pa_mainloop_get_api); SDL_PULSEAUDIO_SYM(pa_mainloop_iterate); + SDL_PULSEAUDIO_SYM(pa_mainloop_run); + SDL_PULSEAUDIO_SYM(pa_mainloop_quit); SDL_PULSEAUDIO_SYM(pa_mainloop_free); SDL_PULSEAUDIO_SYM(pa_operation_get_state); SDL_PULSEAUDIO_SYM(pa_operation_cancel); SDL_PULSEAUDIO_SYM(pa_operation_unref); SDL_PULSEAUDIO_SYM(pa_context_new); SDL_PULSEAUDIO_SYM(pa_context_connect); + SDL_PULSEAUDIO_SYM(pa_context_get_sink_info_list); + SDL_PULSEAUDIO_SYM(pa_context_get_source_info_list); + SDL_PULSEAUDIO_SYM(pa_context_get_sink_info_by_index); + SDL_PULSEAUDIO_SYM(pa_context_get_source_info_by_index); SDL_PULSEAUDIO_SYM(pa_context_get_state); + SDL_PULSEAUDIO_SYM(pa_context_subscribe); + SDL_PULSEAUDIO_SYM(pa_context_set_subscribe_callback); SDL_PULSEAUDIO_SYM(pa_context_disconnect); SDL_PULSEAUDIO_SYM(pa_context_unref); SDL_PULSEAUDIO_SYM(pa_stream_new); @@ -206,122 +216,6 @@ load_pulseaudio_syms(void) return 0; } - -/* Check to see if we can connect to PulseAudio */ -static SDL_bool -CheckPulseAudioAvailable() -{ - pa_simple *s; - pa_sample_spec ss; - - ss.format = PA_SAMPLE_S16NE; - ss.channels = 1; - ss.rate = 22050; - - s = PULSEAUDIO_pa_simple_new(NULL, "SDL", PA_STREAM_PLAYBACK, NULL, - "Test", &ss, NULL, NULL, NULL); - if (s) { - PULSEAUDIO_pa_simple_free(s); - return SDL_TRUE; - } else { - return SDL_FALSE; - } -} - -/* This function waits until it is possible to write a full sound buffer */ -static void -PULSEAUDIO_WaitDevice(_THIS) -{ - struct SDL_PrivateAudioData *h = this->hidden; - - while(1) { - if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || - PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || - PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { - this->enabled = 0; - return; - } - if (PULSEAUDIO_pa_stream_writable_size(h->stream) >= h->mixlen) { - return; - } - } -} - -static void -PULSEAUDIO_PlayDevice(_THIS) -{ - /* Write the audio data */ - struct SDL_PrivateAudioData *h = this->hidden; - if (PULSEAUDIO_pa_stream_write(h->stream, h->mixbuf, h->mixlen, NULL, 0LL, - PA_SEEK_RELATIVE) < 0) { - this->enabled = 0; - } -} - -static void -stream_drain_complete(pa_stream *s, int success, void *userdata) -{ - /* no-op for pa_stream_drain() to use for callback. */ -} - -static void -PULSEAUDIO_WaitDone(_THIS) -{ - struct SDL_PrivateAudioData *h = this->hidden; - pa_operation *o; - - o = PULSEAUDIO_pa_stream_drain(h->stream, stream_drain_complete, NULL); - if (!o) { - return; - } - - while (PULSEAUDIO_pa_operation_get_state(o) != PA_OPERATION_DONE) { - if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || - PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || - PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { - PULSEAUDIO_pa_operation_cancel(o); - break; - } - } - - PULSEAUDIO_pa_operation_unref(o); -} - - - -static Uint8 * -PULSEAUDIO_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - - -static void -PULSEAUDIO_CloseDevice(_THIS) -{ - if (this->hidden != NULL) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - if (this->hidden->stream) { - PULSEAUDIO_pa_stream_disconnect(this->hidden->stream); - PULSEAUDIO_pa_stream_unref(this->hidden->stream); - this->hidden->stream = NULL; - } - if (this->hidden->context != NULL) { - PULSEAUDIO_pa_context_disconnect(this->hidden->context); - PULSEAUDIO_pa_context_unref(this->hidden->context); - this->hidden->context = NULL; - } - if (this->hidden->mainloop != NULL) { - PULSEAUDIO_pa_mainloop_free(this->hidden->mainloop); - this->hidden->mainloop = NULL; - } - SDL_free(this->hidden); - this->hidden = NULL; - } -} - - static SDL_INLINE int squashVersion(const int major, const int minor, const int patch) { @@ -344,8 +238,193 @@ getAppName(void) return "SDL Application"; /* oh well. */ } +static void +WaitForPulseOperation(pa_mainloop *mainloop, pa_operation *o) +{ + /* This checks for NO errors currently. Either fix that, check results elsewhere, or do things you don't care about. */ + if (mainloop && o) { + SDL_bool okay = SDL_TRUE; + while (okay && (PULSEAUDIO_pa_operation_get_state(o) == PA_OPERATION_RUNNING)) { + okay = (PULSEAUDIO_pa_mainloop_iterate(mainloop, 1, NULL) >= 0); + } + PULSEAUDIO_pa_operation_unref(o); + } +} + +static void +DisconnectFromPulseServer(pa_mainloop *mainloop, pa_context *context) +{ + if (context) { + PULSEAUDIO_pa_context_disconnect(context); + PULSEAUDIO_pa_context_unref(context); + } + if (mainloop != NULL) { + PULSEAUDIO_pa_mainloop_free(mainloop); + } +} + static int -PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +ConnectToPulseServer_Internal(pa_mainloop **_mainloop, pa_context **_context) +{ + pa_mainloop *mainloop = NULL; + pa_context *context = NULL; + pa_mainloop_api *mainloop_api = NULL; + int state = 0; + + *_mainloop = NULL; + *_context = NULL; + + /* Set up a new main loop */ + if (!(mainloop = PULSEAUDIO_pa_mainloop_new())) { + return SDL_SetError("pa_mainloop_new() failed"); + } + + *_mainloop = mainloop; + + mainloop_api = PULSEAUDIO_pa_mainloop_get_api(mainloop); + SDL_assert(mainloop_api); /* this never fails, right? */ + + context = PULSEAUDIO_pa_context_new(mainloop_api, getAppName()); + if (!context) { + return SDL_SetError("pa_context_new() failed"); + } + *_context = context; + + /* Connect to the PulseAudio server */ + if (PULSEAUDIO_pa_context_connect(context, NULL, 0, NULL) < 0) { + return SDL_SetError("Could not setup connection to PulseAudio"); + } + + do { + if (PULSEAUDIO_pa_mainloop_iterate(mainloop, 1, NULL) < 0) { + return SDL_SetError("pa_mainloop_iterate() failed"); + } + state = PULSEAUDIO_pa_context_get_state(context); + if (!PA_CONTEXT_IS_GOOD(state)) { + return SDL_SetError("Could not connect to PulseAudio"); + } + } while (state != PA_CONTEXT_READY); + + return 0; /* connected and ready! */ +} + +static int +ConnectToPulseServer(pa_mainloop **_mainloop, pa_context **_context) +{ + const int retval = ConnectToPulseServer_Internal(_mainloop, _context); + if (retval < 0) { + DisconnectFromPulseServer(*_mainloop, *_context); + } + return retval; +} + + +/* This function waits until it is possible to write a full sound buffer */ +static void +PULSEAUDIO_WaitDevice(_THIS) +{ + struct SDL_PrivateAudioData *h = this->hidden; + + while (this->enabled) { + if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || + PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || + PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + SDL_OpenedAudioDeviceDisconnected(this); + return; + } + if (PULSEAUDIO_pa_stream_writable_size(h->stream) >= h->mixlen) { + return; + } + } +} + +static void +PULSEAUDIO_PlayDevice(_THIS) +{ + /* Write the audio data */ + struct SDL_PrivateAudioData *h = this->hidden; + if (this->enabled) { + if (PULSEAUDIO_pa_stream_write(h->stream, h->mixbuf, h->mixlen, NULL, 0LL, PA_SEEK_RELATIVE) < 0) { + SDL_OpenedAudioDeviceDisconnected(this); + } + } +} + +static void +stream_drain_complete(pa_stream *s, int success, void *userdata) +{ + /* no-op for pa_stream_drain() to use for callback. */ +} + +static void +PULSEAUDIO_WaitDone(_THIS) +{ + if (this->enabled) { + struct SDL_PrivateAudioData *h = this->hidden; + pa_operation *o = PULSEAUDIO_pa_stream_drain(h->stream, stream_drain_complete, NULL); + if (o) { + while (PULSEAUDIO_pa_operation_get_state(o) != PA_OPERATION_DONE) { + if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || + PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || + PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + PULSEAUDIO_pa_operation_cancel(o); + break; + } + } + PULSEAUDIO_pa_operation_unref(o); + } + } +} + + + +static Uint8 * +PULSEAUDIO_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + + +static void +PULSEAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + SDL_free(this->hidden->device_name); + if (this->hidden->stream) { + PULSEAUDIO_pa_stream_disconnect(this->hidden->stream); + PULSEAUDIO_pa_stream_unref(this->hidden->stream); + } + DisconnectFromPulseServer(this->hidden->mainloop, this->hidden->context); + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static void +DeviceNameCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) +{ + if (i) { + char **devname = (char **) data; + *devname = SDL_strdup(i->name); + } +} + +static SDL_bool +FindDeviceName(struct SDL_PrivateAudioData *h, void *handle) +{ + const uint32_t idx = ((uint32_t) ((size_t) handle)) - 1; + + if (handle == NULL) { /* NULL == default device. */ + return SDL_TRUE; + } + + WaitForPulseOperation(h->mainloop, PULSEAUDIO_pa_context_get_sink_info_by_index(h->context, idx, DeviceNameCallback, &h->device_name)); + return (h->device_name != NULL); +} + +static int +PULSEAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { struct SDL_PrivateAudioData *h = NULL; Uint16 test_format = 0; @@ -442,42 +521,21 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) paattr.minreq = h->mixlen; #endif + if (ConnectToPulseServer(&h->mainloop, &h->context) < 0) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Could not connect to PulseAudio server"); + } + + if (!FindDeviceName(h, handle)) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Requested PulseAudio sink missing?"); + } + /* The SDL ALSA output hints us that we use Windows' channel mapping */ /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */ PULSEAUDIO_pa_channel_map_init_auto(&pacmap, this->spec.channels, PA_CHANNEL_MAP_WAVEEX); - /* Set up a new main loop */ - if (!(h->mainloop = PULSEAUDIO_pa_mainloop_new())) { - PULSEAUDIO_CloseDevice(this); - return SDL_SetError("pa_mainloop_new() failed"); - } - - h->mainloop_api = PULSEAUDIO_pa_mainloop_get_api(h->mainloop); - h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, getAppName()); - if (!h->context) { - PULSEAUDIO_CloseDevice(this); - return SDL_SetError("pa_context_new() failed"); - } - - /* Connect to the PulseAudio server */ - if (PULSEAUDIO_pa_context_connect(h->context, NULL, 0, NULL) < 0) { - PULSEAUDIO_CloseDevice(this); - return SDL_SetError("Could not setup connection to PulseAudio"); - } - - do { - if (PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { - PULSEAUDIO_CloseDevice(this); - return SDL_SetError("pa_mainloop_iterate() failed"); - } - state = PULSEAUDIO_pa_context_get_state(h->context); - if (!PA_CONTEXT_IS_GOOD(state)) { - PULSEAUDIO_CloseDevice(this); - return SDL_SetError("Could not connect to PulseAudio"); - } - } while (state != PA_CONTEXT_READY); - h->stream = PULSEAUDIO_pa_stream_new( h->context, "Simple DirectMedia Layer", /* stream description */ @@ -490,7 +548,13 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) return SDL_SetError("Could not set up PulseAudio stream"); } - if (PULSEAUDIO_pa_stream_connect_playback(h->stream, NULL, &paattr, flags, + /* now that we have multi-device support, don't move a stream from + a device that was unplugged to something else, unless we're default. */ + if (h->device_name != NULL) { + flags |= PA_STREAM_DONT_MOVE; + } + + if (PULSEAUDIO_pa_stream_connect_playback(h->stream, h->device_name, &paattr, flags, NULL, NULL) < 0) { PULSEAUDIO_CloseDevice(this); return SDL_SetError("Could not connect PulseAudio stream"); @@ -504,7 +568,7 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) state = PULSEAUDIO_pa_stream_get_state(h->stream); if (!PA_STREAM_IS_GOOD(state)) { PULSEAUDIO_CloseDevice(this); - return SDL_SetError("Could not create to PulseAudio stream"); + return SDL_SetError("Could not connect PulseAudio stream"); } } while (state != PA_STREAM_READY); @@ -512,10 +576,92 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) return 0; } +static pa_mainloop *hotplug_mainloop = NULL; +static pa_context *hotplug_context = NULL; +static SDL_Thread *hotplug_thread = NULL; + +/* device handles are device index + 1, cast to void*, so we never pass a NULL. */ + +/* This is called when PulseAudio adds an output ("sink") device. */ +static void +SinkInfoCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) +{ + if (i) { + SDL_AddAudioDevice(SDL_FALSE, i->description, (void *) ((size_t) i->index+1)); + } +} + +/* This is called when PulseAudio adds a capture ("source") device. */ +static void +SourceInfoCallback(pa_context *c, const pa_source_info *i, int is_last, void *data) +{ + if (i) { + /* Skip "monitor" sources. These are just output from other sinks. */ + if (i->monitor_of_sink == PA_INVALID_INDEX) { + SDL_AddAudioDevice(SDL_TRUE, i->description, (void *) ((size_t) i->index+1)); + } + } +} + +/* This is called when PulseAudio has a device connected/removed/changed. */ +static void +HotplugCallback(pa_context *c, pa_subscription_event_type_t t, uint32_t idx, void *data) +{ + const SDL_bool added = ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW); + const SDL_bool removed = ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE); + + if (added || removed) { /* we only care about add/remove events. */ + const SDL_bool sink = ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK); + const SDL_bool source = ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE); + + /* adds need sink details from the PulseAudio server. Another callback... */ + if (added && sink) { + PULSEAUDIO_pa_context_get_sink_info_by_index(hotplug_context, idx, SinkInfoCallback, NULL); + } else if (added && source) { + PULSEAUDIO_pa_context_get_source_info_by_index(hotplug_context, idx, SourceInfoCallback, NULL); + } else if (removed && (sink || source)) { + /* removes we can handle just with the device index. */ + SDL_RemoveAudioDevice(source != 0, (void *) ((size_t) idx+1)); + } + } +} + +/* this runs as a thread while the Pulse target is initialized to catch hotplug events. */ +static int SDLCALL +HotplugThread(void *data) +{ + pa_operation *o; + SDL_SetThreadPriority(SDL_THREAD_PRIORITY_LOW); + PULSEAUDIO_pa_context_set_subscribe_callback(hotplug_context, HotplugCallback, NULL); + o = PULSEAUDIO_pa_context_subscribe(hotplug_context, PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE, NULL, NULL); + PULSEAUDIO_pa_operation_unref(o); /* don't wait for it, just do our thing. */ + PULSEAUDIO_pa_mainloop_run(hotplug_mainloop, NULL); + return 0; +} + +static void +PULSEAUDIO_DetectDevices() +{ + WaitForPulseOperation(hotplug_mainloop, PULSEAUDIO_pa_context_get_sink_info_list(hotplug_context, SinkInfoCallback, NULL)); + WaitForPulseOperation(hotplug_mainloop, PULSEAUDIO_pa_context_get_source_info_list(hotplug_context, SourceInfoCallback, NULL)); + + /* ok, we have a sane list, let's set up hotplug notifications now... */ + hotplug_thread = SDL_CreateThread(HotplugThread, "PulseHotplug", NULL); +} static void PULSEAUDIO_Deinitialize(void) { + if (hotplug_thread) { + PULSEAUDIO_pa_mainloop_quit(hotplug_mainloop, 0); + SDL_WaitThread(hotplug_thread, NULL); + hotplug_thread = NULL; + } + + DisconnectFromPulseServer(hotplug_mainloop, hotplug_context); + hotplug_mainloop = NULL; + hotplug_context = NULL; + UnloadPulseAudioLibrary(); } @@ -526,12 +672,13 @@ PULSEAUDIO_Init(SDL_AudioDriverImpl * impl) return 0; } - if (!CheckPulseAudioAvailable()) { + if (ConnectToPulseServer(&hotplug_mainloop, &hotplug_context) < 0) { UnloadPulseAudioLibrary(); return 0; } /* Set the function pointers */ + impl->DetectDevices = PULSEAUDIO_DetectDevices; impl->OpenDevice = PULSEAUDIO_OpenDevice; impl->PlayDevice = PULSEAUDIO_PlayDevice; impl->WaitDevice = PULSEAUDIO_WaitDevice; @@ -539,12 +686,10 @@ PULSEAUDIO_Init(SDL_AudioDriverImpl * impl) impl->CloseDevice = PULSEAUDIO_CloseDevice; impl->WaitDone = PULSEAUDIO_WaitDone; impl->Deinitialize = PULSEAUDIO_Deinitialize; - impl->OnlyHasDefaultOutputDevice = 1; return 1; /* this audio target is available. */ } - AudioBootStrap PULSEAUDIO_bootstrap = { "pulseaudio", "PulseAudio", PULSEAUDIO_Init, 0 }; diff --git a/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h b/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h index a75409bc..995c53c6 100644 --- a/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h +++ b/libs/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,9 +32,10 @@ struct SDL_PrivateAudioData { + char *device_name; + /* pulseaudio structures */ pa_mainloop *mainloop; - pa_mainloop_api *mainloop_api; pa_context *context; pa_stream *stream; diff --git a/libs/SDL2/src/audio/qsa/SDL_qsa_audio.c b/libs/SDL2/src/audio/qsa/SDL_qsa_audio.c index d6b8a680..784466ca 100644 --- a/libs/SDL2/src/audio/qsa/SDL_qsa_audio.c +++ b/libs/SDL2/src/audio/qsa/SDL_qsa_audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,6 +19,15 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* + * !!! FIXME: streamline this a little by removing all the + * !!! FIXME: if (capture) {} else {} sections that are identical + * !!! FIXME: except for one flag. + */ + +/* !!! FIXME: can this target support hotplugging? */ +/* !!! FIXME: ...does SDL2 even support QNX? */ + #include "../../SDL_internal.h" #if SDL_AUDIO_DRIVER_QSA @@ -300,7 +309,7 @@ QSA_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if (towrite != 0) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } } @@ -337,8 +346,9 @@ QSA_CloseDevice(_THIS) } static int -QSA_OpenDevice(_THIS, const char *devname, int iscapture) +QSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { + const QSA_Device *device = (const QSA_Device *) handle; int status = 0; int format = 0; SDL_AudioFormat test_format = 0; @@ -363,80 +373,19 @@ QSA_OpenDevice(_THIS, const char *devname, int iscapture) /* Initialize channel direction: capture or playback */ this->hidden->iscapture = iscapture; - /* Find deviceid and cardid by device name for playback */ - if ((!this->hidden->iscapture) && (devname != NULL)) { - uint32_t device; - int32_t status; - - /* Search in the playback devices */ - device = 0; - do { - status = SDL_strcmp(qsa_playback_device[device].name, devname); - if (status == 0) { - /* Found requested device */ - this->hidden->deviceno = qsa_playback_device[device].deviceno; - this->hidden->cardno = qsa_playback_device[device].cardno; - break; - } - device++; - if (device >= qsa_playback_devices) { - QSA_CloseDevice(this); - return SDL_SetError("No such playback device"); - } - } while (1); - } - - /* Find deviceid and cardid by device name for capture */ - if ((this->hidden->iscapture) && (devname != NULL)) { - /* Search in the capture devices */ - uint32_t device; - int32_t status; - - /* Searching in the playback devices */ - device = 0; - do { - status = SDL_strcmp(qsa_capture_device[device].name, devname); - if (status == 0) { - /* Found requested device */ - this->hidden->deviceno = qsa_capture_device[device].deviceno; - this->hidden->cardno = qsa_capture_device[device].cardno; - break; - } - device++; - if (device >= qsa_capture_devices) { - QSA_CloseDevice(this); - return SDL_SetError("No such capture device"); - } - } while (1); - } - - /* Check if SDL requested default audio device */ - if (devname == NULL) { - /* Open system default audio device */ - if (!this->hidden->iscapture) { - status = snd_pcm_open_preferred(&this->hidden->audio_handle, - &this->hidden->cardno, - &this->hidden->deviceno, - SND_PCM_OPEN_PLAYBACK); - } else { - status = snd_pcm_open_preferred(&this->hidden->audio_handle, - &this->hidden->cardno, - &this->hidden->deviceno, - SND_PCM_OPEN_CAPTURE); - } - } else { + if (device != NULL) { /* Open requested audio device */ - if (!this->hidden->iscapture) { - status = - snd_pcm_open(&this->hidden->audio_handle, - this->hidden->cardno, this->hidden->deviceno, - SND_PCM_OPEN_PLAYBACK); - } else { - status = - snd_pcm_open(&this->hidden->audio_handle, - this->hidden->cardno, this->hidden->deviceno, - SND_PCM_OPEN_CAPTURE); - } + this->hidden->deviceno = device->deviceno; + this->hidden->cardno = device->cardno; + status = snd_pcm_open(&this->hidden->audio_handle, + device->cardno, device->deviceno, + iscapture ? SND_PCM_OPEN_PLAYBACK : SND_PCM_OPEN_CAPTURE); + } else { + /* Open system default audio device */ + status = snd_pcm_open_preferred(&this->hidden->audio_handle, + &this->hidden->cardno, + &this->hidden->deviceno, + iscapture ? SND_PCM_OPEN_PLAYBACK : SND_PCM_OPEN_CAPTURE); } /* Check if requested device is opened */ @@ -638,7 +587,7 @@ QSA_OpenDevice(_THIS, const char *devname, int iscapture) } static void -QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +QSA_DetectDevices(void) { uint32_t it; uint32_t cards; @@ -656,8 +605,9 @@ QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) return; } + /* !!! FIXME: code duplication */ /* Find requested devices by type */ - if (!iscapture) { + { /* output devices */ /* Playback devices enumeration requested */ for (it = 0; it < cards; it++) { devices = 0; @@ -688,7 +638,7 @@ QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) devices; status = snd_pcm_close(handle); if (status == EOK) { - addfn(qsa_playback_device[qsa_playback_devices].name); + SDL_AddAudioDevice(SDL_FALSE, qsa_playback_device[qsa_playback_devices].name, &qsa_playback_device[qsa_playback_devices]); qsa_playback_devices++; } } else { @@ -713,7 +663,9 @@ QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) break; } } - } else { + } + + { /* capture devices */ /* Capture devices enumeration requested */ for (it = 0; it < cards; it++) { devices = 0; @@ -744,7 +696,7 @@ QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) devices; status = snd_pcm_close(handle); if (status == EOK) { - addfn(qsa_capture_device[qsa_capture_devices].name); + SDL_AddAudioDevice(SDL_TRUE, qsa_capture_device[qsa_capture_devices].name, &qsa_capture_device[qsa_capture_devices]); qsa_capture_devices++; } } else { diff --git a/libs/SDL2/src/audio/qsa/SDL_qsa_audio.h b/libs/SDL2/src/audio/qsa/SDL_qsa_audio.h index 66650d2a..363feb47 100644 --- a/libs/SDL2/src/audio/qsa/SDL_qsa_audio.h +++ b/libs/SDL2/src/audio/qsa/SDL_qsa_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/sdlgenaudiocvt.pl b/libs/SDL2/src/audio/sdlgenaudiocvt.pl index d4c2c502..b012df80 100644 --- a/libs/SDL2/src/audio/sdlgenaudiocvt.pl +++ b/libs/SDL2/src/audio/sdlgenaudiocvt.pl @@ -38,7 +38,7 @@ sub outputHeader { /* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/sndio/SDL_sndioaudio.c b/libs/SDL2/src/audio/sndio/SDL_sndioaudio.c index 5c063650..ba4fc4fa 100644 --- a/libs/SDL2/src/audio/sndio/SDL_sndioaudio.c +++ b/libs/SDL2/src/audio/sndio/SDL_sndioaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -158,7 +158,7 @@ SNDIO_PlayDevice(_THIS) /* If we couldn't write, assume fatal error for now */ if ( written == 0 ) { - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO fprintf(stderr, "Wrote %d bytes of audio data\n", written); @@ -193,7 +193,7 @@ SNDIO_CloseDevice(_THIS) } static int -SNDIO_OpenDevice(_THIS, const char *devname, int iscapture) +SNDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); struct sio_par par; diff --git a/libs/SDL2/src/audio/sndio/SDL_sndioaudio.h b/libs/SDL2/src/audio/sndio/SDL_sndioaudio.h index b8dadb7d..6956674b 100644 --- a/libs/SDL2/src/audio/sndio/SDL_sndioaudio.h +++ b/libs/SDL2/src/audio/sndio/SDL_sndioaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/sun/SDL_sunaudio.c b/libs/SDL2/src/audio/sun/SDL_sunaudio.c index 7efe30ec..9cdefbdb 100644 --- a/libs/SDL2/src/audio/sun/SDL_sunaudio.c +++ b/libs/SDL2/src/audio/sun/SDL_sunaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -56,9 +56,9 @@ static Uint8 snd2au(int sample); /* Audio driver bootstrap functions */ static void -SUNAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +SUNAUDIO_DetectDevices(void) { - SDL_EnumUnixAudioDevices(iscapture, 1, (int (*)(int fd)) NULL, addfn); + SDL_EnumUnixAudioDevices(1, (int (*)(int)) NULL); } #ifdef DEBUG_AUDIO @@ -158,7 +158,7 @@ SUNAUDIO_PlayDevice(_THIS) if (write(this->hidden->audio_fd, this->hidden->ulaw_buf, this->hidden->fragsize) < 0) { /* Assume fatal error, for now */ - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } this->hidden->written += this->hidden->fragsize; } else { @@ -168,7 +168,7 @@ SUNAUDIO_PlayDevice(_THIS) if (write(this->hidden->audio_fd, this->hidden->mixbuf, this->spec.size) < 0) { /* Assume fatal error, for now */ - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } this->hidden->written += this->hidden->fragsize; } @@ -198,7 +198,7 @@ SUNAUDIO_CloseDevice(_THIS) } static int -SUNAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +SUNAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); SDL_AudioFormat format = 0; @@ -414,6 +414,8 @@ SUNAUDIO_Init(SDL_AudioDriverImpl * impl) impl->GetDeviceBuf = SUNAUDIO_GetDeviceBuf; impl->CloseDevice = SUNAUDIO_CloseDevice; + impl->AllowsArbitraryDeviceNames = 1; + return 1; /* this audio target is available. */ } diff --git a/libs/SDL2/src/audio/sun/SDL_sunaudio.h b/libs/SDL2/src/audio/sun/SDL_sunaudio.h index df05e6fc..02ac6cbd 100644 --- a/libs/SDL2/src/audio/sun/SDL_sunaudio.h +++ b/libs/SDL2/src/audio/sun/SDL_sunaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/winmm/SDL_winmm.c b/libs/SDL2/src/audio/winmm/SDL_winmm.c index 88a8154e..37debb90 100644 --- a/libs/SDL2/src/audio/winmm/SDL_winmm.c +++ b/libs/SDL2/src/audio/winmm/SDL_winmm.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,8 +36,9 @@ #define WAVE_FORMAT_IEEE_FLOAT 0x0003 #endif -#define DETECT_DEV_IMPL(typ, capstyp) \ -static void DetectWave##typ##Devs(SDL_AddAudioDevice addfn) { \ +#define DETECT_DEV_IMPL(iscap, typ, capstyp) \ +static void DetectWave##typ##Devs(void) { \ + const UINT iscapture = iscap ? 1 : 0; \ const UINT devcount = wave##typ##GetNumDevs(); \ capstyp caps; \ UINT i; \ @@ -45,24 +46,21 @@ static void DetectWave##typ##Devs(SDL_AddAudioDevice addfn) { \ if (wave##typ##GetDevCaps(i,&caps,sizeof(caps))==MMSYSERR_NOERROR) { \ char *name = WIN_StringToUTF8(caps.szPname); \ if (name != NULL) { \ - addfn(name); \ + SDL_AddAudioDevice((int) iscapture, name, (void *) ((size_t) i+1)); \ SDL_free(name); \ } \ } \ } \ } -DETECT_DEV_IMPL(Out, WAVEOUTCAPS) -DETECT_DEV_IMPL(In, WAVEINCAPS) +DETECT_DEV_IMPL(SDL_FALSE, Out, WAVEOUTCAPS) +DETECT_DEV_IMPL(SDL_TRUE, In, WAVEINCAPS) static void -WINMM_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +WINMM_DetectDevices(void) { - if (iscapture) { - DetectWaveInDevs(addfn); - } else { - DetectWaveOutDevs(addfn); - } + DetectWaveInDevs(); + DetectWaveOutDevs(); } static void CALLBACK @@ -220,48 +218,19 @@ PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture) } static int -WINMM_OpenDevice(_THIS, const char *devname, int iscapture) +WINMM_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); int valid_datatype = 0; MMRESULT result; WAVEFORMATEX waveformat; UINT devId = WAVE_MAPPER; /* WAVE_MAPPER == choose system's default */ - char *utf8 = NULL; UINT i; - if (devname != NULL) { /* specific device requested? */ - if (iscapture) { - const UINT devcount = waveInGetNumDevs(); - WAVEINCAPS caps; - for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) { - result = waveInGetDevCaps(i, &caps, sizeof (caps)); - if (result != MMSYSERR_NOERROR) - continue; - else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL) - continue; - else if (SDL_strcmp(devname, utf8) == 0) - devId = i; - SDL_free(utf8); - } - } else { - const UINT devcount = waveOutGetNumDevs(); - WAVEOUTCAPS caps; - for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) { - result = waveOutGetDevCaps(i, &caps, sizeof (caps)); - if (result != MMSYSERR_NOERROR) - continue; - else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL) - continue; - else if (SDL_strcmp(devname, utf8) == 0) - devId = i; - SDL_free(utf8); - } - } - - if (devId == WAVE_MAPPER) { - return SDL_SetError("Requested device not found"); - } + if (handle != NULL) { /* specific device requested? */ + /* -1 because we increment the original value to avoid NULL. */ + const size_t val = ((size_t) handle) - 1; + devId = (UINT) val; } /* Initialize all variables that we clean on shutdown */ @@ -279,10 +248,6 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture) if (this->spec.channels > 2) this->spec.channels = 2; /* !!! FIXME: is this right? */ - /* Check the buffer size -- minimum of 1/4 second (word aligned) */ - if (this->spec.samples < (this->spec.freq / 4)) - this->spec.samples = ((this->spec.freq / 4) + 3) & ~3; - while ((!valid_datatype) && (test_format)) { switch (test_format) { case AUDIO_U8: diff --git a/libs/SDL2/src/audio/winmm/SDL_winmm.h b/libs/SDL2/src/audio/winmm/SDL_winmm.h index 47996c1a..a0dec010 100644 --- a/libs/SDL2/src/audio/winmm/SDL_winmm.h +++ b/libs/SDL2/src/audio/winmm/SDL_winmm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/xaudio2/SDL_xaudio2.c b/libs/SDL2/src/audio/xaudio2/SDL_xaudio2.c index 85ac1460..9d685833 100644 --- a/libs/SDL2/src/audio/xaudio2/SDL_xaudio2.c +++ b/libs/SDL2/src/audio/xaudio2/SDL_xaudio2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -65,6 +65,11 @@ The XAudio2 implementation available in the Windows 8 SDK targets Windows 8 and newer. If you want to build SDL with XAudio2 support you should install the DirectX SDK. */ +/* Disable compiling in the XAudio2 support pending fixes to dynamically load the XAudio2 + entry points so we can be robust to user configuration. Also needs to be fixed to build + with the Windows 10 SDK. +*/ +#if 0 /* See comment above */ #include #if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284)) # pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.") @@ -72,6 +77,7 @@ # define SDL_XAUDIO2_HAS_SDK 1 #endif #endif +#endif /* 0 */ #ifdef SDL_XAUDIO2_HAS_SDK @@ -126,16 +132,13 @@ struct SDL_PrivateAudioData static void -XAUDIO2_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +XAUDIO2_DetectDevices(void) { IXAudio2 *ixa2 = NULL; UINT32 devcount = 0; UINT32 i = 0; - if (iscapture) { - SDL_SetError("XAudio2: capture devices unsupported."); - return; - } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { + if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { SDL_SetError("XAudio2: XAudio2Create() failed at detection."); return; } else if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) { @@ -149,8 +152,8 @@ XAUDIO2_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) { char *str = WIN_StringToUTF8(details.DisplayName); if (str != NULL) { - addfn(str); - SDL_free(str); /* addfn() made a copy of the string. */ + SDL_AddAudioDevice(SDL_FALSE, str, (void *) ((size_t) i+1)); + SDL_free(str); /* SDL_AddAudioDevice made a copy of the string. */ } } } @@ -169,8 +172,8 @@ VoiceCBOnBufferEnd(THIS_ void *data) static void STDMETHODCALLTYPE VoiceCBOnVoiceError(THIS_ void *data, HRESULT Error) { - /* !!! FIXME: attempt to recover, or mark device disconnected. */ - SDL_assert(0 && "write me!"); + SDL_AudioDevice *this = (SDL_AudioDevice *) data; + SDL_OpenedAudioDeviceDisconnected(this); } /* no-op callbacks... */ @@ -221,7 +224,7 @@ XAUDIO2_PlayDevice(_THIS) if (result != S_OK) { /* uhoh, panic! */ IXAudio2SourceVoice_FlushSourceBuffers(source); - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } } @@ -289,7 +292,7 @@ XAUDIO2_CloseDevice(_THIS) } static int -XAUDIO2_OpenDevice(_THIS, const char *devname, int iscapture) +XAUDIO2_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { HRESULT result = S_OK; WAVEFORMATEX waveformat; @@ -315,9 +318,17 @@ XAUDIO2_OpenDevice(_THIS, const char *devname, int iscapture) static IXAudio2VoiceCallback callbacks = { &callbacks_vtable }; - if (iscapture) { - return SDL_SetError("XAudio2: capture devices unsupported."); - } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { +#if defined(SDL_XAUDIO2_WIN8) + /* !!! FIXME: hook up hotplugging. */ +#else + if (handle != NULL) { /* specific device requested? */ + /* -1 because we increment the original value to avoid NULL. */ + const size_t val = ((size_t) handle) - 1; + devId = (UINT32) val; + } +#endif + + if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { return SDL_SetError("XAudio2: XAudio2Create() failed at open."); } @@ -332,37 +343,6 @@ XAUDIO2_OpenDevice(_THIS, const char *devname, int iscapture) ixa2->SetDebugConfiguration(&debugConfig); */ -#if ! defined(__WINRT__) - if (devname != NULL) { - UINT32 devcount = 0; - UINT32 i = 0; - - if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) { - IXAudio2_Release(ixa2); - return SDL_SetError("XAudio2: IXAudio2_GetDeviceCount() failed."); - } - for (i = 0; i < devcount; i++) { - XAUDIO2_DEVICE_DETAILS details; - if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) { - char *str = WIN_StringToUTF8(details.DisplayName); - if (str != NULL) { - const int match = (SDL_strcmp(str, devname) == 0); - SDL_free(str); - if (match) { - devId = i; - break; - } - } - } - } - - if (i == devcount) { - IXAudio2_Release(ixa2); - return SDL_SetError("XAudio2: Requested device not found."); - } - } -#endif - /* Initialize all variables that we clean on shutdown */ this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc((sizeof *this->hidden)); @@ -529,6 +509,16 @@ XAUDIO2_Init(SDL_AudioDriverImpl * impl) impl->CloseDevice = XAUDIO2_CloseDevice; impl->Deinitialize = XAUDIO2_Deinitialize; + /* !!! FIXME: We can apparently use a C++ interface on Windows 8 + * !!! FIXME: (Windows::Devices::Enumeration::DeviceInformation) for device + * !!! FIXME: detection, but it's not implemented here yet. + * !!! FIXME: see http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx + * !!! FIXME: for now, force the default device. + */ +#if defined(SDL_XAUDIO2_WIN8) || defined(__WINRT__) + impl->OnlyHasDefaultOutputDevice = 1; +#endif + return 1; /* this audio target is available. */ #endif } diff --git a/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp b/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp index 69eb5ad1..e4fb8e84 100644 --- a/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp +++ b/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h b/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h index 3db04cf9..6f14f17a 100644 --- a/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h +++ b/libs/SDL2/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/android/SDL_android.c b/libs/SDL2/src/core/android/SDL_android.c index b29f7e4e..cac0872c 100644 --- a/libs/SDL2/src/core/android/SDL_android.c +++ b/libs/SDL2/src/core/android/SDL_android.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,6 +32,7 @@ #include "../../events/SDL_events_c.h" #include "../../video/android/SDL_androidkeyboard.h" +#include "../../video/android/SDL_androidmouse.h" #include "../../video/android/SDL_androidtouch.h" #include "../../video/android/SDL_androidvideo.h" #include "../../video/android/SDL_androidwindow.h" @@ -140,6 +141,16 @@ JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls) __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init() finished!"); } +/* Drop file */ +void Java_org_libsdl_app_SDLActivity_onNativeDropFile( + JNIEnv* env, jclass jcls, + jstring filename) +{ + const char *path = (*env)->GetStringUTFChars(env, filename, NULL); + SDL_SendDropFile(path); + (*env)->ReleaseStringUTFChars(env, filename, path); +} + /* Resize */ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize( JNIEnv* env, jclass jcls, @@ -293,6 +304,14 @@ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeTouch( Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p); } +/* Mouse */ +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeMouse( + JNIEnv* env, jclass jcls, + jint button, jint action, jfloat x, jfloat y) +{ + Android_OnMouse(button, action, x, y); +} + /* Accelerometer */ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel( JNIEnv* env, jclass jcls, @@ -441,7 +460,7 @@ static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder) } } -static SDL_bool LocalReferenceHolder_IsActive() +static SDL_bool LocalReferenceHolder_IsActive(void) { return s_active > 0; } @@ -459,7 +478,7 @@ ANativeWindow* Android_JNI_GetNativeWindow(void) return anw; } -void Android_JNI_SwapWindow() +void Android_JNI_SwapWindow(void) { JNIEnv *mEnv = Android_JNI_GetEnv(); (*mEnv)->CallStaticVoidMethod(mEnv, mActivityClass, midFlipBuffers); @@ -611,12 +630,12 @@ int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, i return audioBufferFrames; } -void * Android_JNI_GetAudioBuffer() +void * Android_JNI_GetAudioBuffer(void) { return audioBufferPinned; } -void Android_JNI_WriteAudioBuffer() +void Android_JNI_WriteAudioBuffer(void) { JNIEnv *mAudioEnv = Android_JNI_GetEnv(); @@ -631,7 +650,7 @@ void Android_JNI_WriteAudioBuffer() /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */ } -void Android_JNI_CloseAudioDevice() +void Android_JNI_CloseAudioDevice(void) { JNIEnv *env = Android_JNI_GetEnv(); @@ -1133,7 +1152,7 @@ int Android_JNI_SetClipboardText(const char* text) return 0; } -char* Android_JNI_GetClipboardText() +char* Android_JNI_GetClipboardText(void) { SETUP_CLIPBOARD(SDL_strdup("")) @@ -1159,7 +1178,7 @@ char* Android_JNI_GetClipboardText() return SDL_strdup(""); } -SDL_bool Android_JNI_HasClipboardText() +SDL_bool Android_JNI_HasClipboardText(void) { SETUP_CLIPBOARD(SDL_FALSE) @@ -1295,7 +1314,7 @@ int Android_JNI_GetTouchDeviceIds(int **ids) { return number; } -void Android_JNI_PollInputDevices() +void Android_JNI_PollInputDevices(void) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midPollInputDevices); @@ -1342,7 +1361,7 @@ void Android_JNI_ShowTextInput(SDL_Rect *inputRect) inputRect->h ); } -void Android_JNI_HideTextInput() +void Android_JNI_HideTextInput(void) { /* has to match Activity constant */ const int COMMAND_TEXTEDIT_HIDE = 3; @@ -1601,6 +1620,11 @@ const char * SDL_AndroidGetExternalStoragePath() return s_AndroidExternalFilesPath; } +jclass Android_JNI_GetActivityClass(void) +{ + return mActivityClass; +} + #endif /* __ANDROID__ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/core/android/SDL_android.h b/libs/SDL2/src/core/android/SDL_android.h index 051958a4..378fa058 100644 --- a/libs/SDL2/src/core/android/SDL_android.h +++ b/libs/SDL2/src/core/android/SDL_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,18 +35,18 @@ extern "C" { /* Interface from the SDL library into the Android Java activity */ /* extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, int red, int green, int blue, int alpha, int buffer, int depth, int stencil, int buffers, int samples); extern SDL_bool Android_JNI_DeleteContext(void); */ -extern void Android_JNI_SwapWindow(); +extern void Android_JNI_SwapWindow(void); extern void Android_JNI_SetActivityTitle(const char *title); extern SDL_bool Android_JNI_GetAccelerometerValues(float values[3]); extern void Android_JNI_ShowTextInput(SDL_Rect *inputRect); -extern void Android_JNI_HideTextInput(); +extern void Android_JNI_HideTextInput(void); extern ANativeWindow* Android_JNI_GetNativeWindow(void); /* Audio support */ extern int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames); -extern void* Android_JNI_GetAudioBuffer(); -extern void Android_JNI_WriteAudioBuffer(); -extern void Android_JNI_CloseAudioDevice(); +extern void* Android_JNI_GetAudioBuffer(void); +extern void Android_JNI_WriteAudioBuffer(void); +extern void Android_JNI_CloseAudioDevice(void); #include "SDL_rwops.h" @@ -59,14 +59,14 @@ int Android_JNI_FileClose(SDL_RWops* ctx); /* Clipboard support */ int Android_JNI_SetClipboardText(const char* text); -char* Android_JNI_GetClipboardText(); -SDL_bool Android_JNI_HasClipboardText(); +char* Android_JNI_GetClipboardText(void); +SDL_bool Android_JNI_HasClipboardText(void); /* Power support */ int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent); /* Joystick support */ -void Android_JNI_PollInputDevices(); +void Android_JNI_PollInputDevices(void); /* Video */ void Android_JNI_SuspendScreenSaver(SDL_bool suspend); @@ -78,6 +78,7 @@ int Android_JNI_GetTouchDeviceIds(int **ids); #include JNIEnv *Android_JNI_GetEnv(void); int Android_JNI_SetupThread(void); +jclass Android_JNI_GetActivityClass(void); /* Generic messages */ int Android_JNI_SendMessage(int command, int param); diff --git a/libs/SDL2/src/core/linux/SDL_dbus.c b/libs/SDL2/src/core/linux/SDL_dbus.c index d9dbd961..cc7b3d37 100644 --- a/libs/SDL2/src/core/linux/SDL_dbus.c +++ b/libs/SDL2/src/core/linux/SDL_dbus.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ static unsigned int screensaver_cookie = 0; static SDL_DBusContext dbus = {0}; static int -load_dbus_syms(void) +LoadDBUSSyms(void) { #define SDL_DBUS_SYM2(x, y) \ if (!(dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1 @@ -45,6 +45,7 @@ load_dbus_syms(void) SDL_DBUS_SYM(connection_set_exit_on_disconnect); SDL_DBUS_SYM(connection_get_is_connected); SDL_DBUS_SYM(connection_add_filter); + SDL_DBUS_SYM(connection_try_register_object_path); SDL_DBUS_SYM(connection_send); SDL_DBUS_SYM(connection_send_with_reply_and_block); SDL_DBUS_SYM(connection_close); @@ -94,7 +95,7 @@ LoadDBUSLibrary(void) retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } else { - retval = load_dbus_syms(); + retval = LoadDBUSSyms(); if (retval < 0) { UnloadDBUSLibrary(); } diff --git a/libs/SDL2/src/core/linux/SDL_dbus.h b/libs/SDL2/src/core/linux/SDL_dbus.h index 0fbb2142..dcfec77e 100644 --- a/libs/SDL2/src/core/linux/SDL_dbus.h +++ b/libs/SDL2/src/core/linux/SDL_dbus.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,6 +41,8 @@ typedef struct SDL_DBusContext { dbus_bool_t (*connection_get_is_connected)(DBusConnection *); dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction, void *, DBusFreeFunction); + dbus_bool_t (*connection_try_register_object_path)(DBusConnection *, const char *, + const DBusObjectPathVTable *, void *, DBusError *); dbus_bool_t (*connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *); DBusMessage *(*connection_send_with_reply_and_block)(DBusConnection *, DBusMessage *, int, DBusError *); void (*connection_close)(DBusConnection *); diff --git a/libs/SDL2/src/core/linux/SDL_evdev.c b/libs/SDL2/src/core/linux/SDL_evdev.c index 1f4c3165..b9246745 100644 --- a/libs/SDL2/src/core/linux/SDL_evdev.c +++ b/libs/SDL2/src/core/linux/SDL_evdev.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -341,7 +341,7 @@ static Uint8 EVDEV_MouseButtons[] = { SDL_BUTTON_X2 + 3 /* BTN_TASK 0x117 */ }; -static char* EVDEV_consoles[] = { +static const char* EVDEV_consoles[] = { "/proc/self/fd/0", "/dev/tty", "/dev/tty0", @@ -364,7 +364,7 @@ static int SDL_EVDEV_get_console_fd(void) /* Try a few consoles to see which one we have read access to */ - for( i = 0; i < SDL_arraysize(EVDEV_consoles); i++) { + for(i = 0; i < SDL_arraysize(EVDEV_consoles); i++) { fd = open(EVDEV_consoles[i], O_RDONLY); if (fd >= 0) { if (IS_CONSOLE(fd)) return fd; @@ -374,7 +374,7 @@ static int SDL_EVDEV_get_console_fd(void) /* Try stdin, stdout, stderr */ - for( fd = 0; fd < 3; fd++) { + for(fd = 0; fd < 3; fd++) { if (IS_CONSOLE(fd)) return fd; } @@ -468,7 +468,7 @@ SDL_EVDEV_Init(void) } /* Set up the udev callback */ - if ( SDL_UDEV_AddCallback(SDL_EVDEV_udev_callback) < 0) { + if (SDL_UDEV_AddCallback(SDL_EVDEV_udev_callback) < 0) { SDL_EVDEV_Quit(); return -1; } @@ -547,12 +547,11 @@ void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, con return; } - if (!(udev_class & (SDL_UDEV_DEVICE_MOUSE|SDL_UDEV_DEVICE_KEYBOARD))) { - return; - } - - switch( udev_type ) { + switch(udev_type) { case SDL_UDEV_DEVICEADDED: + if (!(udev_class & (SDL_UDEV_DEVICE_MOUSE|SDL_UDEV_DEVICE_KEYBOARD))) { + return; + } SDL_EVDEV_device_added(devpath); break; @@ -615,7 +614,7 @@ SDL_EVDEV_Poll(void) if (scan_code != SDL_SCANCODE_UNKNOWN) { if (events[i].value == 0) { SDL_SendKeyboardKey(SDL_RELEASED, scan_code); - } else if (events[i].value == 1 || events[i].value == 2 /* Key repeated */ ) { + } else if (events[i].value == 1 || events[i].value == 2 /* Key repeated */) { SDL_SendKeyboardKey(SDL_PRESSED, scan_code); #ifdef SDL_INPUT_LINUXKD if (_this->console_fd >= 0) { @@ -626,12 +625,12 @@ SDL_EVDEV_Poll(void) kbe.kb_table = 0; /* Ref: http://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching */ - kbe.kb_table |= -( (modstate & KMOD_LCTRL) != 0) & (1 << KG_CTRLL | 1 << KG_CTRL); - kbe.kb_table |= -( (modstate & KMOD_RCTRL) != 0) & (1 << KG_CTRLR | 1 << KG_CTRL); - kbe.kb_table |= -( (modstate & KMOD_LSHIFT) != 0) & (1 << KG_SHIFTL | 1 << KG_SHIFT); - kbe.kb_table |= -( (modstate & KMOD_RSHIFT) != 0) & (1 << KG_SHIFTR | 1 << KG_SHIFT); - kbe.kb_table |= -( (modstate & KMOD_LALT) != 0) & (1 << KG_ALT); - kbe.kb_table |= -( (modstate & KMOD_RALT) != 0) & (1 << KG_ALTGR); + kbe.kb_table |= -((modstate & KMOD_LCTRL) != 0) & (1 << KG_CTRLL | 1 << KG_CTRL); + kbe.kb_table |= -((modstate & KMOD_RCTRL) != 0) & (1 << KG_CTRLR | 1 << KG_CTRL); + kbe.kb_table |= -((modstate & KMOD_LSHIFT) != 0) & (1 << KG_SHIFTL | 1 << KG_SHIFT); + kbe.kb_table |= -((modstate & KMOD_RSHIFT) != 0) & (1 << KG_SHIFTR | 1 << KG_SHIFT); + kbe.kb_table |= -((modstate & KMOD_LALT) != 0) & (1 << KG_ALT); + kbe.kb_table |= -((modstate & KMOD_RALT) != 0) & (1 << KG_ALTGR); if (ioctl(_this->console_fd, KDGKBENT, (unsigned long)&kbe) == 0 && ((KTYP(kbe.kb_value) == KT_LATIN) || (KTYP(kbe.kb_value) == KT_ASCII) || (KTYP(kbe.kb_value) == KT_LETTER))) @@ -642,8 +641,8 @@ SDL_EVDEV_Poll(void) * because 1 << KG_CAPSSHIFT overflows the 8 bits of kb_table * So, we do the CAPS LOCK logic here. Note that isalpha depends on the locale! */ - if ( modstate & KMOD_CAPS && isalpha(kval) ) { - if ( isupper(kval) ) { + if (modstate & KMOD_CAPS && isalpha(kval)) { + if (isupper(kval)) { kval = tolower(kval); } else { kval = toupper(kval); @@ -651,7 +650,7 @@ SDL_EVDEV_Poll(void) } /* Convert to UTF-8 and send */ - end = SDL_UCS4ToUTF8( kval, keysym); + end = SDL_UCS4ToUTF8(kval, keysym); *end = '\0'; SDL_SendKeyboardText(keysym); } @@ -733,7 +732,7 @@ SDL_EVDEV_device_added(const char *devpath) /* Check to make sure it's not already in list. */ for (item = _this->first; item != NULL; item = item->next) { - if (strcmp(devpath, item->path) == 0) { + if (SDL_strcmp(devpath, item->path) == 0) { return -1; /* already have this one */ } } @@ -780,7 +779,7 @@ SDL_EVDEV_device_removed(const char *devpath) for (item = _this->first; item != NULL; item = item->next) { /* found it, remove it. */ - if ( strcmp(devpath, item->path) ==0 ) { + if (SDL_strcmp(devpath, item->path) == 0) { if (prev != NULL) { prev->next = item->next; } else { diff --git a/libs/SDL2/src/core/linux/SDL_evdev.h b/libs/SDL2/src/core/linux/SDL_evdev.h index f6398ea5..670a5cb2 100644 --- a/libs/SDL2/src/core/linux/SDL_evdev.h +++ b/libs/SDL2/src/core/linux/SDL_evdev.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/linux/SDL_ibus.c b/libs/SDL2/src/core/linux/SDL_ibus.c index 1a0729f2..46d602af 100644 --- a/libs/SDL2/src/core/linux/SDL_ibus.c +++ b/libs/SDL2/src/core/linux/SDL_ibus.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -123,7 +123,7 @@ IBus_utf8_strlen(const char *str) } static DBusHandlerResult -IBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *user_data) +IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) { SDL_DBusContext *dbus = (SDL_DBusContext *)user_data; @@ -156,12 +156,12 @@ IBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *user_data) dbus->message_iter_init(msg, &iter); text = IBus_GetVariantText(conn, &iter, dbus); - if (text && *text) { + if (text) { char buf[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; size_t text_bytes = SDL_strlen(text), i = 0; size_t cursor = 0; - while (i < text_bytes) { + do { size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf)); size_t chars = IBus_utf8_strlen(buf); @@ -169,7 +169,7 @@ IBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *user_data) i += sz; cursor += chars; - } + } while (i < text_bytes); } SDL_IBus_UpdateTextRect(NULL); @@ -341,6 +341,8 @@ IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) const char *path = NULL; SDL_bool result = SDL_FALSE; DBusMessage *msg; + DBusObjectPathVTable ibus_vtable = {0}; + ibus_vtable.message_function = &IBus_MessageHandler; ibus_conn = dbus->connection_open_private(addr, NULL); @@ -388,7 +390,7 @@ IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, &IBus_SetCapabilities, NULL); dbus->bus_add_match(ibus_conn, "type='signal',interface='org.freedesktop.IBus.InputContext'", NULL); - dbus->connection_add_filter(ibus_conn, &IBus_MessageFilter, dbus, NULL); + dbus->connection_try_register_object_path(ibus_conn, input_ctx_path, &ibus_vtable, dbus, NULL); dbus->connection_flush(ibus_conn); } @@ -459,9 +461,14 @@ SDL_IBus_Init(void) return SDL_FALSE; } + /* !!! FIXME: if ibus_addr_file != NULL, this will overwrite it and leak (twice!) */ ibus_addr_file = SDL_strdup(addr_file); addr = IBus_ReadAddressFromFile(addr_file); + if (!addr) { + SDL_free(addr_file); + return SDL_FALSE; + } if (inotify_fd < 0) { inotify_fd = inotify_init(); @@ -476,8 +483,10 @@ SDL_IBus_Init(void) inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY); SDL_free(addr_file); - result = IBus_SetupConnection(dbus, addr); - SDL_free(addr); + if (addr) { + result = IBus_SetupConnection(dbus, addr); + SDL_free(addr); + } } return result; @@ -663,7 +672,7 @@ SDL_IBus_PumpEvents(void) dbus->connection_read_write(ibus_conn, 0); while (dbus->connection_dispatch(ibus_conn) == DBUS_DISPATCH_DATA_REMAINS) { - /* Do nothing, actual work happens in IBus_MessageFilter */ + /* Do nothing, actual work happens in IBus_MessageHandler */ } } } diff --git a/libs/SDL2/src/core/linux/SDL_ibus.h b/libs/SDL2/src/core/linux/SDL_ibus.h index d982e684..24765223 100644 --- a/libs/SDL2/src/core/linux/SDL_ibus.h +++ b/libs/SDL2/src/core/linux/SDL_ibus.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/linux/SDL_udev.c b/libs/SDL2/src/core/linux/SDL_udev.c index d00fd82a..cf66331e 100644 --- a/libs/SDL2/src/core/linux/SDL_udev.c +++ b/libs/SDL2/src/core/linux/SDL_udev.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,7 @@ #include "SDL.h" -static char* SDL_UDEV_LIBS[] = { "libudev.so.1", "libudev.so.0" }; +static const char* SDL_UDEV_LIBS[] = { "libudev.so.1", "libudev.so.0" }; #define _THIS SDL_UDEV_PrivateData *_this static _THIS = NULL; @@ -350,17 +350,19 @@ guess_device_class(struct udev_device *dev) devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */ } else if (test_bit(BTN_TOUCH, bitmask_key)) { ; /* ID_INPUT_TOUCHSCREEN */ - } else if (test_bit(BTN_TRIGGER, bitmask_key) || - test_bit(BTN_A, bitmask_key) || - test_bit(BTN_1, bitmask_key) || - test_bit(ABS_RX, bitmask_abs) || - test_bit(ABS_RY, bitmask_abs) || - test_bit(ABS_RZ, bitmask_abs) || - test_bit(ABS_THROTTLE, bitmask_abs) || - test_bit(ABS_RUDDER, bitmask_abs) || - test_bit(ABS_WHEEL, bitmask_abs) || - test_bit(ABS_GAS, bitmask_abs) || - test_bit(ABS_BRAKE, bitmask_abs)) { + } + + if (test_bit(BTN_TRIGGER, bitmask_key) || + test_bit(BTN_A, bitmask_key) || + test_bit(BTN_1, bitmask_key) || + test_bit(ABS_RX, bitmask_abs) || + test_bit(ABS_RY, bitmask_abs) || + test_bit(ABS_RZ, bitmask_abs) || + test_bit(ABS_THROTTLE, bitmask_abs) || + test_bit(ABS_RUDDER, bitmask_abs) || + test_bit(ABS_WHEEL, bitmask_abs) || + test_bit(ABS_GAS, bitmask_abs) || + test_bit(ABS_BRAKE, bitmask_abs)) { devclass |= SDL_UDEV_DEVICE_JOYSTICK; /* ID_INPUT_JOYSTICK */ } } @@ -467,6 +469,9 @@ SDL_UDEV_Poll(void) action = _this->udev_device_get_action(dev); if (SDL_strcmp(action, "add") == 0) { + /* Wait for the device to finish initialization */ + SDL_Delay(100); + device_event(SDL_UDEV_DEVICEADDED, dev); } else if (SDL_strcmp(action, "remove") == 0) { device_event(SDL_UDEV_DEVICEREMOVED, dev); diff --git a/libs/SDL2/src/core/linux/SDL_udev.h b/libs/SDL2/src/core/linux/SDL_udev.h index 5ec86de2..9242870c 100644 --- a/libs/SDL2/src/core/linux/SDL_udev.h +++ b/libs/SDL2/src/core/linux/SDL_udev.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/windows/SDL_directx.h b/libs/SDL2/src/core/windows/SDL_directx.h index f37bccef..10692643 100644 --- a/libs/SDL2/src/core/windows/SDL_directx.h +++ b/libs/SDL2/src/core/windows/SDL_directx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/windows/SDL_windows.c b/libs/SDL2/src/core/windows/SDL_windows.c index 1e5d0ff4..aff6e6d2 100644 --- a/libs/SDL2/src/core/windows/SDL_windows.c +++ b/libs/SDL2/src/core/windows/SDL_windows.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -124,6 +124,6 @@ BOOL WIN_IsWindowsVistaOrGreater() #endif } -#endif /* __WIN32__ */ +#endif /* __WIN32__ || __WINRT__ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/core/windows/SDL_windows.h b/libs/SDL2/src/core/windows/SDL_windows.h index bb563ccd..863971b6 100644 --- a/libs/SDL2/src/core/windows/SDL_windows.h +++ b/libs/SDL2/src/core/windows/SDL_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/windows/SDL_xinput.c b/libs/SDL2/src/core/windows/SDL_xinput.c index 9dcac364..49d4ecbe 100644 --- a/libs/SDL2/src/core/windows/SDL_xinput.c +++ b/libs/SDL2/src/core/windows/SDL_xinput.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/windows/SDL_xinput.h b/libs/SDL2/src/core/windows/SDL_xinput.h index 721c3811..5c577376 100644 --- a/libs/SDL2/src/core/windows/SDL_xinput.h +++ b/libs/SDL2/src/core/windows/SDL_xinput.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/winrt/SDL_winrtapp_common.cpp b/libs/SDL2/src/core/winrt/SDL_winrtapp_common.cpp index 0758ad92..c8ac4813 100644 --- a/libs/SDL2/src/core/winrt/SDL_winrtapp_common.cpp +++ b/libs/SDL2/src/core/winrt/SDL_winrtapp_common.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/winrt/SDL_winrtapp_common.h b/libs/SDL2/src/core/winrt/SDL_winrtapp_common.h index e49e615e..e905139c 100644 --- a/libs/SDL2/src/core/winrt/SDL_winrtapp_common.h +++ b/libs/SDL2/src/core/winrt/SDL_winrtapp_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.cpp b/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.cpp index 009d1a52..267ce4ed 100644 --- a/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.h b/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.h index 255e2b1e..6a8838ec 100644 --- a/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.h +++ b/libs/SDL2/src/core/winrt/SDL_winrtapp_direct3d.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.cpp b/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.cpp index 38694e11..9f943309 100644 --- a/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.cpp +++ b/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.h b/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.h index 7f5d7f1d..7537710e 100644 --- a/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.h +++ b/libs/SDL2/src/core/winrt/SDL_winrtapp_xaml.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/cpuinfo/SDL_cpuinfo.c b/libs/SDL2/src/cpuinfo/SDL_cpuinfo.c index 48e8001f..ed839ccc 100644 --- a/libs/SDL2/src/cpuinfo/SDL_cpuinfo.c +++ b/libs/SDL2/src/cpuinfo/SDL_cpuinfo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/dynapi/SDL_dynapi.c b/libs/SDL2/src/dynapi/SDL_dynapi.c index f14cda94..02e5c787 100644 --- a/libs/SDL2/src/dynapi/SDL_dynapi.c +++ b/libs/SDL2/src/dynapi/SDL_dynapi.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/dynapi/SDL_dynapi.h b/libs/SDL2/src/dynapi/SDL_dynapi.h index df876001..fa9a0c7f 100644 --- a/libs/SDL2/src/dynapi/SDL_dynapi.h +++ b/libs/SDL2/src/dynapi/SDL_dynapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,7 +49,10 @@ #define SDL_DYNAMIC_API 0 #elif defined(__clang_analyzer__) #define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */ -#else /* everyone else. */ +#endif + +/* everyone else. This is where we turn on the API if nothing forced it off. */ +#ifndef SDL_DYNAMIC_API #define SDL_DYNAMIC_API 1 #endif diff --git a/libs/SDL2/src/dynapi/SDL_dynapi_overrides.h b/libs/SDL2/src/dynapi/SDL_dynapi_overrides.h index 8bcde631..3ae3ed89 100644 --- a/libs/SDL2/src/dynapi/SDL_dynapi_overrides.h +++ b/libs/SDL2/src/dynapi/SDL_dynapi_overrides.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -505,6 +505,7 @@ #define SDL_GetNumVideoDisplays SDL_GetNumVideoDisplays_REAL #define SDL_GetDisplayName SDL_GetDisplayName_REAL #define SDL_GetDisplayBounds SDL_GetDisplayBounds_REAL +#define SDL_GetDisplayDPI SDL_GetDisplayDPI_REAL #define SDL_GetNumDisplayModes SDL_GetNumDisplayModes_REAL #define SDL_GetDisplayMode SDL_GetDisplayMode_REAL #define SDL_GetDesktopDisplayMode SDL_GetDesktopDisplayMode_REAL @@ -591,3 +592,5 @@ #define SDL_QueueAudio SDL_QueueAudio_REAL #define SDL_GetQueuedAudioSize SDL_GetQueuedAudioSize_REAL #define SDL_ClearQueuedAudio SDL_ClearQueuedAudio_REAL +#define SDL_GetGrabbedWindow SDL_GetGrabbedWindow_REAL +#define SDL_SetWindowsMessageHook SDL_SetWindowsMessageHook_REAL diff --git a/libs/SDL2/src/dynapi/SDL_dynapi_procs.h b/libs/SDL2/src/dynapi/SDL_dynapi_procs.h index c41cdc9f..d085fe5e 100644 --- a/libs/SDL2/src/dynapi/SDL_dynapi_procs.h +++ b/libs/SDL2/src/dynapi/SDL_dynapi_procs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -612,7 +612,7 @@ SDL_DYNAPI_PROC(int,SDL_WinRTRunApp,(int a, char **b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(const wchar_t*,SDL_WinRTGetFSPathUNICODE,(SDL_WinRT_Path a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_WinRTGetFSPathUTF8,(SDL_WinRT_Path a),(a),return) #endif -SDL_DYNAPI_PROC(void,SDL_WarpMouseGlobal,(int a, int b),(a,b),) +SDL_DYNAPI_PROC(int,SDL_WarpMouseGlobal,(int a, int b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_sqrtf,(float a),(a),return) SDL_DYNAPI_PROC(double,SDL_tan,(double a),(a),return) SDL_DYNAPI_PROC(float,SDL_tanf,(float a),(a),return) @@ -623,3 +623,8 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX2,(void),(),return) SDL_DYNAPI_PROC(int,SDL_QueueAudio,(SDL_AudioDeviceID a, const void *b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(Uint32,SDL_GetQueuedAudioSize,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),) +SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return) +#ifdef __WIN32__ +SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),) +#endif +SDL_DYNAPI_PROC(int,SDL_GetDisplayDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return) diff --git a/libs/SDL2/src/dynapi/gendynapi.pl b/libs/SDL2/src/dynapi/gendynapi.pl index 091a08c7..192889fd 100644 --- a/libs/SDL2/src/dynapi/gendynapi.pl +++ b/libs/SDL2/src/dynapi/gendynapi.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # Simple DirectMedia Layer -# Copyright (C) 1997-2014 Sam Lantinga +# Copyright (C) 1997-2015 Sam Lantinga # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_clipboardevents.c b/libs/SDL2/src/events/SDL_clipboardevents.c index 3ef7bed2..5df8aa1c 100644 --- a/libs/SDL2/src/events/SDL_clipboardevents.c +++ b/libs/SDL2/src/events/SDL_clipboardevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_clipboardevents_c.h b/libs/SDL2/src/events/SDL_clipboardevents_c.h index c71da2a4..6c58ee43 100644 --- a/libs/SDL2/src/events/SDL_clipboardevents_c.h +++ b/libs/SDL2/src/events/SDL_clipboardevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_dropevents.c b/libs/SDL2/src/events/SDL_dropevents.c index 4830d14f..0c8c7bea 100644 --- a/libs/SDL2/src/events/SDL_dropevents.c +++ b/libs/SDL2/src/events/SDL_dropevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_dropevents_c.h b/libs/SDL2/src/events/SDL_dropevents_c.h index cb5e1dc5..3e8615e8 100644 --- a/libs/SDL2/src/events/SDL_dropevents_c.h +++ b/libs/SDL2/src/events/SDL_dropevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_events.c b/libs/SDL2/src/events/SDL_events.c index 963b9bd7..4f5bb2d9 100644 --- a/libs/SDL2/src/events/SDL_events.c +++ b/libs/SDL2/src/events/SDL_events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -75,12 +75,13 @@ static struct SDL_mutex *lock; volatile SDL_bool active; volatile int count; + volatile int max_events_seen; SDL_EventEntry *head; SDL_EventEntry *tail; SDL_EventEntry *free; SDL_SysWMEntry *wmmsg_used; SDL_SysWMEntry *wmmsg_free; -} SDL_EventQ = { NULL, SDL_TRUE }; +} SDL_EventQ = { NULL, SDL_TRUE, 0, 0, NULL, NULL, NULL, NULL, NULL }; /* Public functions */ @@ -88,6 +89,7 @@ static struct void SDL_StopEventLoop(void) { + const char *report = SDL_GetHint("SDL_EVENT_QUEUE_STATISTICS"); int i; SDL_EventEntry *entry; SDL_SysWMEntry *wmmsg; @@ -98,6 +100,11 @@ SDL_StopEventLoop(void) SDL_EventQ.active = SDL_FALSE; + if (report && SDL_atoi(report)) { + SDL_Log("SDL EVENT QUEUE: Maximum events in-flight: %d\n", + SDL_EventQ.max_events_seen); + } + /* Clean out EventQ */ for (entry = SDL_EventQ.head; entry; ) { SDL_EventEntry *next = entry->next; @@ -119,7 +126,9 @@ SDL_StopEventLoop(void) SDL_free(wmmsg); wmmsg = next; } + SDL_EventQ.count = 0; + SDL_EventQ.max_events_seen = 0; SDL_EventQ.head = NULL; SDL_EventQ.tail = NULL; SDL_EventQ.free = NULL; @@ -218,6 +227,10 @@ SDL_AddEvent(SDL_Event * event) } ++SDL_EventQ.count; + if (SDL_EventQ.count > SDL_EventQ.max_events_seen) { + SDL_EventQ.max_events_seen = SDL_EventQ.count; + } + return 1; } @@ -393,6 +406,8 @@ SDL_PumpEvents(void) SDL_JoystickUpdate(); } #endif + + SDL_SendPendingQuit(); /* in case we had a signal handler fire, etc. */ } /* Public functions */ diff --git a/libs/SDL2/src/events/SDL_events_c.h b/libs/SDL2/src/events/SDL_events_c.h index 11d6e304..ebd983d3 100644 --- a/libs/SDL2/src/events/SDL_events_c.h +++ b/libs/SDL2/src/events/SDL_events_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,6 +43,8 @@ extern int SDL_QuitInit(void); extern int SDL_SendQuit(void); extern void SDL_QuitQuit(void); +extern void SDL_SendPendingQuit(void); + /* The event filter function */ extern SDL_EventFilter SDL_EventOK; extern void *SDL_EventOKParam; diff --git a/libs/SDL2/src/events/SDL_gesture.c b/libs/SDL2/src/events/SDL_gesture.c index 46a55463..b7980ede 100644 --- a/libs/SDL2/src/events/SDL_gesture.c +++ b/libs/SDL2/src/events/SDL_gesture.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,6 +24,7 @@ /* General mouse handling code for SDL */ #include "SDL_events.h" +#include "SDL_endian.h" #include "SDL_events_c.h" #include "SDL_gesture_c.h" @@ -114,14 +115,34 @@ static unsigned long SDL_HashDollar(SDL_FloatPoint* points) static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst) { - if (dst == NULL) return 0; + if (dst == NULL) { + return 0; + } /* No Longer storing the Hash, rehash on load */ /* if (SDL_RWops.write(dst, &(templ->hash), sizeof(templ->hash), 1) != 1) return 0; */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN if (SDL_RWwrite(dst, templ->path, - sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) + sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) { return 0; + } +#else + { + SDL_DollarTemplate copy = *templ; + SDL_FloatPoint *p = copy.path; + int i; + for (i = 0; i < DOLLARNPOINTS; i++, p++) { + p->x = SDL_SwapFloatLE(p->x); + p->y = SDL_SwapFloatLE(p->y); + } + + if (SDL_RWwrite(dst, copy.path, + sizeof(copy.path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) { + return 0; + } + } +#endif return 1; } @@ -184,7 +205,7 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) int index = -1; int i = 0; if (inTouch == NULL) { - if (SDL_numGestureTouches == 0) return -1; + if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered"); for (i = 0; i < SDL_numGestureTouches; i++) { inTouch = &SDL_gestureTouch[i]; index = SDL_AddDollarGesture_one(inTouch, path); @@ -203,17 +224,33 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) SDL_GestureTouch *touch = NULL; if (src == NULL) return 0; if (touchId >= 0) { - for (i = 0; i < SDL_numGestureTouches; i++) - if (SDL_gestureTouch[i].id == touchId) + for (i = 0; i < SDL_numGestureTouches; i++) { + if (SDL_gestureTouch[i].id == touchId) { touch = &SDL_gestureTouch[i]; - if (touch == NULL) return -1; + } + } + if (touch == NULL) { + return SDL_SetError("given touch id not found"); + } } while (1) { SDL_DollarTemplate templ; - if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) < - DOLLARNPOINTS) break; + if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) < DOLLARNPOINTS) { + if (loaded == 0) { + return SDL_SetError("could not read any dollar gesture from rwops"); + } + break; + } + +#if SDL_BYTEORDER != SDL_LIL_ENDIAN + for (i = 0; i < DOLLARNPOINTS; i++) { + SDL_FloatPoint *p = &templ.path[i]; + p->x = SDL_SwapFloatLE(p->x); + p->y = SDL_SwapFloatLE(p->y); + } +#endif if (touchId >= 0) { /* printf("Adding loaded gesture to 1 touch\n"); */ @@ -612,8 +649,7 @@ void SDL_GestureProcessEvent(SDL_Event* event) break; pressure? */ } - - if (event->type == SDL_FINGERDOWN) { + else if (event->type == SDL_FINGERDOWN) { inTouch->numDownFingers++; inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers - 1)+ diff --git a/libs/SDL2/src/events/SDL_gesture_c.h b/libs/SDL2/src/events/SDL_gesture_c.h index 3f1ed9b1..f94dc715 100644 --- a/libs/SDL2/src/events/SDL_gesture_c.h +++ b/libs/SDL2/src/events/SDL_gesture_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_keyboard.c b/libs/SDL2/src/events/SDL_keyboard.c index ed4043e9..d4dc0e7b 100644 --- a/libs/SDL2/src/events/SDL_keyboard.c +++ b/libs/SDL2/src/events/SDL_keyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -662,6 +662,8 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; + SDL_Keymod modifier; + SDL_Keycode keycode; Uint16 modstate; Uint32 type; Uint8 repeat; @@ -673,82 +675,6 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), state == SDL_PRESSED ? "pressed" : "released"); #endif - if (state == SDL_PRESSED) { - modstate = keyboard->modstate; - switch (scancode) { - case SDL_SCANCODE_NUMLOCKCLEAR: - keyboard->modstate ^= KMOD_NUM; - break; - case SDL_SCANCODE_CAPSLOCK: - keyboard->modstate ^= KMOD_CAPS; - break; - case SDL_SCANCODE_LCTRL: - keyboard->modstate |= KMOD_LCTRL; - break; - case SDL_SCANCODE_RCTRL: - keyboard->modstate |= KMOD_RCTRL; - break; - case SDL_SCANCODE_LSHIFT: - keyboard->modstate |= KMOD_LSHIFT; - break; - case SDL_SCANCODE_RSHIFT: - keyboard->modstate |= KMOD_RSHIFT; - break; - case SDL_SCANCODE_LALT: - keyboard->modstate |= KMOD_LALT; - break; - case SDL_SCANCODE_RALT: - keyboard->modstate |= KMOD_RALT; - break; - case SDL_SCANCODE_LGUI: - keyboard->modstate |= KMOD_LGUI; - break; - case SDL_SCANCODE_RGUI: - keyboard->modstate |= KMOD_RGUI; - break; - case SDL_SCANCODE_MODE: - keyboard->modstate |= KMOD_MODE; - break; - default: - break; - } - } else { - switch (scancode) { - case SDL_SCANCODE_NUMLOCKCLEAR: - case SDL_SCANCODE_CAPSLOCK: - break; - case SDL_SCANCODE_LCTRL: - keyboard->modstate &= ~KMOD_LCTRL; - break; - case SDL_SCANCODE_RCTRL: - keyboard->modstate &= ~KMOD_RCTRL; - break; - case SDL_SCANCODE_LSHIFT: - keyboard->modstate &= ~KMOD_LSHIFT; - break; - case SDL_SCANCODE_RSHIFT: - keyboard->modstate &= ~KMOD_RSHIFT; - break; - case SDL_SCANCODE_LALT: - keyboard->modstate &= ~KMOD_LALT; - break; - case SDL_SCANCODE_RALT: - keyboard->modstate &= ~KMOD_RALT; - break; - case SDL_SCANCODE_LGUI: - keyboard->modstate &= ~KMOD_LGUI; - break; - case SDL_SCANCODE_RGUI: - keyboard->modstate &= ~KMOD_RGUI; - break; - case SDL_SCANCODE_MODE: - keyboard->modstate &= ~KMOD_MODE; - break; - default: - break; - } - modstate = keyboard->modstate; - } /* Figure out what type of event this is */ switch (state) { @@ -775,6 +701,59 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) /* Update internal keyboard state */ keyboard->keystate[scancode] = state; + keycode = keyboard->keymap[scancode]; + + /* Update modifiers state if applicable */ + switch (keycode) { + case SDLK_LCTRL: + modifier = KMOD_LCTRL; + break; + case SDLK_RCTRL: + modifier = KMOD_RCTRL; + break; + case SDLK_LSHIFT: + modifier = KMOD_LSHIFT; + break; + case SDLK_RSHIFT: + modifier = KMOD_RSHIFT; + break; + case SDLK_LALT: + modifier = KMOD_LALT; + break; + case SDLK_RALT: + modifier = KMOD_RALT; + break; + case SDLK_LGUI: + modifier = KMOD_LGUI; + break; + case SDLK_RGUI: + modifier = KMOD_RGUI; + break; + case SDLK_MODE: + modifier = KMOD_MODE; + break; + default: + modifier = KMOD_NONE; + break; + } + if (SDL_KEYDOWN == type) { + modstate = keyboard->modstate; + switch (keycode) { + case SDLK_NUMLOCKCLEAR: + keyboard->modstate ^= KMOD_NUM; + break; + case SDLK_CAPSLOCK: + keyboard->modstate ^= KMOD_CAPS; + break; + default: + keyboard->modstate |= modifier; + break; + } + } else { + keyboard->modstate &= ~modifier; + modstate = keyboard->modstate; + } + /* Post the event, if desired */ posted = 0; if (SDL_GetEventState(type) == SDL_ENABLE) { @@ -783,7 +762,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) event.key.state = state; event.key.repeat = repeat; event.key.keysym.scancode = scancode; - event.key.keysym.sym = keyboard->keymap[scancode]; + event.key.keysym.sym = keycode; event.key.keysym.mod = modstate; event.key.windowID = keyboard->focus ? keyboard->focus->id : 0; posted = (SDL_PushEvent(&event) > 0); diff --git a/libs/SDL2/src/events/SDL_keyboard_c.h b/libs/SDL2/src/events/SDL_keyboard_c.h index 05b52538..50fb06da 100644 --- a/libs/SDL2/src/events/SDL_keyboard_c.h +++ b/libs/SDL2/src/events/SDL_keyboard_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_mouse.c b/libs/SDL2/src/events/SDL_mouse.c index 0ce443a3..716384a1 100644 --- a/libs/SDL2/src/events/SDL_mouse.c +++ b/libs/SDL2/src/events/SDL_mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -293,9 +293,14 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ event.motion.yrel = yrel; posted = (SDL_PushEvent(&event) > 0); } - /* Use unclamped values if we're getting events outside the window */ - mouse->last_x = x; - mouse->last_y = y; + if (relative) { + mouse->last_x = mouse->x; + mouse->last_y = mouse->y; + } else { + /* Use unclamped values if we're getting events outside the window */ + mouse->last_x = x; + mouse->last_y = y; + } return posted; } @@ -530,14 +535,16 @@ SDL_WarpMouseInWindow(SDL_Window * window, int x, int y) } } -void +int SDL_WarpMouseGlobal(int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); if (mouse->WarpMouseGlobal) { - mouse->WarpMouseGlobal(x, y); + return mouse->WarpMouseGlobal(x, y); } + + return SDL_Unsupported(); } static SDL_bool diff --git a/libs/SDL2/src/events/SDL_mouse_c.h b/libs/SDL2/src/events/SDL_mouse_c.h index 56c061a5..b12bec35 100644 --- a/libs/SDL2/src/events/SDL_mouse_c.h +++ b/libs/SDL2/src/events/SDL_mouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -61,7 +61,7 @@ typedef struct void (*WarpMouse) (SDL_Window * window, int x, int y); /* Warp the mouse to (x,y) in screen space */ - void (*WarpMouseGlobal) (int x, int y); + int (*WarpMouseGlobal) (int x, int y); /* Set relative mode */ int (*SetRelativeMouseMode) (SDL_bool enabled); diff --git a/libs/SDL2/src/events/SDL_quit.c b/libs/SDL2/src/events/SDL_quit.c index db7af98f..d2b215bc 100644 --- a/libs/SDL2/src/events/SDL_quit.c +++ b/libs/SDL2/src/events/SDL_quit.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,6 +19,8 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "../SDL_internal.h" +#include "SDL_hints.h" +#include "SDL_assert.h" /* General quit handling code for SDL */ @@ -29,6 +31,8 @@ #include "SDL_events.h" #include "SDL_events_c.h" +static SDL_bool disable_signals = SDL_FALSE; +static SDL_bool send_quit_pending = SDL_FALSE; #ifdef HAVE_SIGNAL_H static void @@ -37,14 +41,15 @@ SDL_HandleSIG(int sig) /* Reset the signal handler */ signal(sig, SDL_HandleSIG); - /* Signal a quit interrupt */ - SDL_SendQuit(); + /* Send a quit event next time the event loop pumps. */ + /* We can't send it in signal handler; malloc() might be interrupted! */ + send_quit_pending = SDL_TRUE; } #endif /* HAVE_SIGNAL_H */ /* Public functions */ -int -SDL_QuitInit(void) +static int +SDL_QuitInit_Internal(void) { #ifdef HAVE_SIGACTION struct sigaction action; @@ -80,11 +85,22 @@ SDL_QuitInit(void) #endif /* HAVE_SIGNAL_H */ /* That's it! */ - return (0); + return 0; } -void -SDL_QuitQuit(void) +int +SDL_QuitInit(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS); + disable_signals = hint && (SDL_atoi(hint) == 1); + if (!disable_signals) { + return SDL_QuitInit_Internal(); + } + return 0; +} + +static void +SDL_QuitQuit_Internal(void) { #ifdef HAVE_SIGACTION struct sigaction action; @@ -110,11 +126,29 @@ SDL_QuitQuit(void) #endif /* HAVE_SIGNAL_H */ } +void +SDL_QuitQuit(void) +{ + if (!disable_signals) { + SDL_QuitQuit_Internal(); + } +} + /* This function returns 1 if it's okay to close the application window */ int SDL_SendQuit(void) { + send_quit_pending = SDL_FALSE; return SDL_SendAppEvent(SDL_QUIT); } +void +SDL_SendPendingQuit(void) +{ + if (send_quit_pending) { + SDL_SendQuit(); + SDL_assert(!send_quit_pending); + } +} + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/events/SDL_sysevents.h b/libs/SDL2/src/events/SDL_sysevents.h index a5be7bc3..f1d460d8 100644 --- a/libs/SDL2/src/events/SDL_sysevents.h +++ b/libs/SDL2/src/events/SDL_sysevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_touch.c b/libs/SDL2/src/events/SDL_touch.c index 14a337a9..1b477ea7 100644 --- a/libs/SDL2/src/events/SDL_touch.c +++ b/libs/SDL2/src/events/SDL_touch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -145,13 +145,16 @@ SDL_AddTouch(SDL_TouchID touchID, const char *name) } SDL_touchDevices = touchDevices; - index = SDL_num_touch++; + index = SDL_num_touch; SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index])); if (!SDL_touchDevices[index]) { return SDL_OutOfMemory(); } + /* Added touch to list */ + ++SDL_num_touch; + /* we're setting the touch properties */ SDL_touchDevices[index]->id = touchID; SDL_touchDevices[index]->num_fingers = 0; diff --git a/libs/SDL2/src/events/SDL_touch_c.h b/libs/SDL2/src/events/SDL_touch_c.h index f9781789..3e4b8bbf 100644 --- a/libs/SDL2/src/events/SDL_touch_c.h +++ b/libs/SDL2/src/events/SDL_touch_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_windowevents.c b/libs/SDL2/src/events/SDL_windowevents.c index 146cbc54..0e480f27 100644 --- a/libs/SDL2/src/events/SDL_windowevents.c +++ b/libs/SDL2/src/events/SDL_windowevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/SDL_windowevents_c.h b/libs/SDL2/src/events/SDL_windowevents_c.h index 9ad34a34..140b38c3 100644 --- a/libs/SDL2/src/events/SDL_windowevents_c.h +++ b/libs/SDL2/src/events/SDL_windowevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/blank_cursor.h b/libs/SDL2/src/events/blank_cursor.h index 423fa138..17501293 100644 --- a/libs/SDL2/src/events/blank_cursor.h +++ b/libs/SDL2/src/events/blank_cursor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/default_cursor.h b/libs/SDL2/src/events/default_cursor.h index 6e09380e..e292cbf5 100644 --- a/libs/SDL2/src/events/default_cursor.h +++ b/libs/SDL2/src/events/default_cursor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -110,5 +110,5 @@ static const unsigned char default_cmask[] = { 0x03, 0x00 }; -#endif /* TRUE_MACINTOSH_CURSOR */ +#endif /* USE_MACOS_CURSOR */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/events/scancodes_darwin.h b/libs/SDL2/src/events/scancodes_darwin.h index 42fcbdfa..5677a894 100644 --- a/libs/SDL2/src/events/scancodes_darwin.h +++ b/libs/SDL2/src/events/scancodes_darwin.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/scancodes_linux.h b/libs/SDL2/src/events/scancodes_linux.h index dbf7a7a5..532a2a98 100644 --- a/libs/SDL2/src/events/scancodes_linux.h +++ b/libs/SDL2/src/events/scancodes_linux.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/events/scancodes_windows.h b/libs/SDL2/src/events/scancodes_windows.h index fa894e48..f712d5a0 100644 --- a/libs/SDL2/src/events/scancodes_windows.h +++ b/libs/SDL2/src/events/scancodes_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,7 +49,7 @@ static const SDL_Scancode windows_scancode_table[] = SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */ SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */ - SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */ - SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */ + SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */ + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */ }; /* *INDENT-ON* */ diff --git a/libs/SDL2/src/events/scancodes_xfree86.h b/libs/SDL2/src/events/scancodes_xfree86.h index 8b10c3d9..e6155525 100644 --- a/libs/SDL2/src/events/scancodes_xfree86.h +++ b/libs/SDL2/src/events/scancodes_xfree86.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -141,15 +141,15 @@ static const SDL_Scancode xfree86_scancode_table[] = { /* 112 */ SDL_SCANCODE_F15, /* 113 */ SDL_SCANCODE_F16, /* 114 */ SDL_SCANCODE_F17, - /* 115 */ SDL_SCANCODE_UNKNOWN, + /* 115 */ SDL_SCANCODE_INTERNATIONAL1, /* \_ */ /* 116 */ SDL_SCANCODE_UNKNOWN, /* is translated to XK_ISO_Level3_Shift by my X server, but I have no keyboard that generates this code, so I don't know what the correct SDL_SCANCODE_* for it is */ /* 117 */ SDL_SCANCODE_UNKNOWN, /* 118 */ SDL_SCANCODE_KP_EQUALS, /* 119 */ SDL_SCANCODE_UNKNOWN, /* 120 */ SDL_SCANCODE_UNKNOWN, - /* 121 */ SDL_SCANCODE_UNKNOWN, + /* 121 */ SDL_SCANCODE_INTERNATIONAL4, /* Henkan_Mode */ /* 122 */ SDL_SCANCODE_UNKNOWN, - /* 123 */ SDL_SCANCODE_UNKNOWN, + /* 123 */ SDL_SCANCODE_INTERNATIONAL5, /* Muhenkan */ /* 124 */ SDL_SCANCODE_UNKNOWN, /* 125 */ SDL_SCANCODE_INTERNATIONAL3, /* Yen */ /* 126 */ SDL_SCANCODE_UNKNOWN, @@ -266,12 +266,12 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 86 */ SDL_SCANCODE_NONUSBACKSLASH, /* 87 */ SDL_SCANCODE_F11, /* 88 */ SDL_SCANCODE_F12, - /* 89 */ SDL_SCANCODE_UNKNOWN, + /* 89 */ SDL_SCANCODE_INTERNATIONAL1, /* \_ */ /* 90 */ SDL_SCANCODE_UNKNOWN, /* Katakana */ /* 91 */ SDL_SCANCODE_UNKNOWN, /* Hiragana */ - /* 92 */ SDL_SCANCODE_UNKNOWN, /* Henkan_Mode */ - /* 93 */ SDL_SCANCODE_UNKNOWN, /* Hiragana_Katakana */ - /* 94 */ SDL_SCANCODE_UNKNOWN, /* Muhenkan */ + /* 92 */ SDL_SCANCODE_INTERNATIONAL4, /* Henkan_Mode */ + /* 93 */ SDL_SCANCODE_INTERNATIONAL2, /* Hiragana_Katakana */ + /* 94 */ SDL_SCANCODE_INTERNATIONAL5, /* Muhenkan */ /* 95 */ SDL_SCANCODE_UNKNOWN, /* 96 */ SDL_SCANCODE_KP_ENTER, /* 97 */ SDL_SCANCODE_RCTRL, @@ -301,7 +301,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 121 */ SDL_SCANCODE_UNKNOWN, /* KP_Decimal */ /* 122 */ SDL_SCANCODE_UNKNOWN, /* Hangul */ /* 123 */ SDL_SCANCODE_UNKNOWN, /* Hangul_Hanja */ - /* 124 */ SDL_SCANCODE_UNKNOWN, + /* 124 */ SDL_SCANCODE_INTERNATIONAL3, /* Yen */ /* 125 */ SDL_SCANCODE_LGUI, /* 126 */ SDL_SCANCODE_RGUI, /* 127 */ SDL_SCANCODE_APPLICATION, diff --git a/libs/SDL2/src/file/SDL_rwops.c b/libs/SDL2/src/file/SDL_rwops.c index 41f6c6d0..b3b445d2 100644 --- a/libs/SDL2/src/file/SDL_rwops.c +++ b/libs/SDL2/src/file/SDL_rwops.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h b/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h index 9a8a9662..387428f3 100644 --- a/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h +++ b/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m b/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m index 1ae399c2..1d665edb 100644 --- a/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m +++ b/libs/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,14 +50,13 @@ FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; if([file_manager fileExistsAtPath:full_path_with_file_to_try]) { fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); - } - else { + } else { fp = fopen(file, mode); } return fp; }} -#endif /* __MACOSX__ */ +#endif /* __APPLE__ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/filesystem/android/SDL_sysfilesystem.c b/libs/SDL2/src/filesystem/android/SDL_sysfilesystem.c index b3937449..0401773e 100644 --- a/libs/SDL2/src/filesystem/android/SDL_sysfilesystem.c +++ b/libs/SDL2/src/filesystem/android/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m b/libs/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m index dab51c50..1e6a2067 100644 --- a/libs/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/libs/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,6 +41,7 @@ SDL_GetBasePath(void) const char* baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String]; const char *base = NULL; char *retval = NULL; + if (baseType == NULL) { baseType = "resource"; } @@ -52,6 +53,7 @@ SDL_GetBasePath(void) /* this returns the exedir for non-bundled and the resourceDir for bundled apps */ base = [[bundle resourcePath] fileSystemRepresentation]; } + if (base) { const size_t len = SDL_strlen(base) + 2; retval = (char *) SDL_malloc(len); @@ -69,9 +71,10 @@ char * SDL_GetPrefPath(const char *org, const char *app) { @autoreleasepool { - NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); char *retval = NULL; + NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); + if ([array count] > 0) { /* we only want the first item in the list. */ NSString *str = [array objectAtIndex:0]; const char *base = [str fileSystemRepresentation]; diff --git a/libs/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c b/libs/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c index 7e860939..2cb9e21e 100644 --- a/libs/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/libs/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/filesystem/emscripten/SDL_sysfilesystem.c b/libs/SDL2/src/filesystem/emscripten/SDL_sysfilesystem.c index f5ea7890..e9ded675 100644 --- a/libs/SDL2/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/libs/SDL2/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -57,6 +57,7 @@ SDL_GetPrefPath(const char *org, const char *app) if (mkdir(retval, 0700) != 0 && errno != EEXIST) { SDL_SetError("Couldn't create directory '%s': '%s'", retval, strerror(errno)); + SDL_free(retval); return NULL; } diff --git a/libs/SDL2/src/filesystem/haiku/SDL_sysfilesystem.cc b/libs/SDL2/src/filesystem/haiku/SDL_sysfilesystem.cc index b83d4d0a..3a0ea348 100644 --- a/libs/SDL2/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/libs/SDL2/src/filesystem/haiku/SDL_sysfilesystem.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/filesystem/nacl/SDL_sysfilesystem.c b/libs/SDL2/src/filesystem/nacl/SDL_sysfilesystem.c index 0111683a..4efda46e 100644 --- a/libs/SDL2/src/filesystem/nacl/SDL_sysfilesystem.c +++ b/libs/SDL2/src/filesystem/nacl/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/filesystem/unix/SDL_sysfilesystem.c b/libs/SDL2/src/filesystem/unix/SDL_sysfilesystem.c index cd11a67d..b3264949 100644 --- a/libs/SDL2/src/filesystem/unix/SDL_sysfilesystem.c +++ b/libs/SDL2/src/filesystem/unix/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/filesystem/windows/SDL_sysfilesystem.c b/libs/SDL2/src/filesystem/windows/SDL_sysfilesystem.c index 2791fb39..2d1c7819 100644 --- a/libs/SDL2/src/filesystem/windows/SDL_sysfilesystem.c +++ b/libs/SDL2/src/filesystem/windows/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,13 +36,51 @@ char * SDL_GetBasePath(void) { - TCHAR path[MAX_PATH]; - const DWORD len = GetModuleFileName(NULL, path, SDL_arraysize(path)); - size_t i; + typedef DWORD (WINAPI *GetModuleFileNameExW_t)(HANDLE, HMODULE, LPWSTR, DWORD); + GetModuleFileNameExW_t pGetModuleFileNameExW; + DWORD buflen = 128; + WCHAR *path = NULL; + HANDLE psapi = LoadLibrary(L"psapi.dll"); + char *retval = NULL; + DWORD len = 0; + int i; - SDL_assert(len < SDL_arraysize(path)); + if (!psapi) { + WIN_SetError("Couldn't load psapi.dll"); + return NULL; + } + + pGetModuleFileNameExW = (GetModuleFileNameExW_t)GetProcAddress(psapi, "GetModuleFileNameExW"); + if (!pGetModuleFileNameExW) { + WIN_SetError("Couldn't find GetModuleFileNameExW"); + FreeLibrary(psapi); + return NULL; + } + + while (SDL_TRUE) { + void *ptr = SDL_realloc(path, buflen * sizeof (WCHAR)); + if (!ptr) { + SDL_free(path); + FreeLibrary(psapi); + SDL_OutOfMemory(); + return NULL; + } + + path = (WCHAR *) ptr; + + len = pGetModuleFileNameExW(GetCurrentProcess(), NULL, path, buflen); + if (len != buflen) { + break; + } + + /* buffer too small? Try again. */ + buflen *= 2; + } + + FreeLibrary(psapi); if (len == 0) { + SDL_free(path); WIN_SetError("Couldn't locate our .exe"); return NULL; } @@ -55,7 +93,11 @@ SDL_GetBasePath(void) SDL_assert(i > 0); /* Should have been an absolute path. */ path[i+1] = '\0'; /* chop off filename. */ - return WIN_StringToUTF8(path); + + retval = WIN_StringToUTF8(path); + SDL_free(path); + + return retval; } char * diff --git a/libs/SDL2/src/filesystem/winrt/SDL_sysfilesystem.cpp b/libs/SDL2/src/filesystem/winrt/SDL_sysfilesystem.cpp index 370508dc..a70c7fe4 100644 --- a/libs/SDL2/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/libs/SDL2/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/haptic/SDL_haptic.c b/libs/SDL2/src/haptic/SDL_haptic.c index 596b26e6..0d5c0ef5 100644 --- a/libs/SDL2/src/haptic/SDL_haptic.c +++ b/libs/SDL2/src/haptic/SDL_haptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -845,3 +845,4 @@ SDL_HapticRumbleStop(SDL_Haptic * haptic) return SDL_HapticStopEffect(haptic, haptic->rumble_id); } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/haptic/SDL_haptic_c.h b/libs/SDL2/src/haptic/SDL_haptic_c.h index b318fff1..24389c7e 100644 --- a/libs/SDL2/src/haptic/SDL_haptic_c.h +++ b/libs/SDL2/src/haptic/SDL_haptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/haptic/SDL_syshaptic.h b/libs/SDL2/src/haptic/SDL_syshaptic.h index fa91f9be..a364f8a8 100644 --- a/libs/SDL2/src/haptic/SDL_syshaptic.h +++ b/libs/SDL2/src/haptic/SDL_syshaptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -206,4 +206,3 @@ extern int SDL_SYS_HapticStopAll(SDL_Haptic * haptic); #endif /* _SDL_syshaptic_h */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/libs/SDL2/src/haptic/darwin/SDL_syshaptic.c b/libs/SDL2/src/haptic/darwin/SDL_syshaptic.c index a74f008b..152f779d 100644 --- a/libs/SDL2/src/haptic/darwin/SDL_syshaptic.c +++ b/libs/SDL2/src/haptic/darwin/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -262,13 +262,13 @@ MacHaptic_MaybeAddDevice( io_object_t device ) CFSTR(kIOHIDPrimaryUsagePageKey)); if (refCF) { if (!CFNumberGetValue(refCF, kCFNumberLongType, &item->usagePage)) { - SDL_SetError("Haptic: Recieving device's usage page."); + SDL_SetError("Haptic: Receiving device's usage page."); } refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsageKey)); if (refCF) { if (!CFNumberGetValue(refCF, kCFNumberLongType, &item->usage)) { - SDL_SetError("Haptic: Recieving device's usage."); + SDL_SetError("Haptic: Receiving device's usage."); } } } @@ -683,7 +683,10 @@ SDL_SYS_HapticQuit(void) IOObjectRelease(item->dev); SDL_free(item); } + numhaptics = -1; + SDL_hapticlist = NULL; + SDL_hapticlist_tail = NULL; } @@ -771,18 +774,18 @@ static int SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) { int i; - FFCONSTANTFORCE *constant; - FFPERIODIC *periodic; - FFCONDITION *condition; /* Actually an array of conditions - one per axis. */ - FFRAMPFORCE *ramp; - FFCUSTOMFORCE *custom; - FFENVELOPE *envelope; - SDL_HapticConstant *hap_constant; - SDL_HapticPeriodic *hap_periodic; - SDL_HapticCondition *hap_condition; - SDL_HapticRamp *hap_ramp; - SDL_HapticCustom *hap_custom; - DWORD *axes; + FFCONSTANTFORCE *constant = NULL; + FFPERIODIC *periodic = NULL; + FFCONDITION *condition = NULL; /* Actually an array of conditions - one per axis. */ + FFRAMPFORCE *ramp = NULL; + FFCUSTOMFORCE *custom = NULL; + FFENVELOPE *envelope = NULL; + SDL_HapticConstant *hap_constant = NULL; + SDL_HapticPeriodic *hap_periodic = NULL; + SDL_HapticCondition *hap_condition = NULL; + SDL_HapticRamp *hap_ramp = NULL; + SDL_HapticCustom *hap_custom = NULL; + DWORD *axes = NULL; /* Set global stuff. */ SDL_memset(dest, 0, sizeof(FFEFFECT)); @@ -912,25 +915,28 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) case SDL_HAPTIC_INERTIA: case SDL_HAPTIC_FRICTION: hap_condition = &src->condition; - condition = SDL_malloc(sizeof(FFCONDITION) * dest->cAxes); - if (condition == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(condition, 0, sizeof(FFCONDITION)); + if (dest->cAxes > 0) { + condition = SDL_malloc(sizeof(FFCONDITION) * dest->cAxes); + if (condition == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(condition, 0, sizeof(FFCONDITION)); - /* Specifics */ - for (i = 0; i < dest->cAxes; i++) { - condition[i].lOffset = CONVERT(hap_condition->center[i]); - condition[i].lPositiveCoefficient = - CONVERT(hap_condition->right_coeff[i]); - condition[i].lNegativeCoefficient = - CONVERT(hap_condition->left_coeff[i]); - condition[i].dwPositiveSaturation = - CCONVERT(hap_condition->right_sat[i] / 2); - condition[i].dwNegativeSaturation = - CCONVERT(hap_condition->left_sat[i] / 2); - condition[i].lDeadBand = CCONVERT(hap_condition->deadband[i] / 2); + /* Specifics */ + for (i = 0; i < dest->cAxes; i++) { + condition[i].lOffset = CONVERT(hap_condition->center[i]); + condition[i].lPositiveCoefficient = + CONVERT(hap_condition->right_coeff[i]); + condition[i].lNegativeCoefficient = + CONVERT(hap_condition->left_coeff[i]); + condition[i].dwPositiveSaturation = + CCONVERT(hap_condition->right_sat[i] / 2); + condition[i].dwNegativeSaturation = + CCONVERT(hap_condition->left_sat[i] / 2); + condition[i].lDeadBand = CCONVERT(hap_condition->deadband[i] / 2); + } } + dest->cbTypeSpecificParams = sizeof(FFCONDITION) * dest->cAxes; dest->lpvTypeSpecificParams = condition; @@ -1406,5 +1412,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) return 0; } - #endif /* SDL_HAPTIC_IOKIT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/haptic/darwin/SDL_syshaptic_c.h b/libs/SDL2/src/haptic/darwin/SDL_syshaptic_c.h index f8072071..0af04487 100644 --- a/libs/SDL2/src/haptic/darwin/SDL_syshaptic_c.h +++ b/libs/SDL2/src/haptic/darwin/SDL_syshaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/haptic/dummy/SDL_syshaptic.c b/libs/SDL2/src/haptic/dummy/SDL_syshaptic.c index 09839c6d..ebff7dae 100644 --- a/libs/SDL2/src/haptic/dummy/SDL_syshaptic.c +++ b/libs/SDL2/src/haptic/dummy/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -182,3 +182,5 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) } #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/haptic/linux/SDL_syshaptic.c b/libs/SDL2/src/haptic/linux/SDL_syshaptic.c index fba536b4..ab0a5707 100644 --- a/libs/SDL2/src/haptic/linux/SDL_syshaptic.c +++ b/libs/SDL2/src/haptic/linux/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -59,6 +59,7 @@ typedef struct SDL_hapticlist_item { char *fname; /* Dev path name (like /dev/input/event1) */ SDL_Haptic *haptic; /* Associated haptic. */ + dev_t dev_num; struct SDL_hapticlist_item *next; } SDL_hapticlist_item; @@ -236,15 +237,11 @@ void haptic_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const static int MaybeAddDevice(const char *path) { - dev_t dev_nums[MAX_HAPTICS]; struct stat sb; int fd; - int k; - int duplicate; int success; SDL_hapticlist_item *item; - if (path == NULL) { return -1; } @@ -255,15 +252,11 @@ MaybeAddDevice(const char *path) } /* check for duplicates */ - duplicate = 0; - for (k = 0; (k < numhaptics) && !duplicate; ++k) { - if (sb.st_rdev == dev_nums[k]) { - duplicate = 1; + for (item = SDL_hapticlist; item != NULL; item = item->next) { + if (item->dev_num == sb.st_rdev) { + return -1; /* duplicate. */ } } - if (duplicate) { - return -1; - } /* try to open */ fd = open(path, O_RDWR, 0); @@ -293,6 +286,8 @@ MaybeAddDevice(const char *path) return -1; } + item->dev_num = sb.st_rdev; + /* TODO: should we add instance IDs? */ if (SDL_hapticlist_tail == NULL) { SDL_hapticlist = SDL_hapticlist_tail = item; @@ -301,8 +296,6 @@ MaybeAddDevice(const char *path) SDL_hapticlist_tail = item; } - dev_nums[numhaptics] = sb.st_rdev; - ++numhaptics; /* !!! TODO: Send a haptic add event? */ @@ -390,8 +383,8 @@ SDL_SYS_HapticName(int index) /* No name found, return device character device */ name = item->fname; } + close(fd); } - close(fd); return name; } @@ -546,7 +539,6 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) int ret; SDL_hapticlist_item *item; - /* Find the joystick in the haptic list. */ for (item = SDL_hapticlist; item; item = item->next) { if (SDL_strcmp(item->fname, joystick->hwdata->fname) == 0) { @@ -1162,5 +1154,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) return 0; } - #endif /* SDL_HAPTIC_LINUX */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/haptic/windows/SDL_dinputhaptic.c b/libs/SDL2/src/haptic/windows/SDL_dinputhaptic.c index 9ff46a9d..1cd70425 100644 --- a/libs/SDL2/src/haptic/windows/SDL_dinputhaptic.c +++ b/libs/SDL2/src/haptic/windows/SDL_dinputhaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,17 +21,17 @@ #include "../../SDL_internal.h" #include "SDL_error.h" -#include "SDL_stdinc.h" #include "SDL_haptic.h" +#include "../SDL_syshaptic.h" + +#if SDL_HAPTIC_DINPUT + +#include "SDL_stdinc.h" #include "SDL_timer.h" #include "SDL_windowshaptic_c.h" #include "SDL_dinputhaptic_c.h" -#include "../SDL_syshaptic.h" #include "../../joystick/windows/SDL_windowsjoystick_c.h" - -#if SDL_HAPTIC_DINPUT - /* * External stuff. */ @@ -1181,6 +1181,8 @@ SDL_DINPUT_HapticStopAll(SDL_Haptic * haptic) #else /* !SDL_HAPTIC_DINPUT */ +typedef struct DIDEVICEINSTANCE DIDEVICEINSTANCE; +typedef struct SDL_hapticlist_item SDL_hapticlist_item; int SDL_DINPUT_HapticInit(void) diff --git a/libs/SDL2/src/haptic/windows/SDL_dinputhaptic_c.h b/libs/SDL2/src/haptic/windows/SDL_dinputhaptic_c.h index 9801fe27..d587ab72 100644 --- a/libs/SDL2/src/haptic/windows/SDL_dinputhaptic_c.h +++ b/libs/SDL2/src/haptic/windows/SDL_dinputhaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/haptic/windows/SDL_windowshaptic.c b/libs/SDL2/src/haptic/windows/SDL_windowshaptic.c index 26095dc5..a0b6c554 100644 --- a/libs/SDL2/src/haptic/windows/SDL_windowshaptic.c +++ b/libs/SDL2/src/haptic/windows/SDL_windowshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -272,6 +272,10 @@ SDL_SYS_HapticQuit(void) SDL_XINPUT_HapticQuit(); SDL_DINPUT_HapticQuit(); + + numhaptics = 0; + SDL_hapticlist = NULL; + SDL_hapticlist_tail = NULL; } /* diff --git a/libs/SDL2/src/haptic/windows/SDL_windowshaptic_c.h b/libs/SDL2/src/haptic/windows/SDL_windowshaptic_c.h index e715339d..e3de1336 100644 --- a/libs/SDL2/src/haptic/windows/SDL_windowshaptic_c.h +++ b/libs/SDL2/src/haptic/windows/SDL_windowshaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/haptic/windows/SDL_xinputhaptic.c b/libs/SDL2/src/haptic/windows/SDL_xinputhaptic.c index 2e76a959..b5fb2e34 100644 --- a/libs/SDL2/src/haptic/windows/SDL_xinputhaptic.c +++ b/libs/SDL2/src/haptic/windows/SDL_xinputhaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,20 +20,20 @@ */ #include "../../SDL_internal.h" -#include "SDL_assert.h" #include "SDL_error.h" #include "SDL_haptic.h" +#include "../SDL_syshaptic.h" + +#if SDL_HAPTIC_XINPUT + +#include "SDL_assert.h" #include "SDL_hints.h" #include "SDL_timer.h" #include "SDL_windowshaptic_c.h" #include "SDL_xinputhaptic_c.h" -#include "../SDL_syshaptic.h" #include "../../core/windows/SDL_xinput.h" #include "../../joystick/windows/SDL_windowsjoystick_c.h" - -#if SDL_HAPTIC_XINPUT - /* * Internal stuff. */ @@ -375,6 +375,9 @@ SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic) #else /* !SDL_HAPTIC_XINPUT */ +#include "../../core/windows/SDL_windows.h" + +typedef struct SDL_hapticlist_item SDL_hapticlist_item; int SDL_XINPUT_HapticInit(void) @@ -488,4 +491,5 @@ SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic) } #endif /* SDL_HAPTIC_XINPUT */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/haptic/windows/SDL_xinputhaptic_c.h b/libs/SDL2/src/haptic/windows/SDL_xinputhaptic_c.h index c3062b6e..7917128d 100644 --- a/libs/SDL2/src/haptic/windows/SDL_xinputhaptic_c.h +++ b/libs/SDL2/src/haptic/windows/SDL_xinputhaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/SDL_gamecontroller.c b/libs/SDL2/src/joystick/SDL_gamecontroller.c index 766cfdf8..bfa8abea 100644 --- a/libs/SDL2/src/joystick/SDL_gamecontroller.c +++ b/libs/SDL2/src/joystick/SDL_gamecontroller.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -259,22 +259,29 @@ ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *gu */ ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) { + SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index); + ControllerMapping_t *mapping; + + mapping = SDL_PrivateGetControllerMappingForGUID(&jGUID); #if SDL_JOYSTICK_XINPUT - if (SDL_SYS_IsXInputGamepad_DeviceIndex(device_index) && s_pXInputMapping) { - return s_pXInputMapping; + if (!mapping && SDL_SYS_IsXInputGamepad_DeviceIndex(device_index)) { + mapping = s_pXInputMapping; } - else #endif #if defined(SDL_JOYSTICK_EMSCRIPTEN) - if (s_pEmscriptenMapping) { - return s_pEmscriptenMapping; + if (!mapping && s_pEmscriptenMapping) { + mapping = s_pEmscriptenMapping; } - else #endif - { - SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index); - return SDL_PrivateGetControllerMappingForGUID(&jGUID); + if (!mapping) { + const char *name = SDL_JoystickNameForIndex(device_index); + if (name) { + if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box")) { + mapping = s_pXInputMapping; + } + } } + return mapping; } static const char* map_StringForControllerAxis[] = { diff --git a/libs/SDL2/src/joystick/SDL_gamecontrollerdb.h b/libs/SDL2/src/joystick/SDL_gamecontrollerdb.h index ddd53713..d6c23a83 100644 --- a/libs/SDL2/src/joystick/SDL_gamecontrollerdb.h +++ b/libs/SDL2/src/joystick/SDL_gamecontrollerdb.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -63,23 +63,27 @@ static const char *s_ControllerMappings [] = "030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */ "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - "050000003620000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,platform:Linux,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,", + "030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", + "050000003620000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,", "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,", + "03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", + "03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", + "050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", "03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000de280000ff11000001000000,Valve Streaming Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - "030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - "030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - "030000005e040000d102000001010000,Xbox One Wireless Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,", + "xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000005e040000d102000001010000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", #endif #if defined(__ANDROID__) "4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", #endif #if defined(SDL_JOYSTICK_EMSCRIPTEN) - "emscripten,Standard Gamepad,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,lefttrigger:b6,righttrigger:b7,back:b8,start:b9,leftstick:b10,rightstick:b11,dpup:b12,dpdown:b13,dpleft:b14,dpright:b15,guide:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,", + "emscripten,Standard Gamepad,a:b0,b:b1,back:b8,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b16,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", #endif NULL }; diff --git a/libs/SDL2/src/joystick/SDL_joystick.c b/libs/SDL2/src/joystick/SDL_joystick.c index 2a60c003..192e0539 100644 --- a/libs/SDL2/src/joystick/SDL_joystick.c +++ b/libs/SDL2/src/joystick/SDL_joystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -206,10 +206,6 @@ SDL_PrivateJoystickValid(SDL_Joystick * joystick) valid = 1; } - if (joystick && joystick->closed) { - valid = 0; - } - return valid; } @@ -412,6 +408,7 @@ SDL_JoystickClose(SDL_Joystick * joystick) } SDL_SYS_JoystickClose(joystick); + joystick->hwdata = NULL; joysticklist = SDL_joysticks; joysticklistprev = NULL; @@ -668,7 +665,7 @@ SDL_JoystickUpdate(void) SDL_SYS_JoystickUpdate(joystick); - if (joystick->closed && joystick->uncentered) { + if (joystick->force_recentering) { int i; /* Tell the app that everything is centered/unpressed... */ @@ -681,7 +678,7 @@ SDL_JoystickUpdate(void) for (i = 0; i < joystick->nhats; i++) SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED); - joystick->uncentered = SDL_FALSE; + joystick->force_recentering = SDL_FALSE; } SDL_updating_joystick = NULL; diff --git a/libs/SDL2/src/joystick/SDL_joystick_c.h b/libs/SDL2/src/joystick/SDL_joystick_c.h index 064fb8a3..ee4a14a3 100644 --- a/libs/SDL2/src/joystick/SDL_joystick_c.h +++ b/libs/SDL2/src/joystick/SDL_joystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/SDL_sysjoystick.h b/libs/SDL2/src/joystick/SDL_sysjoystick.h index 819a961a..7c104b50 100644 --- a/libs/SDL2/src/joystick/SDL_sysjoystick.h +++ b/libs/SDL2/src/joystick/SDL_sysjoystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -53,8 +53,7 @@ struct _SDL_Joystick int ref_count; /* Reference count for multiple opens */ - SDL_bool closed; /* SDL_TRUE if this device is no longer valid */ - SDL_bool uncentered; /* SDL_TRUE if this device needs to have its state reset to 0 */ + SDL_bool force_recentering; /* SDL_TRUE if this device needs to have its state reset to 0 */ struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */ }; diff --git a/libs/SDL2/src/joystick/android/SDL_sysjoystick.c b/libs/SDL2/src/joystick/android/SDL_sysjoystick.c index 49fa5842..8ab682d4 100644 --- a/libs/SDL2/src/joystick/android/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/android/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -191,8 +191,8 @@ Android_OnPadDown(int device_id, int keycode) item = JoystickByDeviceId(device_id); if (item && item->joystick) { SDL_PrivateJoystickButton(item->joystick, button , SDL_PRESSED); + return 0; } - return 0; } return -1; @@ -207,8 +207,8 @@ Android_OnPadUp(int device_id, int keycode) item = JoystickByDeviceId(device_id); if (item && item->joystick) { SDL_PrivateJoystickButton(item->joystick, button, SDL_RELEASED); + return 0; } - return 0; } return -1; @@ -311,7 +311,9 @@ Android_AddJoystick(int device_id, const char *name, SDL_bool is_accelerometer, } #endif /* !SDL_EVENTS_DISABLED */ +#ifdef DEBUG_JOYSTICK SDL_Log("Added joystick %s with device_id %d", name, device_id); +#endif return numjoysticks; } @@ -368,7 +370,9 @@ Android_RemoveJoystick(int device_id) } #endif /* !SDL_EVENTS_DISABLED */ +#ifdef DEBUG_JOYSTICK SDL_Log("Removed joystick with device_id %d", device_id); +#endif SDL_free(item->name); SDL_free(item); @@ -495,10 +499,10 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) return (0); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { - return !joystick->closed && (joystick->hwdata != NULL); + return joystick->hwdata != NULL; } void @@ -514,6 +518,12 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) if (item->joystick) { if (Android_JNI_GetAccelerometerValues(values)) { for ( i = 0; i < 3; i++ ) { + if (values[i] > 1.0f) { + values[i] = 1.0f; + } else if (values[i] < -1.0f) { + values[i] = -1.0f; + } + value = (Sint16)(values[i] * 32767.0f); SDL_PrivateJoystickAxis(item->joystick, i, value); } @@ -529,11 +539,6 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - if (joystick->hwdata) { - ((SDL_joylist_item*)joystick->hwdata)->joystick = NULL; - joystick->hwdata = NULL; - } - joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ diff --git a/libs/SDL2/src/joystick/android/SDL_sysjoystick_c.h b/libs/SDL2/src/joystick/android/SDL_sysjoystick_c.h index 6ad6aa7a..2137e33c 100644 --- a/libs/SDL2/src/joystick/android/SDL_sysjoystick_c.h +++ b/libs/SDL2/src/joystick/android/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/bsd/SDL_sysjoystick.c b/libs/SDL2/src/joystick/bsd/SDL_sysjoystick.c index 65a32ed2..a6fe2f73 100644 --- a/libs/SDL2/src/joystick/bsd/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/bsd/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -421,7 +421,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy, int device_index) return (-1); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { return SDL_TRUE; @@ -558,8 +558,6 @@ SDL_SYS_JoystickClose(SDL_Joystick * joy) close(joy->hwdata->fd); SDL_free(joy->hwdata->path); SDL_free(joy->hwdata); - - return; } void diff --git a/libs/SDL2/src/joystick/darwin/SDL_sysjoystick.c b/libs/SDL2/src/joystick/darwin/SDL_sysjoystick.c index 45966b72..2b5f5915 100644 --- a/libs/SDL2/src/joystick/darwin/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/darwin/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -46,13 +46,23 @@ static IOHIDManagerRef hidman = NULL; /* Linked list of all available devices */ static recDevice *gpDeviceList = NULL; -/* if SDL_TRUE then a device was added since the last update call */ -static SDL_bool s_bDeviceAdded = SDL_FALSE; -static SDL_bool s_bDeviceRemoved = SDL_FALSE; - /* static incrementing counter for new joystick devices seen on the system. Devices should start with index 0 */ static int s_joystick_instance_id = -1; +static recDevice *GetDeviceForIndex(int device_index) +{ + recDevice *device = gpDeviceList; + while (device) { + if (!device->removed) { + if (device_index == 0) + break; + + --device_index; + } + device = device->pNext; + } + return device; +} static void FreeElementList(recElement *pElement) @@ -138,12 +148,27 @@ static void JoystickDeviceWasRemovedCallback(void *ctx, IOReturn result, void *sender) { recDevice *device = (recDevice *) ctx; - device->removed = 1; + device->removed = SDL_TRUE; device->deviceRef = NULL; // deviceRef was invalidated due to the remove #if SDL_HAPTIC_IOKIT MacHaptic_MaybeRemoveDevice(device->ffservice); #endif - s_bDeviceRemoved = SDL_TRUE; + +/* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceRemoved()? */ +#if !SDL_EVENTS_DISABLED + { + SDL_Event event; + event.type = SDL_JOYDEVICEREMOVED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = device->instance_id; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } + } +#endif /* !SDL_EVENTS_DISABLED */ } @@ -381,6 +406,7 @@ static void JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject) { recDevice *device; + int device_index = 0; if (res != kIOReturnSuccess) { return; @@ -410,18 +436,22 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic device->instance_id = ++s_joystick_instance_id; /* We have to do some storage of the io_service_t for SDL_HapticOpenFromJoystick */ + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 if (IOHIDDeviceGetService != NULL) { /* weak reference: available in 10.6 and later. */ +#endif + const io_service_t ioservice = IOHIDDeviceGetService(ioHIDDeviceObject); +#if SDL_HAPTIC_IOKIT if ((ioservice) && (FFIsForceFeedback(ioservice) == FF_OK)) { device->ffservice = ioservice; -#if SDL_HAPTIC_IOKIT MacHaptic_MaybeAddDevice(ioservice); -#endif } - } +#endif - device->send_open_event = 1; - s_bDeviceAdded = SDL_TRUE; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + } +#endif /* Add device to the end of the list */ if ( !gpDeviceList ) { @@ -431,10 +461,27 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic curdevice = gpDeviceList; while ( curdevice->pNext ) { + ++device_index; curdevice = curdevice->pNext; } curdevice->pNext = device; } + +/* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceAdded()? */ +#if !SDL_EVENTS_DISABLED + { + SDL_Event event; + event.type = SDL_JOYDEVICEADDED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = device_index; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } + } +#endif /* !SDL_EVENTS_DISABLED */ } static SDL_bool @@ -560,53 +607,12 @@ SDL_SYS_NumJoysticks() void SDL_SYS_JoystickDetect() { - if (s_bDeviceAdded || s_bDeviceRemoved) { - recDevice *device = gpDeviceList; - s_bDeviceAdded = SDL_FALSE; - s_bDeviceRemoved = SDL_FALSE; - int device_index = 0; - /* send notifications */ - while (device) { - if (device->send_open_event) { - device->send_open_event = 0; -/* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceAdded()? */ -#if !SDL_EVENTS_DISABLED - SDL_Event event; - event.type = SDL_JOYDEVICEADDED; - - if (SDL_GetEventState(event.type) == SDL_ENABLE) { - event.jdevice.which = device_index; - if ((SDL_EventOK == NULL) - || (*SDL_EventOK) (SDL_EventOKParam, &event)) { - SDL_PushEvent(&event); - } - } -#endif /* !SDL_EVENTS_DISABLED */ - - } - - if (device->removed) { - const int instance_id = device->instance_id; - device = FreeDevice(device); - -/* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceRemoved()? */ -#if !SDL_EVENTS_DISABLED - SDL_Event event; - event.type = SDL_JOYDEVICEREMOVED; - - if (SDL_GetEventState(event.type) == SDL_ENABLE) { - event.jdevice.which = instance_id; - if ((SDL_EventOK == NULL) - || (*SDL_EventOK) (SDL_EventOKParam, &event)) { - SDL_PushEvent(&event); - } - } -#endif /* !SDL_EVENTS_DISABLED */ - - } else { - device = device->pNext; - device_index++; - } + recDevice *device = gpDeviceList; + while (device) { + if (device->removed) { + device = FreeDevice(device); + } else { + device = device->pNext; } } @@ -621,13 +627,8 @@ SDL_SYS_JoystickDetect() const char * SDL_SYS_JoystickNameForDeviceIndex(int device_index) { - recDevice *device = gpDeviceList; - - while (device_index-- > 0) { - device = device->pNext; - } - - return device->product; + recDevice *device = GetDeviceForIndex(device_index); + return device ? device->product : "UNKNOWN"; } /* Function to return the instance id of the joystick at device_index @@ -635,14 +636,8 @@ SDL_SYS_JoystickNameForDeviceIndex(int device_index) SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) { - recDevice *device = gpDeviceList; - int index; - - for (index = device_index; index > 0; index--) { - device = device->pNext; - } - - return device->instance_id; + recDevice *device = GetDeviceForIndex(device_index); + return device ? device->instance_id : 0; } /* Function to open a joystick for use. @@ -653,12 +648,7 @@ SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) { - recDevice *device = gpDeviceList; - int index; - - for (index = device_index; index > 0; index--) { - device = device->pNext; - } + recDevice *device = GetDeviceForIndex(device_index); joystick->instance_id = device->instance_id; joystick->hwdata = device; @@ -677,16 +667,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick) { - recDevice *device = gpDeviceList; - - while (device) { - if (joystick->instance_id == device->instance_id) { - return SDL_TRUE; - } - device = device->pNext; - } - - return SDL_FALSE; + return joystick->hwdata != NULL; } /* Function to update the state of a joystick - called as a device poll. @@ -707,9 +688,10 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) } if (device->removed) { /* device was unplugged; ignore it. */ - joystick->closed = 1; - joystick->uncentered = 1; - joystick->hwdata = NULL; + if (joystick->hwdata) { + joystick->force_recentering = SDL_TRUE; + joystick->hwdata = NULL; + } return; } @@ -797,7 +779,6 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ @@ -814,21 +795,19 @@ SDL_SYS_JoystickQuit(void) CFRelease(hidman); hidman = NULL; } - - s_bDeviceAdded = s_bDeviceRemoved = SDL_FALSE; } SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) { - recDevice *device = gpDeviceList; - int index; - - for (index = device_index; index > 0; index--) { - device = device->pNext; + recDevice *device = GetDeviceForIndex(device_index); + SDL_JoystickGUID guid; + if (device) { + guid = device->guid; + } else { + SDL_zero(guid); } - - return device->guid; + return guid; } SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick *joystick) diff --git a/libs/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h b/libs/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h index 0a15ba18..7bc20d06 100644 --- a/libs/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h +++ b/libs/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -58,12 +58,10 @@ struct joystick_hwdata recElement *firstButton; recElement *firstHat; - int removed; - int uncentered; + SDL_bool removed; int instance_id; SDL_JoystickGUID guid; - Uint8 send_open_event; /* 1 if we need to send an Added event for this device */ struct joystick_hwdata *pNext; /* next device */ }; diff --git a/libs/SDL2/src/joystick/dummy/SDL_sysjoystick.c b/libs/SDL2/src/joystick/dummy/SDL_sysjoystick.c index 1d1c16a1..6212c0e5 100644 --- a/libs/SDL2/src/joystick/dummy/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/dummy/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,7 +34,7 @@ int SDL_SYS_JoystickInit(void) { - return (0); + return 0; } int SDL_SYS_NumJoysticks() @@ -71,7 +71,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) return SDL_SetError("Logic error: No joysticks available"); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { return SDL_TRUE; @@ -85,21 +85,18 @@ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { - return; } /* Function to close a joystick after use */ void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - return; } /* Function to perform any system-specific joystick related cleanup */ void SDL_SYS_JoystickQuit(void) { - return; } SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) diff --git a/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick.c b/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick.c index 5b826775..92b93715 100644 --- a/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -200,7 +200,7 @@ SDL_SYS_JoystickInit(void) /* Check if gamepad is supported by browser */ if (numjs == EMSCRIPTEN_RESULT_NOT_SUPPORTED) { - return -1; + return SDL_SetError("Gamepads not supported"); } /* handle already connected gamepads */ @@ -221,7 +221,7 @@ SDL_SYS_JoystickInit(void) if(retval != EMSCRIPTEN_RESULT_SUCCESS) { SDL_SYS_JoystickQuit(); - return -1; + return SDL_SetError("Could not set gamepad connect callback"); } retval = emscripten_set_gamepaddisconnected_callback(NULL, @@ -229,7 +229,7 @@ SDL_SYS_JoystickInit(void) Emscripten_JoyStickDisconnected); if(retval != EMSCRIPTEN_RESULT_SUCCESS) { SDL_SYS_JoystickQuit(); - return -1; + return SDL_SetError("Could not set gamepad disconnect callback"); } return 0; @@ -323,10 +323,10 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) return (0); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { - return !joystick->closed && (joystick->hwdata != NULL); + return joystick->hwdata != NULL; } /* Function to update the state of a joystick - called as a device poll. @@ -350,6 +350,10 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) buttonState = gamepadState.digitalButton[i]? SDL_PRESSED: SDL_RELEASED; SDL_PrivateJoystickButton(item->joystick, i, buttonState); } + + /* store values to compare them in the next update */ + item->analogButton[i] = gamepadState.analogButton[i]; + item->digitalButton[i] = gamepadState.digitalButton[i]; } for(i = 0; i < item->naxes; i++) { @@ -358,17 +362,12 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) SDL_PrivateJoystickAxis(item->joystick, i, (Sint16) (32767.*gamepadState.axis[i])); } - } - item->timestamp = gamepadState.timestamp; - for( i = 0; i < item->naxes; i++) { + /* store to compare in next update */ item->axis[i] = gamepadState.axis[i]; } - for( i = 0; i < item->nbuttons; i++) { - item->analogButton[i] = gamepadState.analogButton[i]; - item->digitalButton[i] = gamepadState.digitalButton[i]; - } + item->timestamp = gamepadState.timestamp; } } } @@ -378,11 +377,6 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - if (joystick->hwdata) { - ((SDL_joylist_item*)joystick->hwdata)->joystick = NULL; - joystick->hwdata = NULL; - } - joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ diff --git a/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick_c.h b/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick_c.h index 4c907a66..82b4e13b 100644 --- a/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick_c.h +++ b/libs/SDL2/src/joystick/emscripten/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/haiku/SDL_haikujoystick.cc b/libs/SDL2/src/joystick/haiku/SDL_haikujoystick.cc index 394804e0..612f3849 100644 --- a/libs/SDL2/src/joystick/haiku/SDL_haikujoystick.cc +++ b/libs/SDL2/src/joystick/haiku/SDL_haikujoystick.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -152,7 +152,7 @@ extern "C" return (0); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { return SDL_TRUE; @@ -228,7 +228,6 @@ extern "C" SDL_free(joystick->hwdata->new_hats); SDL_free(joystick->hwdata->new_axes); SDL_free(joystick->hwdata); - joystick->hwdata = NULL; } } diff --git a/libs/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m b/libs/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m index dd626f20..d7a7fcbc 100644 --- a/libs/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m +++ b/libs/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,6 +23,7 @@ /* This is the iOS implementation of the SDL joystick API */ #include "SDL_joystick.h" +#include "SDL_hints.h" #include "SDL_stdinc.h" #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" @@ -32,9 +33,10 @@ /* needed for SDL_IPHONE_MAX_GFORCE macro */ #import "SDL_config_iphoneos.h" -const char *accelerometerName = "iOS accelerometer"; +const char *accelerometerName = "iOS Accelerometer"; static CMMotionManager *motionManager = nil; +static int numjoysticks = 0; /* Function to scan the system for joysticks. * Joystick 0 should be the system default joystick. @@ -43,12 +45,18 @@ static CMMotionManager *motionManager = nil; int SDL_SYS_JoystickInit(void) { - return (1); + const char *hint = SDL_GetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK); + if (!hint || SDL_atoi(hint)) { + /* Default behavior, accelerometer as joystick */ + numjoysticks = 1; + } + + return numjoysticks; } int SDL_SYS_NumJoysticks() { - return 1; + return numjoysticks; } void SDL_SYS_JoystickDetect() @@ -81,18 +89,20 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) joystick->nballs = 0; joystick->nbuttons = 0; - if (motionManager == nil) { - motionManager = [[CMMotionManager alloc] init]; - } + @autoreleasepool { + if (motionManager == nil) { + motionManager = [[CMMotionManager alloc] init]; + } - /* Shorter times between updates can significantly increase CPU usage. */ - motionManager.accelerometerUpdateInterval = 0.1; - [motionManager startAccelerometerUpdates]; + /* Shorter times between updates can significantly increase CPU usage. */ + motionManager.accelerometerUpdateInterval = 0.1; + [motionManager startAccelerometerUpdates]; + } return 0; } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { return SDL_TRUE; @@ -104,11 +114,13 @@ static void SDL_SYS_AccelerometerUpdate(SDL_Joystick * joystick) const SInt16 maxsint16 = 0x7FFF; CMAcceleration accel; - if (!motionManager.accelerometerActive) { - return; - } + @autoreleasepool { + if (!motionManager.accelerometerActive) { + return; + } - accel = [[motionManager accelerometerData] acceleration]; + accel = motionManager.accelerometerData.acceleration; + } /* Convert accelerometer data from floating point to Sint16, which is what @@ -152,18 +164,20 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - [motionManager stopAccelerometerUpdates]; - joystick->closed = 1; + @autoreleasepool { + [motionManager stopAccelerometerUpdates]; + } } /* Function to perform any system-specific joystick related cleanup */ void SDL_SYS_JoystickQuit(void) { - if (motionManager != nil) { - [motionManager release]; + @autoreleasepool { motionManager = nil; } + + numjoysticks = 0; } SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) diff --git a/libs/SDL2/src/joystick/linux/SDL_sysjoystick.c b/libs/SDL2/src/joystick/linux/SDL_sysjoystick.c index d4e42e4c..c6f7911c 100644 --- a/libs/SDL2/src/joystick/linux/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/linux/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -492,7 +492,7 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) ++joystick->nbuttons; } } - for (i = 0; i < ABS_MISC; ++i) { + for (i = 0; i < ABS_MAX; ++i) { /* Skip hats */ if (i == ABS_HAT0X) { i = ABS_HAT3Y; @@ -621,10 +621,10 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) return (0); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { - return !joystick->closed && (joystick->hwdata->item != NULL); + return joystick->hwdata->item != NULL; } static SDL_INLINE void @@ -753,10 +753,6 @@ HandleInputEvents(SDL_Joystick * joystick) } break; case EV_ABS: - if (code >= ABS_MISC) { - break; - } - switch (code) { case ABS_HAT0X: case ABS_HAT0Y: @@ -841,9 +837,7 @@ SDL_SYS_JoystickClose(SDL_Joystick * joystick) SDL_free(joystick->hwdata->balls); SDL_free(joystick->hwdata->fname); SDL_free(joystick->hwdata); - joystick->hwdata = NULL; } - joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ diff --git a/libs/SDL2/src/joystick/linux/SDL_sysjoystick_c.h b/libs/SDL2/src/joystick/linux/SDL_sysjoystick_c.h index 16d16e26..0d7e65d2 100644 --- a/libs/SDL2/src/joystick/linux/SDL_sysjoystick_c.h +++ b/libs/SDL2/src/joystick/linux/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/psp/SDL_sysjoystick.c b/libs/SDL2/src/joystick/psp/SDL_sysjoystick.c index 9eae4e25..9d20f90d 100644 --- a/libs/SDL2/src/joystick/psp/SDL_sysjoystick.c +++ b/libs/SDL2/src/joystick/psp/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -177,7 +177,7 @@ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick, int device_index) return 0; } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { return SDL_TRUE; @@ -233,7 +233,6 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) /* Function to close a joystick after use */ void SDL_SYS_JoystickClose(SDL_Joystick *joystick) { - /* Do nothing. */ } /* Function to perform any system-specific joystick related cleanup */ diff --git a/libs/SDL2/src/joystick/windows/SDL_dinputjoystick.c b/libs/SDL2/src/joystick/windows/SDL_dinputjoystick.c index 179f9928..61d5b386 100644 --- a/libs/SDL2/src/joystick/windows/SDL_dinputjoystick.c +++ b/libs/SDL2/src/joystick/windows/SDL_dinputjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,13 +21,13 @@ #include "../../SDL_internal.h" #include "../SDL_sysjoystick.h" + +#if SDL_JOYSTICK_DINPUT + #include "SDL_windowsjoystick_c.h" #include "SDL_dinputjoystick_c.h" #include "SDL_xinputjoystick_c.h" - -#if SDL_JOYSTICK_DINPUT - #ifndef DIDFT_OPTIONAL #define DIDFT_OPTIONAL 0x80000000 #endif @@ -340,6 +340,11 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) { JoyStick_DeviceData *pNewJoystick; JoyStick_DeviceData *pPrevJoystick = NULL; + const DWORD devtype = (pdidInstance->dwDevType & 0xFF); + + if (devtype == DI8DEVTYPE_SUPPLEMENTAL) { + return DIENUM_CONTINUE; /* Ignore touchpads, etc. */ + } if (SDL_IsXInputDevice(&pdidInstance->guidProduct)) { return DIENUM_CONTINUE; /* ignore XInput devices here, keep going. */ @@ -862,6 +867,7 @@ SDL_DINPUT_JoystickQuit(void) #else /* !SDL_JOYSTICK_DINPUT */ +typedef struct JoyStick_DeviceData JoyStick_DeviceData; int SDL_DINPUT_JoystickInit(void) diff --git a/libs/SDL2/src/joystick/windows/SDL_dinputjoystick_c.h b/libs/SDL2/src/joystick/windows/SDL_dinputjoystick_c.h index 3facf0e5..f93b1209 100644 --- a/libs/SDL2/src/joystick/windows/SDL_dinputjoystick_c.h +++ b/libs/SDL2/src/joystick/windows/SDL_dinputjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/windows/SDL_mmjoystick.c b/libs/SDL2/src/joystick/windows/SDL_mmjoystick.c index 7fd555d9..65b16ab9 100644 --- a/libs/SDL2/src/joystick/windows/SDL_mmjoystick.c +++ b/libs/SDL2/src/joystick/windows/SDL_mmjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -271,7 +271,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) return (0); } -/* Function to determine is this joystick is attached to the system right now */ +/* Function to determine if this joystick is attached to the system right now */ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { return SDL_TRUE; @@ -383,9 +383,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - /* free system specific hardware data */ SDL_free(joystick->hwdata); - joystick->hwdata = NULL; } /* Function to perform any system-specific joystick related cleanup */ diff --git a/libs/SDL2/src/joystick/windows/SDL_windowsjoystick.c b/libs/SDL2/src/joystick/windows/SDL_windowsjoystick.c index 3404899f..c06fad0d 100644 --- a/libs/SDL2/src/joystick/windows/SDL_windowsjoystick.c +++ b/libs/SDL2/src/joystick/windows/SDL_windowsjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -460,7 +460,6 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) /* allocate memory for system specific hardware data */ joystick->instance_id = joystickdevice->nInstanceID; - joystick->closed = SDL_FALSE; joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata)); if (joystick->hwdata == NULL) { @@ -480,13 +479,13 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick) { - return !joystick->closed && !joystick->hwdata->removed; + return joystick->hwdata && !joystick->hwdata->removed; } void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { - if (joystick->closed || !joystick->hwdata) { + if (!joystick->hwdata || joystick->hwdata->removed) { return; } @@ -497,8 +496,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) } if (joystick->hwdata->removed) { - joystick->closed = SDL_TRUE; - joystick->uncentered = SDL_TRUE; + joystick->force_recentering = SDL_TRUE; } } @@ -512,10 +510,7 @@ SDL_SYS_JoystickClose(SDL_Joystick * joystick) SDL_DINPUT_JoystickClose(joystick); } - /* free system specific hardware data */ SDL_free(joystick->hwdata); - - joystick->closed = SDL_TRUE; } /* Function to perform any system-specific joystick related cleanup */ diff --git a/libs/SDL2/src/joystick/windows/SDL_windowsjoystick_c.h b/libs/SDL2/src/joystick/windows/SDL_windowsjoystick_c.h index 9b09e656..5f991dc2 100644 --- a/libs/SDL2/src/joystick/windows/SDL_windowsjoystick_c.h +++ b/libs/SDL2/src/joystick/windows/SDL_windowsjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/joystick/windows/SDL_xinputjoystick.c b/libs/SDL2/src/joystick/windows/SDL_xinputjoystick.c index 12bf9885..b1c22ab1 100644 --- a/libs/SDL2/src/joystick/windows/SDL_xinputjoystick.c +++ b/libs/SDL2/src/joystick/windows/SDL_xinputjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,15 @@ */ #include "../../SDL_internal.h" -#include "SDL_assert.h" -#include "SDL_hints.h" #include "../SDL_sysjoystick.h" -#include "SDL_windowsjoystick_c.h" -#include "SDL_xinputjoystick_c.h" - #if SDL_JOYSTICK_XINPUT +#include "SDL_assert.h" +#include "SDL_hints.h" +#include "SDL_windowsjoystick_c.h" +#include "SDL_xinputjoystick_c.h" + /* * Internal stuff. */ @@ -339,6 +339,7 @@ SDL_SYS_IsXInputGamepad_DeviceIndex(int device_index) #else /* !SDL_JOYSTICK_XINPUT */ +typedef struct JoyStick_DeviceData JoyStick_DeviceData; SDL_bool SDL_XINPUT_Enabled(void) { diff --git a/libs/SDL2/src/joystick/windows/SDL_xinputjoystick_c.h b/libs/SDL2/src/joystick/windows/SDL_xinputjoystick_c.h index 825c2920..ed6087bc 100644 --- a/libs/SDL2/src/joystick/windows/SDL_xinputjoystick_c.h +++ b/libs/SDL2/src/joystick/windows/SDL_xinputjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/libm/math_libm.h b/libs/SDL2/src/libm/math_libm.h index 6b479f44..9e91073e 100644 --- a/libs/SDL2/src/libm/math_libm.h +++ b/libs/SDL2/src/libm/math_libm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/loadso/dlopen/SDL_sysloadso.c b/libs/SDL2/src/loadso/dlopen/SDL_sysloadso.c index db842222..f3dffefd 100644 --- a/libs/SDL2/src/loadso/dlopen/SDL_sysloadso.c +++ b/libs/SDL2/src/loadso/dlopen/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/loadso/dummy/SDL_sysloadso.c b/libs/SDL2/src/loadso/dummy/SDL_sysloadso.c index 0dfb90b0..a38b5697 100644 --- a/libs/SDL2/src/loadso/dummy/SDL_sysloadso.c +++ b/libs/SDL2/src/loadso/dummy/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/loadso/haiku/SDL_sysloadso.c b/libs/SDL2/src/loadso/haiku/SDL_sysloadso.c index c8bba670..a5f12950 100644 --- a/libs/SDL2/src/loadso/haiku/SDL_sysloadso.c +++ b/libs/SDL2/src/loadso/haiku/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/loadso/windows/SDL_sysloadso.c b/libs/SDL2/src/loadso/windows/SDL_sysloadso.c index 4d32b098..1c1d8cfa 100644 --- a/libs/SDL2/src/loadso/windows/SDL_sysloadso.c +++ b/libs/SDL2/src/loadso/windows/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/main/android/SDL_android_main.c b/libs/SDL2/src/main/android/SDL_android_main.c index 3a53d092..4173bcb1 100644 --- a/libs/SDL2/src/main/android/SDL_android_main.c +++ b/libs/SDL2/src/main/android/SDL_android_main.c @@ -17,7 +17,7 @@ extern void SDL_Android_Init(JNIEnv* env, jclass cls); /* Start up the SDL app */ -int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject array) +JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject array) { int i; int argc; diff --git a/libs/SDL2/src/main/haiku/SDL_BApp.h b/libs/SDL2/src/main/haiku/SDL_BApp.h index 9eece544..1c5dbb84 100644 --- a/libs/SDL2/src/main/haiku/SDL_BApp.h +++ b/libs/SDL2/src/main/haiku/SDL_BApp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/main/haiku/SDL_BeApp.cc b/libs/SDL2/src/main/haiku/SDL_BeApp.cc index d471887f..f09afb2e 100644 --- a/libs/SDL2/src/main/haiku/SDL_BeApp.cc +++ b/libs/SDL2/src/main/haiku/SDL_BeApp.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/main/haiku/SDL_BeApp.h b/libs/SDL2/src/main/haiku/SDL_BeApp.h index f4399c81..b1cb9501 100644 --- a/libs/SDL2/src/main/haiku/SDL_BeApp.h +++ b/libs/SDL2/src/main/haiku/SDL_BeApp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/main/nacl/SDL_nacl_main.c b/libs/SDL2/src/main/nacl/SDL_nacl_main.c index 40a29ddf..378db7af 100644 --- a/libs/SDL2/src/main/nacl/SDL_nacl_main.c +++ b/libs/SDL2/src/main/nacl/SDL_nacl_main.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -90,4 +90,4 @@ nacl_main(int argc, char *argv[]) /* ppapi_simple will start nacl_main in a worker thread */ PPAPI_SIMPLE_REGISTER_MAIN(nacl_main); -#endif /* SDL_VIDEO_DRIVER_NACL */ \ No newline at end of file +#endif /* SDL_VIDEO_DRIVER_NACL */ diff --git a/libs/SDL2/src/main/windows/version.rc b/libs/SDL2/src/main/windows/version.rc index 3a461276..d9fbffc7 100644 --- a/libs/SDL2/src/main/windows/version.rc +++ b/libs/SDL2/src/main/windows/version.rc @@ -25,7 +25,7 @@ BEGIN VALUE "FileDescription", "SDL\0" VALUE "FileVersion", "2, 0, 4, 0\0" VALUE "InternalName", "SDL\0" - VALUE "LegalCopyright", "Copyright © 2014 Sam Lantinga\0" + VALUE "LegalCopyright", "Copyright © 2015 Sam Lantinga\0" VALUE "OriginalFilename", "SDL2.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" VALUE "ProductVersion", "2, 0, 4, 0\0" diff --git a/libs/SDL2/src/power/SDL_power.c b/libs/SDL2/src/power/SDL_power.c index 64425312..8f919f2e 100644 --- a/libs/SDL2/src/power/SDL_power.c +++ b/libs/SDL2/src/power/SDL_power.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,6 +29,7 @@ typedef SDL_bool (*SDL_GetPowerInfo_Impl) (SDL_PowerState * state, int *seconds, int *percent); +SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *, int *, int *); SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *); SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *); SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *); @@ -58,6 +59,7 @@ SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent) static SDL_GetPowerInfo_Impl implementations[] = { #ifndef SDL_POWER_DISABLED #ifdef SDL_POWER_LINUX /* in order of preference. More than could work. */ + SDL_GetPowerInfo_Linux_sys_class_power_supply, SDL_GetPowerInfo_Linux_proc_acpi, SDL_GetPowerInfo_Linux_proc_apm, #endif diff --git a/libs/SDL2/src/power/android/SDL_syspower.c b/libs/SDL2/src/power/android/SDL_syspower.c index e363731d..94a4ff4c 100644 --- a/libs/SDL2/src/power/android/SDL_syspower.c +++ b/libs/SDL2/src/power/android/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/power/emscripten/SDL_syspower.c b/libs/SDL2/src/power/emscripten/SDL_syspower.c index 75677331..3a2b4ed8 100644 --- a/libs/SDL2/src/power/emscripten/SDL_syspower.c +++ b/libs/SDL2/src/power/emscripten/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/power/haiku/SDL_syspower.c b/libs/SDL2/src/power/haiku/SDL_syspower.c index aaf61e8b..2d87806a 100644 --- a/libs/SDL2/src/power/haiku/SDL_syspower.c +++ b/libs/SDL2/src/power/haiku/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/power/linux/SDL_syspower.c b/libs/SDL2/src/power/linux/SDL_syspower.c index 05eb200b..3986489f 100644 --- a/libs/SDL2/src/power/linux/SDL_syspower.c +++ b/libs/SDL2/src/power/linux/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,8 +36,10 @@ static const char *proc_apm_path = "/proc/apm"; static const char *proc_acpi_battery_path = "/proc/acpi/battery"; static const char *proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter"; +static const char *sys_class_power_supply_path = "/sys/class/power_supply"; -static int open_acpi_file(const char *base, const char *node, const char *key) +static int +open_power_file(const char *base, const char *node, const char *key) { const size_t pathlen = strlen(base) + strlen(node) + strlen(key) + 3; char *path = (char *) alloca(pathlen); @@ -51,11 +53,11 @@ static int open_acpi_file(const char *base, const char *node, const char *key) static SDL_bool -load_acpi_file(const char *base, const char *node, const char *key, - char *buf, size_t buflen) +read_power_file(const char *base, const char *node, const char *key, + char *buf, size_t buflen) { ssize_t br = 0; - const int fd = open_acpi_file(base, node, key); + const int fd = open_power_file(base, node, key); if (fd == -1) { return SDL_FALSE; } @@ -133,9 +135,9 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, int secs = -1; int pct = -1; - if (!load_acpi_file(base, node, "state", state, sizeof (state))) { + if (!read_power_file(base, node, "state", state, sizeof (state))) { return; - } else if (!load_acpi_file(base, node, "info", info, sizeof (info))) { + } else if (!read_power_file(base, node, "info", info, sizeof (info))) { return; } @@ -214,7 +216,7 @@ check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac) char *key = NULL; char *val = NULL; - if (!load_acpi_file(base, node, "state", state, sizeof (state))) { + if (!read_power_file(base, node, "state", state, sizeof (state))) { return; } @@ -423,6 +425,94 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, return SDL_TRUE; } +/* !!! FIXME: implement d-bus queries to org.freedesktop.UPower. */ + +SDL_bool +SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent) +{ + const char *base = sys_class_power_supply_path; + struct dirent *dent; + DIR *dirp; + + dirp = opendir(base); + if (!dirp) { + return SDL_FALSE; + } + + *state = SDL_POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */ + *seconds = -1; + *percent = -1; + + while ((dent = readdir(dirp)) != NULL) { + const char *name = dent->d_name; + SDL_bool choose = SDL_FALSE; + char str[64]; + SDL_PowerState st; + int secs; + int pct; + + if ((SDL_strcmp(name, ".") == 0) || (SDL_strcmp(name, "..") == 0)) { + continue; /* skip these, of course. */ + } else if (!read_power_file(base, name, "type", str, sizeof (str))) { + continue; /* Don't know _what_ we're looking at. Give up on it. */ + } else if (SDL_strcmp(str, "Battery\n") != 0) { + continue; /* we don't care about UPS and such. */ + } + + /* some drivers don't offer this, so if it's not explicitly reported assume it's present. */ + if (read_power_file(base, name, "present", str, sizeof (str)) && (SDL_strcmp(str, "0\n") == 0)) { + st = SDL_POWERSTATE_NO_BATTERY; + } else if (!read_power_file(base, name, "status", str, sizeof (str))) { + st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ + } else if (SDL_strcmp(str, "Charging\n") == 0) { + st = SDL_POWERSTATE_CHARGING; + } else if (SDL_strcmp(str, "Discharging\n") == 0) { + st = SDL_POWERSTATE_ON_BATTERY; + } else if ((SDL_strcmp(str, "Full\n") == 0) || (SDL_strcmp(str, "Not charging\n") == 0)) { + st = SDL_POWERSTATE_CHARGED; + } else { + st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ + } + + if (!read_power_file(base, name, "capacity", str, sizeof (str))) { + pct = -1; + } else { + pct = SDL_atoi(str); + pct = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + + if (!read_power_file(base, name, "time_to_empty_now", str, sizeof (str))) { + secs = -1; + } else { + secs = SDL_atoi(str); + secs = (secs <= 0) ? -1 : secs; /* 0 == unknown */ + } + + /* + * We pick the battery that claims to have the most minutes left. + * (failing a report of minutes, we'll take the highest percent.) + */ + if ((secs < 0) && (*seconds < 0)) { + if ((pct < 0) && (*percent < 0)) { + choose = SDL_TRUE; /* at least we know there's a battery. */ + } else if (pct > *percent) { + choose = SDL_TRUE; + } + } else if (secs > *seconds) { + choose = SDL_TRUE; + } + + if (choose) { + *seconds = secs; + *percent = pct; + *state = st; + } + } + + closedir(dirp); + return SDL_TRUE; /* don't look any further. */ +} + #endif /* SDL_POWER_LINUX */ #endif /* SDL_POWER_DISABLED */ diff --git a/libs/SDL2/src/power/macosx/SDL_syspower.c b/libs/SDL2/src/power/macosx/SDL_syspower.c index 9bcacafd..d029de5d 100644 --- a/libs/SDL2/src/power/macosx/SDL_syspower.c +++ b/libs/SDL2/src/power/macosx/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,13 +23,13 @@ #ifndef SDL_POWER_DISABLED #if SDL_POWER_MACOSX -#include +#include #include #include #include "SDL_power.h" -/* Carbon is so verbose... */ +/* CoreFoundation is so verbose... */ #define STRMATCH(a,b) (CFStringCompare(a, b, 0) == kCFCompareEqualTo) #define GETVAL(k,v) \ CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **) v) diff --git a/libs/SDL2/src/power/psp/SDL_syspower.c b/libs/SDL2/src/power/psp/SDL_syspower.c index b28a68cf..55011080 100644 --- a/libs/SDL2/src/power/psp/SDL_syspower.c +++ b/libs/SDL2/src/power/psp/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/power/uikit/SDL_syspower.h b/libs/SDL2/src/power/uikit/SDL_syspower.h index 581c358d..7b0e5242 100644 --- a/libs/SDL2/src/power/uikit/SDL_syspower.h +++ b/libs/SDL2/src/power/uikit/SDL_syspower.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/power/uikit/SDL_syspower.m b/libs/SDL2/src/power/uikit/SDL_syspower.m index 60c42745..2851c109 100644 --- a/libs/SDL2/src/power/uikit/SDL_syspower.m +++ b/libs/SDL2/src/power/uikit/SDL_syspower.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,24 +50,24 @@ SDL_UIKit_UpdateBatteryMonitoring(void) SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent) { - UIDevice *uidev = [UIDevice currentDevice]; + @autoreleasepool { + UIDevice *uidev = [UIDevice currentDevice]; - if (!SDL_UIKitLastPowerInfoQuery) { - SDL_assert([uidev isBatteryMonitoringEnabled] == NO); - [uidev setBatteryMonitoringEnabled:YES]; - } + if (!SDL_UIKitLastPowerInfoQuery) { + SDL_assert(uidev.isBatteryMonitoringEnabled == NO); + uidev.batteryMonitoringEnabled = YES; + } - /* UIKit_GL_SwapWindow() (etc) will check this and disable the battery - * monitoring if the app hasn't queried it in the last X seconds. - * Apparently monitoring the battery burns battery life. :) - * Apple's docs say not to monitor the battery unless you need it. - */ - SDL_UIKitLastPowerInfoQuery = SDL_GetTicks(); + /* UIKit_GL_SwapWindow() (etc) will check this and disable the battery + * monitoring if the app hasn't queried it in the last X seconds. + * Apparently monitoring the battery burns battery life. :) + * Apple's docs say not to monitor the battery unless you need it. + */ + SDL_UIKitLastPowerInfoQuery = SDL_GetTicks(); - *seconds = -1; /* no API to estimate this in UIKit. */ + *seconds = -1; /* no API to estimate this in UIKit. */ - switch ([uidev batteryState]) - { + switch (uidev.batteryState) { case UIDeviceBatteryStateCharging: *state = SDL_POWERSTATE_CHARGING; break; @@ -84,11 +84,12 @@ SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent) default: *state = SDL_POWERSTATE_UNKNOWN; break; - } + } - const float level = [uidev batteryLevel]; - *percent = ( (level < 0.0f) ? -1 : ((int) ((level * 100) + 0.5f)) ); - return SDL_TRUE; /* always the definitive answer on iOS. */ + const float level = uidev.batteryLevel; + *percent = ( (level < 0.0f) ? -1 : ((int) ((level * 100) + 0.5f)) ); + return SDL_TRUE; /* always the definitive answer on iOS. */ + } } #endif /* SDL_POWER_UIKIT */ diff --git a/libs/SDL2/src/power/windows/SDL_syspower.c b/libs/SDL2/src/power/windows/SDL_syspower.c index 0a247ba0..5c9e0240 100644 --- a/libs/SDL2/src/power/windows/SDL_syspower.c +++ b/libs/SDL2/src/power/windows/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/power/winrt/SDL_syspower.cpp b/libs/SDL2/src/power/winrt/SDL_syspower.cpp index 8804aec7..cce6bede 100644 --- a/libs/SDL2/src/power/winrt/SDL_syspower.cpp +++ b/libs/SDL2/src/power/winrt/SDL_syspower.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/SDL_d3dmath.c b/libs/SDL2/src/render/SDL_d3dmath.c index 7c358a1e..058b3af2 100644 --- a/libs/SDL2/src/render/SDL_d3dmath.c +++ b/libs/SDL2/src/render/SDL_d3dmath.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/SDL_d3dmath.h b/libs/SDL2/src/render/SDL_d3dmath.h index aa6c3fff..34a226d5 100644 --- a/libs/SDL2/src/render/SDL_d3dmath.h +++ b/libs/SDL2/src/render/SDL_d3dmath.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/SDL_render.c b/libs/SDL2/src/render/SDL_render.c index 4480d715..f00688b0 100644 --- a/libs/SDL2/src/render/SDL_render.c +++ b/libs/SDL2/src/render/SDL_render.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -165,7 +165,8 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) } } } else if (event->type == SDL_MOUSEMOTION) { - if (renderer->logical_w) { + SDL_Window *window = SDL_GetWindowFromID(event->motion.windowID); + if (renderer->logical_w && window == renderer->window) { event->motion.x -= renderer->viewport.x; event->motion.y -= renderer->viewport.y; event->motion.x = (int)(event->motion.x / renderer->scale.x); @@ -183,7 +184,8 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) } } else if (event->type == SDL_MOUSEBUTTONDOWN || event->type == SDL_MOUSEBUTTONUP) { - if (renderer->logical_w) { + SDL_Window *window = SDL_GetWindowFromID(event->button.windowID); + if (renderer->logical_w && window == renderer->window) { event->button.x -= renderer->viewport.x; event->button.y -= renderer->viewport.y; event->button.x = (int)(event->button.x / renderer->scale.x); @@ -455,7 +457,7 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int if (IsSupportedFormat(renderer, format)) { if (renderer->CreateTexture(renderer, texture) < 0) { SDL_DestroyTexture(texture); - return 0; + return NULL; } } else { texture->native = SDL_CreateTexture(renderer, @@ -820,7 +822,9 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, rect = &full_rect; } - if (texture->yuv) { + if ((rect->w == 0) || (rect->h == 0)) { + return 0; /* nothing to do. */ + } else if (texture->yuv) { return SDL_UpdateTextureYUV(texture, rect, pixels, pitch); } else if (texture->native) { return SDL_UpdateTextureNative(texture, rect, pixels, pitch); @@ -1730,6 +1734,10 @@ SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, SDL_FRect frect; SDL_FPoint fcenter; + if (flip == SDL_FLIP_NONE && angle == 0) { /* fast path when we don't need rotation or flipping */ + return SDL_RenderCopy(renderer, texture, srcrect, dstrect); + } + CHECK_RENDERER_MAGIC(renderer, -1); CHECK_TEXTURE_MAGIC(texture, -1); diff --git a/libs/SDL2/src/render/SDL_sysrender.h b/libs/SDL2/src/render/SDL_sysrender.h index aba4bbb4..9c74ebbe 100644 --- a/libs/SDL2/src/render/SDL_sysrender.h +++ b/libs/SDL2/src/render/SDL_sysrender.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/SDL_yuv_mmx.c b/libs/SDL2/src/render/SDL_yuv_mmx.c index e4ae4acb..f9320bfb 100644 --- a/libs/SDL2/src/render/SDL_yuv_mmx.c +++ b/libs/SDL2/src/render/SDL_yuv_mmx.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/SDL_yuv_sw.c b/libs/SDL2/src/render/SDL_yuv_sw.c index 4bd1856f..a9ad87aa 100644 --- a/libs/SDL2/src/render/SDL_yuv_sw.c +++ b/libs/SDL2/src/render/SDL_yuv_sw.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/SDL_yuv_sw_c.h b/libs/SDL2/src/render/SDL_yuv_sw_c.h index 6b4044b6..3b3a266f 100644 --- a/libs/SDL2/src/render/SDL_yuv_sw_c.h +++ b/libs/SDL2/src/render/SDL_yuv_sw_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/direct3d/SDL_render_d3d.c b/libs/SDL2/src/render/direct3d/SDL_render_d3d.c index d96522e7..910ceb37 100644 --- a/libs/SDL2/src/render/direct3d/SDL_render_d3d.c +++ b/libs/SDL2/src/render/direct3d/SDL_render_d3d.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -843,7 +843,7 @@ D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) HRESULT result; if (texture->staging == NULL) { - result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, texture->usage, + result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, 0, PixelFormatToD3DFMT(texture->format), D3DPOOL_SYSTEMMEM, &texture->staging, NULL); if (FAILED(result)) { @@ -1269,10 +1269,10 @@ D3D_UpdateClipRect(SDL_Renderer * renderer) HRESULT result; IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE); - r.left = rect->x; - r.top = rect->y; - r.right = rect->x + rect->w; - r.bottom = rect->y + rect->h; + r.left = renderer->viewport.x + rect->x; + r.top = renderer->viewport.y + rect->y; + r.right = renderer->viewport.x + rect->x + rect->w; + r.bottom = renderer->viewport.y + rect->y + rect->h; result = IDirect3DDevice9_SetScissorRect(data->device, &r); if (result != D3D_OK) { diff --git a/libs/SDL2/src/render/direct3d11/SDL_render_d3d11.c b/libs/SDL2/src/render/direct3d11/SDL_render_d3d11.c index c8a487a6..78d67144 100644 --- a/libs/SDL2/src/render/direct3d11/SDL_render_d3d11.c +++ b/libs/SDL2/src/render/direct3d11/SDL_render_d3d11.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -1356,7 +1356,7 @@ D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer * renderer) } static int -D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRect, D3D11_RECT * outRect) +D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRect, D3D11_RECT * outRect, BOOL includeViewportOffset) { D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; const int rotation = D3D11_GetRotationForCurrentRenderTarget(renderer); @@ -1366,6 +1366,12 @@ D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRec outRect->right = sdlRect->x + sdlRect->w; outRect->top = sdlRect->y; outRect->bottom = sdlRect->y + sdlRect->h; + if (includeViewportOffset) { + outRect->left += renderer->viewport.x; + outRect->right += renderer->viewport.x; + outRect->top += renderer->viewport.y; + outRect->bottom += renderer->viewport.y; + } break; case DXGI_MODE_ROTATION_ROTATE270: outRect->left = sdlRect->y; @@ -2280,7 +2286,7 @@ D3D11_UpdateClipRect(SDL_Renderer * renderer) ID3D11DeviceContext_RSSetScissorRects(data->d3dContext, 0, NULL); } else { D3D11_RECT scissorRect; - if (D3D11_GetViewportAlignedD3DRect(renderer, &renderer->clip_rect, &scissorRect) != 0) { + if (D3D11_GetViewportAlignedD3DRect(renderer, &renderer->clip_rect, &scissorRect, TRUE) != 0) { /* D3D11_GetViewportAlignedD3DRect will have set the SDL error */ return -1; } @@ -2869,7 +2875,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, } /* Copy the desired portion of the back buffer to the staging texture: */ - if (D3D11_GetViewportAlignedD3DRect(renderer, rect, &srcRect) != 0) { + if (D3D11_GetViewportAlignedD3DRect(renderer, rect, &srcRect, FALSE) != 0) { /* D3D11_GetViewportAlignedD3DRect will have set the SDL error */ goto done; } @@ -2916,7 +2922,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, */ char errorMessage[1024]; SDL_snprintf(errorMessage, sizeof(errorMessage), __FUNCTION__ ", Convert Pixels failed: %s", SDL_GetError()); - SDL_SetError(errorMessage); + SDL_SetError("%s", errorMessage); goto done; } diff --git a/libs/SDL2/src/render/direct3d11/SDL_render_winrt.cpp b/libs/SDL2/src/render/direct3d11/SDL_render_winrt.cpp index 19c060f1..99136662 100644 --- a/libs/SDL2/src/render/direct3d11/SDL_render_winrt.cpp +++ b/libs/SDL2/src/render/direct3d11/SDL_render_winrt.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/direct3d11/SDL_render_winrt.h b/libs/SDL2/src/render/direct3d11/SDL_render_winrt.h index 66a3220d..5c76b70f 100644 --- a/libs/SDL2/src/render/direct3d11/SDL_render_winrt.h +++ b/libs/SDL2/src/render/direct3d11/SDL_render_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/opengl/SDL_glfuncs.h b/libs/SDL2/src/render/opengl/SDL_glfuncs.h index fefbdd26..a9f38c43 100644 --- a/libs/SDL2/src/render/opengl/SDL_glfuncs.h +++ b/libs/SDL2/src/render/opengl/SDL_glfuncs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/opengl/SDL_render_gl.c b/libs/SDL2/src/render/opengl/SDL_render_gl.c index 0c930f35..f5ac96d0 100644 --- a/libs/SDL2/src/render/opengl/SDL_render_gl.c +++ b/libs/SDL2/src/render/opengl/SDL_render_gl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -1046,7 +1046,14 @@ GL_UpdateClipRect(SDL_Renderer * renderer) if (renderer->clipping_enabled) { const SDL_Rect *rect = &renderer->clip_rect; data->glEnable(GL_SCISSOR_TEST); - data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h); + if (renderer->target) { + data->glScissor(renderer->viewport.x + rect->x, renderer->viewport.y + rect->y, rect->w, rect->h); + } else { + int w, h; + + SDL_GetRendererOutputSize(renderer, &w, &h); + data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + } } else { data->glDisable(GL_SCISSOR_TEST); } diff --git a/libs/SDL2/src/render/opengl/SDL_shaders_gl.c b/libs/SDL2/src/render/opengl/SDL_shaders_gl.c index a831890c..f0885523 100644 --- a/libs/SDL2/src/render/opengl/SDL_shaders_gl.c +++ b/libs/SDL2/src/render/opengl/SDL_shaders_gl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/opengl/SDL_shaders_gl.h b/libs/SDL2/src/render/opengl/SDL_shaders_gl.h index 4604f05f..1b2e4a5a 100644 --- a/libs/SDL2/src/render/opengl/SDL_shaders_gl.h +++ b/libs/SDL2/src/render/opengl/SDL_shaders_gl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/opengles/SDL_glesfuncs.h b/libs/SDL2/src/render/opengles/SDL_glesfuncs.h index 6dc197a6..4eb72d6b 100644 --- a/libs/SDL2/src/render/opengles/SDL_glesfuncs.h +++ b/libs/SDL2/src/render/opengles/SDL_glesfuncs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/opengles/SDL_render_gles.c b/libs/SDL2/src/render/opengles/SDL_render_gles.c index 72cce305..21c22bfd 100644 --- a/libs/SDL2/src/render/opengles/SDL_render_gles.c +++ b/libs/SDL2/src/render/opengles/SDL_render_gles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,7 +43,7 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) return; } -#endif /* PANDORA */ +#endif /* SDL_VIDEO_DRIVER_PANDORA */ /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ @@ -55,6 +55,7 @@ static const float inv255f = 1.0f / 255.0f; static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags); static void GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event); +static int GLES_GetOutputSize(SDL_Renderer * renderer, int *w, int *h); static int GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); static int GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, @@ -205,7 +206,7 @@ static int GLES_LoadFunctions(GLES_RenderData * data) do { \ data->func = SDL_GL_GetProcAddress(#func); \ } while ( 0 ); -#endif /* _SDL_NOGETPROCADDR_ */ +#endif /* __SDL_NOGETPROCADDR__ */ #include "SDL_glesfuncs.h" #undef SDL_PROC @@ -219,12 +220,10 @@ GLES_FBOList * GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h) { GLES_FBOList *result = data->framebuffers; - while ((result) && ((result->w != w) || (result->h != h)) ) - { + while ((result) && ((result->w != w) || (result->h != h)) ) { result = result->next; } - if (result == NULL) - { + if (result == NULL) { result = SDL_malloc(sizeof(GLES_FBOList)); result->w = w; result->h = h; @@ -321,6 +320,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) } renderer->WindowEvent = GLES_WindowEvent; + renderer->GetOutputSize = GLES_GetOutputSize; renderer->CreateTexture = GLES_CreateTexture; renderer->UpdateTexture = GLES_UpdateTexture; renderer->LockTexture = GLES_LockTexture; @@ -438,6 +438,13 @@ GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } +static int +GLES_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +{ + SDL_GL_GetDrawableSize(renderer->window, w, h); + return 0; +} + static SDL_INLINE int power_of_2(int input) { @@ -563,8 +570,9 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, GLES_ActivateRenderer(renderer); /* Bail out if we're supposed to update an empty rectangle */ - if (rect->w <= 0 || rect->h <= 0) + if (rect->w <= 0 || rect->h <= 0) { return 0; + } /* Reformat the texture data into a tightly packed array */ srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format); @@ -599,8 +607,7 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, src); SDL_free(blob); - if (renderdata->glGetError() != GL_NO_ERROR) - { + if (renderdata->glGetError() != GL_NO_ERROR) { return SDL_SetError("Failed to update texture"); } return 0; @@ -641,7 +648,7 @@ GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) GLenum status; GLES_ActivateRenderer(renderer); - + if (!data->GL_OES_framebuffer_object_supported) { return SDL_SetError("Can't enable render target support in this renderer"); } @@ -673,8 +680,16 @@ GLES_UpdateViewport(SDL_Renderer * renderer) return 0; } - data->glViewport(renderer->viewport.x, renderer->viewport.y, - renderer->viewport.w, renderer->viewport.h); + if (renderer->target) { + data->glViewport(renderer->viewport.x, renderer->viewport.y, + renderer->viewport.w, renderer->viewport.h); + } else { + int w, h; + + SDL_GetRendererOutputSize(renderer, &w, &h); + data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h), + renderer->viewport.w, renderer->viewport.h); + } if (renderer->viewport.w && renderer->viewport.h) { data->glMatrixMode(GL_PROJECTION); @@ -700,7 +715,14 @@ GLES_UpdateClipRect(SDL_Renderer * renderer) if (renderer->clipping_enabled) { const SDL_Rect *rect = &renderer->clip_rect; data->glEnable(GL_SCISSOR_TEST); - data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h); + if (renderer->target) { + data->glScissor(renderer->viewport.x + rect->x, renderer->viewport.y + rect->y, rect->w, rect->h); + } else { + int w, h; + + SDL_GetRendererOutputSize(renderer, &w, &h); + data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + } } else { data->glDisable(GL_SCISSOR_TEST); } @@ -1197,8 +1219,12 @@ static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, floa data->glEnable(GL_TEXTURE_2D); data->glBindTexture(texturedata->type, texturedata->texture); - if(texw) *texw = (float)texturedata->texw; - if(texh) *texh = (float)texturedata->texh; + if (texw) { + *texw = (float)texturedata->texw; + } + if (texh) { + *texh = (float)texturedata->texh; + } return 0; } diff --git a/libs/SDL2/src/render/opengles2/SDL_gles2funcs.h b/libs/SDL2/src/render/opengles2/SDL_gles2funcs.h index 105da61e..36dcf742 100644 --- a/libs/SDL2/src/render/opengles2/SDL_gles2funcs.h +++ b/libs/SDL2/src/render/opengles2/SDL_gles2funcs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/opengles2/SDL_render_gles2.c b/libs/SDL2/src/render/opengles2/SDL_render_gles2.c index 71ee7081..7254cb7a 100644 --- a/libs/SDL2/src/render/opengles2/SDL_render_gles2.c +++ b/libs/SDL2/src/render/opengles2/SDL_render_gles2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -224,8 +224,7 @@ GL_ClearErrors(SDL_Renderer *renderer) { GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata; - if (!data->debug_enabled) - { + if (!data->debug_enabled) { return; } while (data->glGetError() != GL_NO_ERROR) { @@ -239,8 +238,7 @@ GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata; int ret = 0; - if (!data->debug_enabled) - { + if (!data->debug_enabled) { return 0; } /* check gl errors (can return multiple errors) */ @@ -302,7 +300,7 @@ static int GLES2_LoadFunctions(GLES2_DriverContext * data) return SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \ } \ } while ( 0 ); -#endif /* _SDL_NOGETPROCADDR_ */ +#endif /* __SDL_NOGETPROCADDR__ */ #include "SDL_gles2funcs.h" #undef SDL_PROC @@ -313,12 +311,10 @@ GLES2_FBOList * GLES2_GetFBO(GLES2_DriverContext *data, Uint32 w, Uint32 h) { GLES2_FBOList *result = data->framebuffers; - while ((result) && ((result->w != w) || (result->h != h)) ) - { + while ((result) && ((result->w != w) || (result->h != h)) ) { result = result->next; } - if (result == NULL) - { + if (result == NULL) { result = SDL_malloc(sizeof(GLES2_FBOList)); result->w = w; result->h = h; @@ -369,6 +365,13 @@ GLES2_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } +static int +GLES2_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +{ + SDL_GL_GetDrawableSize(renderer->window, w, h); + return 0; +} + static int GLES2_UpdateViewport(SDL_Renderer * renderer) { @@ -379,8 +382,16 @@ GLES2_UpdateViewport(SDL_Renderer * renderer) return 0; } - data->glViewport(renderer->viewport.x, renderer->viewport.y, - renderer->viewport.w, renderer->viewport.h); + if (renderer->target) { + data->glViewport(renderer->viewport.x, renderer->viewport.y, + renderer->viewport.w, renderer->viewport.h); + } else { + int w, h; + + SDL_GetRendererOutputSize(renderer, &w, &h); + data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h), + renderer->viewport.w, renderer->viewport.h); + } if (data->current_program) { GLES2_SetOrthographicProjection(renderer); @@ -401,7 +412,14 @@ GLES2_UpdateClipRect(SDL_Renderer * renderer) if (renderer->clipping_enabled) { const SDL_Rect *rect = &renderer->clip_rect; data->glEnable(GL_SCISSOR_TEST); - data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h); + if (renderer->target) { + data->glScissor(renderer->viewport.x + rect->x, renderer->viewport.y + rect->y, rect->w, rect->h); + } else { + int w, h; + + SDL_GetRendererOutputSize(renderer, &w, &h); + data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + } } else { data->glDisable(GL_SCISSOR_TEST); } @@ -421,8 +439,7 @@ GLES2_DestroyRenderer(SDL_Renderer *renderer) GLES2_ShaderCacheEntry *entry; GLES2_ShaderCacheEntry *next; entry = data->shader_cache.head; - while (entry) - { + while (entry) { data->glDeleteShader(entry->id); next = entry->next; SDL_free(entry); @@ -670,8 +687,9 @@ GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect GLES2_ActivateRenderer(renderer); /* Bail out if we're supposed to update an empty rectangle */ - if (rect->w <= 0 || rect->h <= 0) + if (rect->w <= 0 || rect->h <= 0) { return 0; + } /* Create a texture subimage with the supplied data */ data->glBindTexture(tdata->texture_type, tdata->texture); @@ -748,8 +766,9 @@ GLES2_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, GLES2_ActivateRenderer(renderer); /* Bail out if we're supposed to update an empty rectangle */ - if (rect->w <= 0 || rect->h <= 0) + if (rect->w <= 0 || rect->h <= 0) { return 0; + } data->glBindTexture(tdata->texture_type, tdata->texture_v); GLES2_TexSubImage2D(data, tdata->texture_type, @@ -845,8 +864,7 @@ GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) GLES2_ActivateRenderer(renderer); /* Destroy the texture */ - if (tdata) - { + if (tdata) { data->glDeleteTextures(1, &tdata->texture); if (tdata->texture_v) { data->glDeleteTextures(1, &tdata->texture_v); @@ -885,20 +903,20 @@ GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex, /* Check if we've already cached this program */ entry = data->program_cache.head; - while (entry) - { - if (entry->vertex_shader == vertex && entry->fragment_shader == fragment) + while (entry) { + if (entry->vertex_shader == vertex && entry->fragment_shader == fragment) { break; + } entry = entry->next; } - if (entry) - { - if (data->program_cache.head != entry) - { - if (entry->next) + if (entry) { + if (data->program_cache.head != entry) { + if (entry->next) { entry->next->prev = entry->prev; - if (entry->prev) + } + if (entry->prev) { entry->prev->next = entry->next; + } entry->prev = NULL; entry->next = data->program_cache.head; data->program_cache.head->prev = entry; @@ -909,8 +927,7 @@ GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex, /* Create a program cache entry */ entry = (GLES2_ProgramCacheEntry *)SDL_calloc(1, sizeof(GLES2_ProgramCacheEntry)); - if (!entry) - { + if (!entry) { SDL_OutOfMemory(); return NULL; } @@ -928,8 +945,7 @@ GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex, data->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_CENTER, "a_center"); data->glLinkProgram(entry->id); data->glGetProgramiv(entry->id, GL_LINK_STATUS, &linkSuccessful); - if (!linkSuccessful) - { + if (!linkSuccessful) { data->glDeleteProgram(entry->id); SDL_free(entry); SDL_SetError("Failed to link shader program"); @@ -962,13 +978,10 @@ GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex, data->glUniform4f(entry->uniform_locations[GLES2_UNIFORM_COLOR], 1.0f, 1.0f, 1.0f, 1.0f); /* Cache the linked program */ - if (data->program_cache.head) - { + if (data->program_cache.head) { entry->next = data->program_cache.head; data->program_cache.head->prev = entry; - } - else - { + } else { data->program_cache.tail = entry; } data->program_cache.head = entry; @@ -979,14 +992,15 @@ GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex, ++fragment->references; /* Evict the last entry from the cache if we exceed the limit */ - if (data->program_cache.count > GLES2_MAX_CACHED_PROGRAMS) - { + if (data->program_cache.count > GLES2_MAX_CACHED_PROGRAMS) { shaderEntry = data->program_cache.tail->vertex_shader; - if (--shaderEntry->references <= 0) + if (--shaderEntry->references <= 0) { GLES2_EvictShader(renderer, shaderEntry); + } shaderEntry = data->program_cache.tail->fragment_shader; - if (--shaderEntry->references <= 0) + if (--shaderEntry->references <= 0) { GLES2_EvictShader(renderer, shaderEntry); + } data->glDeleteProgram(data->program_cache.tail->id); data->program_cache.tail = data->program_cache.tail->prev; SDL_free(data->program_cache.tail->next); @@ -1008,47 +1022,43 @@ GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, SDL_BlendMode b /* Find the corresponding shader */ shader = GLES2_GetShader(type, blendMode); - if (!shader) - { + if (!shader) { SDL_SetError("No shader matching the requested characteristics was found"); return NULL; } /* Find a matching shader instance that's supported on this hardware */ - for (i = 0; i < shader->instance_count && !instance; ++i) - { - for (j = 0; j < data->shader_format_count && !instance; ++j) - { - if (!shader->instances) + for (i = 0; i < shader->instance_count && !instance; ++i) { + for (j = 0; j < data->shader_format_count && !instance; ++j) { + if (!shader->instances[i]) { continue; - if (!shader->instances[i]) - continue; - if (shader->instances[i]->format != data->shader_formats[j]) + } + if (shader->instances[i]->format != data->shader_formats[j]) { continue; + } instance = shader->instances[i]; } } - if (!instance) - { + if (!instance) { SDL_SetError("The specified shader cannot be loaded on the current platform"); return NULL; } /* Check if we've already cached this shader */ entry = data->shader_cache.head; - while (entry) - { - if (entry->instance == instance) + while (entry) { + if (entry->instance == instance) { break; + } entry = entry->next; } - if (entry) + if (entry) { return entry; + } /* Create a shader cache entry */ entry = (GLES2_ShaderCacheEntry *)SDL_calloc(1, sizeof(GLES2_ShaderCacheEntry)); - if (!entry) - { + if (!entry) { SDL_OutOfMemory(); return NULL; } @@ -1057,19 +1067,15 @@ GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, SDL_BlendMode b /* Compile or load the selected shader instance */ entry->id = data->glCreateShader(instance->type); - if (instance->format == (GLenum)-1) - { + if (instance->format == (GLenum)-1) { data->glShaderSource(entry->id, 1, (const char **)&instance->data, NULL); data->glCompileShader(entry->id); data->glGetShaderiv(entry->id, GL_COMPILE_STATUS, &compileSuccessful); - } - else - { + } else { data->glShaderBinary(1, &entry->id, instance->format, instance->data, instance->length); compileSuccessful = GL_TRUE; } - if (!compileSuccessful) - { + if (!compileSuccessful) { char *info = NULL; int length = 0; @@ -1092,8 +1098,7 @@ GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, SDL_BlendMode b } /* Link the shader entry in at the front of the cache */ - if (data->shader_cache.head) - { + if (data->shader_cache.head) { entry->next = data->shader_cache.head; data->shader_cache.head->prev = entry; } @@ -1108,12 +1113,15 @@ GLES2_EvictShader(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *entry) GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata; /* Unlink the shader from the cache */ - if (entry->next) + if (entry->next) { entry->next->prev = entry->prev; - if (entry->prev) + } + if (entry->prev) { entry->prev->next = entry->next; - if (data->shader_cache.head == entry) + } + if (data->shader_cache.head == entry) { data->shader_cache.head = entry->next; + } --data->shader_cache.count; /* Deallocate the shader */ @@ -1132,8 +1140,7 @@ GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source, SDL_BlendM /* Select an appropriate shader pair for the specified modes */ vtype = GLES2_SHADER_VERTEX_DEFAULT; - switch (source) - { + switch (source) { case GLES2_IMAGESOURCE_SOLID: ftype = GLES2_SHADER_FRAGMENT_SOLID_SRC; break; @@ -1164,22 +1171,26 @@ GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source, SDL_BlendM /* Load the requested shaders */ vertex = GLES2_CacheShader(renderer, vtype, blendMode); - if (!vertex) + if (!vertex) { goto fault; + } fragment = GLES2_CacheShader(renderer, ftype, blendMode); - if (!fragment) + if (!fragment) { goto fault; + } /* Check if we need to change programs at all */ if (data->current_program && data->current_program->vertex_shader == vertex && - data->current_program->fragment_shader == fragment) + data->current_program->fragment_shader == fragment) { return 0; + } /* Generate a matching program */ program = GLES2_CacheProgram(renderer, vertex, fragment, blendMode); - if (!program) + if (!program) { goto fault; + } /* Select that program in OpenGL */ data->glUseProgram(program->id); @@ -1188,16 +1199,19 @@ GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source, SDL_BlendM data->current_program = program; /* Activate an orthographic projection */ - if (GLES2_SetOrthographicProjection(renderer) < 0) + if (GLES2_SetOrthographicProjection(renderer) < 0) { goto fault; + } /* Clean up and return */ return 0; fault: - if (vertex && vertex->references <= 0) + if (vertex && vertex->references <= 0) { GLES2_EvictShader(renderer, vertex); - if (fragment && fragment->references <= 0) + } + if (fragment && fragment->references <= 0) { GLES2_EvictShader(renderer, fragment); + } data->current_program = NULL; return -1; } @@ -1412,8 +1426,9 @@ GLES2_UpdateVertexBuffer(SDL_Renderer *renderer, GLES2_Attribute attr, #if !SDL_GLES2_USE_VBOS data->glVertexAttribPointer(attr, attr == GLES2_ATTRIBUTE_ANGLE ? 1 : 2, GL_FLOAT, GL_FALSE, 0, vertexData); #else - if (!data->vertex_buffers[attr]) + if (!data->vertex_buffers[attr]) { data->glGenBuffers(1, &data->vertex_buffers[attr]); + } data->glBindBuffer(GL_ARRAY_BUFFER, data->vertex_buffers[attr]); @@ -1541,58 +1556,53 @@ GLES2_SetupCopy(SDL_Renderer *renderer, SDL_Texture *texture) if (renderer->target) { /* Check if we need to do color mapping between the source and render target textures */ if (renderer->target->format != texture->format) { - switch (texture->format) - { + switch (texture->format) { case SDL_PIXELFORMAT_ARGB8888: - switch (renderer->target->format) - { - case SDL_PIXELFORMAT_ABGR8888: - case SDL_PIXELFORMAT_BGR888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; - break; - case SDL_PIXELFORMAT_RGB888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; - break; + switch (renderer->target->format) { + case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; } break; case SDL_PIXELFORMAT_ABGR8888: - switch (renderer->target->format) - { - case SDL_PIXELFORMAT_ARGB8888: - case SDL_PIXELFORMAT_RGB888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; - break; - case SDL_PIXELFORMAT_BGR888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; - break; + switch (renderer->target->format) { + case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; } break; case SDL_PIXELFORMAT_RGB888: - switch (renderer->target->format) - { - case SDL_PIXELFORMAT_ABGR8888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; - break; - case SDL_PIXELFORMAT_ARGB8888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; - break; - case SDL_PIXELFORMAT_BGR888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; - break; + switch (renderer->target->format) { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; } break; case SDL_PIXELFORMAT_BGR888: - switch (renderer->target->format) - { - case SDL_PIXELFORMAT_ABGR8888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; - break; - case SDL_PIXELFORMAT_ARGB8888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; - break; - case SDL_PIXELFORMAT_RGB888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; - break; + switch (renderer->target->format) { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; } break; case SDL_PIXELFORMAT_IYUV: @@ -1608,11 +1618,11 @@ GLES2_SetupCopy(SDL_Renderer *renderer, SDL_Texture *texture) default: return SDL_SetError("Unsupported texture format"); } + } else { + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */ } - else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */ } else { - switch (texture->format) - { + switch (texture->format) { case SDL_PIXELFORMAT_ARGB8888: sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; break; @@ -1877,8 +1887,12 @@ static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, flo data->glBindTexture(texturedata->texture_type, texturedata->texture); - if(texw) *texw = 1.0; - if(texh) *texh = 1.0; + if (texw) { + *texw = 1.0; + } + if (texh) { + *texh = 1.0; + } return 0; } @@ -2034,12 +2048,12 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) #else /* !ZUNE_HD */ data->glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &nFormats); data->glGetBooleanv(GL_SHADER_COMPILER, &hasCompiler); - if (hasCompiler) + if (hasCompiler) { ++nFormats; + } #endif /* ZUNE_HD */ data->shader_formats = (GLenum *)SDL_calloc(nFormats, sizeof(GLenum)); - if (!data->shader_formats) - { + if (!data->shader_formats) { GLES2_DestroyRenderer(renderer); SDL_OutOfMemory(); goto error; @@ -2049,8 +2063,9 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) data->shader_formats[0] = GL_NVIDIA_PLATFORM_BINARY_NV; #else /* !ZUNE_HD */ data->glGetIntegerv(GL_SHADER_BINARY_FORMATS, (GLint *)data->shader_formats); - if (hasCompiler) + if (hasCompiler) { data->shader_formats[nFormats - 1] = (GLenum)-1; + } #endif /* ZUNE_HD */ data->framebuffers = NULL; @@ -2059,6 +2074,7 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) /* Populate the function pointers for the module */ renderer->WindowEvent = &GLES2_WindowEvent; + renderer->GetOutputSize = &GLES2_GetOutputSize; renderer->CreateTexture = &GLES2_CreateTexture; renderer->UpdateTexture = &GLES2_UpdateTexture; renderer->UpdateTextureYUV = &GLES2_UpdateTextureYUV; diff --git a/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.c b/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.c index 48040f96..6f650811 100644 --- a/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.c +++ b/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -810,13 +810,11 @@ static GLES2_Shader GLES2_FragmentShader_TextureNV21Src = { const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode) { - switch (type) - { + switch (type) { case GLES2_SHADER_VERTEX_DEFAULT: return &GLES2_VertexShader_Default; case GLES2_SHADER_FRAGMENT_SOLID_SRC: - switch (blendMode) - { + switch (blendMode) { case SDL_BLENDMODE_NONE: return &GLES2_FragmentShader_None_SolidSrc; case SDL_BLENDMODE_BLEND: @@ -829,8 +827,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo return NULL; } case GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC: - switch (blendMode) - { + switch (blendMode) { case SDL_BLENDMODE_NONE: return &GLES2_FragmentShader_None_TextureABGRSrc; case SDL_BLENDMODE_BLEND: @@ -843,8 +840,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo return NULL; } case GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC: - switch (blendMode) - { + switch (blendMode) { case SDL_BLENDMODE_NONE: return &GLES2_FragmentShader_None_TextureARGBSrc; case SDL_BLENDMODE_BLEND: @@ -858,8 +854,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo } case GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC: - switch (blendMode) - { + switch (blendMode) { case SDL_BLENDMODE_NONE: return &GLES2_FragmentShader_None_TextureRGBSrc; case SDL_BLENDMODE_BLEND: @@ -873,8 +868,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo } case GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC: - switch (blendMode) - { + switch (blendMode) { case SDL_BLENDMODE_NONE: return &GLES2_FragmentShader_None_TextureBGRSrc; case SDL_BLENDMODE_BLEND: diff --git a/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.h b/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.h index d68f7d05..f22c8f56 100644 --- a/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.h +++ b/libs/SDL2/src/render/opengles2/SDL_shaders_gles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/psp/SDL_render_psp.c b/libs/SDL2/src/render/psp/SDL_render_psp.c index cdd13e82..39a2eab6 100644 --- a/libs/SDL2/src/render/psp/SDL_render_psp.c +++ b/libs/SDL2/src/render/psp/SDL_render_psp.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -459,7 +459,7 @@ static int PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { /* PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; */ - PSP_TextureData* psp_texture = (PSP_TextureData*) SDL_calloc(1, sizeof(*psp_texture));; + PSP_TextureData* psp_texture = (PSP_TextureData*) SDL_calloc(1, sizeof(*psp_texture)); if(!psp_texture) return -1; diff --git a/libs/SDL2/src/render/software/SDL_blendfillrect.c b/libs/SDL2/src/render/software/SDL_blendfillrect.c index cb184d63..669422f7 100644 --- a/libs/SDL2/src/render/software/SDL_blendfillrect.c +++ b/libs/SDL2/src/render/software/SDL_blendfillrect.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_blendfillrect.h b/libs/SDL2/src/render/software/SDL_blendfillrect.h index 297c839e..b612db24 100644 --- a/libs/SDL2/src/render/software/SDL_blendfillrect.h +++ b/libs/SDL2/src/render/software/SDL_blendfillrect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_blendline.c b/libs/SDL2/src/render/software/SDL_blendline.c index 02d748d5..b2090b13 100644 --- a/libs/SDL2/src/render/software/SDL_blendline.c +++ b/libs/SDL2/src/render/software/SDL_blendline.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_blendline.h b/libs/SDL2/src/render/software/SDL_blendline.h index 14a7c18a..602cafd6 100644 --- a/libs/SDL2/src/render/software/SDL_blendline.h +++ b/libs/SDL2/src/render/software/SDL_blendline.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_blendpoint.c b/libs/SDL2/src/render/software/SDL_blendpoint.c index dab13560..47243794 100644 --- a/libs/SDL2/src/render/software/SDL_blendpoint.c +++ b/libs/SDL2/src/render/software/SDL_blendpoint.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_blendpoint.h b/libs/SDL2/src/render/software/SDL_blendpoint.h index 72eaf7b8..7045326a 100644 --- a/libs/SDL2/src/render/software/SDL_blendpoint.h +++ b/libs/SDL2/src/render/software/SDL_blendpoint.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_draw.h b/libs/SDL2/src/render/software/SDL_draw.h index 2bd8f94c..e2822427 100644 --- a/libs/SDL2/src/render/software/SDL_draw.h +++ b/libs/SDL2/src/render/software/SDL_draw.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_drawline.c b/libs/SDL2/src/render/software/SDL_drawline.c index 1ff84a46..e76c3f40 100644 --- a/libs/SDL2/src/render/software/SDL_drawline.c +++ b/libs/SDL2/src/render/software/SDL_drawline.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_drawline.h b/libs/SDL2/src/render/software/SDL_drawline.h index e3378ae8..e2dafeae 100644 --- a/libs/SDL2/src/render/software/SDL_drawline.h +++ b/libs/SDL2/src/render/software/SDL_drawline.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_drawpoint.c b/libs/SDL2/src/render/software/SDL_drawpoint.c index 3f2de86c..38ea4b74 100644 --- a/libs/SDL2/src/render/software/SDL_drawpoint.c +++ b/libs/SDL2/src/render/software/SDL_drawpoint.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_drawpoint.h b/libs/SDL2/src/render/software/SDL_drawpoint.h index 96933d61..d26c2b58 100644 --- a/libs/SDL2/src/render/software/SDL_drawpoint.h +++ b/libs/SDL2/src/render/software/SDL_drawpoint.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_render_sw.c b/libs/SDL2/src/render/software/SDL_render_sw.c index 37f42f07..119b2001 100644 --- a/libs/SDL2/src/render/software/SDL_render_sw.c +++ b/libs/SDL2/src/render/software/SDL_render_sw.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -253,6 +253,12 @@ static int SW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + /* If the color mod is ever enabled (non-white), permanently disable RLE (which doesn't support + * color mod) to avoid potentially frequent RLE encoding/decoding. + */ + if ((texture->r & texture->g & texture->b) != 255) { + SDL_SetSurfaceRLE(surface, 0); + } return SDL_SetSurfaceColorMod(surface, texture->r, texture->g, texture->b); } @@ -261,6 +267,12 @@ static int SW_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + /* If the texture ever has multiple alpha values (surface alpha plus alpha channel), permanently + * disable RLE (which doesn't support this) to avoid potentially frequent RLE encoding/decoding. + */ + if (texture->a != 255 && surface->format->Amask) { + SDL_SetSurfaceRLE(surface, 0); + } return SDL_SetSurfaceAlphaMod(surface, texture->a); } @@ -268,6 +280,12 @@ static int SW_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + /* If add or mod blending are ever enabled, permanently disable RLE (which doesn't support + * them) to avoid potentially frequent RLE encoding/decoding. + */ + if ((texture->blendMode == SDL_BLENDMODE_ADD || texture->blendMode == SDL_BLENDMODE_MOD)) { + SDL_SetSurfaceRLE(surface, 0); + } return SDL_SetSurfaceBlendMode(surface, texture->blendMode); } @@ -553,6 +571,10 @@ SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, if ( srcrect->w == final_rect.w && srcrect->h == final_rect.h ) { return SDL_BlitSurface(src, srcrect, surface, &final_rect); } else { + /* If scaling is ever done, permanently disable RLE (which doesn't support scaling) + * to avoid potentially frequent RLE encoding/decoding. + */ + SDL_SetSurfaceRLE(surface, 0); return SDL_BlitScaled(src, srcrect, surface, &final_rect); } } @@ -578,7 +600,6 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Surface *src = (SDL_Surface *) texture->driverdata; SDL_Rect final_rect, tmp_rect; SDL_Surface *surface_rotated, *surface_scaled; - Uint32 colorkey; int retval, dstwidth, dstheight, abscenterx, abscentery; double cangle, sangle, px, py, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y; @@ -596,66 +617,113 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, final_rect.w = (int)dstrect->w; final_rect.h = (int)dstrect->h; - surface_scaled = SDL_CreateRGBSurface(SDL_SWSURFACE, final_rect.w, final_rect.h, src->format->BitsPerPixel, - src->format->Rmask, src->format->Gmask, - src->format->Bmask, src->format->Amask ); - if (surface_scaled) { - SDL_GetColorKey(src, &colorkey); - SDL_SetColorKey(surface_scaled, SDL_TRUE, colorkey); - tmp_rect = final_rect; - tmp_rect.x = 0; - tmp_rect.y = 0; + /* SDLgfx_rotateSurface doesn't accept a source rectangle, so crop and scale if we need to */ + tmp_rect = final_rect; + tmp_rect.x = 0; + tmp_rect.y = 0; + if (srcrect->w == final_rect.w && srcrect->h == final_rect.h && srcrect->x == 0 && srcrect->y == 0) { + surface_scaled = src; /* but if we don't need to, just use the original */ + retval = 0; + } else { + SDL_Surface *blit_src = src; + Uint32 colorkey; + SDL_BlendMode blendMode; + Uint8 alphaMod, r, g, b; + SDL_bool cloneSource = SDL_FALSE; - retval = SDL_BlitScaled(src, srcrect, surface_scaled, &tmp_rect); - if (!retval) { - SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, -angle, &dstwidth, &dstheight, &cangle, &sangle); - surface_rotated = SDLgfx_rotateSurface(surface_scaled, -angle, dstwidth/2, dstheight/2, GetScaleQuality(), flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle); - if(surface_rotated) { - /* Find out where the new origin is by rotating the four final_rect points around the center and then taking the extremes */ - abscenterx = final_rect.x + (int)center->x; - abscentery = final_rect.y + (int)center->y; - /* Compensate the angle inversion to match the behaviour of the other backends */ - sangle = -sangle; - - /* Top Left */ - px = final_rect.x - abscenterx; - py = final_rect.y - abscentery; - p1x = px * cangle - py * sangle + abscenterx; - p1y = px * sangle + py * cangle + abscentery; - - /* Top Right */ - px = final_rect.x + final_rect.w - abscenterx; - py = final_rect.y - abscentery; - p2x = px * cangle - py * sangle + abscenterx; - p2y = px * sangle + py * cangle + abscentery; - - /* Bottom Left */ - px = final_rect.x - abscenterx; - py = final_rect.y + final_rect.h - abscentery; - p3x = px * cangle - py * sangle + abscenterx; - p3y = px * sangle + py * cangle + abscentery; - - /* Bottom Right */ - px = final_rect.x + final_rect.w - abscenterx; - py = final_rect.y + final_rect.h - abscentery; - p4x = px * cangle - py * sangle + abscenterx; - p4y = px * sangle + py * cangle + abscentery; - - tmp_rect.x = (int)MIN(MIN(p1x, p2x), MIN(p3x, p4x)); - tmp_rect.y = (int)MIN(MIN(p1y, p2y), MIN(p3y, p4y)); - tmp_rect.w = dstwidth; - tmp_rect.h = dstheight; - - retval = SDL_BlitSurface(surface_rotated, NULL, surface, &tmp_rect); - SDL_FreeSurface(surface_scaled); - SDL_FreeSurface(surface_rotated); - return retval; - } + surface_scaled = SDL_CreateRGBSurface(SDL_SWSURFACE, final_rect.w, final_rect.h, src->format->BitsPerPixel, + src->format->Rmask, src->format->Gmask, + src->format->Bmask, src->format->Amask ); + if (!surface_scaled) { + return -1; + } + + /* copy the color key, alpha mod, blend mode, and color mod so the scaled surface behaves like the source */ + if (SDL_GetColorKey(src, &colorkey) == 0) { + SDL_SetColorKey(surface_scaled, SDL_TRUE, colorkey); + cloneSource = SDL_TRUE; + } + SDL_GetSurfaceAlphaMod(src, &alphaMod); /* these will be copied to surface_scaled below if necessary */ + SDL_GetSurfaceBlendMode(src, &blendMode); + SDL_GetSurfaceColorMod(src, &r, &g, &b); + + /* now we need to blit the src into surface_scaled. since we want to copy the colors from the source to + * surface_scaled rather than blend them, etc. we'll need to disable the blend mode, alpha mod, etc. + * but we don't want to modify src (in case it's being used on other threads), so we'll need to clone it + * before changing the blend options + */ + cloneSource |= blendMode != SDL_BLENDMODE_NONE || (alphaMod & r & g & b) != 255; + if (cloneSource) { + blit_src = SDL_ConvertSurface(src, src->format, src->flags); /* clone src */ + if (!blit_src) { + SDL_FreeSurface(surface_scaled); + return -1; + } + SDL_SetSurfaceAlphaMod(blit_src, 255); /* disable all blending options in blit_src */ + SDL_SetSurfaceBlendMode(blit_src, SDL_BLENDMODE_NONE); + SDL_SetColorKey(blit_src, 0, 0); + SDL_SetSurfaceColorMod(blit_src, 255, 255, 255); + SDL_SetSurfaceRLE(blit_src, 0); /* don't RLE encode a surface we'll only use once */ + + SDL_SetSurfaceAlphaMod(surface_scaled, alphaMod); /* copy blending options to surface_scaled */ + SDL_SetSurfaceBlendMode(surface_scaled, blendMode); + SDL_SetSurfaceColorMod(surface_scaled, r, g, b); + } + + retval = SDL_BlitScaled(blit_src, srcrect, surface_scaled, &tmp_rect); + if (blit_src != src) { + SDL_FreeSurface(blit_src); } - return retval; } - return -1; + if (!retval) { + SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, -angle, &dstwidth, &dstheight, &cangle, &sangle); + surface_rotated = SDLgfx_rotateSurface(surface_scaled, -angle, dstwidth/2, dstheight/2, GetScaleQuality(), flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle); + if(surface_rotated) { + /* Find out where the new origin is by rotating the four final_rect points around the center and then taking the extremes */ + abscenterx = final_rect.x + (int)center->x; + abscentery = final_rect.y + (int)center->y; + /* Compensate the angle inversion to match the behaviour of the other backends */ + sangle = -sangle; + + /* Top Left */ + px = final_rect.x - abscenterx; + py = final_rect.y - abscentery; + p1x = px * cangle - py * sangle + abscenterx; + p1y = px * sangle + py * cangle + abscentery; + + /* Top Right */ + px = final_rect.x + final_rect.w - abscenterx; + py = final_rect.y - abscentery; + p2x = px * cangle - py * sangle + abscenterx; + p2y = px * sangle + py * cangle + abscentery; + + /* Bottom Left */ + px = final_rect.x - abscenterx; + py = final_rect.y + final_rect.h - abscentery; + p3x = px * cangle - py * sangle + abscenterx; + p3y = px * sangle + py * cangle + abscentery; + + /* Bottom Right */ + px = final_rect.x + final_rect.w - abscenterx; + py = final_rect.y + final_rect.h - abscentery; + p4x = px * cangle - py * sangle + abscenterx; + p4y = px * sangle + py * cangle + abscentery; + + tmp_rect.x = (int)MIN(MIN(p1x, p2x), MIN(p3x, p4x)); + tmp_rect.y = (int)MIN(MIN(p1y, p2y), MIN(p3y, p4y)); + tmp_rect.w = dstwidth; + tmp_rect.h = dstheight; + + retval = SDL_BlitSurface(surface_rotated, NULL, surface, &tmp_rect); + SDL_FreeSurface(surface_rotated); + } + } + + if (surface_scaled != src) { + SDL_FreeSurface(surface_scaled); + } + return retval; } static int diff --git a/libs/SDL2/src/render/software/SDL_render_sw_c.h b/libs/SDL2/src/render/software/SDL_render_sw_c.h index 81cb656c..df1a6473 100644 --- a/libs/SDL2/src/render/software/SDL_render_sw_c.h +++ b/libs/SDL2/src/render/software/SDL_render_sw_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/render/software/SDL_rotate.c b/libs/SDL2/src/render/software/SDL_rotate.c index 0edf784c..8d92758f 100644 --- a/libs/SDL2/src/render/software/SDL_rotate.c +++ b/libs/SDL2/src/render/software/SDL_rotate.c @@ -188,10 +188,8 @@ _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int dy = (sdy >> 16); if (flipx) dx = sw - dx; if (flipy) dy = sh - dy; - if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) { - sp = (tColorRGBA *)src->pixels; - sp += ((src->pitch/4) * dy); - sp += dx; + if ((unsigned)dx < (unsigned)sw && (unsigned)dy < (unsigned)sh) { + sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy) + dx; c00 = *sp; sp += 1; c01 = *sp; @@ -237,14 +235,12 @@ _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { - dx = (short) (sdx >> 16); - dy = (short) (sdy >> 16); - if (flipx) dx = (src->w-1)-dx; - if (flipy) dy = (src->h-1)-dy; - if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { - sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy); - sp += dx; - *pc = *sp; + dx = (sdx >> 16); + dy = (sdy >> 16); + if ((unsigned)dx < (unsigned)src->w && (unsigned)dy < (unsigned)src->h) { + if(flipx) dx = sw - dx; + if(flipy) dy = sh - dy; + *pc = *((tColorRGBA *)((Uint8 *)src->pixels + src->pitch * dy) + dx); } sdx += icos; sdy += isin; @@ -277,7 +273,7 @@ static void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy) { int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay; - tColorY *pc, *sp; + tColorY *pc; int gap; /* @@ -301,14 +297,12 @@ transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { - dx = (short) (sdx >> 16); - dy = (short) (sdy >> 16); - if (flipx) dx = (src->w-1)-dx; - if (flipy) dy = (src->h-1)-dy; - if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { - sp = (tColorY *) (src->pixels); - sp += (src->pitch * dy + dx); - *pc = *sp; + dx = (sdx >> 16); + dy = (sdy >> 16); + if ((unsigned)dx < (unsigned)src->w && (unsigned)dy < (unsigned)src->h) { + if (flipx) dx = (src->w-1)-dx; + if (flipy) dy = (src->h-1)-dy; + *pc = *((tColorY *)src->pixels + src->pitch * dy + dx); } sdx += icos; sdy += isin; @@ -348,7 +342,7 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, SDL_Surface *rz_src; SDL_Surface *rz_dst; int is32bit; - int i, src_converted; + int i; Uint8 r,g,b; Uint32 colorkey = 0; int colorKeyAvailable = 0; @@ -375,27 +369,15 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, * Use source surface 'as is' */ rz_src = src; - src_converted = 0; } else { - /* - * New source surface is 32bit with a defined RGBA ordering - */ - rz_src = - SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, + Uint32 format = SDL_MasksToPixelFormatEnum(32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif - ); - if(colorKeyAvailable) - SDL_SetColorKey(src, 0, 0); - - SDL_BlitSurface(src, NULL, rz_src, NULL); - - if(colorKeyAvailable) - SDL_SetColorKey(src, SDL_TRUE /* SDL_SRCCOLORKEY */, colorkey); - src_converted = 1; + ); + rz_src = SDL_ConvertSurfaceFormat(src, format, src->flags); is32bit = 1; } @@ -480,6 +462,19 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, flipx, flipy); SDL_SetColorKey(rz_dst, /* SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src)); } + + /* copy alpha mod, color mod, and blend mode */ + { + SDL_BlendMode blendMode; + Uint8 alphaMod, cr, cg, cb; + SDL_GetSurfaceAlphaMod(src, &alphaMod); + SDL_GetSurfaceBlendMode(src, &blendMode); + SDL_GetSurfaceColorMod(src, &cr, &cg, &cb); + SDL_SetSurfaceAlphaMod(rz_dst, alphaMod); + SDL_SetSurfaceBlendMode(rz_dst, blendMode); + SDL_SetSurfaceColorMod(rz_dst, cr, cg, cb); + } + /* * Unlock source surface */ @@ -490,7 +485,7 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, /* * Cleanup temp surface */ - if (src_converted) { + if (rz_src != src) { SDL_FreeSurface(rz_src); } diff --git a/libs/SDL2/src/render/software/SDL_rotate.h b/libs/SDL2/src/render/software/SDL_rotate.h index e92c3b77..01ceb2d8 100644 --- a/libs/SDL2/src/render/software/SDL_rotate.h +++ b/libs/SDL2/src/render/software/SDL_rotate.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/stdlib/SDL_getenv.c b/libs/SDL2/src/stdlib/SDL_getenv.c index a2905c45..7936498c 100644 --- a/libs/SDL2/src/stdlib/SDL_getenv.c +++ b/libs/SDL2/src/stdlib/SDL_getenv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/stdlib/SDL_iconv.c b/libs/SDL2/src/stdlib/SDL_iconv.c index fdb5e261..31efb426 100644 --- a/libs/SDL2/src/stdlib/SDL_iconv.c +++ b/libs/SDL2/src/stdlib/SDL_iconv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/stdlib/SDL_malloc.c b/libs/SDL2/src/stdlib/SDL_malloc.c index 71f5f696..996e5d24 100644 --- a/libs/SDL2/src/stdlib/SDL_malloc.c +++ b/libs/SDL2/src/stdlib/SDL_malloc.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/stdlib/SDL_stdlib.c b/libs/SDL2/src/stdlib/SDL_stdlib.c index c2c14212..a488af26 100644 --- a/libs/SDL2/src/stdlib/SDL_stdlib.c +++ b/libs/SDL2/src/stdlib/SDL_stdlib.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -278,8 +278,8 @@ int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : __declspec(selectany) int _fltused = 1; #endif -/* The optimizer on Visual Studio 2010/2012 generates memcpy() calls */ -#if _MSC_VER >= 1600 && defined(_WIN64) && !defined(_DEBUG) +/* The optimizer on Visual Studio 2005 and later generates memcpy() calls */ +#if (_MSC_VER >= 1400) && defined(_WIN64) && !defined(_DEBUG) #include #pragma function(memcpy) diff --git a/libs/SDL2/src/stdlib/SDL_string.c b/libs/SDL2/src/stdlib/SDL_string.c index ce8b2fd2..68d88ece 100644 --- a/libs/SDL2/src/stdlib/SDL_string.c +++ b/libs/SDL2/src/stdlib/SDL_string.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,6 +23,10 @@ #define SDL_DISABLE_ANALYZE_MACROS 1 #endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + #include "../SDL_internal.h" /* This file contains portable string manipulation functions for SDL */ diff --git a/libs/SDL2/src/test/SDL_test_assert.c b/libs/SDL2/src/test/SDL_test_assert.c index 691453f0..12eca146 100644 --- a/libs/SDL2/src/test/SDL_test_assert.c +++ b/libs/SDL2/src/test/SDL_test_assert.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_common.c b/libs/SDL2/src/test/SDL_test_common.c index 4022d20d..2f06a794 100644 --- a/libs/SDL2/src/test/SDL_test_common.c +++ b/libs/SDL2/src/test/SDL_test_common.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -1204,10 +1204,10 @@ SDLTest_PrintEvent(SDL_Event * event) event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure); break; case SDL_DOLLARGESTURE: - SDL_Log("SDL_EVENT: Dollar gesture detect: %"SDL_PRIs64, (long long) event->dgesture.gestureId); + SDL_Log("SDL_EVENT: Dollar gesture detect: %"SDL_PRIs64, (Sint64) event->dgesture.gestureId); break; case SDL_DOLLARRECORD: - SDL_Log("SDL_EVENT: Dollar gesture record: %"SDL_PRIs64, (long long) event->dgesture.gestureId); + SDL_Log("SDL_EVENT: Dollar gesture record: %"SDL_PRIs64, (Sint64) event->dgesture.gestureId); break; case SDL_MULTIGESTURE: SDL_Log("SDL_EVENT: Multi gesture fingers: %d", event->mgesture.numFingers); diff --git a/libs/SDL2/src/test/SDL_test_compare.c b/libs/SDL2/src/test/SDL_test_compare.c index 5fffe416..9f74c44d 100644 --- a/libs/SDL2/src/test/SDL_test_compare.c +++ b/libs/SDL2/src/test/SDL_test_compare.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_crc32.c b/libs/SDL2/src/test/SDL_test_crc32.c index dafe7229..7aa0a68f 100644 --- a/libs/SDL2/src/test/SDL_test_crc32.c +++ b/libs/SDL2/src/test/SDL_test_crc32.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_font.c b/libs/SDL2/src/test/SDL_test_font.c index a6bc40ce..4be29f11 100644 --- a/libs/SDL2/src/test/SDL_test_font.c +++ b/libs/SDL2/src/test/SDL_test_font.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_fuzzer.c b/libs/SDL2/src/test/SDL_test_fuzzer.c index 963fc10b..9fad1785 100644 --- a/libs/SDL2/src/test/SDL_test_fuzzer.c +++ b/libs/SDL2/src/test/SDL_test_fuzzer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,6 +34,7 @@ #define UINT32_MAX ~(Uint32)0 #define UINT64_MAX ~(Uint64)0 #else +#define _GNU_SOURCE #include #endif #include diff --git a/libs/SDL2/src/test/SDL_test_harness.c b/libs/SDL2/src/test/SDL_test_harness.c index 9ad2697f..6dde93f8 100644 --- a/libs/SDL2/src/test/SDL_test_harness.c +++ b/libs/SDL2/src/test/SDL_test_harness.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -484,6 +484,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user if (suiteFilter == 0 && testFilter == 0) { SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter); SDLTest_Log("Exit code: 2"); + SDL_free(failedTests); return 2; } } diff --git a/libs/SDL2/src/test/SDL_test_imageBlit.c b/libs/SDL2/src/test/SDL_test_imageBlit.c index d4c74fb4..1b9ed7bf 100644 --- a/libs/SDL2/src/test/SDL_test_imageBlit.c +++ b/libs/SDL2/src/test/SDL_test_imageBlit.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_imageBlitBlend.c b/libs/SDL2/src/test/SDL_test_imageBlitBlend.c index f849d730..963520bd 100644 --- a/libs/SDL2/src/test/SDL_test_imageBlitBlend.c +++ b/libs/SDL2/src/test/SDL_test_imageBlitBlend.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_imageFace.c b/libs/SDL2/src/test/SDL_test_imageFace.c index 74fa8341..37498d87 100644 --- a/libs/SDL2/src/test/SDL_test_imageFace.c +++ b/libs/SDL2/src/test/SDL_test_imageFace.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_imagePrimitives.c b/libs/SDL2/src/test/SDL_test_imagePrimitives.c index d2aafcbe..5576d3d2 100644 --- a/libs/SDL2/src/test/SDL_test_imagePrimitives.c +++ b/libs/SDL2/src/test/SDL_test_imagePrimitives.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_imagePrimitivesBlend.c b/libs/SDL2/src/test/SDL_test_imagePrimitivesBlend.c index cfe189a0..c8e19930 100644 --- a/libs/SDL2/src/test/SDL_test_imagePrimitivesBlend.c +++ b/libs/SDL2/src/test/SDL_test_imagePrimitivesBlend.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_log.c b/libs/SDL2/src/test/SDL_test_log.c index 6c076aac..ed7139b6 100644 --- a/libs/SDL2/src/test/SDL_test_log.c +++ b/libs/SDL2/src/test/SDL_test_log.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_md5.c b/libs/SDL2/src/test/SDL_test_md5.c index 8467ccbc..291ad6b2 100644 --- a/libs/SDL2/src/test/SDL_test_md5.c +++ b/libs/SDL2/src/test/SDL_test_md5.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/test/SDL_test_random.c b/libs/SDL2/src/test/SDL_test_random.c index bc434183..088c301a 100644 --- a/libs/SDL2/src/test/SDL_test_random.c +++ b/libs/SDL2/src/test/SDL_test_random.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/SDL_systhread.h b/libs/SDL2/src/thread/SDL_systhread.h index 9c9409a5..d3eab1f3 100644 --- a/libs/SDL2/src/thread/SDL_systhread.h +++ b/libs/SDL2/src/thread/SDL_systhread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/SDL_thread.c b/libs/SDL2/src/thread/SDL_thread.c index 3724f4f3..8bc37fac 100644 --- a/libs/SDL2/src/thread/SDL_thread.c +++ b/libs/SDL2/src/thread/SDL_thread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/SDL_thread_c.h b/libs/SDL2/src/thread/SDL_thread_c.h index 85ef5cce..2df71254 100644 --- a/libs/SDL2/src/thread/SDL_thread_c.h +++ b/libs/SDL2/src/thread/SDL_thread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_syscond.c b/libs/SDL2/src/thread/generic/SDL_syscond.c index 64cc6340..6e7f9b33 100644 --- a/libs/SDL2/src/thread/generic/SDL_syscond.c +++ b/libs/SDL2/src/thread/generic/SDL_syscond.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_sysmutex.c b/libs/SDL2/src/thread/generic/SDL_sysmutex.c index ddcc8cdf..0c7a8514 100644 --- a/libs/SDL2/src/thread/generic/SDL_sysmutex.c +++ b/libs/SDL2/src/thread/generic/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_sysmutex_c.h b/libs/SDL2/src/thread/generic/SDL_sysmutex_c.h index f868fade..7481b665 100644 --- a/libs/SDL2/src/thread/generic/SDL_sysmutex_c.h +++ b/libs/SDL2/src/thread/generic/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_syssem.c b/libs/SDL2/src/thread/generic/SDL_syssem.c index c7220a2a..cae084db 100644 --- a/libs/SDL2/src/thread/generic/SDL_syssem.c +++ b/libs/SDL2/src/thread/generic/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_systhread.c b/libs/SDL2/src/thread/generic/SDL_systhread.c index 6cd29f76..b248165f 100644 --- a/libs/SDL2/src/thread/generic/SDL_systhread.c +++ b/libs/SDL2/src/thread/generic/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_systhread_c.h b/libs/SDL2/src/thread/generic/SDL_systhread_c.h index 38e8b208..30ba69ea 100644 --- a/libs/SDL2/src/thread/generic/SDL_systhread_c.h +++ b/libs/SDL2/src/thread/generic/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/generic/SDL_systls.c b/libs/SDL2/src/thread/generic/SDL_systls.c index b73d901f..99bfce77 100644 --- a/libs/SDL2/src/thread/generic/SDL_systls.c +++ b/libs/SDL2/src/thread/generic/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/psp/SDL_syscond.c b/libs/SDL2/src/thread/psp/SDL_syscond.c index 3959a4c4..d4ff59d5 100644 --- a/libs/SDL2/src/thread/psp/SDL_syscond.c +++ b/libs/SDL2/src/thread/psp/SDL_syscond.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/psp/SDL_sysmutex.c b/libs/SDL2/src/thread/psp/SDL_sysmutex.c index e1cf413c..e0f411ea 100644 --- a/libs/SDL2/src/thread/psp/SDL_sysmutex.c +++ b/libs/SDL2/src/thread/psp/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/psp/SDL_sysmutex_c.h b/libs/SDL2/src/thread/psp/SDL_sysmutex_c.h index f868fade..7481b665 100644 --- a/libs/SDL2/src/thread/psp/SDL_sysmutex_c.h +++ b/libs/SDL2/src/thread/psp/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/psp/SDL_syssem.c b/libs/SDL2/src/thread/psp/SDL_syssem.c index 609ba737..cfbbe433 100644 --- a/libs/SDL2/src/thread/psp/SDL_syssem.c +++ b/libs/SDL2/src/thread/psp/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -79,7 +79,7 @@ void SDL_DestroySemaphore(SDL_sem *sem) int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { Uint32 *pTimeout; - unsigned int res; + int res; if (sem == NULL) { SDL_SetError("Passed a NULL sem"); diff --git a/libs/SDL2/src/thread/psp/SDL_systhread.c b/libs/SDL2/src/thread/psp/SDL_systhread.c index 8cbd2f13..95141cc8 100644 --- a/libs/SDL2/src/thread/psp/SDL_systhread.c +++ b/libs/SDL2/src/thread/psp/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/psp/SDL_systhread_c.h b/libs/SDL2/src/thread/psp/SDL_systhread_c.h index 4f9dac24..2c5de1ba 100644 --- a/libs/SDL2/src/thread/psp/SDL_systhread_c.h +++ b/libs/SDL2/src/thread/psp/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/pthread/SDL_syscond.c b/libs/SDL2/src/thread/pthread/SDL_syscond.c index 77aebb0d..2b0e0a53 100644 --- a/libs/SDL2/src/thread/pthread/SDL_syscond.c +++ b/libs/SDL2/src/thread/pthread/SDL_syscond.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/pthread/SDL_sysmutex.c b/libs/SDL2/src/thread/pthread/SDL_sysmutex.c index 8303c619..d7fa982c 100644 --- a/libs/SDL2/src/thread/pthread/SDL_sysmutex.c +++ b/libs/SDL2/src/thread/pthread/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,8 +23,8 @@ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif -#include #include +#include #include "SDL_thread.h" diff --git a/libs/SDL2/src/thread/pthread/SDL_sysmutex_c.h b/libs/SDL2/src/thread/pthread/SDL_sysmutex_c.h index bf69bcd1..475275a2 100644 --- a/libs/SDL2/src/thread/pthread/SDL_sysmutex_c.h +++ b/libs/SDL2/src/thread/pthread/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/pthread/SDL_syssem.c b/libs/SDL2/src/thread/pthread/SDL_syssem.c index 1d5faa18..a89a262a 100644 --- a/libs/SDL2/src/thread/pthread/SDL_syssem.c +++ b/libs/SDL2/src/thread/pthread/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,6 +20,9 @@ */ #include "../../SDL_internal.h" +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #include #include diff --git a/libs/SDL2/src/thread/pthread/SDL_systhread.c b/libs/SDL2/src/thread/pthread/SDL_systhread.c index 6eaf20ea..14eee8de 100644 --- a/libs/SDL2/src/thread/pthread/SDL_systhread.c +++ b/libs/SDL2/src/thread/pthread/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -45,6 +45,7 @@ #include "SDL_platform.h" #include "SDL_thread.h" +#include "SDL_hints.h" #include "../SDL_thread_c.h" #include "../SDL_systhread.h" #ifdef __ANDROID__ @@ -86,6 +87,7 @@ int SDL_SYS_CreateThread(SDL_Thread * thread, void *args) { pthread_attr_t type; + const char *hint = SDL_GetHint(SDL_HINT_THREAD_STACK_SIZE); /* do this here before any threads exist, so there's no race condition. */ #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__) @@ -105,6 +107,14 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args) return SDL_SetError("Couldn't initialize pthread attributes"); } pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); + + /* If the SDL_HINT_THREAD_STACK_SIZE exists and it seems to be a positive number, use it */ + if (hint && hint[0] >= '0' && hint[0] <= '9') { + const size_t stacksize = (size_t) SDL_atoi(hint); + if (stacksize > 0) { + pthread_attr_setstacksize(&type, stacksize); + } + } /* Create the thread and go! */ if (pthread_create(&thread->handle, &type, RunThread, args) != 0) { @@ -117,10 +127,10 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args) void SDL_SYS_SetupThread(const char *name) { -#ifndef __NACL__ +#if !defined(__ANDROID__) && !defined(__NACL__) int i; sigset_t mask; -#endif +#endif /* !__ANDROID__ && !__NACL__ */ if (name != NULL) { #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__) @@ -146,14 +156,15 @@ SDL_SYS_SetupThread(const char *name) } /* NativeClient does not yet support signals.*/ -#ifndef __NACL__ +#if !defined(__ANDROID__) && !defined(__NACL__) /* Mask asynchronous signals for this thread */ sigemptyset(&mask); for (i = 0; sig_list[i]; ++i) { sigaddset(&mask, sig_list[i]); } pthread_sigmask(SIG_BLOCK, &mask, 0); -#endif +#endif /* !__ANDROID__ && !__NACL__ */ + #ifdef PTHREAD_CANCEL_ASYNCHRONOUS /* Allow ourselves to be asynchronously cancelled */ diff --git a/libs/SDL2/src/thread/pthread/SDL_systhread_c.h b/libs/SDL2/src/thread/pthread/SDL_systhread_c.h index eedb7d1f..3a25f47a 100644 --- a/libs/SDL2/src/thread/pthread/SDL_systhread_c.h +++ b/libs/SDL2/src/thread/pthread/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/pthread/SDL_systls.c b/libs/SDL2/src/thread/pthread/SDL_systls.c index 09a27904..0440af57 100644 --- a/libs/SDL2/src/thread/pthread/SDL_systls.c +++ b/libs/SDL2/src/thread/pthread/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/stdcpp/SDL_syscond.cpp b/libs/SDL2/src/thread/stdcpp/SDL_syscond.cpp index e9da82a3..51ec4dc7 100644 --- a/libs/SDL2/src/thread/stdcpp/SDL_syscond.cpp +++ b/libs/SDL2/src/thread/stdcpp/SDL_syscond.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/stdcpp/SDL_sysmutex.cpp b/libs/SDL2/src/thread/stdcpp/SDL_sysmutex.cpp index 4b60fb1d..da411612 100644 --- a/libs/SDL2/src/thread/stdcpp/SDL_sysmutex.cpp +++ b/libs/SDL2/src/thread/stdcpp/SDL_sysmutex.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/stdcpp/SDL_sysmutex_c.h b/libs/SDL2/src/thread/stdcpp/SDL_sysmutex_c.h index 6bbd9dcd..d7b5b218 100644 --- a/libs/SDL2/src/thread/stdcpp/SDL_sysmutex_c.h +++ b/libs/SDL2/src/thread/stdcpp/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/stdcpp/SDL_systhread.cpp b/libs/SDL2/src/thread/stdcpp/SDL_systhread.cpp index 5de700ab..ab8e1505 100644 --- a/libs/SDL2/src/thread/stdcpp/SDL_systhread.cpp +++ b/libs/SDL2/src/thread/stdcpp/SDL_systhread.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/stdcpp/SDL_systhread_c.h b/libs/SDL2/src/thread/stdcpp/SDL_systhread_c.h index a0a338f5..d3affedc 100644 --- a/libs/SDL2/src/thread/stdcpp/SDL_systhread_c.h +++ b/libs/SDL2/src/thread/stdcpp/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/windows/SDL_sysmutex.c b/libs/SDL2/src/thread/windows/SDL_sysmutex.c index 8333e11b..a5c62cd5 100644 --- a/libs/SDL2/src/thread/windows/SDL_sysmutex.c +++ b/libs/SDL2/src/thread/windows/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/windows/SDL_syssem.c b/libs/SDL2/src/thread/windows/SDL_syssem.c index a4f75f5c..149c2757 100644 --- a/libs/SDL2/src/thread/windows/SDL_syssem.c +++ b/libs/SDL2/src/thread/windows/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/windows/SDL_systhread.c b/libs/SDL2/src/thread/windows/SDL_systhread.c index 79c40b16..34d70d45 100644 --- a/libs/SDL2/src/thread/windows/SDL_systhread.c +++ b/libs/SDL2/src/thread/windows/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/windows/SDL_systhread_c.h b/libs/SDL2/src/thread/windows/SDL_systhread_c.h index f3c78e99..0beafe88 100644 --- a/libs/SDL2/src/thread/windows/SDL_systhread_c.h +++ b/libs/SDL2/src/thread/windows/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/thread/windows/SDL_systls.c b/libs/SDL2/src/thread/windows/SDL_systls.c index 6ceadaa1..67c84741 100644 --- a/libs/SDL2/src/thread/windows/SDL_systls.c +++ b/libs/SDL2/src/thread/windows/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/timer/SDL_timer.c b/libs/SDL2/src/timer/SDL_timer.c index 3ec1291b..2e5e544c 100644 --- a/libs/SDL2/src/timer/SDL_timer.c +++ b/libs/SDL2/src/timer/SDL_timer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/timer/SDL_timer_c.h b/libs/SDL2/src/timer/SDL_timer_c.h index 8d563cff..ab1e16ac 100644 --- a/libs/SDL2/src/timer/SDL_timer_c.h +++ b/libs/SDL2/src/timer/SDL_timer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/timer/dummy/SDL_systimer.c b/libs/SDL2/src/timer/dummy/SDL_systimer.c index 57899ae9..0a63bfab 100644 --- a/libs/SDL2/src/timer/dummy/SDL_systimer.c +++ b/libs/SDL2/src/timer/dummy/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/timer/haiku/SDL_systimer.c b/libs/SDL2/src/timer/haiku/SDL_systimer.c index 685f72a8..ea736ba7 100644 --- a/libs/SDL2/src/timer/haiku/SDL_systimer.c +++ b/libs/SDL2/src/timer/haiku/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/timer/psp/SDL_systimer.c b/libs/SDL2/src/timer/psp/SDL_systimer.c index 8488b284..ece71d37 100644 --- a/libs/SDL2/src/timer/psp/SDL_systimer.c +++ b/libs/SDL2/src/timer/psp/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/timer/unix/SDL_systimer.c b/libs/SDL2/src/timer/unix/SDL_systimer.c index cace8661..98917214 100644 --- a/libs/SDL2/src/timer/unix/SDL_systimer.c +++ b/libs/SDL2/src/timer/unix/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,6 +48,15 @@ #include #endif +/* Use CLOCK_MONOTONIC_RAW, if available, which is not subject to adjustment by NTP */ +#if HAVE_CLOCK_GETTIME +#ifdef CLOCK_MONOTONIC_RAW +#define SDL_MONOTONIC_CLOCK CLOCK_MONOTONIC_RAW +#else +#define SDL_MONOTONIC_CLOCK CLOCK_MONOTONIC +#endif +#endif + /* The first ticks value of the application */ #if HAVE_CLOCK_GETTIME static struct timespec start_ts; @@ -69,7 +78,7 @@ SDL_TicksInit(void) /* Set first ticks value */ #if HAVE_CLOCK_GETTIME - if (clock_gettime(CLOCK_MONOTONIC, &start_ts) == 0) { + if (clock_gettime(SDL_MONOTONIC_CLOCK, &start_ts) == 0) { has_monotonic_time = SDL_TRUE; } else #elif defined(__APPLE__) @@ -101,7 +110,7 @@ SDL_GetTicks(void) if (has_monotonic_time) { #if HAVE_CLOCK_GETTIME struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); + clock_gettime(SDL_MONOTONIC_CLOCK, &now); ticks = (now.tv_sec - start_ts.tv_sec) * 1000 + (now.tv_nsec - start_ts.tv_nsec) / 1000000; #elif defined(__APPLE__) @@ -132,7 +141,7 @@ SDL_GetPerformanceCounter(void) #if HAVE_CLOCK_GETTIME struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); + clock_gettime(SDL_MONOTONIC_CLOCK, &now); ticks = now.tv_sec; ticks *= 1000000000; ticks += now.tv_nsec; diff --git a/libs/SDL2/src/timer/windows/SDL_systimer.c b/libs/SDL2/src/timer/windows/SDL_systimer.c index c9435c3e..a213be00 100644 --- a/libs/SDL2/src/timer/windows/SDL_systimer.c +++ b/libs/SDL2/src/timer/windows/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,10 +30,9 @@ /* The first (low-resolution) ticks value of the application */ -static DWORD start; +static DWORD start = 0; static BOOL ticks_started = FALSE; -#ifndef USE_GETTICKCOUNT /* Store if a high-resolution performance counter exists on the system */ static BOOL hires_timer_available; /* The first high-resolution ticks value of the application */ @@ -41,10 +40,10 @@ static LARGE_INTEGER hires_start_ticks; /* The number of ticks per second of the high-resolution performance counter */ static LARGE_INTEGER hires_ticks_per_second; -#ifndef __WINRT__ static void -timeSetPeriod(UINT uPeriod) +SDL_SetSystemTimerResolution(const UINT uPeriod) { +#ifndef __WINRT__ static UINT timer_period = 0; if (uPeriod != timer_period) { @@ -58,6 +57,7 @@ timeSetPeriod(UINT uPeriod) timeBeginPeriod(timer_period); } } +#endif } static void @@ -72,12 +72,9 @@ SDL_TimerResolutionChanged(void *userdata, const char *name, const char *oldValu uPeriod = 1; } if (uPeriod || oldValue != hint) { - timeSetPeriod(uPeriod); + SDL_SetSystemTimerResolution(uPeriod); } } -#endif /* ifndef __WINRT__ */ - -#endif /* !USE_GETTICKCOUNT */ void SDL_TicksInit(void) @@ -87,10 +84,12 @@ SDL_TicksInit(void) } ticks_started = SDL_TRUE; + /* if we didn't set a precision, set it high. This affects lots of things + on Windows besides the SDL timers, like audio callbacks, etc. */ + SDL_AddHintCallback(SDL_HINT_TIMER_RESOLUTION, + SDL_TimerResolutionChanged, NULL); + /* Set first ticks value */ -#ifdef USE_GETTICKCOUNT - start = GetTickCount(); -#else /* QueryPerformanceCounter has had problems in the past, but lots of games use it, so we'll rely on it here. */ @@ -99,51 +98,36 @@ SDL_TicksInit(void) QueryPerformanceCounter(&hires_start_ticks); } else { hires_timer_available = FALSE; -#ifdef __WINRT__ - start = 0; /* the timer failed to start! */ -#else - timeSetPeriod(1); /* use 1 ms timer precision */ +#ifndef __WINRT__ start = timeGetTime(); - - SDL_AddHintCallback(SDL_HINT_TIMER_RESOLUTION, - SDL_TimerResolutionChanged, NULL); #endif /* __WINRT__ */ } -#endif /* USE_GETTICKCOUNT */ } void SDL_TicksQuit(void) { -#ifndef USE_GETTICKCOUNT if (!hires_timer_available) { -#ifndef __WINRT__ SDL_DelHintCallback(SDL_HINT_TIMER_RESOLUTION, SDL_TimerResolutionChanged, NULL); - - timeSetPeriod(0); -#endif /* __WINRT__ */ } -#endif /* USE_GETTICKCOUNT */ + SDL_SetSystemTimerResolution(0); /* always release our timer resolution request. */ + + start = 0; ticks_started = SDL_FALSE; } Uint32 SDL_GetTicks(void) { - DWORD now; -#ifndef USE_GETTICKCOUNT + DWORD now = 0; LARGE_INTEGER hires_now; -#endif if (!ticks_started) { SDL_TicksInit(); } -#ifdef USE_GETTICKCOUNT - now = GetTickCount(); -#else if (hires_timer_available) { QueryPerformanceCounter(&hires_now); @@ -153,13 +137,10 @@ SDL_GetTicks(void) return (DWORD) hires_now.QuadPart; } else { -#ifdef __WINRT__ - now = 0; -#else +#ifndef __WINRT__ now = timeGetTime(); #endif /* __WINRT__ */ } -#endif return (now - start); } @@ -186,35 +167,30 @@ SDL_GetPerformanceFrequency(void) return frequency.QuadPart; } -/* Sleep() is not publicly available to apps in early versions of WinRT. - * - * Visual C++ 2013 Update 4 re-introduced Sleep() for Windows 8.1 and - * Windows Phone 8.1. - * - * Use the compiler version to determine availability. - * - * NOTE #1: _MSC_FULL_VER == 180030723 for Visual C++ 2013 Update 3. - * NOTE #2: Visual C++ 2013, when compiling for Windows 8.0 and - * Windows Phone 8.0, uses the Visual C++ 2012 compiler to build - * apps and libraries. - */ -#if defined(__WINRT__) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER <= 180030723) -static void -Sleep(DWORD timeout) -{ - static HANDLE mutex = 0; - if ( ! mutex ) - { - mutex = CreateEventEx(0, 0, 0, EVENT_ALL_ACCESS); - } - WaitForSingleObjectEx(mutex, timeout, FALSE); -} -#endif - void SDL_Delay(Uint32 ms) { + /* Sleep() is not publicly available to apps in early versions of WinRT. + * + * Visual C++ 2013 Update 4 re-introduced Sleep() for Windows 8.1 and + * Windows Phone 8.1. + * + * Use the compiler version to determine availability. + * + * NOTE #1: _MSC_FULL_VER == 180030723 for Visual C++ 2013 Update 3. + * NOTE #2: Visual C++ 2013, when compiling for Windows 8.0 and + * Windows Phone 8.0, uses the Visual C++ 2012 compiler to build + * apps and libraries. + */ +#if defined(__WINRT__) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER <= 180030723) + static HANDLE mutex = 0; + if (!mutex) { + mutex = CreateEventEx(0, 0, 0, EVENT_ALL_ACCESS); + } + WaitForSingleObjectEx(mutex, ms, FALSE); +#else Sleep(ms); +#endif } #endif /* SDL_TIMER_WINDOWS */ diff --git a/libs/SDL2/src/video/SDL_RLEaccel.c b/libs/SDL2/src/video/SDL_RLEaccel.c index 1f0f7507..b9f1426d 100644 --- a/libs/SDL2/src/video/SDL_RLEaccel.c +++ b/libs/SDL2/src/video/SDL_RLEaccel.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -373,6 +373,18 @@ } \ } while(0) +/* + * Set a pixel value using the given format, except that the alpha value is + * placed in the top byte. This is the format used for RLE with alpha. + */ +#define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ +{ \ + Pixel = ((r>>fmt->Rloss)<Rshift)| \ + ((g>>fmt->Gloss)<Gshift)| \ + ((b>>fmt->Bloss)<Bshift)| \ + (a<<24); \ +} + /* * This takes care of the case when the surface is clipped on the left and/or * right. Top clipping has already been taken care of. @@ -982,7 +994,7 @@ copy_32(void *dst, Uint32 * src, int n, for (i = 0; i < n; i++) { unsigned r, g, b, a; RGBA_FROM_8888(*src, sfmt, r, g, b, a); - PIXEL_FROM_RGBA(*d, dfmt, r, g, b, a); + RLEPIXEL_FROM_RGBA(*d, dfmt, r, g, b, a); d++; src++; } diff --git a/libs/SDL2/src/video/SDL_RLEaccel_c.h b/libs/SDL2/src/video/SDL_RLEaccel_c.h index 271faa0b..ed980f98 100644 --- a/libs/SDL2/src/video/SDL_RLEaccel_c.h +++ b/libs/SDL2/src/video/SDL_RLEaccel_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit.c b/libs/SDL2/src/video/SDL_blit.c index fe30923b..1c8b0735 100644 --- a/libs/SDL2/src/video/SDL_blit.c +++ b/libs/SDL2/src/video/SDL_blit.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit.h b/libs/SDL2/src/video/SDL_blit.h index f12018d8..6b8effff 100644 --- a/libs/SDL2/src/video/SDL_blit.h +++ b/libs/SDL2/src/video/SDL_blit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_0.c b/libs/SDL2/src/video/SDL_blit_0.c index a820fb37..64e20f8e 100644 --- a/libs/SDL2/src/video/SDL_blit_0.c +++ b/libs/SDL2/src/video/SDL_blit_0.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_1.c b/libs/SDL2/src/video/SDL_blit_1.c index 4dfcabda..53f486b9 100644 --- a/libs/SDL2/src/video/SDL_blit_1.c +++ b/libs/SDL2/src/video/SDL_blit_1.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_A.c b/libs/SDL2/src/video/SDL_blit_A.c index d3a9e814..4ba7c82c 100644 --- a/libs/SDL2/src/video/SDL_blit_A.c +++ b/libs/SDL2/src/video/SDL_blit_A.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -580,7 +580,7 @@ BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info) _mm_empty(); } -#endif /* __MMX__ */ +#endif /* __3dNOW__ */ /* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */ diff --git a/libs/SDL2/src/video/SDL_blit_N.c b/libs/SDL2/src/video/SDL_blit_N.c index 41615be5..c0c7fbfb 100644 --- a/libs/SDL2/src/video/SDL_blit_N.c +++ b/libs/SDL2/src/video/SDL_blit_N.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -2114,6 +2114,33 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) } } +/* blits 32 bit RGBA<->RGBA with both surfaces having the same R,G,B,A fields */ +static void +Blit4to4CopyAlpha(SDL_BlitInfo * info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint32 *src = (Uint32 *) info->src; + int srcskip = info->src_skip; + Uint32 *dst = (Uint32 *) info->dst; + int dstskip = info->dst_skip; + + /* RGBA->RGBA, COPY_ALPHA */ + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst = *src; + ++dst; + ++src; + }, + width); + /* *INDENT-ON* */ + src = (Uint32 *) ((Uint8 *) src + srcskip); + dst = (Uint32 *) ((Uint8 *) dst + dstskip); + } +} + static void BlitNtoN(SDL_BlitInfo * info) { @@ -2562,8 +2589,17 @@ SDL_CalculateBlitN(SDL_Surface * surface) srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask) { - /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */ - blitfun = Blit4to4MaskAlpha; + if (a_need == COPY_ALPHA) { + if (srcfmt->Amask == dstfmt->Amask) { + /* Fastpath C fallback: 32bit RGBA<->RGBA blit with matching RGBA */ + blitfun = Blit4to4CopyAlpha; + } else { + blitfun = BlitNtoNCopyAlpha; + } + } else { + /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */ + blitfun = Blit4to4MaskAlpha; + } } else if (a_need == COPY_ALPHA) { blitfun = BlitNtoNCopyAlpha; } diff --git a/libs/SDL2/src/video/SDL_blit_auto.c b/libs/SDL2/src/video/SDL_blit_auto.c index 8b7c8e9b..987d12d8 100644 --- a/libs/SDL2/src/video/SDL_blit_auto.c +++ b/libs/SDL2/src/video/SDL_blit_auto.c @@ -1,7 +1,7 @@ /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_auto.h b/libs/SDL2/src/video/SDL_blit_auto.h index 369e12fc..7ba689c7 100644 --- a/libs/SDL2/src/video/SDL_blit_auto.h +++ b/libs/SDL2/src/video/SDL_blit_auto.h @@ -1,7 +1,7 @@ /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_copy.c b/libs/SDL2/src/video/SDL_blit_copy.c index 5c62d633..3ec2e7eb 100644 --- a/libs/SDL2/src/video/SDL_blit_copy.c +++ b/libs/SDL2/src/video/SDL_blit_copy.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_copy.h b/libs/SDL2/src/video/SDL_blit_copy.h index 8b6950ce..73defa2f 100644 --- a/libs/SDL2/src/video/SDL_blit_copy.h +++ b/libs/SDL2/src/video/SDL_blit_copy.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_slow.c b/libs/SDL2/src/video/SDL_blit_slow.c index ca644adc..9082f7a6 100644 --- a/libs/SDL2/src/video/SDL_blit_slow.c +++ b/libs/SDL2/src/video/SDL_blit_slow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_blit_slow.h b/libs/SDL2/src/video/SDL_blit_slow.h index c1786e0b..5bd0598a 100644 --- a/libs/SDL2/src/video/SDL_blit_slow.h +++ b/libs/SDL2/src/video/SDL_blit_slow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_bmp.c b/libs/SDL2/src/video/SDL_bmp.c index f2b19fab..3ea2dd54 100644 --- a/libs/SDL2/src/video/SDL_bmp.c +++ b/libs/SDL2/src/video/SDL_bmp.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -531,6 +531,10 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) format.BitsPerPixel); } } + } else { + /* Set no error here because it may overwrite a more useful message from + SDL_RWFromFile() if SDL_SaveBMP_RW() is called from SDL_SaveBMP(). */ + return -1; } if (surface && (SDL_LockSurface(surface) == 0)) { diff --git a/libs/SDL2/src/video/SDL_clipboard.c b/libs/SDL2/src/video/SDL_clipboard.c index f2b45015..feff8eb3 100644 --- a/libs/SDL2/src/video/SDL_clipboard.c +++ b/libs/SDL2/src/video/SDL_clipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_egl.c b/libs/SDL2/src/video/SDL_egl.c index a93b7b71..7b1c690e 100644 --- a/libs/SDL2/src/video/SDL_egl.c +++ b/libs/SDL2/src/video/SDL_egl.c @@ -1,6 +1,6 @@ /* * Simple DirectMedia Layer - * Copyright (C) 1997-2014 Sam Lantinga + * Copyright (C) 1997-2015 Sam Lantinga * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -31,6 +31,13 @@ #include "SDL_loadso.h" #include "SDL_hints.h" +#ifdef EGL_KHR_create_context +/* EGL_OPENGL_ES3_BIT_KHR was added in version 13 of the extension. */ +#ifndef EGL_OPENGL_ES3_BIT_KHR +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif +#endif /* EGL_KHR_create_context */ + #if SDL_VIDEO_DRIVER_RPI /* Raspbian places the OpenGL ES/EGL binaries in a non standard path */ #define DEFAULT_EGL "/opt/vc/lib/libEGL.so" @@ -74,26 +81,25 @@ static int SDL_EGL_HasExtension(_THIS, const char *ext) { int i; int len = 0; - int ext_len; + size_t ext_len; const char *exts; const char *ext_word; ext_len = SDL_strlen(ext); exts = _this->egl_data->eglQueryString(_this->egl_data->egl_display, EGL_EXTENSIONS); - if(exts) { + if (exts) { ext_word = exts; - for(i = 0; exts[i] != 0; i++) { - if(exts[i] == ' ') { - if(ext_len == len && !SDL_strncmp(ext_word, ext, len)) { + for (i = 0; exts[i] != 0; i++) { + if (exts[i] == ' ') { + if (ext_len == len && !SDL_strncmp(ext_word, ext, len)) { return 1; } len = 0; ext_word = &exts[i + 1]; - } - else { + } else { len++; } } @@ -190,12 +196,11 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa } if (egl_dll_handle == NULL) { - if(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { + if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { if (_this->gl_config.major_version > 1) { path = DEFAULT_OGL_ES2; egl_dll_handle = SDL_LoadObject(path); - } - else { + } else { path = DEFAULT_OGL_ES; egl_dll_handle = SDL_LoadObject(path); if (egl_dll_handle == NULL) { @@ -334,23 +339,40 @@ SDL_EGL_ChooseConfig(_THIS) attribs[i++] = EGL_SAMPLES; attribs[i++] = _this->gl_config.multisamplesamples; } - + + if (_this->gl_config.framebuffer_srgb_capable) { +#ifdef EGL_KHR_gl_colorspace + if (SDL_EGL_HasExtension(_this, "EGL_KHR_gl_colorspace")) { + attribs[i++] = EGL_GL_COLORSPACE_KHR; + attribs[i++] = EGL_GL_COLORSPACE_SRGB_KHR; + } else +#endif + { + return SDL_SetError("EGL implementation does not support sRGB system framebuffers"); + } + } + attribs[i++] = EGL_RENDERABLE_TYPE; - if(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { - if (_this->gl_config.major_version == 2) { + if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { +#ifdef EGL_KHR_create_context + if (_this->gl_config.major_version >= 3 && + SDL_EGL_HasExtension(_this, "EGL_KHR_create_context")) { + attribs[i++] = EGL_OPENGL_ES3_BIT_KHR; + } else +#endif + if (_this->gl_config.major_version >= 2) { attribs[i++] = EGL_OPENGL_ES2_BIT; } else { attribs[i++] = EGL_OPENGL_ES_BIT; } _this->egl_data->eglBindAPI(EGL_OPENGL_ES_API); - } - else { + } else { attribs[i++] = EGL_OPENGL_BIT; _this->egl_data->eglBindAPI(EGL_OPENGL_API); } - + attribs[i++] = EGL_NONE; - + if (_this->egl_data->eglChooseConfig(_this->egl_data->egl_display, attribs, configs, SDL_arraysize(configs), @@ -358,11 +380,11 @@ SDL_EGL_ChooseConfig(_THIS) found_configs == 0) { return SDL_SetError("Couldn't find matching EGL config"); } - + /* eglChooseConfig returns a number of configurations that match or exceed the requested attribs. */ /* From those, we select the one that matches our requirements more closely via a makeshift algorithm */ - for ( i=0; igl_config.profile_mask; + EGLint major_version = _this->gl_config.major_version; + EGLint minor_version = _this->gl_config.minor_version; + SDL_bool profile_es = (profile_mask == SDL_GL_CONTEXT_PROFILE_ES); + if (!_this->egl_data) { /* The EGL library wasn't loaded, SDL_GetError() should have info */ return NULL; } - + if (_this->gl_config.share_with_current_context) { share_context = (EGLContext)SDL_GL_GetCurrentContext(); } - - /* Bind the API */ - if(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { - _this->egl_data->eglBindAPI(EGL_OPENGL_ES_API); - if (_this->gl_config.major_version) { - context_attrib_list[1] = _this->gl_config.major_version; + + /* Set the context version and other attributes. */ + if ((major_version < 3 || (minor_version == 0 && profile_es)) && + _this->gl_config.flags == 0 && + (profile_mask == 0 || profile_es)) { + /* Create a context without using EGL_KHR_create_context attribs. + * When creating a GLES context without EGL_KHR_create_context we can + * only specify the major version. When creating a desktop GL context + * we can't specify any version, so we only try in that case when the + * version is less than 3.0 (matches SDL's GLX/WGL behavior.) + */ + if (profile_es) { + attribs[attr++] = EGL_CONTEXT_CLIENT_VERSION; + attribs[attr++] = SDL_max(major_version, 1); } + } else { +#ifdef EGL_KHR_create_context + /* The Major/minor version, context profiles, and context flags can + * only be specified when this extension is available. + */ + if (SDL_EGL_HasExtension(_this, "EGL_KHR_create_context")) { + attribs[attr++] = EGL_CONTEXT_MAJOR_VERSION_KHR; + attribs[attr++] = major_version; + attribs[attr++] = EGL_CONTEXT_MINOR_VERSION_KHR; + attribs[attr++] = minor_version; - egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display, - _this->egl_data->egl_config, - share_context, context_attrib_list); - } - else { - _this->egl_data->eglBindAPI(EGL_OPENGL_API); -#ifdef EGL_KHR_create_context - if(SDL_EGL_HasExtension(_this, "EGL_KHR_create_context")) { - context_attrib_list[0] = EGL_CONTEXT_MAJOR_VERSION_KHR; - context_attrib_list[1] = _this->gl_config.major_version; - context_attrib_list[2] = EGL_CONTEXT_MINOR_VERSION_KHR; - context_attrib_list[3] = _this->gl_config.minor_version; - context_attrib_list[4] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR; - switch(_this->gl_config.profile_mask) { - case SDL_GL_CONTEXT_PROFILE_COMPATIBILITY: - context_attrib_list[5] = EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR; - break; - - case SDL_GL_CONTEXT_PROFILE_CORE: - default: - context_attrib_list[5] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR; - break; + /* SDL profile bits match EGL profile bits. */ + if (profile_mask != 0 && profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { + attribs[attr++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR; + attribs[attr++] = profile_mask; } - } - else { - context_attrib_list[0] = EGL_NONE; - } -#else /* EGL_KHR_create_context */ - context_attrib_list[0] = EGL_NONE; + + /* SDL flags match EGL flags. */ + if (_this->gl_config.flags != 0) { + attribs[attr++] = EGL_CONTEXT_FLAGS_KHR; + attribs[attr++] = _this->gl_config.flags; + } + } else #endif /* EGL_KHR_create_context */ - egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display, - _this->egl_data->egl_config, - share_context, context_attrib_list); + { + SDL_SetError("Could not create EGL context (context attributes are not supported)"); + return NULL; + } } - + + attribs[attr++] = EGL_NONE; + + /* Bind the API */ + if (profile_es) { + _this->egl_data->eglBindAPI(EGL_OPENGL_ES_API); + } else { + _this->egl_data->eglBindAPI(EGL_OPENGL_API); + } + + egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display, + _this->egl_data->egl_config, + share_context, attribs); + if (egl_context == EGL_NO_CONTEXT) { SDL_SetError("Could not create EGL context"); return NULL; } - + _this->egl_data->egl_swapinterval = 0; - + if (SDL_EGL_MakeCurrent(_this, egl_surface, egl_context) < 0) { SDL_EGL_DeleteContext(_this, egl_context); SDL_SetError("Could not make EGL context current"); return NULL; } - + return (SDL_GLContext) egl_context; } @@ -489,8 +526,7 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) */ if (!egl_context || !egl_surface) { _this->egl_data->eglMakeCurrent(_this->egl_data->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - } - else { + } else { if (!_this->egl_data->eglMakeCurrent(_this->egl_data->egl_display, egl_surface, egl_surface, egl_context)) { return SDL_SetError("Unable to make EGL context current"); diff --git a/libs/SDL2/src/video/SDL_egl_c.h b/libs/SDL2/src/video/SDL_egl_c.h index ef58b18e..b46cfca6 100644 --- a/libs/SDL2/src/video/SDL_egl_c.h +++ b/libs/SDL2/src/video/SDL_egl_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_fillrect.c b/libs/SDL2/src/video/SDL_fillrect.c index 84707842..2282d2b1 100644 --- a/libs/SDL2/src/video/SDL_fillrect.c +++ b/libs/SDL2/src/video/SDL_fillrect.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -196,9 +196,15 @@ SDL_FillRect2(Uint8 * pixels, int pitch, Uint32 color, int w, int h) static void SDL_FillRect3(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - Uint8 r = (Uint8) ((color >> 16) & 0xFF); - Uint8 g = (Uint8) ((color >> 8) & 0xFF); - Uint8 b = (Uint8) (color & 0xFF); +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + Uint8 b1 = (Uint8) (color & 0xFF); + Uint8 b2 = (Uint8) ((color >> 8) & 0xFF); + Uint8 b3 = (Uint8) ((color >> 16) & 0xFF); +#elif SDL_BYTEORDER == SDL_BIG_ENDIAN + Uint8 b1 = (Uint8) ((color >> 16) & 0xFF); + Uint8 b2 = (Uint8) ((color >> 8) & 0xFF); + Uint8 b3 = (Uint8) (color & 0xFF); +#endif int n; Uint8 *p = NULL; @@ -207,9 +213,9 @@ SDL_FillRect3(Uint8 * pixels, int pitch, Uint32 color, int w, int h) p = pixels; while (n--) { - *p++ = r; - *p++ = g; - *p++ = b; + *p++ = b1; + *p++ = b2; + *p++ = b3; } pixels += pitch; } diff --git a/libs/SDL2/src/video/SDL_pixels.c b/libs/SDL2/src/video/SDL_pixels.c index 0858daad..6b96125b 100644 --- a/libs/SDL2/src/video/SDL_pixels.c +++ b/libs/SDL2/src/video/SDL_pixels.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -1101,9 +1101,7 @@ SDL_CalculateGammaRamp(float gamma, Uint16 * ramp) /* 0.0 gamma is all black */ if (gamma == 0.0f) { - for (i = 0; i < 256; ++i) { - ramp[i] = 0; - } + SDL_memset(ramp, 0, 256 * sizeof(Uint16)); return; } else if (gamma == 1.0f) { /* 1.0 gamma is identity */ diff --git a/libs/SDL2/src/video/SDL_pixels_c.h b/libs/SDL2/src/video/SDL_pixels_c.h index de2916ff..3d2deb1a 100644 --- a/libs/SDL2/src/video/SDL_pixels_c.h +++ b/libs/SDL2/src/video/SDL_pixels_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_rect.c b/libs/SDL2/src/video/SDL_rect.c index a0456bd6..b2295195 100644 --- a/libs/SDL2/src/video/SDL_rect.c +++ b/libs/SDL2/src/video/SDL_rect.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_rect_c.h b/libs/SDL2/src/video/SDL_rect_c.h index e6be3292..bc639ae2 100644 --- a/libs/SDL2/src/video/SDL_rect_c.h +++ b/libs/SDL2/src/video/SDL_rect_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_shape.c b/libs/SDL2/src/video/SDL_shape.c index 147c60a5..3309f6db 100644 --- a/libs/SDL2/src/video/SDL_shape.c +++ b/libs/SDL2/src/video/SDL_shape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_shape_internals.h b/libs/SDL2/src/video/SDL_shape_internals.h index b5413e1e..4eda9dd1 100644 --- a/libs/SDL2/src/video/SDL_shape_internals.h +++ b/libs/SDL2/src/video/SDL_shape_internals.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_stretch.c b/libs/SDL2/src/video/SDL_stretch.c index a4faacaf..d3abaed5 100644 --- a/libs/SDL2/src/video/SDL_stretch.c +++ b/libs/SDL2/src/video/SDL_stretch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_surface.c b/libs/SDL2/src/video/SDL_surface.c index abcdee8d..ef581fa9 100644 --- a/libs/SDL2/src/video/SDL_surface.c +++ b/libs/SDL2/src/video/SDL_surface.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/SDL_sysvideo.h b/libs/SDL2/src/video/SDL_sysvideo.h index 2f072555..5e3e1526 100644 --- a/libs/SDL2/src/video/SDL_sysvideo.h +++ b/libs/SDL2/src/video/SDL_sysvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -170,6 +170,11 @@ struct SDL_VideoDevice */ int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); + /* + * Get the dots/pixels-per-inch of a display + */ + int (*GetDisplayDPI) (_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi); + /* * Get a list of the available display modes for a display. */ @@ -274,6 +279,7 @@ struct SDL_VideoDevice int num_displays; SDL_VideoDisplay *displays; SDL_Window *windows; + SDL_Window *grabbed_window; Uint8 window_magic; Uint32 next_object_id; char * clipboard_text; @@ -303,6 +309,7 @@ struct SDL_VideoDevice int flags; int profile_mask; int share_with_current_context; + int release_behavior; int framebuffer_srgb_capable; int retained_backing; int driver_loaded; @@ -421,6 +428,8 @@ extern SDL_Window * SDL_GetFocusWindow(void); extern SDL_bool SDL_ShouldAllowTopmost(void); +extern float SDL_ComputeDiagonalDPI(int hpix, int vpix, float hinches, float vinches); + #endif /* _SDL_sysvideo_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/SDL_video.c b/libs/SDL2/src/video/SDL_video.c index 1dcfabf0..a89399d9 100644 --- a/libs/SDL2/src/video/SDL_video.c +++ b/libs/SDL2/src/video/SDL_video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -46,6 +46,10 @@ #include "SDL_opengles2.h" #endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */ +#ifndef GL_CONTEXT_RELEASE_BEHAVIOR_KHR +#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB +#endif + /* On Windows, windows.h defines CreateWindow */ #ifdef CreateWindow #undef CreateWindow @@ -683,6 +687,24 @@ SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect) return 0; } +int +SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) +{ + SDL_VideoDisplay *display; + + CHECK_DISPLAY_INDEX(displayIndex, -1); + + display = &_this->displays[displayIndex]; + + if (_this->GetDisplayDPI) { + if (_this->GetDisplayDPI(_this, display, ddpi, hdpi, vdpi) == 0) { + return 0; + } + } + + return -1; +} + SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) { @@ -1103,22 +1125,22 @@ SDL_RestoreMousePosition(SDL_Window *window) } } -static void +static int SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) { SDL_VideoDisplay *display; SDL_Window *other; - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window,-1); /* if we are in the process of hiding don't go back to fullscreen */ if ( window->is_hiding && fullscreen ) - return; + return 0; #ifdef __MACOSX__ if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) { window->last_fullscreen_flags = window->flags; - return; + return 0; } #endif @@ -1135,7 +1157,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) /* See if anything needs to be done now */ if ((display->fullscreen_window == window) == fullscreen) { if ((window->last_fullscreen_flags & FULLSCREEN_MASK) == (window->flags & FULLSCREEN_MASK)) { - return; + return 0; } } @@ -1164,9 +1186,13 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) /* only do the mode change if we want exclusive fullscreen */ if ((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP) { - SDL_SetDisplayModeForDisplay(display, &fullscreen_mode); + if (SDL_SetDisplayModeForDisplay(display, &fullscreen_mode) < 0) { + return -1; + } } else { - SDL_SetDisplayModeForDisplay(display, NULL); + if (SDL_SetDisplayModeForDisplay(display, NULL) < 0) { + return -1; + } } if (_this->SetWindowFullscreen) { @@ -1185,7 +1211,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) SDL_RestoreMousePosition(other); window->last_fullscreen_flags = window->flags; - return; + return 0; } } } @@ -1205,6 +1231,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) SDL_RestoreMousePosition(window); window->last_fullscreen_flags = window->flags; + return 0; } #define CREATE_FLAGS \ @@ -1256,6 +1283,12 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) h = 1; } + /* Some platforms blow up if the windows are too large. Raise it later? */ + if ((w > 16384) || (h > 16384)) { + SDL_SetError("Window is too large."); + return NULL; + } + /* Some platforms have OpenGL enabled by default */ #if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ || __NACL__ flags |= SDL_WINDOW_OPENGL; @@ -1373,8 +1406,6 @@ SDL_CreateWindowFrom(const void *data) int SDL_RecreateWindow(SDL_Window * window, Uint32 flags) { - char *title = window->title; - SDL_Surface *icon = window->icon; SDL_bool loaded_opengl = SDL_FALSE; if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) { @@ -1414,8 +1445,6 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) } } - window->title = NULL; - window->icon = NULL; window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN); window->last_fullscreen_flags = window->flags; window->is_destroying = SDL_FALSE; @@ -1429,17 +1458,17 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) return -1; } } + if (flags & SDL_WINDOW_FOREIGN) { window->flags |= SDL_WINDOW_FOREIGN; } - if (title) { - SDL_SetWindowTitle(window, title); - SDL_free(title); + if (_this->SetWindowTitle && window->title) { + _this->SetWindowTitle(_this, window); } - if (icon) { - SDL_SetWindowIcon(window, icon); - SDL_FreeSurface(icon); + + if (_this->SetWindowIcon && window->icon) { + _this->SetWindowIcon(_this, window, window->icon); } if (window->hit_test) { @@ -1492,11 +1521,8 @@ SDL_SetWindowTitle(SDL_Window * window, const char *title) return; } SDL_free(window->title); - if (title && *title) { - window->title = SDL_strdup(title); - } else { - window->title = NULL; - } + + window->title = SDL_strdup(title ? title : ""); if (_this->SetWindowTitle) { _this->SetWindowTitle(_this, window); @@ -1653,12 +1679,31 @@ SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) /* Fullscreen windows are always at their display's origin */ if (window->flags & SDL_WINDOW_FULLSCREEN) { + int displayIndex; + if (x) { *x = 0; } if (y) { *y = 0; } + + /* Find the window's monitor and update to the + monitor offset. */ + displayIndex = SDL_GetWindowDisplayIndex(window); + if (displayIndex >= 0) { + SDL_Rect bounds; + + SDL_zero(bounds); + + SDL_GetDisplayBounds(displayIndex, &bounds); + if (x) { + *x = bounds.x; + } + if (y) { + *y = bounds.y; + } + } } else { if (x) { *x = window->x; @@ -1931,9 +1976,7 @@ SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) window->flags &= ~FULLSCREEN_MASK; window->flags |= flags; - SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)); - - return 0; + return SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)); } static SDL_Surface * @@ -2045,6 +2088,7 @@ SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, if (SDL_GetWindowGammaRamp(window, NULL, NULL, NULL) < 0) { return -1; } + SDL_assert(window->gamma != NULL); } if (red) { @@ -2111,14 +2155,30 @@ SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, void SDL_UpdateWindowGrab(SDL_Window * window) { - if (_this->SetWindowGrab) { - SDL_bool grabbed; - if ((SDL_GetMouse()->relative_mode || (window->flags & SDL_WINDOW_INPUT_GRABBED)) && - (window->flags & SDL_WINDOW_INPUT_FOCUS)) { - grabbed = SDL_TRUE; - } else { - grabbed = SDL_FALSE; + SDL_Window *grabbed_window; + SDL_bool grabbed; + if ((SDL_GetMouse()->relative_mode || (window->flags & SDL_WINDOW_INPUT_GRABBED)) && + (window->flags & SDL_WINDOW_INPUT_FOCUS)) { + grabbed = SDL_TRUE; + } else { + grabbed = SDL_FALSE; + } + + grabbed_window = _this->grabbed_window; + if (grabbed) { + if (grabbed_window && (grabbed_window != window)) { + /* stealing a grab from another window! */ + grabbed_window->flags &= ~SDL_WINDOW_INPUT_GRABBED; + if (_this->SetWindowGrab) { + _this->SetWindowGrab(_this, grabbed_window, SDL_FALSE); + } } + _this->grabbed_window = window; + } else if (grabbed_window == window) { + _this->grabbed_window = NULL; /* ungrabbing. */ + } + + if (_this->SetWindowGrab) { _this->SetWindowGrab(_this, window, grabbed); } } @@ -2143,8 +2203,15 @@ SDL_bool SDL_GetWindowGrab(SDL_Window * window) { CHECK_WINDOW_MAGIC(window, SDL_FALSE); + SDL_assert(!_this->grabbed_window || ((_this->grabbed_window->flags & SDL_WINDOW_INPUT_GRABBED) != 0)); + return window == _this->grabbed_window; +} - return ((window->flags & SDL_WINDOW_INPUT_GRABBED) != 0); +SDL_Window * +SDL_GetGrabbedWindow(void) +{ + SDL_assert(!_this->grabbed_window || ((_this->grabbed_window->flags & SDL_WINDOW_INPUT_GRABBED) != 0)); + return _this->grabbed_window; } void @@ -2637,6 +2704,7 @@ SDL_GL_ResetAttributes() #endif _this->gl_config.flags = 0; _this->gl_config.framebuffer_srgb_capable = 0; + _this->gl_config.release_behavior = SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH; _this->gl_config.share_with_current_context = 0; } @@ -2743,6 +2811,9 @@ SDL_GL_SetAttribute(SDL_GLattr attr, int value) case SDL_GL_FRAMEBUFFER_SRGB_CAPABLE: _this->gl_config.framebuffer_srgb_capable = value; break; + case SDL_GL_CONTEXT_RELEASE_BEHAVIOR: + _this->gl_config.release_behavior = value; + break; default: retval = SDL_SetError("Unknown OpenGL attribute"); break; @@ -2757,19 +2828,31 @@ int SDL_GL_GetAttribute(SDL_GLattr attr, int *value) { #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 - void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); - GLenum(APIENTRY * glGetErrorFunc) (void); + GLenum (APIENTRY *glGetErrorFunc) (void); GLenum attrib = 0; GLenum error = 0; - glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); - if (!glGetIntegervFunc) { - return -1; + /* + * Some queries in Core Profile desktop OpenGL 3+ contexts require + * glGetFramebufferAttachmentParameteriv instead of glGetIntegerv. Note that + * the enums we use for the former function don't exist in OpenGL ES 2, and + * the function itself doesn't exist prior to OpenGL 3 and OpenGL ES 2. + */ +#if SDL_VIDEO_OPENGL + const GLubyte *(APIENTRY *glGetStringFunc) (GLenum name); + void (APIENTRY *glGetFramebufferAttachmentParameterivFunc) (GLenum target, GLenum attachment, GLenum pname, GLint* params); + GLenum attachment = GL_BACK_LEFT; + GLenum attachmentattrib = 0; + + glGetStringFunc = SDL_GL_GetProcAddress("glGetString"); + if (!glGetStringFunc) { + return SDL_SetError("Failed getting OpenGL glGetString entry point"); } +#endif glGetErrorFunc = SDL_GL_GetProcAddress("glGetError"); if (!glGetErrorFunc) { - return -1; + return SDL_SetError("Failed getting OpenGL glGetError entry point"); } /* Clear value in any case */ @@ -2777,15 +2860,27 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) switch (attr) { case SDL_GL_RED_SIZE: +#if SDL_VIDEO_OPENGL + attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE; +#endif attrib = GL_RED_BITS; break; case SDL_GL_BLUE_SIZE: +#if SDL_VIDEO_OPENGL + attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE; +#endif attrib = GL_BLUE_BITS; break; case SDL_GL_GREEN_SIZE: +#if SDL_VIDEO_OPENGL + attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE; +#endif attrib = GL_GREEN_BITS; break; case SDL_GL_ALPHA_SIZE: +#if SDL_VIDEO_OPENGL + attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE; +#endif attrib = GL_ALPHA_BITS; break; case SDL_GL_DOUBLEBUFFER: @@ -2800,9 +2895,17 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) return 0; #endif case SDL_GL_DEPTH_SIZE: +#if SDL_VIDEO_OPENGL + attachment = GL_DEPTH; + attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE; +#endif attrib = GL_DEPTH_BITS; break; case SDL_GL_STENCIL_SIZE: +#if SDL_VIDEO_OPENGL + attachment = GL_STENCIL; + attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE; +#endif attrib = GL_STENCIL_BITS; break; #if SDL_VIDEO_OPENGL @@ -2832,38 +2935,37 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) return 0; #endif case SDL_GL_MULTISAMPLEBUFFERS: -#if SDL_VIDEO_OPENGL - attrib = GL_SAMPLE_BUFFERS_ARB; -#else attrib = GL_SAMPLE_BUFFERS; -#endif break; case SDL_GL_MULTISAMPLESAMPLES: -#if SDL_VIDEO_OPENGL - attrib = GL_SAMPLES_ARB; -#else attrib = GL_SAMPLES; + break; + case SDL_GL_CONTEXT_RELEASE_BEHAVIOR: +#if SDL_VIDEO_OPENGL + attrib = GL_CONTEXT_RELEASE_BEHAVIOR; +#else + attrib = GL_CONTEXT_RELEASE_BEHAVIOR_KHR; #endif break; case SDL_GL_BUFFER_SIZE: { - GLint bits = 0; - GLint component; + int rsize = 0, gsize = 0, bsize = 0, asize = 0; - /* - * there doesn't seem to be a single flag in OpenGL - * for this! - */ - glGetIntegervFunc(GL_RED_BITS, &component); - bits += component; - glGetIntegervFunc(GL_GREEN_BITS, &component); - bits += component; - glGetIntegervFunc(GL_BLUE_BITS, &component); - bits += component; - glGetIntegervFunc(GL_ALPHA_BITS, &component); - bits += component; + /* There doesn't seem to be a single flag in OpenGL for this! */ + if (SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &rsize) < 0) { + return -1; + } + if (SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &gsize) < 0) { + return -1; + } + if (SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &bsize) < 0) { + return -1; + } + if (SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &asize) < 0) { + return -1; + } - *value = bits; + *value = rsize + gsize + bsize + asize; return 0; } case SDL_GL_ACCELERATED_VISUAL: @@ -2922,7 +3024,27 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) return SDL_SetError("Unknown OpenGL attribute"); } - glGetIntegervFunc(attrib, (GLint *) value); +#if SDL_VIDEO_OPENGL + if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) { + glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv"); + + if (glGetFramebufferAttachmentParameterivFunc) { + glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *) value); + } else { + return SDL_SetError("Failed getting OpenGL glGetFramebufferAttachmentParameteriv entry point"); + } + } else +#endif + { + void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params); + glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); + if (glGetIntegervFunc) { + glGetIntegervFunc(attrib, (GLint *) value); + } else { + return SDL_SetError("Failed getting OpenGL glGetIntegerv entry point"); + } + } + error = glGetErrorFunc(); if (error != GL_NO_ERROR) { if (error == GL_INVALID_ENUM) { @@ -3331,6 +3453,7 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) SDL_CaptureMouse(SDL_FALSE); SDL_SetRelativeMouseMode(SDL_FALSE); show_cursor_prev = SDL_ShowCursor(1); + SDL_ResetKeyboard(); if (!buttonid) { buttonid = &dummybutton; @@ -3452,4 +3575,15 @@ SDL_SetWindowHitTest(SDL_Window * window, SDL_HitTest callback, void *userdata) return 0; } +float SDL_ComputeDiagonalDPI(int hpix, int vpix, float hinches, float vinches) +{ + float den2 = hinches * hinches + vinches * vinches; + if ( den2 <= 0.0f ) { + return 0.0f; + } + + return (float)(SDL_sqrt((double)hpix * (double)hpix + (double)vpix * (double)vpix) / + SDL_sqrt((double)den2)); +} + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/android/SDL_androidclipboard.c b/libs/SDL2/src/video/android/SDL_androidclipboard.c index dcac2e70..6a456472 100644 --- a/libs/SDL2/src/video/android/SDL_androidclipboard.c +++ b/libs/SDL2/src/video/android/SDL_androidclipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidclipboard.h b/libs/SDL2/src/video/android/SDL_androidclipboard.h index c1ab140c..600771b9 100644 --- a/libs/SDL2/src/video/android/SDL_androidclipboard.h +++ b/libs/SDL2/src/video/android/SDL_androidclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidevents.c b/libs/SDL2/src/video/android/SDL_androidevents.c index 2662d1b3..f15180a9 100644 --- a/libs/SDL2/src/video/android/SDL_androidevents.c +++ b/libs/SDL2/src/video/android/SDL_androidevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,8 +32,14 @@ void android_egl_context_backup(); void android_egl_context_restore(); + +#if SDL_AUDIO_DRIVER_ANDROID void AndroidAUD_ResumeDevices(void); void AndroidAUD_PauseDevices(void); +#else +static void AndroidAUD_ResumeDevices(void) {} +static void AndroidAUD_PauseDevices(void) {} +#endif void android_egl_context_restore() diff --git a/libs/SDL2/src/video/android/SDL_androidevents.h b/libs/SDL2/src/video/android/SDL_androidevents.h index 547338d7..888a593c 100644 --- a/libs/SDL2/src/video/android/SDL_androidevents.h +++ b/libs/SDL2/src/video/android/SDL_androidevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidgl.c b/libs/SDL2/src/video/android/SDL_androidgl.c index b452b5c7..5bf8d1a1 100644 --- a/libs/SDL2/src/video/android/SDL_androidgl.c +++ b/libs/SDL2/src/video/android/SDL_androidgl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidkeyboard.c b/libs/SDL2/src/video/android/SDL_androidkeyboard.c index 9ccda879..d75e42ad 100644 --- a/libs/SDL2/src/video/android/SDL_androidkeyboard.c +++ b/libs/SDL2/src/video/android/SDL_androidkeyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -253,8 +253,8 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */ SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUHENKAN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HENKAN */ + SDL_SCANCODE_INTERNATIONAL5, /* AKEYCODE_MUHENKAN */ + SDL_SCANCODE_INTERNATIONAL4, /* AKEYCODE_HENKAN */ SDL_SCANCODE_LANG3, /* AKEYCODE_KATAKANA_HIRAGANA */ SDL_SCANCODE_INTERNATIONAL3, /* AKEYCODE_YEN */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */ diff --git a/libs/SDL2/src/video/android/SDL_androidkeyboard.h b/libs/SDL2/src/video/android/SDL_androidkeyboard.h index 041987ac..3f643c30 100644 --- a/libs/SDL2/src/video/android/SDL_androidkeyboard.h +++ b/libs/SDL2/src/video/android/SDL_androidkeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidmessagebox.c b/libs/SDL2/src/video/android/SDL_androidmessagebox.c index 11f85699..1783b9cd 100644 --- a/libs/SDL2/src/video/android/SDL_androidmessagebox.c +++ b/libs/SDL2/src/video/android/SDL_androidmessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidmessagebox.h b/libs/SDL2/src/video/android/SDL_androidmessagebox.h index bc439cbe..b732a2a0 100644 --- a/libs/SDL2/src/video/android/SDL_androidmessagebox.h +++ b/libs/SDL2/src/video/android/SDL_androidmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidmouse.c b/libs/SDL2/src/video/android/SDL_androidmouse.c new file mode 100644 index 00000000..795b2aab --- /dev/null +++ b/libs/SDL2/src/video/android/SDL_androidmouse.c @@ -0,0 +1,84 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2015 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "../../SDL_internal.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +#include "SDL_androidmouse.h" + +#include "SDL_events.h" +#include "../../events/SDL_mouse_c.h" + +#include "../../core/android/SDL_android.h" + +#define ACTION_DOWN 0 +#define ACTION_UP 1 +#define ACTION_HOVER_MOVE 7 +#define ACTION_SCROLL 8 +#define BUTTON_PRIMARY 1 +#define BUTTON_SECONDARY 2 +#define BUTTON_TERTIARY 4 + +void Android_OnMouse( int androidButton, int action, float x, float y) { + static Uint8 SDLButton; + + if (!Android_Window) { + return; + } + + switch(action) { + case ACTION_DOWN: + // Determine which button originated the event, and store it for ACTION_UP + SDLButton = SDL_BUTTON_LEFT; + if (androidButton == BUTTON_SECONDARY) { + SDLButton = SDL_BUTTON_RIGHT; + } else if (androidButton == BUTTON_TERTIARY) { + SDLButton = SDL_BUTTON_MIDDLE; + } + SDL_SendMouseMotion(Android_Window, 0, 0, x, y); + SDL_SendMouseButton(Android_Window, 0, SDL_PRESSED, SDLButton); + break; + + case ACTION_UP: + // Android won't give us the button that originated the ACTION_DOWN event, so we'll + // assume it's the one we stored + SDL_SendMouseMotion(Android_Window, 0, 0, x, y); + SDL_SendMouseButton(Android_Window, 0, SDL_RELEASED, SDLButton); + break; + + case ACTION_HOVER_MOVE: + SDL_SendMouseMotion(Android_Window, 0, 0, x, y); + break; + + case ACTION_SCROLL: + SDL_SendMouseWheel(Android_Window, 0, x, y, SDL_MOUSEWHEEL_NORMAL); + break; + + default: + break; + } +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/libs/SDL2/src/video/android/SDL_androidmouse.h b/libs/SDL2/src/video/android/SDL_androidmouse.h new file mode 100644 index 00000000..72b3deb3 --- /dev/null +++ b/libs/SDL2/src/video/android/SDL_androidmouse.h @@ -0,0 +1,31 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2015 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_androidmouse_h +#define _SDL_androidmouse_h + +#include "SDL_androidvideo.h" + +extern void Android_OnMouse( int button, int action, float x, float y); + +#endif /* _SDL_androidmouse_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/android/SDL_androidtouch.c b/libs/SDL2/src/video/android/SDL_androidtouch.c index 5f33429b..b7ba3860 100644 --- a/libs/SDL2/src/video/android/SDL_androidtouch.c +++ b/libs/SDL2/src/video/android/SDL_androidtouch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,13 +24,12 @@ #include +#include "SDL_hints.h" #include "SDL_events.h" +#include "SDL_log.h" +#include "SDL_androidtouch.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" -#include "SDL_log.h" - -#include "SDL_androidtouch.h" - #include "../../core/android/SDL_android.h" #define ACTION_DOWN 0 @@ -51,11 +50,29 @@ static void Android_GetWindowCoordinates(float x, float y, *window_y = (int)(y * window_h); } +static volatile SDL_bool separate_mouse_and_touch = SDL_FALSE; + +static void +SeparateEventsHintWatcher(void *userdata, const char *name, + const char *oldValue, const char *newValue) +{ + jclass mActivityClass = Android_JNI_GetActivityClass(); + JNIEnv *env = Android_JNI_GetEnv(); + jfieldID fid = (*env)->GetStaticFieldID(env, mActivityClass, "mSeparateMouseAndTouch", "Z"); + + separate_mouse_and_touch = (newValue && (SDL_strcmp(newValue, "1") == 0)); + (*env)->SetStaticBooleanField(env, mActivityClass, fid, separate_mouse_and_touch ? JNI_TRUE : JNI_FALSE); +} + void Android_InitTouch(void) { int i; int* ids; - int number = Android_JNI_GetTouchDeviceIds(&ids); + const int number = Android_JNI_GetTouchDeviceIds(&ids); + + SDL_AddHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, + SeparateEventsHintWatcher, NULL); + if (0 < number) { for (i = 0; i < number; ++i) { SDL_AddTouch((SDL_TouchID) ids[i], ""); /* no error handling */ @@ -64,6 +81,13 @@ void Android_InitTouch(void) } } +void Android_QuitTouch(void) +{ + SDL_DelHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, + SeparateEventsHintWatcher, NULL); + separate_mouse_and_touch = SDL_FALSE; +} + void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p) { SDL_TouchID touchDeviceId = 0; @@ -84,37 +108,42 @@ void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int actio switch (action) { case ACTION_DOWN: /* Primary pointer down */ - Android_GetWindowCoordinates(x, y, &window_x, &window_y); - /* send moved event */ - SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y); - /* send mouse down event */ - SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); + if (!separate_mouse_and_touch) { + Android_GetWindowCoordinates(x, y, &window_x, &window_y); + /* send moved event */ + SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y); + /* send mouse down event */ + SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); + } pointerFingerID = fingerId; case ACTION_POINTER_DOWN: /* Non primary pointer down */ SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p); break; - + case ACTION_MOVE: if (!pointerFingerID) { - Android_GetWindowCoordinates(x, y, &window_x, &window_y); - - /* send moved event */ - SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y); + if (!separate_mouse_and_touch) { + Android_GetWindowCoordinates(x, y, &window_x, &window_y); + /* send moved event */ + SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y); + } } SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p); break; - + case ACTION_UP: /* Primary pointer up */ - /* send mouse up */ + if (!separate_mouse_and_touch) { + /* send mouse up */ + SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); + } pointerFingerID = (SDL_FingerID) 0; - SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); case ACTION_POINTER_UP: /* Non primary pointer up */ SDL_SendTouch(touchDeviceId, fingerId, SDL_FALSE, x, y, p); break; - + default: break; } diff --git a/libs/SDL2/src/video/android/SDL_androidtouch.h b/libs/SDL2/src/video/android/SDL_androidtouch.h index 81a0cb50..73a934fe 100644 --- a/libs/SDL2/src/video/android/SDL_androidtouch.h +++ b/libs/SDL2/src/video/android/SDL_androidtouch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,6 +23,7 @@ #include "SDL_androidvideo.h" extern void Android_InitTouch(void); +extern void Android_QuitTouch(void); extern void Android_OnTouch( int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p); /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/android/SDL_androidvideo.c b/libs/SDL2/src/video/android/SDL_androidvideo.c index 5e034615..983f3aa3 100644 --- a/libs/SDL2/src/video/android/SDL_androidvideo.c +++ b/libs/SDL2/src/video/android/SDL_androidvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -188,6 +188,7 @@ Android_VideoInit(_THIS) void Android_VideoQuit(_THIS) { + Android_QuitTouch(); } /* This function gets called before VideoInit() */ diff --git a/libs/SDL2/src/video/android/SDL_androidvideo.h b/libs/SDL2/src/video/android/SDL_androidvideo.h index a403c81b..fc6e60e8 100644 --- a/libs/SDL2/src/video/android/SDL_androidvideo.h +++ b/libs/SDL2/src/video/android/SDL_androidvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidwindow.c b/libs/SDL2/src/video/android/SDL_androidwindow.c index 32446dd3..46eaeb2a 100644 --- a/libs/SDL2/src/video/android/SDL_androidwindow.c +++ b/libs/SDL2/src/video/android/SDL_androidwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/android/SDL_androidwindow.h b/libs/SDL2/src/video/android/SDL_androidwindow.h index 9228b0f5..aa9283bc 100644 --- a/libs/SDL2/src/video/android/SDL_androidwindow.h +++ b/libs/SDL2/src/video/android/SDL_androidwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.h b/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.h index 0a5e0dc0..d86a75ef 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.m b/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.m index bf3b9095..73307445 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoaclipboard.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoaevents.h b/libs/SDL2/src/video/cocoa/SDL_cocoaevents.h index 1d27bbf9..f92a4a94 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoaevents.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoaevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoaevents.m b/libs/SDL2/src/video/cocoa/SDL_cocoaevents.m index 51020347..994da182 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoaevents.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoaevents.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,6 +26,7 @@ #include "SDL_cocoavideo.h" #include "../../events/SDL_events_c.h" #include "SDL_assert.h" +#include "SDL_hints.h" /* This define was added in the 10.9 SDK. */ #ifndef kIOPMAssertPreventUserIdleDisplaySleep @@ -66,11 +67,19 @@ { self = [super init]; if (self) { + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + seenFirstActivate = NO; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(focusSomeWindow:) - name:NSApplicationDidBecomeActiveNotification - object:nil]; + + [center addObserver:self + selector:@selector(windowWillClose:) + name:NSWindowWillCloseNotification + object:nil]; + + [center addObserver:self + selector:@selector(focusSomeWindow:) + name:NSApplicationDidBecomeActiveNotification + object:nil]; } return self; @@ -78,16 +87,65 @@ - (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + + [center removeObserver:self name:NSWindowWillCloseNotification object:nil]; + [center removeObserver:self name:NSApplicationDidBecomeActiveNotification object:nil]; + [super dealloc]; } +- (void)windowWillClose:(NSNotification *)notification; +{ + NSWindow *win = (NSWindow*)[notification object]; + + if (![win isKeyWindow]) { + return; + } + + /* HACK: Make the next window in the z-order key when the key window is + * closed. The custom event loop and/or windowing code we have seems to + * prevent the normal behavior: https://bugzilla.libsdl.org/show_bug.cgi?id=1825 + */ + + /* +[NSApp orderedWindows] never includes the 'About' window, but we still + * want to try its list first since the behavior in other apps is to only + * make the 'About' window key if no other windows are on-screen. + */ + for (NSWindow *window in [NSApp orderedWindows]) { + if (window != win && [window canBecomeKeyWindow]) { + if ([window respondsToSelector:@selector(isOnActiveSpace)]) { + if (![window isOnActiveSpace]) { + continue; + } + } + [window makeKeyAndOrderFront:self]; + return; + } + } + + /* If a window wasn't found above, iterate through all visible windows + * (including the 'About' window, if it's shown) and make the first one key. + * Note that +[NSWindow windowNumbersWithOptions:] was added in 10.6. + */ + if ([NSWindow respondsToSelector:@selector(windowNumbersWithOptions:)]) { + /* Get all visible windows in the active Space, in z-order. */ + for (NSNumber *num in [NSWindow windowNumbersWithOptions:0]) { + NSWindow *window = [NSApp windowWithWindowNumber:[num integerValue]]; + if (window && window != win && [window canBecomeKeyWindow]) { + [window makeKeyAndOrderFront:self]; + return; + } + } + } +} + - (void)focusSomeWindow:(NSNotification *)aNotification { /* HACK: Ignore the first call. The application gets a * applicationDidBecomeActive: a little bit after the first window is * created, and if we don't ignore it, a window that has been created with - * SDL_WINDOW_MINIZED will ~immediately be restored. + * SDL_WINDOW_MINIMIZED will ~immediately be restored. */ if (!seenFirstActivate) { seenFirstActivate = YES; @@ -261,19 +319,21 @@ Cocoa_RegisterApp(void) [SDLApplication sharedApplication]; SDL_assert(NSApp != nil); + const char *hint = SDL_GetHint(SDL_HINT_MAC_BACKGROUND_APP); + if (!hint || *hint == '0') { #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 - if ([NSApp respondsToSelector:@selector(setActivationPolicy:)]) { + if ([NSApp respondsToSelector:@selector(setActivationPolicy:)]) { #endif - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 - } else { - ProcessSerialNumber psn = {0, kCurrentProcess}; - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - } + } else { + ProcessSerialNumber psn = {0, kCurrentProcess}; + TransformProcessType(&psn, kProcessTransformToForegroundApplication); + } #endif - - [NSApp activateIgnoringOtherApps:YES]; - + [NSApp activateIgnoringOtherApps:YES]; + } + if ([NSApp mainMenu] == nil) { CreateApplicationMenus(); } diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.h b/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.h index a85f9b7b..e206bd3a 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.m b/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.m index c621182b..41ecf1f6 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoakeyboard.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.h b/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.h index ff468a88..f9ac0c45 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.m b/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.m index 5a8f7805..0998f792 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamessagebox.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamodes.h b/libs/SDL2/src/video/cocoa/SDL_cocoamodes.h index 4f8e8632..57c22ebd 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamodes.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamodes.m b/libs/SDL2/src/video/cocoa/SDL_cocoamodes.m index b3025c4f..73b14ed7 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamodes.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamodes.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -193,6 +193,7 @@ GetDisplayMode(_THIS, const void *moderef, CVDisplayLinkRef link, SDL_DisplayMod break; case 8: /* We don't support palettized modes now */ default: /* Totally unrecognizable bit depth. */ + SDL_free(data); return SDL_FALSE; } mode->w = width; diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamouse.h b/libs/SDL2/src/video/cocoa/SDL_cocoamouse.h index 336b8404..89e68caa 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamouse.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamouse.m b/libs/SDL2/src/video/cocoa/SDL_cocoamouse.m index c5d60f78..625d8f40 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamouse.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamouse.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -195,7 +195,22 @@ Cocoa_ShowCursor(SDL_Cursor * cursor) return 0; }} -static void +static SDL_Window * +SDL_FindWindowAtPoint(const int x, const int y) +{ + const SDL_Point pt = { x, y }; + SDL_Window *i; + for (i = SDL_GetVideoDevice()->windows; i; i = i->next) { + const SDL_Rect r = { i->x, i->y, i->w, i->h }; + if (SDL_PointInRect(&pt, &r)) { + return i; + } + } + + return NULL; +} + +static int Cocoa_WarpMouseGlobal(int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -204,10 +219,10 @@ Cocoa_WarpMouseGlobal(int x, int y) if ([data->listener isMoving]) { DLog("Postponing warp, window being moved."); [data->listener setPendingMoveX:x Y:y]; - return; + return 0; } } - CGPoint point = CGPointMake((float)x, (float)y); + const CGPoint point = CGPointMake((float)x, (float)y); Cocoa_HandleMouseWarp(point.x, point.y); @@ -219,12 +234,19 @@ Cocoa_WarpMouseGlobal(int x, int y) CGWarpMouseCursorPosition(point); CGSetLocalEventsSuppressionInterval(0.25); - if (!mouse->relative_mode && mouse->focus) { - /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our - * other implementations' APIs. - */ - SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x - mouse->focus->x, y - mouse->focus->y); + /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our + * other implementations' APIs. Send what's appropriate. + */ + if (!mouse->relative_mode) { + SDL_Window *win = SDL_FindWindowAtPoint(x, y); + SDL_SetMouseFocus(win); + if (win) { + SDL_assert(win == mouse->focus); + SDL_SendMouseMotion(win, mouse->mouseID, 0, x - win->x, y - win->y); + } } + + return 0; } static void diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.h b/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.h index bf3e7383..f1041b18 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.m b/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.m index c2742895..ca50ff96 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoamousetap.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.h b/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.h index 14fd3ab4..6b18af1e 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.m b/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.m index 0bbbbcb7..d8e9c901 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoaopengl.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -150,8 +150,8 @@ Cocoa_GL_UnloadLibrary(_THIS) SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; SDL_bool lion_or_later = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6; @@ -173,8 +173,6 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) return NULL; } - pool = [[NSAutoreleasePool alloc] init]; - /* specify a profile if we're on Lion (10.7) or later. */ if (lion_or_later) { NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy; @@ -239,7 +237,6 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr]; if (fmt == nil) { SDL_SetError("Failed creating OpenGL pixel format"); - [pool release]; return NULL; } @@ -253,12 +250,9 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) if (context == nil) { SDL_SetError("Failed creating OpenGL context"); - [pool release]; return NULL; } - [pool release]; - if ( Cocoa_GL_MakeCurrent(_this, window, context) < 0 ) { Cocoa_GL_DeleteContext(_this, context); SDL_SetError("Failed making OpenGL context current"); @@ -306,15 +300,12 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) /*_this->gl_config.minor_version = glversion_minor;*/ } return context; -} +}} int Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +{ @autoreleasepool { - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - if (context) { SDLOpenGLContext *nscontext = (SDLOpenGLContext *)context; [nscontext setWindow:window]; @@ -324,9 +315,8 @@ Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) [NSOpenGLContext clearCurrentContext]; } - [pool release]; return 0; -} +}} void Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) @@ -352,8 +342,8 @@ Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) int Cocoa_GL_SetSwapInterval(_THIS, int interval) +{ @autoreleasepool { - NSAutoreleasePool *pool; NSOpenGLContext *nscontext; GLint value; int status; @@ -362,8 +352,6 @@ Cocoa_GL_SetSwapInterval(_THIS, int interval) return SDL_SetError("Late swap tearing currently unsupported"); } - pool = [[NSAutoreleasePool alloc] init]; - nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext(); if (nscontext != nil) { value = interval; @@ -373,57 +361,44 @@ Cocoa_GL_SetSwapInterval(_THIS, int interval) status = SDL_SetError("No current OpenGL context"); } - [pool release]; return status; -} +}} int Cocoa_GL_GetSwapInterval(_THIS) +{ @autoreleasepool { - NSAutoreleasePool *pool; NSOpenGLContext *nscontext; GLint value; int status = 0; - pool = [[NSAutoreleasePool alloc] init]; - nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext(); if (nscontext != nil) { [nscontext getValues:&value forParameter:NSOpenGLCPSwapInterval]; status = (int)value; } - [pool release]; return status; -} +}} void Cocoa_GL_SwapWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - SDLOpenGLContext* nscontext = (SDLOpenGLContext*)SDL_GL_GetCurrentContext(); [nscontext flushBuffer]; [nscontext updateIfNeeded]; - - [pool release]; -} +}} void Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) +{ @autoreleasepool { - NSAutoreleasePool *pool; SDLOpenGLContext *nscontext = (SDLOpenGLContext *)context; - pool = [[NSAutoreleasePool alloc] init]; - [nscontext setWindow:NULL]; [nscontext release]; - - [pool release]; -} +}} #endif /* SDL_VIDEO_OPENGL_CGL */ diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoashape.h b/libs/SDL2/src/video/cocoa/SDL_cocoashape.h index 0ab9980e..e7fd185d 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoashape.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoashape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoashape.m b/libs/SDL2/src/video/cocoa/SDL_cocoashape.m index 61d800b6..1dce5679 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoashape.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoashape.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -75,11 +75,11 @@ ConvertRects(SDL_ShapeTree* tree, void* closure) int Cocoa_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) +{ @autoreleasepool { SDL_ShapeData* data = (SDL_ShapeData*)shaper->driverdata; SDL_WindowData* windata = (SDL_WindowData*)shaper->window->driverdata; SDL_CocoaClosure closure; - NSAutoreleasePool *pool = NULL; if(data->saved == SDL_TRUE) { [data->context restoreGraphicsState]; data->saved = SDL_FALSE; @@ -93,16 +93,14 @@ Cocoa_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowSha NSRectFill([[windata->nswindow contentView] frame]); data->shape = SDL_CalculateShapeTree(*shape_mode,shape); - pool = [[NSAutoreleasePool alloc] init]; closure.view = [windata->nswindow contentView]; closure.path = [NSBezierPath bezierPath]; closure.window = shaper->window; SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure); [closure.path addClip]; - [pool release]; return 0; -} +}} int Cocoa_ResizeWindowShape(SDL_Window *window) diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoavideo.h b/libs/SDL2/src/video/cocoa/SDL_cocoavideo.h index cf254db1..873f2573 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoavideo.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoavideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoavideo.m b/libs/SDL2/src/video/cocoa/SDL_cocoavideo.m index f31218b3..c6b01296 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoavideo.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoavideo.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoawindow.h b/libs/SDL2/src/video/cocoa/SDL_cocoawindow.h index 65a2c2fc..ed56600f 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoawindow.h +++ b/libs/SDL2/src/video/cocoa/SDL_cocoawindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -70,6 +70,7 @@ typedef enum -(void) windowDidDeminiaturize:(NSNotification *) aNotification; -(void) windowDidBecomeKey:(NSNotification *) aNotification; -(void) windowDidResignKey:(NSNotification *) aNotification; +-(void) windowDidChangeBackingProperties:(NSNotification *) aNotification; -(void) windowWillEnterFullScreen:(NSNotification *) aNotification; -(void) windowDidEnterFullScreen:(NSNotification *) aNotification; -(void) windowWillExitFullScreen:(NSNotification *) aNotification; diff --git a/libs/SDL2/src/video/cocoa/SDL_cocoawindow.m b/libs/SDL2/src/video/cocoa/SDL_cocoawindow.m index d5455290..b2521123 100644 --- a/libs/SDL2/src/video/cocoa/SDL_cocoawindow.m +++ b/libs/SDL2/src/video/cocoa/SDL_cocoawindow.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -106,42 +106,64 @@ - (NSDragOperation)draggingEntered:(id )sender { - return NSDragOperationGeneric; + if (([sender draggingSourceOperationMask] & NSDragOperationGeneric) == NSDragOperationGeneric) { + return NSDragOperationGeneric; + } + + return NSDragOperationNone; /* no idea what to do with this, reject it. */ } - (BOOL)performDragOperation:(id )sender +{ @autoreleasepool { - NSURL *fileURL = [NSURL URLFromPasteboard:[sender draggingPasteboard]]; - NSNumber *isAlias = nil; + NSPasteboard *pasteboard = [sender draggingPasteboard]; + NSArray *types = [NSArray arrayWithObject:NSFilenamesPboardType]; + NSString *desiredType = [pasteboard availableTypeFromArray:types]; + if (desiredType == nil) { + return NO; /* can't accept anything that's being dropped here. */ + } - if (fileURL == nil) { + NSData *data = [pasteboard dataForType:desiredType]; + if (data == nil) { return NO; } - /* Functionality for resolving URL aliases was added with OS X 10.6. */ - if ([fileURL respondsToSelector:@selector(getResourceValue:forKey:error:)]) { - [fileURL getResourceValue:&isAlias forKey:NSURLIsAliasFileKey error:nil]; - } + SDL_assert([desiredType isEqualToString:NSFilenamesPboardType]); + NSArray *array = [pasteboard propertyListForType:@"NSFilenamesPboardType"]; - /* If the URL is an alias, resolve it. */ - if ([isAlias boolValue]) { - NSURLBookmarkResolutionOptions opts = NSURLBookmarkResolutionWithoutMounting | NSURLBookmarkResolutionWithoutUI; - NSData *bookmark = [NSURL bookmarkDataWithContentsOfURL:fileURL error:nil]; - if (bookmark != nil) { - NSURL *resolvedURL = [NSURL URLByResolvingBookmarkData:bookmark - options:opts - relativeToURL:nil - bookmarkDataIsStale:nil - error:nil]; + for (NSString *path in array) { + NSURL *fileURL = [[NSURL fileURLWithPath:path] autorelease]; + NSNumber *isAlias = nil; - if (resolvedURL != nil) { - fileURL = resolvedURL; + /* Functionality for resolving URL aliases was added with OS X 10.6. */ + if ([fileURL respondsToSelector:@selector(getResourceValue:forKey:error:)]) { + [fileURL getResourceValue:&isAlias forKey:NSURLIsAliasFileKey error:nil]; + } + + /* If the URL is an alias, resolve it. */ + if ([isAlias boolValue]) { + NSURLBookmarkResolutionOptions opts = NSURLBookmarkResolutionWithoutMounting | NSURLBookmarkResolutionWithoutUI; + NSData *bookmark = [NSURL bookmarkDataWithContentsOfURL:fileURL error:nil]; + if (bookmark != nil) { + NSURL *resolvedURL = [NSURL URLByResolvingBookmarkData:bookmark + options:opts + relativeToURL:nil + bookmarkDataIsStale:nil + error:nil]; + + if (resolvedURL != nil) { + fileURL = resolvedURL; + } } } + + if (!SDL_SendDropFile([[fileURL path] UTF8String])) { + return NO; + } } - return (BOOL) SDL_SendDropFile([[fileURL path] UTF8String]); -} + return YES; +}} - (BOOL)wantsPeriodicDraggingUpdates { @@ -255,6 +277,7 @@ SetWindowStyle(SDL_Window * window, unsigned int style) [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window]; [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window]; [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window]; + [center addObserver:self selector:@selector(windowDidChangeBackingProperties:) name:NSWindowDidChangeBackingPropertiesNotification object:window]; [center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window]; [center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window]; [center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window]; @@ -374,7 +397,6 @@ SetWindowStyle(SDL_Window * window, unsigned int style) NSNotificationCenter *center; NSWindow *window = _data->nswindow; NSView *view = [window contentView]; - NSArray *windows = nil; center = [NSNotificationCenter defaultCenter]; @@ -386,6 +408,7 @@ SetWindowStyle(SDL_Window * window, unsigned int style) [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window]; [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window]; [center removeObserver:self name:NSWindowDidResignKeyNotification object:window]; + [center removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window]; [center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window]; [center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window]; [center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window]; @@ -402,25 +425,6 @@ SetWindowStyle(SDL_Window * window, unsigned int style) if ([view nextResponder] == self) { [view setNextResponder:nil]; } - - /* Make the next window in the z-order Key. If we weren't the foreground - when closed, this is a no-op. - !!! FIXME: Note that this is a hack, and there are corner cases where - !!! FIXME: this fails (such as the About box). The typical nib+RunLoop - !!! FIXME: handles this for Cocoa apps, but we bypass all that in SDL. - !!! FIXME: We should remove this code when we find a better way to - !!! FIXME: have the system do this for us. See discussion in - !!! FIXME: http://bugzilla.libsdl.org/show_bug.cgi?id=1825 - */ - windows = [NSApp orderedWindows]; - for (NSWindow *win in windows) { - if (win == window) { - continue; - } - - [win makeKeyAndOrderFront:self]; - break; - } } - (BOOL)isMoving @@ -551,13 +555,15 @@ SetWindowStyle(SDL_Window * window, unsigned int style) { SDL_Window *window = _data->window; SDL_Mouse *mouse = SDL_GetMouse(); + + /* We're going to get keyboard events, since we're key. */ + /* This needs to be done before restoring the relative mouse mode. */ + SDL_SetKeyboardFocus(window); + if (mouse->relative_mode && !mouse->relative_mode_warp && ![self isMoving]) { mouse->SetRelativeMouseMode(SDL_TRUE); } - /* We're going to get keyboard events, since we're key. */ - SDL_SetKeyboardFocus(window); - /* If we just gained focus we need the updated mouse position */ if (!mouse->relative_mode) { NSPoint point; @@ -602,6 +608,22 @@ SetWindowStyle(SDL_Window * window, unsigned int style) } } +- (void)windowDidChangeBackingProperties:(NSNotification *)aNotification +{ + NSNumber *oldscale = [[aNotification userInfo] objectForKey:NSBackingPropertyOldScaleFactorKey]; + + if (inFullscreenTransition) { + return; + } + + if ([oldscale doubleValue] != [_data->nswindow backingScaleFactor]) { + /* Force a resize event when the backing scale factor changes. */ + _data->window->w = 0; + _data->window->h = 0; + [self windowDidResize:aNotification]; + } +} + - (void)windowWillEnterFullScreen:(NSNotification *)aNotification { SDL_Window *window = _data->window; @@ -751,6 +773,14 @@ SetWindowStyle(SDL_Window * window, unsigned int style) { int button; + /* Ignore events that aren't inside the client area (i.e. title bar.) */ + if ([theEvent window]) { + const NSRect windowRect = [[[theEvent window] contentView] frame]; + if (!NSPointInRect([theEvent locationInWindow], windowRect)) { + return; + } + } + if ([self processHitTest:theEvent]) { return; /* dragging, drop event. */ } @@ -951,10 +981,8 @@ SetWindowStyle(SDL_Window * window, unsigned int style) for (NSTouch *touch in touches) { const SDL_TouchID touchId = (SDL_TouchID)(intptr_t)[touch device]; - if (!SDL_GetTouch(touchId)) { - if (SDL_AddTouch(touchId, "") < 0) { - return; - } + if (SDL_AddTouch(touchId, "") < 0) { + return; } const SDL_FingerID fingerId = (SDL_FingerID)(intptr_t)[touch identity]; @@ -982,14 +1010,29 @@ SetWindowStyle(SDL_Window * window, unsigned int style) @end -@interface SDLView : NSView +@interface SDLView : NSView { + SDL_Window *_sdlWindow; +} + +- (void)setSDLWindow:(SDL_Window*)window; /* The default implementation doesn't pass rightMouseDown to responder chain */ - (void)rightMouseDown:(NSEvent *)theEvent; - (BOOL)mouseDownCanMoveWindow; +- (void)drawRect:(NSRect)dirtyRect; @end @implementation SDLView +- (void)setSDLWindow:(SDL_Window*)window +{ + _sdlWindow = window; +} + +- (void)drawRect:(NSRect)dirtyRect +{ + SDL_SendWindowEvent(_sdlWindow, SDL_WINDOWEVENT_EXPOSED, 0, 0); +} + - (void)rightMouseDown:(NSEvent *)theEvent { [[self nextResponder] rightMouseDown:theEvent]; @@ -1020,8 +1063,8 @@ SetWindowStyle(SDL_Window * window, unsigned int style) static int SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created) +{ @autoreleasepool { - NSAutoreleasePool *pool; SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; SDL_WindowData *data; @@ -1036,8 +1079,6 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created data->videodata = videodata; data->nscontexts = [[NSMutableArray alloc] init]; - pool = [[NSAutoreleasePool alloc] init]; - /* Create an event listener for the window */ data->listener = [[Cocoa_WindowListener alloc] init]; @@ -1099,16 +1140,15 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created [nswindow setOneShot:NO]; /* All done! */ - [pool release]; window->driverdata = data; return 0; -} +}} int Cocoa_CreateWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSWindow *nswindow; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); NSRect rect; @@ -1143,9 +1183,7 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window) nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen]; } @catch (NSException *e) { - SDL_SetError("%s", [[e reason] UTF8String]); - [pool release]; - return -1; + return SDL_SetError("%s", [[e reason] UTF8String]); } [nswindow setBackgroundColor:[NSColor blackColor]]; @@ -1161,7 +1199,8 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window) /* Create a default view for this window */ rect = [nswindow contentRectForFrameRect:[nswindow frame]]; - NSView *contentView = [[SDLView alloc] initWithFrame:rect]; + SDLView *contentView = [[SDLView alloc] initWithFrame:rect]; + [contentView setSDLWindow:window]; if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { if ([contentView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) { @@ -1175,70 +1214,55 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window) /* Allow files and folders to be dragged onto the window by users */ [nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]]; - [pool release]; - if (SetupWindowData(_this, window, nswindow, SDL_TRUE) < 0) { [nswindow release]; return -1; } return 0; -} +}} int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +{ @autoreleasepool { - NSAutoreleasePool *pool; NSWindow *nswindow = (NSWindow *) data; NSString *title; - pool = [[NSAutoreleasePool alloc] init]; - /* Query the title from the existing window */ title = [nswindow title]; if (title) { window->title = SDL_strdup([title UTF8String]); } - [pool release]; - return SetupWindowData(_this, window, nswindow, SDL_FALSE); -} +}} void Cocoa_SetWindowTitle(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + const char *title = window->title ? window->title : ""; NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; - NSString *string; - - if(window->title) { - string = [[NSString alloc] initWithUTF8String:window->title]; - } else { - string = [[NSString alloc] init]; - } + NSString *string = [[NSString alloc] initWithUTF8String:title]; [nswindow setTitle:string]; [string release]; - - [pool release]; -} +}} void Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSImage *nsimage = Cocoa_CreateImage(icon); if (nsimage) { [NSApp setApplicationIconImage:nsimage]; } - - [pool release]; -} +}} void Cocoa_SetWindowPosition(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; NSWindow *nswindow = windata->nswindow; NSRect rect; @@ -1256,31 +1280,29 @@ Cocoa_SetWindowPosition(_THIS, SDL_Window * window) s_moveHack = moveHack; ScheduleContextUpdates(windata); - - [pool release]; -} +}} void Cocoa_SetWindowSize(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; NSWindow *nswindow = windata->nswindow; - NSSize size; - size.width = window->w; - size.height = window->h; - [nswindow setContentSize:size]; + NSRect frame = [nswindow frame]; + frame.origin.y = (frame.origin.y + frame.size.height) - ((float) window->h); + frame.size.width = window->w; + frame.size.height = window->h; + + [nswindow setFrame:frame display:YES]; ScheduleContextUpdates(windata); - - [pool release]; -} +}} void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; NSSize minSize; @@ -1288,14 +1310,12 @@ Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window) minSize.height = window->min_h; [windata->nswindow setContentMinSize:minSize]; - - [pool release]; -} +}} void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; NSSize maxSize; @@ -1303,14 +1323,12 @@ Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window) maxSize.height = window->max_h; [windata->nswindow setContentMaxSize:maxSize]; - - [pool release]; -} +}} void Cocoa_ShowWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windowData = ((SDL_WindowData *) window->driverdata); NSWindow *nswindow = windowData->nswindow; @@ -1319,23 +1337,21 @@ Cocoa_ShowWindow(_THIS, SDL_Window * window) [nswindow makeKeyAndOrderFront:nil]; [windowData->listener resumeVisibleObservation]; } - [pool release]; -} +}} void Cocoa_HideWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; [nswindow orderOut:nil]; - [pool release]; -} +}} void Cocoa_RaiseWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windowData = ((SDL_WindowData *) window->driverdata); NSWindow *nswindow = windowData->nswindow; @@ -1348,28 +1364,24 @@ Cocoa_RaiseWindow(_THIS, SDL_Window * window) [nswindow makeKeyAndOrderFront:nil]; } [windowData->listener resumeVisibleObservation]; - - [pool release]; -} +}} void Cocoa_MaximizeWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; NSWindow *nswindow = windata->nswindow; [nswindow zoom:nil]; ScheduleContextUpdates(windata); - - [pool release]; -} +}} void Cocoa_MinimizeWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *data = (SDL_WindowData *) window->driverdata; NSWindow *nswindow = data->nswindow; @@ -1378,13 +1390,12 @@ Cocoa_MinimizeWindow(_THIS, SDL_Window * window) } else { [nswindow miniaturize:nil]; } - [pool release]; -} +}} void Cocoa_RestoreWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; if ([nswindow isMiniaturized]) { @@ -1392,8 +1403,7 @@ Cocoa_RestoreWindow(_THIS, SDL_Window * window) } else if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) { [nswindow zoom:nil]; } - [pool release]; -} +}} static NSWindow * Cocoa_RebuildWindow(SDL_WindowData * data, NSWindow * nswindow, unsigned style) @@ -1418,21 +1428,20 @@ Cocoa_RebuildWindow(SDL_WindowData * data, NSWindow * nswindow, unsigned style) void Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (SetWindowStyle(window, GetWindowStyle(window))) { if (bordered) { Cocoa_SetWindowTitle(_this, window); /* this got blanked out. */ } } - [pool release]; -} +}} void Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *data = (SDL_WindowData *) window->driverdata; NSWindow *nswindow = data->nswindow; NSRect rect; @@ -1472,6 +1481,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display if ([nswindow respondsToSelector: @selector(setStyleMask:)]) { [nswindow performSelector: @selector(setStyleMask:) withObject: (id)(uintptr_t)GetWindowStyle(window)]; + + /* Hack to restore window decorations on Mac OS X 10.10 */ + NSRect frameRect = [nswindow frame]; + [nswindow setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO]; + [nswindow setFrame:frameRect display:NO]; } else { nswindow = Cocoa_RebuildWindow(data, nswindow, GetWindowStyle(window)); } @@ -1506,9 +1520,7 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display } ScheduleContextUpdates(data); - - [pool release]; -} +}} int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) @@ -1591,8 +1603,8 @@ Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) void Cocoa_DestroyWindow(_THIS, SDL_Window * window) +{ @autoreleasepool { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *data = (SDL_WindowData *) window->driverdata; if (data) { @@ -1612,9 +1624,7 @@ Cocoa_DestroyWindow(_THIS, SDL_Window * window) SDL_free(data); } window->driverdata = NULL; - - [pool release]; -} +}} SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) @@ -1646,9 +1656,9 @@ Cocoa_IsWindowInFullscreenSpace(SDL_Window * window) SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window * window, SDL_bool state) +{ @autoreleasepool { SDL_bool succeeded = SDL_FALSE; - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *data = (SDL_WindowData *) window->driverdata; if ([data->listener setFullscreenSpace:(state ? YES : NO)]) { @@ -1669,10 +1679,8 @@ Cocoa_SetWindowFullscreenSpace(SDL_Window * window, SDL_bool state) } } - [pool release]; - return succeeded; -} +}} int Cocoa_SetWindowHitTest(SDL_Window * window, SDL_bool enabled) diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.c index b48a1069..f6e1dea4 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -161,7 +161,7 @@ DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) y, w - 2 * d); /* Caption */ - if (window->title) { + if (*window->title) { s->SetColor(s, COLOR_EXPAND(t->font_color)); DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title); } diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.h index 0bfe07e0..828bd952 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_WM.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.c index 49c737b0..4dfd08c1 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.h index ba57f453..81d2b163 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_dyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_events.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_events.c index 9c6c7940..8508f2a9 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_events.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_events.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_events.h index db5c7f0f..fe205d1d 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_events.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.c index 73de1fc0..ab13b7ee 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.h index 7999f606..c847f182 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_modes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.c index 93798f8e..caa9eeec 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.h index 7ac48682..3f62c01b 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.c index 1a378792..edddd32c 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.h index ecd5bbaf..454aa249 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_render.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_render.c index 3a0220ea..003e4a77 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_render.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_render.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_render.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_render.h index 5405a5e5..0cd4bd32 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_render.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.c index 64e91f61..4c571572 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.h index 99bff800..27304712 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_video.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_video.c index 35379cb9..dbf890be 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_video.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_video.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_video.h index 82250b63..b722bbd9 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_video.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_window.c b/libs/SDL2/src/video/directfb/SDL_DirectFB_window.c index 42064be4..b8a94b45 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_window.c +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_window.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/directfb/SDL_DirectFB_window.h b/libs/SDL2/src/video/directfb/SDL_DirectFB_window.h index a16d1609..9290abcd 100644 --- a/libs/SDL2/src/video/directfb/SDL_DirectFB_window.h +++ b/libs/SDL2/src/video/directfb/SDL_DirectFB_window.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/dummy/SDL_nullevents.c b/libs/SDL2/src/video/dummy/SDL_nullevents.c index 22a34bba..d7df0dcb 100644 --- a/libs/SDL2/src/video/dummy/SDL_nullevents.c +++ b/libs/SDL2/src/video/dummy/SDL_nullevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/dummy/SDL_nullevents_c.h b/libs/SDL2/src/video/dummy/SDL_nullevents_c.h index 41e28caa..21168464 100644 --- a/libs/SDL2/src/video/dummy/SDL_nullevents_c.h +++ b/libs/SDL2/src/video/dummy/SDL_nullevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/dummy/SDL_nullframebuffer.c b/libs/SDL2/src/video/dummy/SDL_nullframebuffer.c index 2f1bcab7..74eeb310 100644 --- a/libs/SDL2/src/video/dummy/SDL_nullframebuffer.c +++ b/libs/SDL2/src/video/dummy/SDL_nullframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/dummy/SDL_nullframebuffer_c.h b/libs/SDL2/src/video/dummy/SDL_nullframebuffer_c.h index 4c582d7d..f75c70e8 100644 --- a/libs/SDL2/src/video/dummy/SDL_nullframebuffer_c.h +++ b/libs/SDL2/src/video/dummy/SDL_nullframebuffer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/dummy/SDL_nullvideo.c b/libs/SDL2/src/video/dummy/SDL_nullvideo.c index 28147bd1..96cee921 100644 --- a/libs/SDL2/src/video/dummy/SDL_nullvideo.c +++ b/libs/SDL2/src/video/dummy/SDL_nullvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -82,7 +82,6 @@ DUMMY_CreateDevice(int devindex) device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - SDL_free(device); return (0); } diff --git a/libs/SDL2/src/video/dummy/SDL_nullvideo.h b/libs/SDL2/src/video/dummy/SDL_nullvideo.h index b0a76c06..90ed3bc8 100644 --- a/libs/SDL2/src/video/dummy/SDL_nullvideo.h +++ b/libs/SDL2/src/video/dummy/SDL_nullvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.c b/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.c index 6a04d4cc..79fa310f 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.c +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,8 +38,9 @@ #define FULLSCREEN_MASK ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN ) /* -.which to scancode -https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Constants +.keyCode to scancode +https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent +https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode */ static const SDL_Scancode emscripten_scancode_table[] = { /* 0 */ SDL_SCANCODE_UNKNOWN, @@ -371,25 +372,24 @@ Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent *wheelEvent, vo EM_BOOL Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) { - /*SDL_WindowData *window_data = userData;*/ + SDL_WindowData *window_data = userData; int i; - SDL_TouchID deviceId = 0; - if (!SDL_GetTouch(deviceId)) { - if (SDL_AddTouch(deviceId, "") < 0) { - return 0; - } + SDL_TouchID deviceId = 1; + if (SDL_AddTouch(deviceId, "") < 0) { + return 0; } for (i = 0; i < touchEvent->numTouches; i++) { - long x, y, id; + SDL_FingerID id; + float x, y; if (!touchEvent->touches[i].isChanged) continue; id = touchEvent->touches[i].identifier; - x = touchEvent->touches[i].canvasX; - y = touchEvent->touches[i].canvasY; + x = touchEvent->touches[i].canvasX / (float)window_data->windowed_width; + y = touchEvent->touches[i].canvasY / (float)window_data->windowed_height; if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) { SDL_SendTouchMotion(deviceId, id, x, y, 1.0f); diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.h b/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.h index 01dc6a5e..ea5c3f5b 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.h +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.c b/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.c index 453865ab..a8f927e5 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.h b/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.h index e7373b51..01ed37d1 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.h +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,6 +27,6 @@ extern int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 extern int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); extern void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window * window); -#endif /* _SDL_emsctiptenframebuffer_h */ +#endif /* _SDL_emscriptenframebuffer_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.c b/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.c index 2e46a0a2..5748d1c2 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.c +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.h b/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.h index 7b3d50e8..1d5d2e9e 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.h +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.c b/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.c index 61198be7..6e9624d7 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.c +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.h b/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.h index 2d37eb05..9c356854 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.h +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.c b/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.c index 5da42927..4ce0a036 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.c +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.h b/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.h index 16ad3854..519e3fc3 100644 --- a/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.h +++ b/libs/SDL2/src/video/emscripten/SDL_emscriptenvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_BWin.h b/libs/SDL2/src/video/haiku/SDL_BWin.h index e6de5b0d..b4e347d0 100644 --- a/libs/SDL2/src/video/haiku/SDL_BWin.h +++ b/libs/SDL2/src/video/haiku/SDL_BWin.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bclipboard.cc b/libs/SDL2/src/video/haiku/SDL_bclipboard.cc index 9760d0fb..1a10b6bf 100644 --- a/libs/SDL2/src/video/haiku/SDL_bclipboard.cc +++ b/libs/SDL2/src/video/haiku/SDL_bclipboard.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bclipboard.h b/libs/SDL2/src/video/haiku/SDL_bclipboard.h index 418ba90b..654c6c59 100644 --- a/libs/SDL2/src/video/haiku/SDL_bclipboard.h +++ b/libs/SDL2/src/video/haiku/SDL_bclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bevents.cc b/libs/SDL2/src/video/haiku/SDL_bevents.cc index 2ffc4713..ec7d0125 100644 --- a/libs/SDL2/src/video/haiku/SDL_bevents.cc +++ b/libs/SDL2/src/video/haiku/SDL_bevents.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bevents.h b/libs/SDL2/src/video/haiku/SDL_bevents.h index 9b53f39a..ffb9ba5e 100644 --- a/libs/SDL2/src/video/haiku/SDL_bevents.h +++ b/libs/SDL2/src/video/haiku/SDL_bevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bframebuffer.cc b/libs/SDL2/src/video/haiku/SDL_bframebuffer.cc index 0c563960..3eb835b2 100644 --- a/libs/SDL2/src/video/haiku/SDL_bframebuffer.cc +++ b/libs/SDL2/src/video/haiku/SDL_bframebuffer.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bframebuffer.h b/libs/SDL2/src/video/haiku/SDL_bframebuffer.h index b0b73d3c..f3fbd96f 100644 --- a/libs/SDL2/src/video/haiku/SDL_bframebuffer.h +++ b/libs/SDL2/src/video/haiku/SDL_bframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bkeyboard.cc b/libs/SDL2/src/video/haiku/SDL_bkeyboard.cc index 97f34b23..e12d30ba 100644 --- a/libs/SDL2/src/video/haiku/SDL_bkeyboard.cc +++ b/libs/SDL2/src/video/haiku/SDL_bkeyboard.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bkeyboard.h b/libs/SDL2/src/video/haiku/SDL_bkeyboard.h index 0acb42c9..edf7643d 100644 --- a/libs/SDL2/src/video/haiku/SDL_bkeyboard.h +++ b/libs/SDL2/src/video/haiku/SDL_bkeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bmodes.cc b/libs/SDL2/src/video/haiku/SDL_bmodes.cc index b56442b0..c5da410f 100644 --- a/libs/SDL2/src/video/haiku/SDL_bmodes.cc +++ b/libs/SDL2/src/video/haiku/SDL_bmodes.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bmodes.h b/libs/SDL2/src/video/haiku/SDL_bmodes.h index 3df862d3..e73c090e 100644 --- a/libs/SDL2/src/video/haiku/SDL_bmodes.h +++ b/libs/SDL2/src/video/haiku/SDL_bmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bopengl.cc b/libs/SDL2/src/video/haiku/SDL_bopengl.cc index 245cec12..25869992 100644 --- a/libs/SDL2/src/video/haiku/SDL_bopengl.cc +++ b/libs/SDL2/src/video/haiku/SDL_bopengl.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bopengl.h b/libs/SDL2/src/video/haiku/SDL_bopengl.h index b046de4e..e325687f 100644 --- a/libs/SDL2/src/video/haiku/SDL_bopengl.h +++ b/libs/SDL2/src/video/haiku/SDL_bopengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bvideo.cc b/libs/SDL2/src/video/haiku/SDL_bvideo.cc index a526893f..9fe24d34 100644 --- a/libs/SDL2/src/video/haiku/SDL_bvideo.cc +++ b/libs/SDL2/src/video/haiku/SDL_bvideo.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bvideo.h b/libs/SDL2/src/video/haiku/SDL_bvideo.h index 925c8b5b..72292d00 100644 --- a/libs/SDL2/src/video/haiku/SDL_bvideo.h +++ b/libs/SDL2/src/video/haiku/SDL_bvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bwindow.cc b/libs/SDL2/src/video/haiku/SDL_bwindow.cc index c0a3cee0..dc3ddb5d 100644 --- a/libs/SDL2/src/video/haiku/SDL_bwindow.cc +++ b/libs/SDL2/src/video/haiku/SDL_bwindow.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/haiku/SDL_bwindow.h b/libs/SDL2/src/video/haiku/SDL_bwindow.h index 5a393497..e1c59134 100644 --- a/libs/SDL2/src/video/haiku/SDL_bwindow.h +++ b/libs/SDL2/src/video/haiku/SDL_bwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirdyn.c b/libs/SDL2/src/video/mir/SDL_mirdyn.c index f544d06e..ffb1e9e2 100644 --- a/libs/SDL2/src/video/mir/SDL_mirdyn.c +++ b/libs/SDL2/src/video/mir/SDL_mirdyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirdyn.h b/libs/SDL2/src/video/mir/SDL_mirdyn.h index 3bd62e14..1dadfc6d 100644 --- a/libs/SDL2/src/video/mir/SDL_mirdyn.h +++ b/libs/SDL2/src/video/mir/SDL_mirdyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirevents.c b/libs/SDL2/src/video/mir/SDL_mirevents.c index 76870d5a..8ff2cb3a 100644 --- a/libs/SDL2/src/video/mir/SDL_mirevents.c +++ b/libs/SDL2/src/video/mir/SDL_mirevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirevents.h b/libs/SDL2/src/video/mir/SDL_mirevents.h index 9219eed1..8caabc8a 100644 --- a/libs/SDL2/src/video/mir/SDL_mirevents.h +++ b/libs/SDL2/src/video/mir/SDL_mirevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirframebuffer.c b/libs/SDL2/src/video/mir/SDL_mirframebuffer.c index 212c4a78..d1821cc4 100644 --- a/libs/SDL2/src/video/mir/SDL_mirframebuffer.c +++ b/libs/SDL2/src/video/mir/SDL_mirframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirframebuffer.h b/libs/SDL2/src/video/mir/SDL_mirframebuffer.h index b4860fe1..328fb23d 100644 --- a/libs/SDL2/src/video/mir/SDL_mirframebuffer.h +++ b/libs/SDL2/src/video/mir/SDL_mirframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirmouse.c b/libs/SDL2/src/video/mir/SDL_mirmouse.c index 72f4b6a3..740ac20e 100644 --- a/libs/SDL2/src/video/mir/SDL_mirmouse.c +++ b/libs/SDL2/src/video/mir/SDL_mirmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -110,10 +110,10 @@ MIR_WarpMouse(SDL_Window* window, int x, int y) SDL_Unsupported(); } -static void +static int MIR_WarpMouseGlobal(int x, int y) { - SDL_Unsupported(); + return SDL_Unsupported(); } static int diff --git a/libs/SDL2/src/video/mir/SDL_mirmouse.h b/libs/SDL2/src/video/mir/SDL_mirmouse.h index fd4e4762..700cc699 100644 --- a/libs/SDL2/src/video/mir/SDL_mirmouse.h +++ b/libs/SDL2/src/video/mir/SDL_mirmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_miropengl.c b/libs/SDL2/src/video/mir/SDL_miropengl.c index 976b7727..b7c7ae80 100644 --- a/libs/SDL2/src/video/mir/SDL_miropengl.c +++ b/libs/SDL2/src/video/mir/SDL_miropengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_miropengl.h b/libs/SDL2/src/video/mir/SDL_miropengl.h index 0f4c9731..5a04ac8a 100644 --- a/libs/SDL2/src/video/mir/SDL_miropengl.h +++ b/libs/SDL2/src/video/mir/SDL_miropengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirsym.h b/libs/SDL2/src/video/mir/SDL_mirsym.h index 1f8359be..415df0c9 100644 --- a/libs/SDL2/src/video/mir/SDL_mirsym.h +++ b/libs/SDL2/src/video/mir/SDL_mirsym.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirvideo.c b/libs/SDL2/src/video/mir/SDL_mirvideo.c index 490e0571..176e9a12 100644 --- a/libs/SDL2/src/video/mir/SDL_mirvideo.c +++ b/libs/SDL2/src/video/mir/SDL_mirvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirvideo.h b/libs/SDL2/src/video/mir/SDL_mirvideo.h index 5a46d09c..8db90b52 100644 --- a/libs/SDL2/src/video/mir/SDL_mirvideo.h +++ b/libs/SDL2/src/video/mir/SDL_mirvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirwindow.c b/libs/SDL2/src/video/mir/SDL_mirwindow.c index 6c9641c0..513dbe24 100644 --- a/libs/SDL2/src/video/mir/SDL_mirwindow.c +++ b/libs/SDL2/src/video/mir/SDL_mirwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/mir/SDL_mirwindow.h b/libs/SDL2/src/video/mir/SDL_mirwindow.h index 411c1485..577dfa41 100644 --- a/libs/SDL2/src/video/mir/SDL_mirwindow.h +++ b/libs/SDL2/src/video/mir/SDL_mirwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -63,7 +63,7 @@ MIR_RestoreWindow(_THIS, SDL_Window* window); extern SDL_bool MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info); -#endif /* _SDL_mirwindow */ +#endif /* _SDL_mirwindow_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/nacl/SDL_naclevents.c b/libs/SDL2/src/video/nacl/SDL_naclevents.c index ebdbbfa2..c552abb8 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclevents.c +++ b/libs/SDL2/src/video/nacl/SDL_naclevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/nacl/SDL_naclevents_c.h b/libs/SDL2/src/video/nacl/SDL_naclevents_c.h index 6e343683..5fa6f991 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclevents_c.h +++ b/libs/SDL2/src/video/nacl/SDL_naclevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/nacl/SDL_naclglue.c b/libs/SDL2/src/video/nacl/SDL_naclglue.c index 722f26ef..127494e9 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclglue.c +++ b/libs/SDL2/src/video/nacl/SDL_naclglue.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,4 +21,4 @@ #include "../../SDL_internal.h" #if SDL_VIDEO_DRIVER_NACL -#endif /* SDL_VIDEO_DRIVER_NACL */ \ No newline at end of file +#endif /* SDL_VIDEO_DRIVER_NACL */ diff --git a/libs/SDL2/src/video/nacl/SDL_naclopengles.c b/libs/SDL2/src/video/nacl/SDL_naclopengles.c index 081cc8a4..349d4bbd 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclopengles.c +++ b/libs/SDL2/src/video/nacl/SDL_naclopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/nacl/SDL_naclopengles.h b/libs/SDL2/src/video/nacl/SDL_naclopengles.h index d5c3e97e..bcbca7db 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclopengles.h +++ b/libs/SDL2/src/video/nacl/SDL_naclopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/nacl/SDL_naclvideo.c b/libs/SDL2/src/video/nacl/SDL_naclvideo.c index 90cc0f22..e9d014c8 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclvideo.c +++ b/libs/SDL2/src/video/nacl/SDL_naclvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -180,4 +180,4 @@ void NACL_VideoQuit(_THIS) { } #endif /* SDL_VIDEO_DRIVER_NACL */ -/* vi: set ts=4 sw=4 expandtab: */ \ No newline at end of file +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/nacl/SDL_naclvideo.h b/libs/SDL2/src/video/nacl/SDL_naclvideo.h index 7e1c77fe..d9dc1630 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclvideo.h +++ b/libs/SDL2/src/video/nacl/SDL_naclvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/nacl/SDL_naclwindow.c b/libs/SDL2/src/video/nacl/SDL_naclwindow.c index 046331e0..73c70337 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclwindow.c +++ b/libs/SDL2/src/video/nacl/SDL_naclwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/nacl/SDL_naclwindow.h b/libs/SDL2/src/video/nacl/SDL_naclwindow.h index ee94e60c..3d6f375b 100644 --- a/libs/SDL2/src/video/nacl/SDL_naclwindow.h +++ b/libs/SDL2/src/video/nacl/SDL_naclwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/pandora/SDL_pandora.c b/libs/SDL2/src/video/pandora/SDL_pandora.c index 10ca3824..2a0f4dcc 100644 --- a/libs/SDL2/src/video/pandora/SDL_pandora.c +++ b/libs/SDL2/src/video/pandora/SDL_pandora.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/pandora/SDL_pandora.h b/libs/SDL2/src/video/pandora/SDL_pandora.h index 802365ee..2dbbb2a9 100644 --- a/libs/SDL2/src/video/pandora/SDL_pandora.h +++ b/libs/SDL2/src/video/pandora/SDL_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/pandora/SDL_pandora_events.c b/libs/SDL2/src/video/pandora/SDL_pandora_events.c index eedbc293..f42e0b71 100644 --- a/libs/SDL2/src/video/pandora/SDL_pandora_events.c +++ b/libs/SDL2/src/video/pandora/SDL_pandora_events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/pandora/SDL_pandora_events.h b/libs/SDL2/src/video/pandora/SDL_pandora_events.h index e628d14a..c4313779 100644 --- a/libs/SDL2/src/video/pandora/SDL_pandora_events.h +++ b/libs/SDL2/src/video/pandora/SDL_pandora_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspevents.c b/libs/SDL2/src/video/psp/SDL_pspevents.c index 399566bf..64fc0f81 100644 --- a/libs/SDL2/src/video/psp/SDL_pspevents.c +++ b/libs/SDL2/src/video/psp/SDL_pspevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspevents_c.h b/libs/SDL2/src/video/psp/SDL_pspevents_c.h index af45c4d1..9e24b6ba 100644 --- a/libs/SDL2/src/video/psp/SDL_pspevents_c.h +++ b/libs/SDL2/src/video/psp/SDL_pspevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspgl.c b/libs/SDL2/src/video/psp/SDL_pspgl.c index 61620de3..f0fa7c3f 100644 --- a/libs/SDL2/src/video/psp/SDL_pspgl.c +++ b/libs/SDL2/src/video/psp/SDL_pspgl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspgl_c.h b/libs/SDL2/src/video/psp/SDL_pspgl_c.h index c0c15d95..03b7a8c2 100644 --- a/libs/SDL2/src/video/psp/SDL_pspgl_c.h +++ b/libs/SDL2/src/video/psp/SDL_pspgl_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspmouse.c b/libs/SDL2/src/video/psp/SDL_pspmouse.c index 0c8f5a42..14c69dee 100644 --- a/libs/SDL2/src/video/psp/SDL_pspmouse.c +++ b/libs/SDL2/src/video/psp/SDL_pspmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspmouse_c.h b/libs/SDL2/src/video/psp/SDL_pspmouse_c.h index d14b84b9..de5ff4ef 100644 --- a/libs/SDL2/src/video/psp/SDL_pspmouse_c.h +++ b/libs/SDL2/src/video/psp/SDL_pspmouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspvideo.c b/libs/SDL2/src/video/psp/SDL_pspvideo.c index 61244093..cfcf0cff 100644 --- a/libs/SDL2/src/video/psp/SDL_pspvideo.c +++ b/libs/SDL2/src/video/psp/SDL_pspvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/psp/SDL_pspvideo.h b/libs/SDL2/src/video/psp/SDL_pspvideo.h index cb25b57d..e468c2dd 100644 --- a/libs/SDL2/src/video/psp/SDL_pspvideo.h +++ b/libs/SDL2/src/video/psp/SDL_pspvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/raspberry/SDL_rpievents.c b/libs/SDL2/src/video/raspberry/SDL_rpievents.c index cdfc746a..12760a86 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpievents.c +++ b/libs/SDL2/src/video/raspberry/SDL_rpievents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/raspberry/SDL_rpievents_c.h b/libs/SDL2/src/video/raspberry/SDL_rpievents_c.h index e69c5917..adc2fdd7 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpievents_c.h +++ b/libs/SDL2/src/video/raspberry/SDL_rpievents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/raspberry/SDL_rpimouse.c b/libs/SDL2/src/video/raspberry/SDL_rpimouse.c index b0ba88de..f8ee4ec6 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpimouse.c +++ b/libs/SDL2/src/video/raspberry/SDL_rpimouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,7 +48,7 @@ static int RPI_ShowCursor(SDL_Cursor * cursor); static void RPI_MoveCursor(SDL_Cursor * cursor); static void RPI_FreeCursor(SDL_Cursor * cursor); static void RPI_WarpMouse(SDL_Window * window, int x, int y); -static void RPI_WarpMouseGlobal(int x, int y); +static int RPI_WarpMouseGlobal(int x, int y); static SDL_Cursor * RPI_CreateDefaultCursor(void) @@ -216,18 +216,18 @@ RPI_WarpMouse(SDL_Window * window, int x, int y) } /* Warp the mouse to (x,y) */ -static void +static int RPI_WarpMouseGlobal(int x, int y) { RPI_CursorData *curdata; DISPMANX_UPDATE_HANDLE_T update; - int ret; VC_RECT_T dst_rect; SDL_Mouse *mouse = SDL_GetMouse(); if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) { curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata; if (curdata->element != DISPMANX_NO_HANDLE) { + int ret; update = vc_dispmanx_update_start( 10 ); SDL_assert( update ); vc_dispmanx_rect_set( &dst_rect, x, y, curdata->w, curdata->h); @@ -245,8 +245,11 @@ RPI_WarpMouseGlobal(int x, int y) /* Submit asynchronously, otherwise the peformance suffers a lot */ ret = vc_dispmanx_update_submit( update, 0, NULL ); SDL_assert( ret == DISPMANX_SUCCESS ); + return (ret == DISPMANX_SUCCESS) ? 0 : -1; } } + + return -1; /* !!! FIXME: this should SDL_SetError() somewhere. */ } void diff --git a/libs/SDL2/src/video/raspberry/SDL_rpimouse.h b/libs/SDL2/src/video/raspberry/SDL_rpimouse.h index a39e6549..db8df76f 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpimouse.h +++ b/libs/SDL2/src/video/raspberry/SDL_rpimouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/raspberry/SDL_rpiopengles.c b/libs/SDL2/src/video/raspberry/SDL_rpiopengles.c index c6f462b2..4809c925 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpiopengles.c +++ b/libs/SDL2/src/video/raspberry/SDL_rpiopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/raspberry/SDL_rpiopengles.h b/libs/SDL2/src/video/raspberry/SDL_rpiopengles.h index 5ef8f8ff..5dda45d5 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpiopengles.h +++ b/libs/SDL2/src/video/raspberry/SDL_rpiopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/raspberry/SDL_rpivideo.c b/libs/SDL2/src/video/raspberry/SDL_rpivideo.c index 8391c762..fae9143b 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpivideo.c +++ b/libs/SDL2/src/video/raspberry/SDL_rpivideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -284,15 +284,14 @@ RPI_CreateWindow(_THIS, SDL_Window * window) void RPI_DestroyWindow(_THIS, SDL_Window * window) { - SDL_WindowData *data; - - if(window->driverdata) { - data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + if(data) { +#if SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { SDL_EGL_DestroySurface(_this, data->egl_surface); - data->egl_surface = EGL_NO_SURFACE; } - SDL_free(window->driverdata); +#endif + SDL_free(data); window->driverdata = NULL; } } diff --git a/libs/SDL2/src/video/raspberry/SDL_rpivideo.h b/libs/SDL2/src/video/raspberry/SDL_rpivideo.h index 4de8983c..648254c8 100644 --- a/libs/SDL2/src/video/raspberry/SDL_rpivideo.h +++ b/libs/SDL2/src/video/raspberry/SDL_rpivideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/sdlgenblit.pl b/libs/SDL2/src/video/sdlgenblit.pl index db83d250..202c6c22 100644 --- a/libs/SDL2/src/video/sdlgenblit.pl +++ b/libs/SDL2/src/video/sdlgenblit.pl @@ -92,7 +92,7 @@ sub open_file { /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.h b/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.h index d5430beb..9f3c9854 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,12 +21,21 @@ #import -@interface SDLUIKitDelegate : NSObject { -} +@interface SDLLaunchScreenController : UIViewController -+ (id) sharedAppDelegate; +- (instancetype)init; +- (void)loadView; +- (NSUInteger)supportedInterfaceOrientations; + +@end + +@interface SDLUIKitDelegate : NSObject + ++ (id)sharedAppDelegate; + (NSString *)getAppDelegateClassName; +- (void)hideLaunchScreen; + @end /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.m b/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.m index f112672a..5d63019e 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitappdelegate.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,8 +28,10 @@ #include "SDL_system.h" #include "SDL_main.h" -#include "SDL_uikitappdelegate.h" -#include "SDL_uikitmodes.h" +#import "SDL_uikitappdelegate.h" +#import "SDL_uikitmodes.h" +#import "SDL_uikitwindow.h" + #include "../../events/SDL_events_c.h" #ifdef main @@ -39,12 +41,10 @@ static int forward_argc; static char **forward_argv; static int exit_status; -static UIWindow *launch_window; int main(int argc, char **argv) { int i; - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; /* store arguments */ forward_argc = argc; @@ -56,7 +56,9 @@ int main(int argc, char **argv) forward_argv[i] = NULL; /* Give over control to run loop, SDLUIKitDelegate will handle most things from here */ - UIApplicationMain(argc, argv, NULL, [SDLUIKitDelegate getAppDelegateClassName]); + @autoreleasepool { + UIApplicationMain(argc, argv, nil, [SDLUIKitDelegate getAppDelegateClassName]); + } /* free the memory we used to hold copies of argc and argv */ for (i = 0; i < forward_argc; i++) { @@ -64,7 +66,6 @@ int main(int argc, char **argv) } free(forward_argv); - [pool release]; return exit_status; } @@ -75,224 +76,291 @@ SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldVa [UIApplication sharedApplication].idleTimerDisabled = disable; } +/* Load a launch image using the old UILaunchImageFile-era naming rules. */ +static UIImage * +SDL_LoadLaunchImageNamed(NSString *name, int screenh) +{ + UIInterfaceOrientation curorient = [UIApplication sharedApplication].statusBarOrientation; + UIUserInterfaceIdiom idiom = [UIDevice currentDevice].userInterfaceIdiom; + UIImage *image = nil; -@interface SDL_launchscreenviewcontroller : UIViewController { - + if (idiom == UIUserInterfaceIdiomPhone && screenh == 568) { + /* The image name for the iPhone 5 uses its height as a suffix. */ + image = [UIImage imageNamed:[NSString stringWithFormat:@"%@-568h", name]]; + } else if (idiom == UIUserInterfaceIdiomPad) { + /* iPad apps can launch in any orientation. */ + if (UIInterfaceOrientationIsLandscape(curorient)) { + if (curorient == UIInterfaceOrientationLandscapeLeft) { + image = [UIImage imageNamed:[NSString stringWithFormat:@"%@-LandscapeLeft", name]]; + } else { + image = [UIImage imageNamed:[NSString stringWithFormat:@"%@-LandscapeRight", name]]; + } + if (!image) { + image = [UIImage imageNamed:[NSString stringWithFormat:@"%@-Landscape", name]]; + } + } else { + if (curorient == UIInterfaceOrientationPortraitUpsideDown) { + image = [UIImage imageNamed:[NSString stringWithFormat:@"%@-PortraitUpsideDown", name]]; + } + if (!image) { + image = [UIImage imageNamed:[NSString stringWithFormat:@"%@-Portrait", name]]; + } + } + } + + if (!image) { + image = [UIImage imageNamed:name]; + } + + return image; } -@end +@implementation SDLLaunchScreenController -@implementation SDL_launchscreenviewcontroller - -- (id)init +- (instancetype)init { - self = [super init]; - if (self == nil) { + if (!(self = [super initWithNibName:nil bundle:nil])) { return nil; } - NSString* launch_screen_name = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"]; + NSBundle *bundle = [NSBundle mainBundle]; + NSString *screenname = [bundle objectForInfoDictionaryKey:@"UILaunchStoryboardName"]; + BOOL atleastiOS8 = UIKit_IsSystemVersionAtLeast(8.0); - if(launch_screen_name) { - // TODO: If the NIB is not in the bundle, this will throw an exception. We might consider a pre-emptive check, but returning a useless viewcontroller isn't helpful and the check should be outside. - UIView* launch_screen = [[[NSBundle mainBundle] loadNibNamed:launch_screen_name owner:self options:nil] objectAtIndex:0]; - CGSize size = [UIScreen mainScreen].bounds.size; - - CGRect bounds = CGRectMake(0, 0, size.width, size.height); - - [launch_screen setFrame:bounds]; - [self setView:launch_screen]; - [launch_screen release]; + /* Launch screens were added in iOS 8. Otherwise we use launch images. */ + if (screenname && atleastiOS8) { + @try { + self.view = [bundle loadNibNamed:screenname owner:self options:nil][0]; + } + @catch (NSException *exception) { + /* If a launch screen name is specified but it fails to load, iOS + * displays a blank screen rather than falling back to an image. */ + return nil; + } } - + if (!self.view) { + NSArray *launchimages = [bundle objectForInfoDictionaryKey:@"UILaunchImages"]; + UIInterfaceOrientation curorient = [UIApplication sharedApplication].statusBarOrientation; + NSString *imagename = nil; + UIImage *image = nil; + int screenw = (int)([UIScreen mainScreen].bounds.size.width + 0.5); + int screenh = (int)([UIScreen mainScreen].bounds.size.height + 0.5); + + /* We always want portrait-oriented size, to match UILaunchImageSize. */ + if (screenw > screenh) { + int width = screenw; + screenw = screenh; + screenh = width; + } + + /* Xcode 5 introduced a dictionary of launch images in Info.plist. */ + if (launchimages) { + for (NSDictionary *dict in launchimages) { + UIInterfaceOrientationMask orientmask = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; + NSString *minversion = dict[@"UILaunchImageMinimumOSVersion"]; + NSString *sizestring = dict[@"UILaunchImageSize"]; + NSString *orientstring = dict[@"UILaunchImageOrientation"]; + + /* Ignore this image if the current version is too low. */ + if (minversion && !UIKit_IsSystemVersionAtLeast(minversion.doubleValue)) { + continue; + } + + /* Ignore this image if the size doesn't match. */ + if (sizestring) { + CGSize size = CGSizeFromString(sizestring); + if ((int)(size.width + 0.5) != screenw || (int)(size.height + 0.5) != screenh) { + continue; + } + } + + if (orientstring) { + if ([orientstring isEqualToString:@"PortraitUpsideDown"]) { + orientmask = UIInterfaceOrientationMaskPortraitUpsideDown; + } else if ([orientstring isEqualToString:@"Landscape"]) { + orientmask = UIInterfaceOrientationMaskLandscape; + } else if ([orientstring isEqualToString:@"LandscapeLeft"]) { + orientmask = UIInterfaceOrientationMaskLandscapeLeft; + } else if ([orientstring isEqualToString:@"LandscapeRight"]) { + orientmask = UIInterfaceOrientationMaskLandscapeRight; + } + } + + /* Ignore this image if the orientation doesn't match. */ + if ((orientmask & (1 << curorient)) == 0) { + continue; + } + + imagename = dict[@"UILaunchImageName"]; + } + + if (imagename) { + image = [UIImage imageNamed:imagename]; + } + } else { + imagename = [bundle objectForInfoDictionaryKey:@"UILaunchImageFile"]; + + if (imagename) { + image = SDL_LoadLaunchImageNamed(imagename, screenh); + } + + if (!image) { + image = SDL_LoadLaunchImageNamed(@"Default", screenh); + } + } + + if (image) { + UIImageView *view = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIImageOrientation imageorient = UIImageOrientationUp; + + /* Bugs observed / workaround tested in iOS 8.3, 7.1, and 6.1. */ + if (UIInterfaceOrientationIsLandscape(curorient)) { + if (atleastiOS8 && image.size.width < image.size.height) { + /* On iOS 8, portrait launch images displayed in forced- + * landscape mode (e.g. a standard Default.png on an iPhone + * when Info.plist only supports landscape orientations) need + * to be rotated to display in the expected orientation. */ + if (curorient == UIInterfaceOrientationLandscapeLeft) { + imageorient = UIImageOrientationRight; + } else if (curorient == UIInterfaceOrientationLandscapeRight) { + imageorient = UIImageOrientationLeft; + } + } else if (!atleastiOS8 && image.size.width > image.size.height) { + /* On iOS 7 and below, landscape launch images displayed in + * landscape mode (e.g. landscape iPad launch images) need + * to be rotated to display in the expected orientation. */ + if (curorient == UIInterfaceOrientationLandscapeLeft) { + imageorient = UIImageOrientationLeft; + } else if (curorient == UIInterfaceOrientationLandscapeRight) { + imageorient = UIImageOrientationRight; + } + } + } + + /* Create the properly oriented image. */ + view.image = [[UIImage alloc] initWithCGImage:image.CGImage scale:image.scale orientation:imageorient]; + + self.view = view; + } + } return self; } -- (NSUInteger)supportedInterfaceOrientations +- (void)loadView { - NSUInteger orientationMask = UIInterfaceOrientationMaskAll; - - /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */ - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { - orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown; - } - return orientationMask; + /* Do nothing. */ } -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient +- (BOOL)shouldAutorotate { - NSUInteger orientationMask = [self supportedInterfaceOrientations]; - return (orientationMask & (1 << orient)); -} - -@end - - -@interface SDL_splashviewcontroller : UIViewController { - UIImageView *splash; - UIImage *splashPortrait; - UIImage *splashLandscape; -} - -- (void)updateSplashImage:(UIInterfaceOrientation)interfaceOrientation; -@end - -@implementation SDL_splashviewcontroller - -- (id)init -{ - self = [super init]; - if (self == nil) { - return nil; - } - - self->splash = [[UIImageView alloc] init]; - [self setView:self->splash]; - - CGSize size = [UIScreen mainScreen].bounds.size; - float height = SDL_max(size.width, size.height); - /* FIXME: Some where around iOS 7, UILaunchImages in the Info.plist was introduced which explicitly maps image names to devices and orientations. - This gets rid of the hardcoded magic file names and allows more control for OS version, orientation, retina, and device. - But this existing code needs to be modified to look in the Info.plist for each key and act appropriately for the correct iOS version. - But iOS 8 superscedes this process and introduces the LaunchScreen NIB which uses autolayout to handle all orientations and devices. - Since we now have a LaunchScreen solution, this may never get fixed, - but this note is here for anybody trying to debug their program on iOS 7 and doesn't understand why their Info.plist isn't working. - */ - self->splashPortrait = [UIImage imageNamed:[NSString stringWithFormat:@"Default-%dh.png", (int)height]]; - if (!self->splashPortrait) { - self->splashPortrait = [UIImage imageNamed:@"Default.png"]; - } - self->splashLandscape = [UIImage imageNamed:@"Default-Landscape.png"]; - if (!self->splashLandscape && self->splashPortrait) { - self->splashLandscape = [[UIImage alloc] initWithCGImage: self->splashPortrait.CGImage - scale: 1.0 - orientation: UIImageOrientationRight]; - } - if (self->splashPortrait) { - [self->splashPortrait retain]; - } - if (self->splashLandscape) { - [self->splashLandscape retain]; - } - - [self updateSplashImage:[[UIApplication sharedApplication] statusBarOrientation]]; - - return self; + /* If YES, the launch image will be incorrectly rotated in some cases. */ + return NO; } - (NSUInteger)supportedInterfaceOrientations { - NSUInteger orientationMask = UIInterfaceOrientationMaskAll; - - /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */ - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { - orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown; - } - return orientationMask; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient -{ - NSUInteger orientationMask = [self supportedInterfaceOrientations]; - return (orientationMask & (1 << orient)); -} - -- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration -{ - [self updateSplashImage:interfaceOrientation]; -} - -- (void)updateSplashImage:(UIInterfaceOrientation)interfaceOrientation -{ - UIImage *image; - - if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) { - image = self->splashLandscape; - } else { - image = self->splashPortrait; - } - if (image) - { - splash.image = image; - } + /* We keep the supported orientations unrestricted to avoid the case where + * there are no common orientations between the ones set in Info.plist and + * the ones set here (it will cause an exception in that case.) */ + return UIInterfaceOrientationMaskAll; } @end - -@implementation SDLUIKitDelegate +@implementation SDLUIKitDelegate { + UIWindow *launchWindow; +} /* convenience method */ -+ (id) sharedAppDelegate ++ (id)sharedAppDelegate { - /* the delegate is set in UIApplicationMain(), which is garaunteed to be called before this method */ - return [[UIApplication sharedApplication] delegate]; + /* the delegate is set in UIApplicationMain(), which is guaranteed to be + * called before this method */ + return [UIApplication sharedApplication].delegate; } + (NSString *)getAppDelegateClassName { - /* subclassing notice: when you subclass this appdelegate, make sure to add a category to override - this method and return the actual name of the delegate */ + /* subclassing notice: when you subclass this appdelegate, make sure to add + * a category to override this method and return the actual name of the + * delegate */ return @"SDLUIKitDelegate"; } -- (id)init +- (void)hideLaunchScreen { - self = [super init]; - return self; + UIWindow *window = launchWindow; + + if (!window || window.hidden) { + return; + } + + launchWindow = nil; + + /* Do a nice animated fade-out (roughly matches the real launch behavior.) */ + [UIView animateWithDuration:0.2 animations:^{ + window.alpha = 0.0; + } completion:^(BOOL finished) { + window.hidden = YES; + }]; } - (void)postFinishLaunch { + /* Hide the launch screen the next time the run loop is run. SDL apps will + * have a chance to load resources while the launch screen is still up. */ + [self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0]; + /* run the user's application, passing argc and argv */ SDL_iPhoneSetEventPump(SDL_TRUE); exit_status = SDL_main(forward_argc, forward_argv); SDL_iPhoneSetEventPump(SDL_FALSE); - /* If we showed a splash image, clean it up */ - if (launch_window) { - [launch_window release]; - launch_window = NULL; + if (launchWindow) { + launchWindow.hidden = YES; + launchWindow = nil; } /* exit, passing the return status from the user's application */ - /* We don't actually exit to support applications that do setup in - * their main function and then allow the Cocoa event loop to run. - */ + /* We don't actually exit to support applications that do setup in their + * main function and then allow the Cocoa event loop to run. */ /* exit(exit_status); */ } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - /* Keep the launch image up until we set a video mode */ - launch_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + NSBundle *bundle = [NSBundle mainBundle]; + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; - /* iOS 8 introduces LaunchScreen NIBs which use autolayout to handle all devices and orientations with a single NIB instead of multiple launch images. - This is also the only way to get the App Store badge "Optimized for iPhone 6 and iPhone 6 Plus". - So if the application is running on iOS 8 or greater AND has specified a LaunchScreen in their Info.plist, we should use the LaunchScreen NIB. - Otherwise, we should fallback to the legacy behavior of launch screen images. - */ - NSString* launch_screen_name = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"]; - if( ([[UIDevice currentDevice].systemVersion intValue] >= 8) && (nil != launch_screen_name) ) { - // iOS 8.0 and above uses LaunchScreen.xib - SDL_launchscreenviewcontroller* launch_screen_view_controller = [[SDL_launchscreenviewcontroller alloc] init]; - launch_window.rootViewController = launch_screen_view_controller; - [launch_window addSubview:launch_screen_view_controller.view]; - [launch_window makeKeyAndVisible]; - } else { - // Anything less than iOS 8.0 +#if SDL_IPHONE_LAUNCHSCREEN + /* The normal launch screen is displayed until didFinishLaunching returns, + * but SDL_main is called after that happens and there may be a noticeable + * delay between the start of SDL_main and when the first real frame is + * displayed (e.g. if resources are loaded before SDL_GL_SwapWindow is + * called), so we show the launch screen programmatically until the first + * time events are pumped. */ + UIViewController *viewcontroller = [[SDLLaunchScreenController alloc] init]; - UIViewController *splashViewController = [[SDL_splashviewcontroller alloc] init]; - launch_window.rootViewController = splashViewController; - [launch_window addSubview:splashViewController.view]; - [launch_window makeKeyAndVisible]; + if (viewcontroller.view) { + launchWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + + /* We don't want the launch window immediately hidden when a real SDL + * window is shown - we fade it out ourselves when we're ready. */ + launchWindow.windowLevel = UIWindowLevelNormal + 1.0; + + /* Show the window but don't make it key. Events should always go to + * other windows when possible. */ + launchWindow.hidden = NO; + + launchWindow.rootViewController = viewcontroller; } +#endif /* Set working directory to resource path */ - [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]]; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:[bundle resourcePath]]; /* register a callback for the idletimer hint */ SDL_AddHintCallback(SDL_HINT_IDLE_TIMER_DISABLED, @@ -314,7 +382,35 @@ SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldVa SDL_SendAppEvent(SDL_APP_LOWMEMORY); } -- (void) applicationWillResignActive:(UIApplication*)application +- (void)application:(UIApplication *)application didChangeStatusBarOrientation:(UIInterfaceOrientation)oldStatusBarOrientation +{ + BOOL isLandscape = UIInterfaceOrientationIsLandscape(application.statusBarOrientation); + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + + if (_this && _this->num_displays > 0) { + SDL_DisplayMode *desktopmode = &_this->displays[0].desktop_mode; + SDL_DisplayMode *currentmode = &_this->displays[0].current_mode; + + /* The desktop display mode should be kept in sync with the screen + * orientation so that updating a window's fullscreen state to + * SDL_WINDOW_FULLSCREEN_DESKTOP keeps the window dimensions in the + * correct orientation. */ + if (isLandscape != (desktopmode->w > desktopmode->h)) { + int height = desktopmode->w; + desktopmode->w = desktopmode->h; + desktopmode->h = height; + } + + /* Same deal with the current mode + SDL_GetCurrentDisplayMode. */ + if (isLandscape != (currentmode->w > currentmode->h)) { + int height = currentmode->w; + currentmode->w = currentmode->h; + currentmode->h = height; + } + } +} + +- (void)applicationWillResignActive:(UIApplication*)application { SDL_VideoDevice *_this = SDL_GetVideoDevice(); if (_this) { @@ -327,17 +423,17 @@ SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldVa SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND); } -- (void) applicationDidEnterBackground:(UIApplication*)application +- (void)applicationDidEnterBackground:(UIApplication*)application { SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND); } -- (void) applicationWillEnterForeground:(UIApplication*)application +- (void)applicationWillEnterForeground:(UIApplication*)application { SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND); } -- (void) applicationDidBecomeActive:(UIApplication*)application +- (void)applicationDidBecomeActive:(UIApplication*)application { SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND); @@ -353,11 +449,11 @@ SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldVa - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - NSURL *fileURL = [url filePathURL]; + NSURL *fileURL = url.filePathURL; if (fileURL != nil) { - SDL_SendDropFile([[fileURL path] UTF8String]); + SDL_SendDropFile([fileURL.path UTF8String]); } else { - SDL_SendDropFile([[url absoluteString] UTF8String]); + SDL_SendDropFile([url.absoluteString UTF8String]); } return YES; } diff --git a/libs/SDL2/src/video/uikit/SDL_uikitevents.h b/libs/SDL2/src/video/uikit/SDL_uikitevents.h index d9fb4ab3..63eeb955 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitevents.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/uikit/SDL_uikitevents.m b/libs/SDL2/src/video/uikit/SDL_uikitevents.m index 94fba878..d4d6fcc4 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitevents.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitevents.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,8 +40,9 @@ SDL_iPhoneSetEventPump(SDL_bool enabled) void UIKit_PumpEvents(_THIS) { - if (!UIKit_EventPumpEnabled) + if (!UIKit_EventPumpEnabled) { return; + } /* Let the run loop run for a short amount of time: long enough for touch events to get processed (which is important to get certain diff --git a/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.h b/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.h index 86af87b5..2f38ac0d 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.m b/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.m index c24f3ff8..dea8bdc6 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitmessagebox.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,35 +30,20 @@ static SDL_bool s_showingMessageBox = SDL_FALSE; -@interface UIKit_UIAlertViewDelegate : NSObject { -@private - int *clickedButtonIndex; -} +@interface SDLAlertViewDelegate : NSObject -- (id)initWithButtonIndex:(int *)_buttonIndex; -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; +@property (nonatomic, assign) int clickedIndex; @end -@implementation UIKit_UIAlertViewDelegate +@implementation SDLAlertViewDelegate -- (id)initWithButtonIndex:(int *)buttonIndex +- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { - self = [self init]; - if (self == nil) { - return nil; - } - self->clickedButtonIndex = buttonIndex; - - return self; + _clickedIndex = (int)buttonIndex; } -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; -{ - *clickedButtonIndex = (int)buttonIndex; -} - -@end /* UIKit_UIAlertViewDelegate */ +@end SDL_bool @@ -70,42 +55,39 @@ UIKit_ShowingMessageBox() int UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { - int clicked; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - UIAlertView* alert = [[UIAlertView alloc] init]; - - alert.title = [NSString stringWithUTF8String:messageboxdata->title]; - alert.message = [NSString stringWithUTF8String:messageboxdata->message]; - alert.delegate = [[UIKit_UIAlertViewDelegate alloc] initWithButtonIndex:&clicked]; - - const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; int i; - for (i = 0; i < messageboxdata->numbuttons; ++i) { - [alert addButtonWithTitle:[[NSString alloc] initWithUTF8String:buttons[i].text]]; + const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; + + @autoreleasepool { + UIAlertView *alert = [[UIAlertView alloc] init]; + SDLAlertViewDelegate *delegate = [[SDLAlertViewDelegate alloc] init]; + + alert.delegate = delegate; + alert.title = @(messageboxdata->title); + alert.message = @(messageboxdata->message); + + for (i = 0; i < messageboxdata->numbuttons; ++i) { + [alert addButtonWithTitle:@(buttons[i].text)]; + } + + /* Set up for showing the alert */ + delegate.clickedIndex = messageboxdata->numbuttons; + + [alert show]; + + /* Run the main event loop until the alert has finished */ + /* Note that this needs to be done on the main thread */ + s_showingMessageBox = SDL_TRUE; + while (delegate.clickedIndex == messageboxdata->numbuttons) { + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; + } + s_showingMessageBox = SDL_FALSE; + + *buttonid = messageboxdata->buttons[delegate.clickedIndex].buttonid; + + alert.delegate = nil; } - /* Set up for showing the alert */ - clicked = messageboxdata->numbuttons; - - [alert show]; - - /* Run the main event loop until the alert has finished */ - /* Note that this needs to be done on the main thread */ - s_showingMessageBox = SDL_TRUE; - while (clicked == messageboxdata->numbuttons) { - [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; - } - s_showingMessageBox = SDL_FALSE; - - *buttonid = messageboxdata->buttons[clicked].buttonid; - - [alert.delegate release]; - [alert release]; - - [pool release]; - return 0; } diff --git a/libs/SDL2/src/video/uikit/SDL_uikitmodes.h b/libs/SDL2/src/video/uikit/SDL_uikitmodes.h index 9f2e9dd3..86bf3b2e 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitmodes.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,17 +25,17 @@ #include "SDL_uikitvideo.h" -typedef struct -{ - UIScreen *uiscreen; - CGFloat scale; -} SDL_DisplayData; +@interface SDL_DisplayData : NSObject -typedef struct -{ - UIScreenMode *uiscreenmode; - CGFloat scale; -} SDL_DisplayModeData; +@property (nonatomic, strong) UIScreen *uiscreen; + +@end + +@interface SDL_DisplayModeData : NSObject + +@property (nonatomic, strong) UIScreenMode *uiscreenmode; + +@end extern SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen); diff --git a/libs/SDL2/src/video/uikit/SDL_uikitmodes.m b/libs/SDL2/src/video/uikit/SDL_uikitmodes.m index 05e33d9c..afe6a957 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitmodes.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitmodes.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,27 +25,36 @@ #include "SDL_assert.h" #include "SDL_uikitmodes.h" +@implementation SDL_DisplayData + +@synthesize uiscreen; + +@end + +@implementation SDL_DisplayModeData + +@synthesize uiscreenmode; + +@end + static int UIKit_AllocateDisplayModeData(SDL_DisplayMode * mode, - UIScreenMode * uiscreenmode, CGFloat scale) + UIScreenMode * uiscreenmode) { - SDL_DisplayModeData *data = NULL; + SDL_DisplayModeData *data = nil; if (uiscreenmode != nil) { /* Allocate the display mode data */ - data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data)); + data = [[SDL_DisplayModeData alloc] init]; if (!data) { return SDL_OutOfMemory(); } - data->uiscreenmode = uiscreenmode; - [data->uiscreenmode retain]; - - data->scale = scale; + data.uiscreenmode = uiscreenmode; } - mode->driverdata = data; + mode->driverdata = (void *) CFBridgingRetain(data); return 0; } @@ -54,23 +63,21 @@ static void UIKit_FreeDisplayModeData(SDL_DisplayMode * mode) { if (mode->driverdata != NULL) { - SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; - [data->uiscreenmode release]; - SDL_free(data); + CFRelease(mode->driverdata); mode->driverdata = NULL; } } static int UIKit_AddSingleDisplayMode(SDL_VideoDisplay * display, int w, int h, - UIScreenMode * uiscreenmode, CGFloat scale) + UIScreenMode * uiscreenmode) { SDL_DisplayMode mode; SDL_zero(mode); mode.format = SDL_PIXELFORMAT_ABGR8888; mode.refresh_rate = 0; - if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode, scale) < 0) { + if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode) < 0) { return -1; } @@ -85,16 +92,16 @@ UIKit_AddSingleDisplayMode(SDL_VideoDisplay * display, int w, int h, } static int -UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, CGFloat scale, +UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, UIScreenMode * uiscreenmode, SDL_bool addRotation) { - if (UIKit_AddSingleDisplayMode(display, w, h, uiscreenmode, scale) < 0) { + if (UIKit_AddSingleDisplayMode(display, w, h, uiscreenmode) < 0) { return -1; } if (addRotation) { /* Add the rotated version */ - if (UIKit_AddSingleDisplayMode(display, h, w, uiscreenmode, scale) < 0) { + if (UIKit_AddSingleDisplayMode(display, h, w, uiscreenmode) < 0) { return -1; } } @@ -105,7 +112,7 @@ UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, CGFloat scale, static int UIKit_AddDisplay(UIScreen *uiscreen) { - CGSize size = [uiscreen bounds].size; + CGSize size = uiscreen.bounds.size; /* Make sure the width/height are oriented correctly */ if (UIKit_IsDisplayLandscape(uiscreen) != (size.width > size.height)) { @@ -114,24 +121,16 @@ UIKit_AddDisplay(UIScreen *uiscreen) size.height = height; } - /* When dealing with UIKit all coordinates are specified in terms of - * what Apple refers to as points. [UIScreen scale] indicates the - * relationship between points and pixels. Since SDL has no notion - * of points, we must compensate in all cases where dealing with such - * units. - */ - CGFloat scale = [uiscreen scale]; - SDL_VideoDisplay display; SDL_DisplayMode mode; SDL_zero(mode); mode.format = SDL_PIXELFORMAT_ABGR8888; - mode.w = (int)(size.width * scale); - mode.h = (int)(size.height * scale); + mode.w = (int) size.width; + mode.h = (int) size.height; - UIScreenMode * uiscreenmode = [uiscreen currentMode]; + UIScreenMode *uiscreenmode = uiscreen.currentMode; - if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode, scale) < 0) { + if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode) < 0) { return -1; } @@ -140,17 +139,15 @@ UIKit_AddDisplay(UIScreen *uiscreen) display.current_mode = mode; /* Allocate the display data */ - SDL_DisplayData *data = (SDL_DisplayData *) SDL_malloc(sizeof(*data)); + SDL_DisplayData *data = [[SDL_DisplayData alloc] init]; if (!data) { UIKit_FreeDisplayModeData(&display.desktop_mode); return SDL_OutOfMemory(); } - [uiscreen retain]; - data->uiscreen = uiscreen; - data->scale = scale; + data.uiscreen = uiscreen; - display.driverdata = data; + display.driverdata = (void *) CFBridgingRetain(data); SDL_AddVideoDisplay(&display); return 0; @@ -160,9 +157,9 @@ SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen) { if (uiscreen == [UIScreen mainScreen]) { - return UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]); + return UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation); } else { - CGSize size = [uiscreen bounds].size; + CGSize size = uiscreen.bounds.size; return (size.width > size.height); } } @@ -170,9 +167,11 @@ UIKit_IsDisplayLandscape(UIScreen *uiscreen) int UIKit_InitModes(_THIS) { - for (UIScreen *uiscreen in [UIScreen screens]) { - if (UIKit_AddDisplay(uiscreen) < 0) { - return -1; + @autoreleasepool { + for (UIScreen *uiscreen in [UIScreen screens]) { + if (UIKit_AddDisplay(uiscreen) < 0) { + return -1; + } } } @@ -182,34 +181,35 @@ UIKit_InitModes(_THIS) void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) { - SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; + @autoreleasepool { + SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; - SDL_bool isLandscape = UIKit_IsDisplayLandscape(data->uiscreen); - SDL_bool addRotation = (data->uiscreen == [UIScreen mainScreen]); + SDL_bool isLandscape = UIKit_IsDisplayLandscape(data.uiscreen); + SDL_bool addRotation = (data.uiscreen == [UIScreen mainScreen]); + CGFloat scale = data.uiscreen.scale; - for (UIScreenMode *uimode in [data->uiscreen availableModes]) { - CGSize size = [uimode size]; - int w = (int)size.width; - int h = (int)size.height; - - /* Make sure the width/height are oriented correctly */ - if (isLandscape != (w > h)) { - int tmp = w; - w = h; - h = tmp; +#ifdef __IPHONE_8_0 + /* The UIScreenMode of an iPhone 6 Plus should be 1080x1920 rather than + * 1242x2208 (414x736@3x), so we should use the native scale. */ + if ([data.uiscreen respondsToSelector:@selector(nativeScale)]) { + scale = data.uiscreen.nativeScale; } +#endif - /* Add the native screen resolution. */ - UIKit_AddDisplayMode(display, w, h, data->scale, uimode, addRotation); + for (UIScreenMode *uimode in data.uiscreen.availableModes) { + /* The size of a UIScreenMode is in pixels, but we deal exclusively + * in points (except in SDL_GL_GetDrawableSize.) */ + int w = (int)(uimode.size.width / scale); + int h = (int)(uimode.size.height / scale); - if (data->scale != 1.0f) { - /* Add the native screen resolution divided by its scale. - * This is so devices capable of e.g. 640x960 also advertise 320x480. - */ - UIKit_AddDisplayMode(display, - (int)(size.width / data->scale), - (int)(size.height / data->scale), - 1.0f, uimode, addRotation); + /* Make sure the width/height are oriented correctly */ + if (isLandscape != (w > h)) { + int tmp = w; + w = h; + h = tmp; + } + + UIKit_AddDisplayMode(display, w, h, uimode, addRotation); } } } @@ -217,19 +217,24 @@ UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { - SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; - SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata; + @autoreleasepool { + SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; + SDL_DisplayModeData *modedata = (__bridge SDL_DisplayModeData *)mode->driverdata; - [data->uiscreen setCurrentMode:modedata->uiscreenmode]; + [data.uiscreen setCurrentMode:modedata.uiscreenmode]; - if (data->uiscreen == [UIScreen mainScreen]) { - if (mode->w > mode->h) { - if (!UIKit_IsDisplayLandscape(data->uiscreen)) { - [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; - } - } else if (mode->w < mode->h) { - if (UIKit_IsDisplayLandscape(data->uiscreen)) { - [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; + if (data.uiscreen == [UIScreen mainScreen]) { + /* [UIApplication setStatusBarOrientation:] no longer works reliably + * in recent iOS versions, so we can't rotate the screen when setting + * the display mode. */ + if (mode->w > mode->h) { + if (!UIKit_IsDisplayLandscape(data.uiscreen)) { + return SDL_SetError("Screen orientation does not match display mode size"); + } + } else if (mode->w < mode->h) { + if (UIKit_IsDisplayLandscape(data.uiscreen)) { + return SDL_SetError("Screen orientation does not match display mode size"); + } } } } @@ -242,19 +247,21 @@ UIKit_QuitModes(_THIS) { /* Release Objective-C objects, so higher level doesn't free() them. */ int i, j; - for (i = 0; i < _this->num_displays; i++) { - SDL_VideoDisplay *display = &_this->displays[i]; + @autoreleasepool { + for (i = 0; i < _this->num_displays; i++) { + SDL_VideoDisplay *display = &_this->displays[i]; - UIKit_FreeDisplayModeData(&display->desktop_mode); - for (j = 0; j < display->num_display_modes; j++) { - SDL_DisplayMode *mode = &display->display_modes[j]; - UIKit_FreeDisplayModeData(mode); + UIKit_FreeDisplayModeData(&display->desktop_mode); + for (j = 0; j < display->num_display_modes; j++) { + SDL_DisplayMode *mode = &display->display_modes[j]; + UIKit_FreeDisplayModeData(mode); + } + + if (display->driverdata != NULL) { + CFRelease(display->driverdata); + display->driverdata = NULL; + } } - - SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; - [data->uiscreen release]; - SDL_free(data); - display->driverdata = NULL; } } diff --git a/libs/SDL2/src/video/uikit/SDL_uikitopengles.h b/libs/SDL2/src/video/uikit/SDL_uikitopengles.h index 947678ca..aa6bc75d 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitopengles.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,6 +25,8 @@ extern int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +extern void UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, + int * w, int * h); extern void UIKit_GL_SwapWindow(_THIS, SDL_Window * window); extern SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window); extern void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context); diff --git a/libs/SDL2/src/video/uikit/SDL_uikitopengles.m b/libs/SDL2/src/video/uikit/SDL_uikitopengles.m index 8d71ee81..e9c26e31 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitopengles.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitopengles.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,10 +23,10 @@ #if SDL_VIDEO_DRIVER_UIKIT #include "SDL_uikitopengles.h" -#include "SDL_uikitopenglview.h" -#include "SDL_uikitappdelegate.h" +#import "SDL_uikitopenglview.h" #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" +#include "SDL_uikitevents.h" #include "../SDL_sysvideo.h" #include "../../events/SDL_keyboard_c.h" #include "../../events/SDL_mouse_c.h" @@ -34,154 +34,189 @@ #include "SDL_loadso.h" #include +@interface SDLEAGLContext : EAGLContext + +/* The OpenGL ES context owns a view / drawable. */ +@property (nonatomic, strong) SDL_uikitopenglview *sdlView; + +@end + +@implementation SDLEAGLContext + +- (void)dealloc +{ + /* When the context is deallocated, its view should be removed from any + * SDL window that it's attached to. */ + [self.sdlView setSDLWindow:NULL]; +} + +@end + static int UIKit_GL_Initialize(_THIS); void * UIKit_GL_GetProcAddress(_THIS, const char *proc) { /* Look through all SO's for the proc symbol. Here's why: - -Looking for the path to the OpenGL Library seems not to work in the iPhone Simulator. - -We don't know that the path won't change in the future. - */ + * -Looking for the path to the OpenGL Library seems not to work in the iOS Simulator. + * -We don't know that the path won't change in the future. */ return dlsym(RTLD_DEFAULT, proc); } /* - note that SDL_GL_Delete context makes it current without passing the window + note that SDL_GL_DeleteContext makes it current without passing the window */ -int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int +UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { - [EAGLContext setCurrentContext: context]; + @autoreleasepool { + SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *) context; + + if (![EAGLContext setCurrentContext:eaglcontext]) { + return SDL_SetError("Could not make EAGL context current"); + } + + if (eaglcontext) { + [eaglcontext.sdlView setSDLWindow:window]; + } + } + return 0; } +void +UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) +{ + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + UIView *view = data.viewcontroller.view; + if ([view isKindOfClass:[SDL_uikitopenglview class]]) { + SDL_uikitopenglview *glview = (SDL_uikitopenglview *) view; + if (w) { + *w = glview.backingWidth; + } + if (h) { + *h = glview.backingHeight; + } + } + } +} + int UIKit_GL_LoadLibrary(_THIS, const char *path) { - /* - shouldn't be passing a path into this function - why? Because we've already loaded the library - and because the SDK forbids loading an external SO - */ + /* We shouldn't pass a path to this function, since we've already loaded the + * library. */ if (path != NULL) { - return SDL_SetError("iPhone GL Load Library just here for compatibility"); + return SDL_SetError("iOS GL Load Library just here for compatibility"); } return 0; } void UIKit_GL_SwapWindow(_THIS, SDL_Window * window) { + @autoreleasepool { + SDLEAGLContext *context = (__bridge SDLEAGLContext *) SDL_GL_GetCurrentContext(); + #if SDL_POWER_UIKIT - /* Check once a frame to see if we should turn off the battery monitor. */ - SDL_UIKit_UpdateBatteryMonitoring(); + /* Check once a frame to see if we should turn off the battery monitor. */ + SDL_UIKit_UpdateBatteryMonitoring(); #endif - SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + [context.sdlView swapBuffers]; - if (nil == data->view) { - return; + /* You need to pump events in order for the OS to make changes visible. + * We don't pump events here because we don't want iOS application events + * (low memory, terminate, etc.) to happen inside low level rendering. */ } - [data->view swapBuffers]; - - /* You need to pump events in order for the OS to make changes visible. - We don't pump events here because we don't want iOS application events - (low memory, terminate, etc.) to happen inside low level rendering. - */ } -SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext +UIKit_GL_CreateContext(_THIS, SDL_Window * window) { - SDL_uikitopenglview *view; - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayData *displaydata = display->driverdata; - SDL_DisplayModeData *displaymodedata = display->current_mode.driverdata; - UIWindow *uiwindow = data->uiwindow; - EAGLSharegroup *share_group = nil; + @autoreleasepool { + SDLEAGLContext *context = nil; + SDL_uikitopenglview *view; + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); + EAGLSharegroup *sharegroup = nil; + CGFloat scale = 1.0; + int samples = 0; - if (_this->gl_config.share_with_current_context) { - SDL_uikitopenglview *view = (SDL_uikitopenglview *) SDL_GL_GetCurrentContext(); - share_group = [view.context sharegroup]; - } + /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES + * versions. */ + EAGLRenderingAPI api = _this->gl_config.major_version; - /* construct our view, passing in SDL's OpenGL configuration data */ - CGRect frame; - if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) { - frame = [displaydata->uiscreen bounds]; - } else { - frame = [displaydata->uiscreen applicationFrame]; - } - view = [[SDL_uikitopenglview alloc] initWithFrame: frame - scale: displaymodedata->scale - retainBacking: _this->gl_config.retained_backing - rBits: _this->gl_config.red_size - gBits: _this->gl_config.green_size - bBits: _this->gl_config.blue_size - aBits: _this->gl_config.alpha_size - depthBits: _this->gl_config.depth_size - stencilBits: _this->gl_config.stencil_size - majorVersion: _this->gl_config.major_version - shareGroup: share_group]; - if (!view) { - return NULL; - } - - data->view = view; - view->viewcontroller = data->viewcontroller; - if (view->viewcontroller != nil) { - [view->viewcontroller setView:view]; - [view->viewcontroller retain]; - } - [uiwindow addSubview: view]; - - /* The view controller needs to be the root in order to control rotation on iOS 6.0 */ - if (uiwindow.rootViewController == nil) { - uiwindow.rootViewController = view->viewcontroller; - } - - EAGLContext *context = view.context; - if (UIKit_GL_MakeCurrent(_this, window, context) < 0) { - UIKit_GL_DeleteContext(_this, context); - return NULL; - } - - /* Make this window the current mouse focus for touch input */ - if (displaydata->uiscreen == [UIScreen mainScreen]) { - SDL_SetMouseFocus(window); - SDL_SetKeyboardFocus(window); - } - - return context; -} - -void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) -{ - SDL_Window *window; - - /* Find the view associated with this context */ - for (window = _this->windows; window; window = window->next) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_uikitopenglview *view = data->view; - if (view.context == context) { - /* the delegate has retained the view, this will release him */ - if (view->viewcontroller) { - UIWindow *uiwindow = (UIWindow *)view.superview; - if (uiwindow.rootViewController == view->viewcontroller) { - uiwindow.rootViewController = nil; - } - [view->viewcontroller setView:nil]; - [view->viewcontroller release]; - } - [view removeFromSuperview]; - - /* FIXME: This doesn't actually call view dealloc - what is holding a reference to it? */ - [view release]; - return; + if (_this->gl_config.multisamplebuffers > 0) { + samples = _this->gl_config.multisamplesamples; } - } - /* View not found... delete the context anyway? */ - [(EAGLContext *)context release]; + if (_this->gl_config.share_with_current_context) { + EAGLContext *context = (__bridge EAGLContext *) SDL_GL_GetCurrentContext(); + sharegroup = context.sharegroup; + } + + if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { + /* Set the scale to the natural scale factor of the screen - the + * backing dimensions of the OpenGL view will match the pixel + * dimensions of the screen rather than the dimensions in points. */ +#ifdef __IPHONE_8_0 + if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) { + scale = data.uiwindow.screen.nativeScale; + } else +#endif + { + scale = data.uiwindow.screen.scale; + } + } + + context = [[SDLEAGLContext alloc] initWithAPI:api sharegroup:sharegroup]; + if (!context) { + SDL_SetError("OpenGL ES %d context could not be created", _this->gl_config.major_version); + return NULL; + } + + /* construct our view, passing in SDL's OpenGL configuration data */ + view = [[SDL_uikitopenglview alloc] initWithFrame:frame + scale:scale + retainBacking:_this->gl_config.retained_backing + rBits:_this->gl_config.red_size + gBits:_this->gl_config.green_size + bBits:_this->gl_config.blue_size + aBits:_this->gl_config.alpha_size + depthBits:_this->gl_config.depth_size + stencilBits:_this->gl_config.stencil_size + sRGB:_this->gl_config.framebuffer_srgb_capable + multisamples:samples + context:context]; + + if (!view) { + return NULL; + } + + /* The context owns the view / drawable. */ + context.sdlView = view; + + if (UIKit_GL_MakeCurrent(_this, window, (__bridge SDL_GLContext) context) < 0) { + UIKit_GL_DeleteContext(_this, (SDL_GLContext) CFBridgingRetain(context)); + return NULL; + } + + /* We return a +1'd context. The window's driverdata owns the view (via + * MakeCurrent.) */ + return (SDL_GLContext) CFBridgingRetain(context); + } +} + +void +UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) +{ + @autoreleasepool { + /* The context was retained in SDL_GL_CreateContext, so we release it + * here. The context's view will be detached from its window when the + * context is deallocated. */ + CFRelease(context); + } } #endif /* SDL_VIDEO_DRIVER_UIKIT */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitopenglview.h b/libs/SDL2/src/video/uikit/SDL_uikitopenglview.h index eed2e5b7..c710813d 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitopenglview.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitopenglview.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,66 +21,40 @@ #import #import -#import -#import +#import + #import "SDL_uikitview.h" -/* - This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. - The view content is basically an EAGL surface you render your OpenGL scene into. - Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. - */ -@interface SDL_uikitopenglview : SDL_uikitview { +#include "SDL_uikitvideo.h" -@private - /* The pixel dimensions of the backbuffer */ - GLint backingWidth; - GLint backingHeight; +@interface SDL_uikitopenglview : SDL_uikitview - EAGLContext *context; +- (instancetype)initWithFrame:(CGRect)frame + scale:(CGFloat)scale + retainBacking:(BOOL)retained + rBits:(int)rBits + gBits:(int)gBits + bBits:(int)bBits + aBits:(int)aBits + depthBits:(int)depthBits + stencilBits:(int)stencilBits + sRGB:(BOOL)sRGB + multisamples:(int)multisamples + context:(EAGLContext *)glcontext; - /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ - GLuint viewRenderbuffer, viewFramebuffer; +@property (nonatomic, readonly, weak) EAGLContext *context; - /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ - GLuint depthRenderbuffer; +/* The width and height of the drawable in pixels (as opposed to points.) */ +@property (nonatomic, readonly) int backingWidth; +@property (nonatomic, readonly) int backingHeight; - /* format of depthRenderbuffer */ - GLenum depthBufferFormat; - - id displayLink; - int animationInterval; - void (*animationCallback)(void*); - void *animationCallbackParam; -} - -@property (nonatomic, retain, readonly) EAGLContext *context; +@property (nonatomic, readonly) GLuint drawableRenderbuffer; +@property (nonatomic, readonly) GLuint drawableFramebuffer; +@property (nonatomic, readonly) GLuint msaaResolveFramebuffer; - (void)swapBuffers; -- (void)setCurrentContext; - -- (id)initWithFrame:(CGRect)frame - scale:(CGFloat)scale - retainBacking:(BOOL)retained - rBits:(int)rBits - gBits:(int)gBits - bBits:(int)bBits - aBits:(int)aBits - depthBits:(int)depthBits - stencilBits:(int)stencilBits - majorVersion:(int)majorVersion - shareGroup:(EAGLSharegroup*)shareGroup; - (void)updateFrame; -- (void)setAnimationCallback:(int)interval - callback:(void (*)(void*))callback - callbackParam:(void*)callbackParam; - -- (void)startAnimation; -- (void)stopAnimation; - -- (void)doLoop:(CADisplayLink*)sender; - @end /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitopenglview.m b/libs/SDL2/src/video/uikit/SDL_uikitopenglview.m index 144100bf..5b8e9cc3 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitopenglview.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitopenglview.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,216 +22,363 @@ #if SDL_VIDEO_DRIVER_UIKIT -#include #include -#include "SDL_uikitopenglview.h" -#include "SDL_uikitmessagebox.h" +#include +#import "SDL_uikitopenglview.h" +#include "SDL_uikitwindow.h" +@implementation SDL_uikitopenglview { + /* The renderbuffer and framebuffer used to render to this layer. */ + GLuint viewRenderbuffer, viewFramebuffer; -@implementation SDL_uikitopenglview + /* The depth buffer that is attached to viewFramebuffer, if it exists. */ + GLuint depthRenderbuffer; + + GLenum colorBufferFormat; + + /* format of depthRenderbuffer */ + GLenum depthBufferFormat; + + /* The framebuffer and renderbuffer used for rendering with MSAA. */ + GLuint msaaFramebuffer, msaaRenderbuffer; + + /* The number of MSAA samples. */ + int samples; + + BOOL retainedBacking; +} @synthesize context; +@synthesize backingWidth; +@synthesize backingHeight; + (Class)layerClass { return [CAEAGLLayer class]; } -- (id)initWithFrame:(CGRect)frame - scale:(CGFloat)scale - retainBacking:(BOOL)retained - rBits:(int)rBits - gBits:(int)gBits - bBits:(int)bBits - aBits:(int)aBits - depthBits:(int)depthBits - stencilBits:(int)stencilBits - majorVersion:(int)majorVersion - shareGroup:(EAGLSharegroup*)shareGroup +- (instancetype)initWithFrame:(CGRect)frame + scale:(CGFloat)scale + retainBacking:(BOOL)retained + rBits:(int)rBits + gBits:(int)gBits + bBits:(int)bBits + aBits:(int)aBits + depthBits:(int)depthBits + stencilBits:(int)stencilBits + sRGB:(BOOL)sRGB + multisamples:(int)multisamples + context:(EAGLContext *)glcontext { - depthBufferFormat = 0; - if ((self = [super initWithFrame:frame])) { const BOOL useStencilBuffer = (stencilBits != 0); const BOOL useDepthBuffer = (depthBits != 0); NSString *colorFormat = nil; - /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES - versions, and this allows us to handle future OpenGL ES versions. - */ - EAGLRenderingAPI api = majorVersion; + context = glcontext; + samples = multisamples; + retainedBacking = retained; - if (rBits == 8 && gBits == 8 && bBits == 8) { - /* if user specifically requests rbg888 or some color format higher than 16bpp */ - colorFormat = kEAGLColorFormatRGBA8; - } else { - /* default case (faster) */ - colorFormat = kEAGLColorFormatRGB565; + if (!context || ![EAGLContext setCurrentContext:context]) { + SDL_SetError("Could not create OpenGL ES drawable (could not make context current)"); + return nil; + } + + if (samples > 0) { + GLint maxsamples = 0; + glGetIntegerv(GL_MAX_SAMPLES, &maxsamples); + + /* Verify that the sample count is supported before creating any + * multisample Renderbuffers, to avoid generating GL errors. */ + if (samples > maxsamples) { + SDL_SetError("Failed creating OpenGL ES framebuffer: Unsupported MSAA sample count"); + return nil; + } + } + + if (sRGB) { + /* sRGB EAGL drawable support was added in iOS 7. */ + if (UIKit_IsSystemVersionAtLeast(7.0)) { + colorFormat = kEAGLColorFormatSRGBA8; + colorBufferFormat = GL_SRGB8_ALPHA8; + } else { + SDL_SetError("sRGB drawables are not supported."); + return nil; + } + } else if (rBits >= 8 || gBits >= 8 || bBits >= 8) { + /* if user specifically requests rbg888 or some color format higher than 16bpp */ + colorFormat = kEAGLColorFormatRGBA8; + colorBufferFormat = GL_RGBA8; + } else { + /* default case (potentially faster) */ + colorFormat = kEAGLColorFormatRGB565; + colorBufferFormat = GL_RGB565; } - /* Get the layer */ CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; eaglLayer.opaque = YES; - eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil]; - - context = [[EAGLContext alloc] initWithAPI:api sharegroup:shareGroup]; - if (!context || ![EAGLContext setCurrentContext:context]) { - [self release]; - SDL_SetError("OpenGL ES %d not supported", majorVersion); - return nil; - } + eaglLayer.drawableProperties = @{ + kEAGLDrawablePropertyRetainedBacking:@(retained), + kEAGLDrawablePropertyColorFormat:colorFormat + }; /* Set the appropriate scale (for retina display support) */ self.contentScaleFactor = scale; - /* create the buffers */ - glGenFramebuffersOES(1, &viewFramebuffer); - glGenRenderbuffersOES(1, &viewRenderbuffer); + /* Create the color Renderbuffer Object */ + glGenRenderbuffers(1, &viewRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer); - glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); - [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer]; - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer); + if (![context renderbufferStorage:GL_RENDERBUFFER fromDrawable:eaglLayer]) { + SDL_SetError("Failed to create OpenGL ES drawable"); + return nil; + } - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth); - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight); + /* Create the Framebuffer Object */ + glGenFramebuffers(1, &viewFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, viewFramebuffer); - if ((useDepthBuffer) || (useStencilBuffer)) { + /* attach the color renderbuffer to the FBO */ + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, viewRenderbuffer); + + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight); + + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + SDL_SetError("Failed creating OpenGL ES framebuffer"); + return nil; + } + + /* When MSAA is used we'll use a separate framebuffer for rendering to, + * since we'll need to do an explicit MSAA resolve before presenting. */ + if (samples > 0) { + glGenFramebuffers(1, &msaaFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer); + + glGenRenderbuffers(1, &msaaRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, msaaRenderbuffer); + + glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, colorBufferFormat, backingWidth, backingHeight); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, msaaRenderbuffer); + } + + if (useDepthBuffer || useStencilBuffer) { if (useStencilBuffer) { /* Apparently you need to pack stencil and depth into one buffer. */ depthBufferFormat = GL_DEPTH24_STENCIL8_OES; } else if (useDepthBuffer) { - /* iOS only has 24-bit depth buffers, even with GL_DEPTH_COMPONENT16_OES */ + /* iOS only uses 32-bit float (exposed as fixed point 24-bit) + * depth buffers. */ depthBufferFormat = GL_DEPTH_COMPONENT24_OES; } - glGenRenderbuffersOES(1, &depthRenderbuffer); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer); - glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight); + glGenRenderbuffers(1, &depthRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer); + + if (samples > 0) { + glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, depthBufferFormat, backingWidth, backingHeight); + } else { + glRenderbufferStorage(GL_RENDERBUFFER, depthBufferFormat, backingWidth, backingHeight); + } + if (useDepthBuffer) { - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer); } if (useStencilBuffer) { - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer); } } - if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) { - return NO; + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + SDL_SetError("Failed creating OpenGL ES framebuffer"); + return nil; } - glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); - /* end create buffers */ + glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer); - self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); - self.autoresizesSubviews = YES; + [self setDebugLabels]; } + return self; } +- (GLuint)drawableRenderbuffer +{ + return viewRenderbuffer; +} + +- (GLuint)drawableFramebuffer +{ + /* When MSAA is used, the MSAA draw framebuffer is used for drawing. */ + if (msaaFramebuffer) { + return msaaFramebuffer; + } else { + return viewFramebuffer; + } +} + +- (GLuint)msaaResolveFramebuffer +{ + /* When MSAA is used, the MSAA draw framebuffer is used for drawing and the + * view framebuffer is used as a MSAA resolve framebuffer. */ + if (msaaFramebuffer) { + return viewFramebuffer; + } else { + return 0; + } +} + - (void)updateFrame { - glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, 0); - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, 0); - glDeleteRenderbuffersOES(1, &viewRenderbuffer); + GLint prevRenderbuffer = 0; + glGetIntegerv(GL_RENDERBUFFER_BINDING, &prevRenderbuffer); - glGenRenderbuffersOES(1, &viewRenderbuffer); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); - [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer]; - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer); + [context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer]; - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth); - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight); + + if (msaaRenderbuffer != 0) { + glBindRenderbuffer(GL_RENDERBUFFER, msaaRenderbuffer); + glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, GL_RGBA8, backingWidth, backingHeight); + } if (depthRenderbuffer != 0) { - glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer); - glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight); + glBindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer); + + if (samples > 0) { + glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, depthBufferFormat, backingWidth, backingHeight); + } else { + glRenderbufferStorage(GL_RENDERBUFFER, depthBufferFormat, backingWidth, backingHeight); + } } - glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, prevRenderbuffer); } -- (void)setAnimationCallback:(int)interval - callback:(void (*)(void*))callback - callbackParam:(void*)callbackParam +- (void)setDebugLabels { - [self stopAnimation]; + if (viewFramebuffer != 0) { + glLabelObjectEXT(GL_FRAMEBUFFER, viewFramebuffer, 0, "context FBO"); + } - animationInterval = interval; - animationCallback = callback; - animationCallbackParam = callbackParam; + if (viewRenderbuffer != 0) { + glLabelObjectEXT(GL_RENDERBUFFER, viewRenderbuffer, 0, "context color buffer"); + } - if (animationCallback) - [self startAnimation]; -} + if (depthRenderbuffer != 0) { + if (depthBufferFormat == GL_DEPTH24_STENCIL8_OES) { + glLabelObjectEXT(GL_RENDERBUFFER, depthRenderbuffer, 0, "context depth-stencil buffer"); + } else { + glLabelObjectEXT(GL_RENDERBUFFER, depthRenderbuffer, 0, "context depth buffer"); + } + } -- (void)startAnimation -{ - displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(doLoop:)]; - [displayLink setFrameInterval:animationInterval]; - [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; -} + if (msaaFramebuffer != 0) { + glLabelObjectEXT(GL_FRAMEBUFFER, msaaFramebuffer, 0, "context MSAA FBO"); + } -- (void)stopAnimation -{ - [displayLink invalidate]; - displayLink = nil; -} - -- (void)doLoop:(CADisplayLink*)sender -{ - /* Don't run the game loop while a messagebox is up */ - if (!UIKit_ShowingMessageBox()) { - animationCallback(animationCallbackParam); + if (msaaRenderbuffer != 0) { + glLabelObjectEXT(GL_RENDERBUFFER, msaaRenderbuffer, 0, "context MSAA renderbuffer"); } } -- (void)setCurrentContext -{ - [EAGLContext setCurrentContext:context]; -} - - - (void)swapBuffers { - /* viewRenderbuffer should always be bound here. Code that binds something - else is responsible for rebinding viewRenderbuffer, to reduce - duplicate state changes. */ - [context presentRenderbuffer:GL_RENDERBUFFER_OES]; -} + if (msaaFramebuffer) { + const GLenum attachments[] = {GL_COLOR_ATTACHMENT0}; + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, viewFramebuffer); + + /* OpenGL ES 3+ provides explicit MSAA resolves via glBlitFramebuffer. + * In OpenGL ES 1 and 2, MSAA resolves must be done via an extension. */ + if (context.API >= kEAGLRenderingAPIOpenGLES3) { + int w = backingWidth; + int h = backingHeight; + glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST); + + if (!retainedBacking) { + /* Discard the contents of the MSAA drawable color buffer. */ + glInvalidateFramebuffer(GL_READ_FRAMEBUFFER, 1, attachments); + } + } else { + glResolveMultisampleFramebufferAPPLE(); + + if (!retainedBacking) { + glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER, 1, attachments); + } + } + + /* We assume the "drawable framebuffer" (MSAA draw framebuffer) was + * previously bound... */ + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, msaaFramebuffer); + } + + /* viewRenderbuffer should always be bound here. Code that binds something + * else is responsible for rebinding viewRenderbuffer, to reduce duplicate + * state changes. */ + [context presentRenderbuffer:GL_RENDERBUFFER]; +} - (void)layoutSubviews { - [EAGLContext setCurrentContext:context]; - [self updateFrame]; + [super layoutSubviews]; + + int width = (int) (self.bounds.size.width * self.contentScaleFactor); + int height = (int) (self.bounds.size.height * self.contentScaleFactor); + + /* Update the color and depth buffer storage if the layer size has changed. */ + if (width != backingWidth || height != backingHeight) { + EAGLContext *prevContext = [EAGLContext currentContext]; + if (prevContext != context) { + [EAGLContext setCurrentContext:context]; + } + + [self updateFrame]; + + if (prevContext != context) { + [EAGLContext setCurrentContext:prevContext]; + } + } } - (void)destroyFramebuffer { - glDeleteFramebuffersOES(1, &viewFramebuffer); - viewFramebuffer = 0; - glDeleteRenderbuffersOES(1, &viewRenderbuffer); - viewRenderbuffer = 0; + if (viewFramebuffer != 0) { + glDeleteFramebuffers(1, &viewFramebuffer); + viewFramebuffer = 0; + } - if (depthRenderbuffer) { - glDeleteRenderbuffersOES(1, &depthRenderbuffer); + if (viewRenderbuffer != 0) { + glDeleteRenderbuffers(1, &viewRenderbuffer); + viewRenderbuffer = 0; + } + + if (depthRenderbuffer != 0) { + glDeleteRenderbuffers(1, &depthRenderbuffer); depthRenderbuffer = 0; } + + if (msaaFramebuffer != 0) { + glDeleteFramebuffers(1, &msaaFramebuffer); + msaaFramebuffer = 0; + } + + if (msaaRenderbuffer != 0) { + glDeleteRenderbuffers(1, &msaaRenderbuffer); + msaaRenderbuffer = 0; + } } - - (void)dealloc { - [self destroyFramebuffer]; - if ([EAGLContext currentContext] == context) { + if (context && context == [EAGLContext currentContext]) { + [self destroyFramebuffer]; [EAGLContext setCurrentContext:nil]; } - [context release]; - [super dealloc]; } @end diff --git a/libs/SDL2/src/video/uikit/SDL_uikitvideo.h b/libs/SDL2/src/video/uikit/SDL_uikitvideo.h index ef629825..5eacd807 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitvideo.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,20 +25,10 @@ #include "../SDL_sysvideo.h" -#ifndef __IPHONE_6_0 -/* This enum isn't available in older SDKs, but we use it for our own purposes on iOS 5.1 and for the system on iOS 6.0 */ -enum UIInterfaceOrientationMask -{ - UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait), - UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft), - UIInterfaceOrientationMaskLandscapeRight = (1 << UIInterfaceOrientationLandscapeRight), - UIInterfaceOrientationMaskPortraitUpsideDown = (1 << UIInterfaceOrientationPortraitUpsideDown), - UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight), - UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown), - UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight), -}; -#endif /* !__IPHONE_6_0 */ +void UIKit_SuspendScreenSaver(_THIS); +BOOL UIKit_IsSystemVersionAtLeast(double version); +CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen); #endif /* _SDL_uikitvideo_h */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitvideo.m b/libs/SDL2/src/video/uikit/SDL_uikitvideo.m index 4893bc16..3847de71 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitvideo.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitvideo.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,6 +26,7 @@ #include "SDL_video.h" #include "SDL_mouse.h" +#include "SDL_hints.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" #include "../../events/SDL_events_c.h" @@ -74,16 +75,17 @@ UIKit_CreateDevice(int devindex) device->GetDisplayModes = UIKit_GetDisplayModes; device->SetDisplayMode = UIKit_SetDisplayMode; device->PumpEvents = UIKit_PumpEvents; + device->SuspendScreenSaver = UIKit_SuspendScreenSaver; device->CreateWindow = UIKit_CreateWindow; + device->SetWindowTitle = UIKit_SetWindowTitle; device->ShowWindow = UIKit_ShowWindow; device->HideWindow = UIKit_HideWindow; device->RaiseWindow = UIKit_RaiseWindow; + device->SetWindowBordered = UIKit_SetWindowBordered; device->SetWindowFullscreen = UIKit_SetWindowFullscreen; device->DestroyWindow = UIKit_DestroyWindow; device->GetWindowWMInfo = UIKit_GetWindowWMInfo; - /* !!! FIXME: implement SetWindowBordered */ - #if SDL_IPHONE_KEYBOARD device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport; device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard; @@ -93,12 +95,13 @@ UIKit_CreateDevice(int devindex) #endif /* OpenGL (ES) functions */ - device->GL_MakeCurrent = UIKit_GL_MakeCurrent; - device->GL_SwapWindow = UIKit_GL_SwapWindow; + device->GL_MakeCurrent = UIKit_GL_MakeCurrent; + device->GL_GetDrawableSize = UIKit_GL_GetDrawableSize; + device->GL_SwapWindow = UIKit_GL_SwapWindow; device->GL_CreateContext = UIKit_GL_CreateContext; device->GL_DeleteContext = UIKit_GL_DeleteContext; device->GL_GetProcAddress = UIKit_GL_GetProcAddress; - device->GL_LoadLibrary = UIKit_GL_LoadLibrary; + device->GL_LoadLibrary = UIKit_GL_LoadLibrary; device->free = UIKit_DeleteDevice; device->gl_config.accelerated = 1; @@ -129,6 +132,40 @@ UIKit_VideoQuit(_THIS) UIKit_QuitModes(_this); } +void +UIKit_SuspendScreenSaver(_THIS) +{ + @autoreleasepool { + /* Ignore ScreenSaver API calls if the idle timer hint has been set. */ + /* FIXME: The idle timer hint should be deprecated for SDL 2.1. */ + if (SDL_GetHint(SDL_HINT_IDLE_TIMER_DISABLED) == NULL) { + UIApplication *app = [UIApplication sharedApplication]; + + /* Prevent the display from dimming and going to sleep. */ + app.idleTimerDisabled = (_this->suspend_screensaver != SDL_FALSE); + } + } +} + +BOOL +UIKit_IsSystemVersionAtLeast(double version) +{ + return [[UIDevice currentDevice].systemVersion doubleValue] >= version; +} + +CGRect +UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen) +{ + BOOL hasiOS7 = UIKit_IsSystemVersionAtLeast(7.0); + + if (hasiOS7 || (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN))) { + /* The view should always show behind the status bar in iOS 7+. */ + return screen.bounds; + } else { + return screen.applicationFrame; + } +} + /* * iOS log support. * diff --git a/libs/SDL2/src/video/uikit/SDL_uikitview.h b/libs/SDL2/src/video/uikit/SDL_uikitview.h index ce616c07..00be7657 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitview.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitview.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,59 +20,22 @@ */ #import -#import "SDL_uikitviewcontroller.h" + +#include "../SDL_sysvideo.h" #include "SDL_touch.h" -#define IPHONE_TOUCH_EFFICIENT_DANGEROUS +@interface SDL_uikitview : UIView -#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS -#define MAX_SIMULTANEOUS_TOUCHES 5 -#endif +- (instancetype)initWithFrame:(CGRect)frame; -#if SDL_IPHONE_KEYBOARD -@interface SDL_uikitview : UIView { -#else -@interface SDL_uikitview : UIView { -#endif +- (void)setSDLWindow:(SDL_Window *)window; - SDL_TouchID touchId; - UITouch *leftFingerDown; -#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS - UITouch *finger[MAX_SIMULTANEOUS_TOUCHES]; -#endif - -#if SDL_IPHONE_KEYBOARD - UITextField *textField; - BOOL keyboardVisible; - SDL_Rect textInputRect; - int keyboardHeight; -#endif - -@public - SDL_uikitviewcontroller *viewcontroller; -} - (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize; - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; -#if SDL_IPHONE_KEYBOARD -- (void)showKeyboard; -- (void)hideKeyboard; -- (void)initializeKeyboard; -@property (readonly) BOOL keyboardVisible; -@property (nonatomic,assign) SDL_Rect textInputRect; -@property (nonatomic,assign) int keyboardHeight; - -SDL_bool UIKit_HasScreenKeyboardSupport(_THIS); -void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window); -void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window); -SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window); -void UIKit_SetTextInputRect(_THIS, SDL_Rect *rect); - -#endif - @end /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitview.m b/libs/SDL2/src/video/uikit/SDL_uikitview.m index c51a3ba7..60cd1708 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitview.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitview.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,438 +24,164 @@ #include "SDL_uikitview.h" -#include "../../events/SDL_keyboard_c.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" +#include "../../events/SDL_events_c.h" -#if SDL_IPHONE_KEYBOARD -#include "keyinfotable.h" -#endif -#include "SDL_uikitappdelegate.h" -#include "SDL_uikitmodes.h" -#include "SDL_uikitwindow.h" +#import "SDL_uikitappdelegate.h" +#import "SDL_uikitmodes.h" +#import "SDL_uikitwindow.h" -void _uikit_keyboard_init() ; +@implementation SDL_uikitview { + SDL_Window *sdlwindow; -@implementation SDL_uikitview - -- (void)dealloc -{ - [super dealloc]; + SDL_TouchID touchId; + UITouch * __weak firstFingerDown; } -- (id)initWithFrame:(CGRect)frame +- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame: frame]; + if ((self = [super initWithFrame:frame])) { + self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.autoresizesSubviews = YES; -#if SDL_IPHONE_KEYBOARD - [self initializeKeyboard]; -#endif + self.multipleTouchEnabled = YES; - self.multipleTouchEnabled = YES; - - touchId = 1; - SDL_AddTouch(touchId, ""); + touchId = 1; + SDL_AddTouch(touchId, ""); + } return self; +} +- (void)setSDLWindow:(SDL_Window *)window +{ + SDL_WindowData *data = nil; + + if (window == sdlwindow) { + return; + } + + /* Remove ourself from the old window. */ + if (sdlwindow) { + SDL_uikitview *view = nil; + data = (__bridge SDL_WindowData *) sdlwindow->driverdata; + + [data.views removeObject:self]; + + [self removeFromSuperview]; + + /* Restore the next-oldest view in the old window. */ + view = data.views.lastObject; + + data.viewcontroller.view = view; + + data.uiwindow.rootViewController = nil; + data.uiwindow.rootViewController = data.viewcontroller; + + [data.uiwindow layoutIfNeeded]; + } + + /* Add ourself to the new window. */ + if (window) { + data = (__bridge SDL_WindowData *) window->driverdata; + + /* Make sure the SDL window has a strong reference to this view. */ + [data.views addObject:self]; + + /* Replace the view controller's old view with this one. */ + [data.viewcontroller.view removeFromSuperview]; + data.viewcontroller.view = self; + + /* The root view controller handles rotation and the status bar. + * Assigning it also adds the controller's view to the window. We + * explicitly re-set it to make sure the view is properly attached to + * the window. Just adding the sub-view if the root view controller is + * already correct causes orientation issues on iOS 7 and below. */ + data.uiwindow.rootViewController = nil; + data.uiwindow.rootViewController = data.viewcontroller; + + /* The view's bounds may not be correct until the next event cycle. That + * might happen after the current dimensions are queried, so we force a + * layout now to immediately update the bounds. */ + [data.uiwindow layoutIfNeeded]; + } + + sdlwindow = window; } - (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize { - CGPoint point = [touch locationInView: self]; - - /* Get the display scale and apply that to the input coordinates */ - SDL_Window *window = self->viewcontroller.window; - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata; + CGPoint point = [touch locationInView:self]; if (normalize) { - CGRect bounds = [self bounds]; + CGRect bounds = self.bounds; point.x /= bounds.size.width; point.y /= bounds.size.height; - } else { - point.x *= displaymodedata->scale; - point.y *= displaymodedata->scale; } + return point; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - NSEnumerator *enumerator = [touches objectEnumerator]; - UITouch *touch = (UITouch*)[enumerator nextObject]; - - while (touch) { - if (!leftFingerDown) { + for (UITouch *touch in touches) { + if (!firstFingerDown) { CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO]; - /* send moved event */ - SDL_SendMouseMotion(self->viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y); + /* send mouse moved event */ + SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y); /* send mouse down event */ - SDL_SendMouseButton(self->viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); + SDL_SendMouseButton(sdlwindow, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); - leftFingerDown = touch; + firstFingerDown = touch; } CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; -#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS - /* FIXME: TODO: Using touch as the fingerId is potentially dangerous - * It is also much more efficient than storing the UITouch pointer - * and comparing it to the incoming event. - */ SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), SDL_TRUE, locationInView.x, locationInView.y, 1.0f); -#else - int i; - for(i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) { - if (finger[i] == NULL) { - finger[i] = touch; - SDL_SendTouch(touchId, i, - SDL_TRUE, locationInView.x, locationInView.y, 1.0f); - break; - } - } -#endif - touch = (UITouch*)[enumerator nextObject]; } } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - NSEnumerator *enumerator = [touches objectEnumerator]; - UITouch *touch = (UITouch*)[enumerator nextObject]; - - while(touch) { - if (touch == leftFingerDown) { + for (UITouch *touch in touches) { + if (touch == firstFingerDown) { /* send mouse up */ - SDL_SendMouseButton(self->viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); - leftFingerDown = nil; + SDL_SendMouseButton(sdlwindow, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); + firstFingerDown = nil; } CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; -#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS - SDL_SendTouch(touchId, (long)touch, + SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), SDL_FALSE, locationInView.x, locationInView.y, 1.0f); -#else - int i; - for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) { - if (finger[i] == touch) { - SDL_SendTouch(touchId, i, - SDL_FALSE, locationInView.x, locationInView.y, 1.0f); - finger[i] = NULL; - break; - } - } -#endif - touch = (UITouch*)[enumerator nextObject]; } } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { - /* - this can happen if the user puts more than 5 touches on the screen - at once, or perhaps in other circumstances. Usually (it seems) - all active touches are canceled. - */ - [self touchesEnded: touches withEvent: event]; + [self touchesEnded:touches withEvent:event]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - NSEnumerator *enumerator = [touches objectEnumerator]; - UITouch *touch = (UITouch*)[enumerator nextObject]; - - while (touch) { - if (touch == leftFingerDown) { + for (UITouch *touch in touches) { + if (touch == firstFingerDown) { CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO]; /* send moved event */ - SDL_SendMouseMotion(self->viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y); + SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y); } CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; -#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS - SDL_SendTouchMotion(touchId, (long)touch, + SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch), locationInView.x, locationInView.y, 1.0f); -#else - int i; - for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) { - if (finger[i] == touch) { - SDL_SendTouchMotion(touchId, i, - locationInView.x, locationInView.y, 1.0f); - break; - } - } -#endif - touch = (UITouch*)[enumerator nextObject]; } } -/* - ---- Keyboard related functionality below this line ---- -*/ -#if SDL_IPHONE_KEYBOARD - -@synthesize textInputRect = textInputRect; -@synthesize keyboardHeight = keyboardHeight; - -/* Is the iPhone virtual keyboard visible onscreen? */ -- (BOOL)keyboardVisible -{ - return keyboardVisible; -} - -/* Set ourselves up as a UITextFieldDelegate */ -- (void)initializeKeyboard -{ - textField = [[UITextField alloc] initWithFrame: CGRectZero]; - textField.delegate = self; - /* placeholder so there is something to delete! */ - textField.text = @" "; - - /* set UITextInputTrait properties, mostly to defaults */ - textField.autocapitalizationType = UITextAutocapitalizationTypeNone; - textField.autocorrectionType = UITextAutocorrectionTypeNo; - textField.enablesReturnKeyAutomatically = NO; - textField.keyboardAppearance = UIKeyboardAppearanceDefault; - textField.keyboardType = UIKeyboardTypeDefault; - textField.returnKeyType = UIReturnKeyDefault; - textField.secureTextEntry = NO; - - textField.hidden = YES; - keyboardVisible = NO; - /* add the UITextField (hidden) to our view */ - [self addSubview: textField]; - [textField release]; - - _uikit_keyboard_init(); -} - -/* reveal onscreen virtual keyboard */ -- (void)showKeyboard -{ - keyboardVisible = YES; - [textField becomeFirstResponder]; -} - -/* hide onscreen virtual keyboard */ -- (void)hideKeyboard -{ - keyboardVisible = NO; - [textField resignFirstResponder]; -} - -/* UITextFieldDelegate method. Invoked when user types something. */ -- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string -{ - if ([string length] == 0) { - /* it wants to replace text with nothing, ie a delete */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE); - } - else { - /* go through all the characters in the string we've been sent - and convert them to key presses */ - int i; - for (i = 0; i < [string length]; i++) { - - unichar c = [string characterAtIndex: i]; - - Uint16 mod = 0; - SDL_Scancode code; - - if (c < 127) { - /* figure out the SDL_Scancode and SDL_keymod for this unichar */ - code = unicharToUIKeyInfoTable[c].code; - mod = unicharToUIKeyInfoTable[c].mod; - } - else { - /* we only deal with ASCII right now */ - code = SDL_SCANCODE_UNKNOWN; - mod = 0; - } - - if (mod & KMOD_SHIFT) { - /* If character uses shift, press shift down */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT); - } - /* send a keydown and keyup even for the character */ - SDL_SendKeyboardKey(SDL_PRESSED, code); - SDL_SendKeyboardKey(SDL_RELEASED, code); - if (mod & KMOD_SHIFT) { - /* If character uses shift, press shift back up */ - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); - } - } - SDL_SendKeyboardText([string UTF8String]); - } - return NO; /* don't allow the edit! (keep placeholder text there) */ -} - -/* Terminates the editing session */ -- (BOOL)textFieldShouldReturn:(UITextField*)_textField -{ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN); - SDL_StopTextInput(); - return YES; -} - -#endif - @end -/* iPhone keyboard addition functions */ -#if SDL_IPHONE_KEYBOARD - -static SDL_uikitview * getWindowView(SDL_Window * window) -{ - if (window == NULL) { - SDL_SetError("Window does not exist"); - return nil; - } - - SDL_WindowData *data = (SDL_WindowData *)window->driverdata; - SDL_uikitview *view = data != NULL ? data->view : nil; - - if (view == nil) { - SDL_SetError("Window has no view"); - } - - return view; -} - -SDL_bool UIKit_HasScreenKeyboardSupport(_THIS) -{ - return SDL_TRUE; -} - -void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window) -{ - SDL_uikitview *view = getWindowView(window); - if (view != nil) { - [view showKeyboard]; - } -} - -void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window) -{ - SDL_uikitview *view = getWindowView(window); - if (view != nil) { - [view hideKeyboard]; - } -} - -SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window) -{ - SDL_uikitview *view = getWindowView(window); - if (view == nil) { - return 0; - } - - return view.keyboardVisible; -} - - -void _uikit_keyboard_update() { - SDL_Window *window = SDL_GetFocusWindow(); - if (!window) { return; } - SDL_WindowData *data = (SDL_WindowData *)window->driverdata; - if (!data) { return; } - SDL_uikitview *view = data->view; - if (!view) { return; } - - SDL_Rect r = view.textInputRect; - int height = view.keyboardHeight; - int offsetx = 0; - int offsety = 0; - float scale = [UIScreen mainScreen].scale; - if (height) { - int sw,sh; - SDL_GetWindowSize(window,&sw,&sh); - int bottom = (r.y + r.h); - int kbottom = sh - height; - if (kbottom < bottom) { - offsety = kbottom-bottom; - } - } - UIInterfaceOrientation ui_orient = [[UIApplication sharedApplication] statusBarOrientation]; - if (ui_orient == UIInterfaceOrientationLandscapeLeft) { - int tmp = offsetx; offsetx = offsety; offsety = tmp; - } - if (ui_orient == UIInterfaceOrientationLandscapeRight) { - offsety = -offsety; - int tmp = offsetx; offsetx = offsety; offsety = tmp; - } - if (ui_orient == UIInterfaceOrientationPortraitUpsideDown) { - offsety = -offsety; - } - - offsetx /= scale; - offsety /= scale; - - view.frame = CGRectMake(offsetx,offsety,view.frame.size.width,view.frame.size.height); -} - -void _uikit_keyboard_set_height(int height) { - SDL_uikitview *view = getWindowView(SDL_GetFocusWindow()); - if (view == nil) { - return ; - } - - view.keyboardHeight = height; - _uikit_keyboard_update(); -} - -void _uikit_keyboard_init() { - NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; - NSOperationQueue *queue = [NSOperationQueue mainQueue]; - [center addObserverForName:UIKeyboardWillShowNotification - object:nil - queue:queue - usingBlock:^(NSNotification *notification) { - int height = 0; - CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - height = keyboardSize.height; - UIInterfaceOrientation ui_orient = [[UIApplication sharedApplication] statusBarOrientation]; - if (ui_orient == UIInterfaceOrientationLandscapeRight || ui_orient == UIInterfaceOrientationLandscapeLeft) { - height = keyboardSize.width; - } - height *= [UIScreen mainScreen].scale; - _uikit_keyboard_set_height(height); - } - ]; - [center addObserverForName:UIKeyboardDidHideNotification - object:nil - queue:queue - usingBlock:^(NSNotification *notification) { - _uikit_keyboard_set_height(0); - } - ]; -} - -void -UIKit_SetTextInputRect(_THIS, SDL_Rect *rect) -{ - if (!rect) { - SDL_InvalidParamError("rect"); - return; - } - - SDL_uikitview *view = getWindowView(SDL_GetFocusWindow()); - if (view == nil) { - return ; - } - - view.textInputRect = *rect; -} - - -#endif /* SDL_IPHONE_KEYBOARD */ - #endif /* SDL_VIDEO_DRIVER_UIKIT */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.h b/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.h index e8d595d9..17db0b26 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,18 +23,56 @@ #include "../SDL_sysvideo.h" -@interface SDL_uikitviewcontroller : UIViewController { -@private - SDL_Window *window; -} +#include "SDL_touch.h" -@property (readwrite) SDL_Window *window; +#if SDL_IPHONE_KEYBOARD +@interface SDL_uikitviewcontroller : UIViewController +#else +@interface SDL_uikitviewcontroller : UIViewController +#endif + +@property (nonatomic, assign) SDL_Window *window; + +- (instancetype)initWithSDLWindow:(SDL_Window *)_window; + +- (void)setAnimationCallback:(int)interval + callback:(void (*)(void*))callback + callbackParam:(void*)callbackParam; + +- (void)startAnimation; +- (void)stopAnimation; + +- (void)doLoop:(CADisplayLink*)sender; -- (id)initWithSDLWindow:(SDL_Window *)_window; - (void)loadView; - (void)viewDidLayoutSubviews; - (NSUInteger)supportedInterfaceOrientations; - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient; - (BOOL)prefersStatusBarHidden; +- (UIStatusBarStyle)preferredStatusBarStyle; + +#if SDL_IPHONE_KEYBOARD +- (void)showKeyboard; +- (void)hideKeyboard; +- (void)initKeyboard; +- (void)deinitKeyboard; + +- (void)keyboardWillShow:(NSNotification *)notification; +- (void)keyboardWillHide:(NSNotification *)notification; + +- (void)updateKeyboard; + +@property (nonatomic, assign, getter=isKeyboardVisible) BOOL keyboardVisible; +@property (nonatomic, assign) SDL_Rect textInputRect; +@property (nonatomic, assign) int keyboardHeight; +#endif @end + +#if SDL_IPHONE_KEYBOARD +SDL_bool UIKit_HasScreenKeyboardSupport(_THIS); +void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window); +void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window); +SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window); +void UIKit_SetTextInputRect(_THIS, SDL_Rect *rect); +#endif diff --git a/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.m b/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.m index 447b80b8..e1667aac 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitviewcontroller.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,108 +28,374 @@ #include "../SDL_sysvideo.h" #include "../../events/SDL_events_c.h" -#include "SDL_uikitviewcontroller.h" +#import "SDL_uikitviewcontroller.h" +#import "SDL_uikitmessagebox.h" #include "SDL_uikitvideo.h" #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" +#if SDL_IPHONE_KEYBOARD +#include "keyinfotable.h" +#endif -@implementation SDL_uikitviewcontroller +@implementation SDL_uikitviewcontroller { + CADisplayLink *displayLink; + int animationInterval; + void (*animationCallback)(void*); + void *animationCallbackParam; + +#if SDL_IPHONE_KEYBOARD + UITextField *textField; +#endif +} @synthesize window; -- (id)initWithSDLWindow:(SDL_Window *)_window +- (instancetype)initWithSDLWindow:(SDL_Window *)_window { - self = [self init]; - if (self == nil) { - return nil; - } - self.window = _window; + if (self = [super initWithNibName:nil bundle:nil]) { + self.window = _window; +#if SDL_IPHONE_KEYBOARD + [self initKeyboard]; +#endif + } return self; } +- (void)dealloc +{ +#if SDL_IPHONE_KEYBOARD + [self deinitKeyboard]; +#endif +} + +- (void)setAnimationCallback:(int)interval + callback:(void (*)(void*))callback + callbackParam:(void*)callbackParam +{ + [self stopAnimation]; + + animationInterval = interval; + animationCallback = callback; + animationCallbackParam = callbackParam; + + if (animationCallback) { + [self startAnimation]; + } +} + +- (void)startAnimation +{ + displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(doLoop:)]; + [displayLink setFrameInterval:animationInterval]; + [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; +} + +- (void)stopAnimation +{ + [displayLink invalidate]; + displayLink = nil; +} + +- (void)doLoop:(CADisplayLink*)sender +{ + /* Don't run the game loop while a messagebox is up */ + if (!UIKit_ShowingMessageBox()) { + animationCallback(animationCallbackParam); + } +} + - (void)loadView { - /* do nothing. */ + /* Do nothing. */ } - (void)viewDidLayoutSubviews { - if (self->window->flags & SDL_WINDOW_RESIZABLE) { - SDL_WindowData *data = self->window->driverdata; - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(self->window); - SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata; - const CGSize size = data->view.bounds.size; - int w, h; + const CGSize size = self.view.bounds.size; + int w = (int) size.width; + int h = (int) size.height; - w = (int)(size.width * displaymodedata->scale); - h = (int)(size.height * displaymodedata->scale); - - SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h); - } + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h); } - (NSUInteger)supportedInterfaceOrientations { - NSUInteger orientationMask = 0; - - const char *orientationsCString; - if ((orientationsCString = SDL_GetHint(SDL_HINT_ORIENTATIONS)) != NULL) { - BOOL rotate = NO; - NSString *orientationsNSString = [NSString stringWithCString:orientationsCString - encoding:NSUTF8StringEncoding]; - NSArray *orientations = [orientationsNSString componentsSeparatedByCharactersInSet: - [NSCharacterSet characterSetWithCharactersInString:@" "]]; - - if ([orientations containsObject:@"LandscapeLeft"]) { - orientationMask |= UIInterfaceOrientationMaskLandscapeLeft; - } - if ([orientations containsObject:@"LandscapeRight"]) { - orientationMask |= UIInterfaceOrientationMaskLandscapeRight; - } - if ([orientations containsObject:@"Portrait"]) { - orientationMask |= UIInterfaceOrientationMaskPortrait; - } - if ([orientations containsObject:@"PortraitUpsideDown"]) { - orientationMask |= UIInterfaceOrientationMaskPortraitUpsideDown; - } - - } else if (self->window->flags & SDL_WINDOW_RESIZABLE) { - orientationMask = UIInterfaceOrientationMaskAll; /* any orientation is okay. */ - } else { - if (self->window->w >= self->window->h) { - orientationMask |= UIInterfaceOrientationMaskLandscape; - } - if (self->window->h >= self->window->w) { - orientationMask |= (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); - } - } - - /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */ - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { - orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown; - } - return orientationMask; + return UIKit_GetSupportedOrientations(window); } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient { - NSUInteger orientationMask = [self supportedInterfaceOrientations]; - return (orientationMask & (1 << orient)); + return ([self supportedInterfaceOrientations] & (1 << orient)) != 0; } - (BOOL)prefersStatusBarHidden { - if (self->window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) { - return YES; - } else { - return NO; + return (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) != 0; +} + +- (UIStatusBarStyle)preferredStatusBarStyle +{ + /* We assume most SDL apps don't have a bright white background. */ + return UIStatusBarStyleLightContent; +} + +/* + ---- Keyboard related functionality below this line ---- + */ +#if SDL_IPHONE_KEYBOARD + +@synthesize textInputRect; +@synthesize keyboardHeight; +@synthesize keyboardVisible; + +/* Set ourselves up as a UITextFieldDelegate */ +- (void)initKeyboard +{ + textField = [[UITextField alloc] initWithFrame:CGRectZero]; + textField.delegate = self; + /* placeholder so there is something to delete! */ + textField.text = @" "; + + /* set UITextInputTrait properties, mostly to defaults */ + textField.autocapitalizationType = UITextAutocapitalizationTypeNone; + textField.autocorrectionType = UITextAutocorrectionTypeNo; + textField.enablesReturnKeyAutomatically = NO; + textField.keyboardAppearance = UIKeyboardAppearanceDefault; + textField.keyboardType = UIKeyboardTypeDefault; + textField.returnKeyType = UIReturnKeyDefault; + textField.secureTextEntry = NO; + + textField.hidden = YES; + keyboardVisible = NO; + + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + [center addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; +} + +- (void)setView:(UIView *)view +{ + [super setView:view]; + + [view addSubview:textField]; + + if (keyboardVisible) { + [self showKeyboard]; } } +- (void)deinitKeyboard +{ + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + [center removeObserver:self name:UIKeyboardWillShowNotification object:nil]; + [center removeObserver:self name:UIKeyboardWillHideNotification object:nil]; +} + +/* reveal onscreen virtual keyboard */ +- (void)showKeyboard +{ + keyboardVisible = YES; + if (textField.window) { + [textField becomeFirstResponder]; + } +} + +/* hide onscreen virtual keyboard */ +- (void)hideKeyboard +{ + keyboardVisible = NO; + [textField resignFirstResponder]; +} + +- (void)keyboardWillShow:(NSNotification *)notification +{ + CGRect kbrect = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue]; + + /* The keyboard rect is in the coordinate space of the screen/window, but we + * want its height in the coordinate space of the view. */ + kbrect = [self.view convertRect:kbrect fromView:nil]; + + [self setKeyboardHeight:(int)kbrect.size.height]; +} + +- (void)keyboardWillHide:(NSNotification *)notification +{ + [self setKeyboardHeight:0]; +} + +- (void)updateKeyboard +{ + CGAffineTransform t = self.view.transform; + CGPoint offset = CGPointMake(0.0, 0.0); + CGRect frame = UIKit_ComputeViewFrame(window, self.view.window.screen); + + if (self.keyboardHeight) { + int rectbottom = self.textInputRect.y + self.textInputRect.h; + int keybottom = self.view.bounds.size.height - self.keyboardHeight; + if (keybottom < rectbottom) { + offset.y = keybottom - rectbottom; + } + } + + /* Apply this view's transform (except any translation) to the offset, in + * order to orient it correctly relative to the frame's coordinate space. */ + t.tx = 0.0; + t.ty = 0.0; + offset = CGPointApplyAffineTransform(offset, t); + + /* Apply the updated offset to the view's frame. */ + frame.origin.x += offset.x; + frame.origin.y += offset.y; + + self.view.frame = frame; +} + +- (void)setKeyboardHeight:(int)height +{ + keyboardVisible = height > 0; + keyboardHeight = height; + [self updateKeyboard]; +} + +/* UITextFieldDelegate method. Invoked when user types something. */ +- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string +{ + NSUInteger len = string.length; + + if (len == 0) { + /* it wants to replace text with nothing, ie a delete */ + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE); + } else { + /* go through all the characters in the string we've been sent and + * convert them to key presses */ + int i; + for (i = 0; i < len; i++) { + unichar c = [string characterAtIndex:i]; + Uint16 mod = 0; + SDL_Scancode code; + + if (c < 127) { + /* figure out the SDL_Scancode and SDL_keymod for this unichar */ + code = unicharToUIKeyInfoTable[c].code; + mod = unicharToUIKeyInfoTable[c].mod; + } else { + /* we only deal with ASCII right now */ + code = SDL_SCANCODE_UNKNOWN; + mod = 0; + } + + if (mod & KMOD_SHIFT) { + /* If character uses shift, press shift down */ + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT); + } + + /* send a keydown and keyup even for the character */ + SDL_SendKeyboardKey(SDL_PRESSED, code); + SDL_SendKeyboardKey(SDL_RELEASED, code); + + if (mod & KMOD_SHIFT) { + /* If character uses shift, press shift back up */ + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); + } + } + + SDL_SendKeyboardText([string UTF8String]); + } + + return NO; /* don't allow the edit! (keep placeholder text there) */ +} + +/* Terminates the editing session */ +- (BOOL)textFieldShouldReturn:(UITextField*)_textField +{ + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN); + SDL_StopTextInput(); + return YES; +} + +#endif + @end +/* iPhone keyboard addition functions */ +#if SDL_IPHONE_KEYBOARD + +static SDL_uikitviewcontroller * +GetWindowViewController(SDL_Window * window) +{ + if (!window || !window->driverdata) { + SDL_SetError("Invalid window"); + return nil; + } + + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + + return data.viewcontroller; +} + +SDL_bool +UIKit_HasScreenKeyboardSupport(_THIS) +{ + return SDL_TRUE; +} + +void +UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window) +{ + @autoreleasepool { + SDL_uikitviewcontroller *vc = GetWindowViewController(window); + [vc showKeyboard]; + } +} + +void +UIKit_HideScreenKeyboard(_THIS, SDL_Window *window) +{ + @autoreleasepool { + SDL_uikitviewcontroller *vc = GetWindowViewController(window); + [vc hideKeyboard]; + } +} + +SDL_bool +UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window) +{ + @autoreleasepool { + SDL_uikitviewcontroller *vc = GetWindowViewController(window); + if (vc != nil) { + return vc.isKeyboardVisible; + } + return SDL_FALSE; + } +} + +void +UIKit_SetTextInputRect(_THIS, SDL_Rect *rect) +{ + if (!rect) { + SDL_InvalidParamError("rect"); + return; + } + + @autoreleasepool { + SDL_uikitviewcontroller *vc = GetWindowViewController(SDL_GetFocusWindow()); + if (vc != nil) { + vc.textInputRect = *rect; + + if (vc.keyboardVisible) { + [vc updateKeyboard]; + } + } + } +} + + +#endif /* SDL_IPHONE_KEYBOARD */ + #endif /* SDL_VIDEO_DRIVER_UIKIT */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitwindow.h b/libs/SDL2/src/video/uikit/SDL_uikitwindow.h index 494b028f..987bbe01 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitwindow.h +++ b/libs/SDL2/src/video/uikit/SDL_uikitwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,28 +23,33 @@ #include "../SDL_sysvideo.h" #import "SDL_uikitvideo.h" -#import "SDL_uikitopenglview.h" +#import "SDL_uikitview.h" #import "SDL_uikitviewcontroller.h" -typedef struct SDL_WindowData SDL_WindowData; - extern int UIKit_CreateWindow(_THIS, SDL_Window * window); +extern void UIKit_SetWindowTitle(_THIS, SDL_Window * window); extern void UIKit_ShowWindow(_THIS, SDL_Window * window); extern void UIKit_HideWindow(_THIS, SDL_Window * window); extern void UIKit_RaiseWindow(_THIS, SDL_Window * window); +extern void UIKit_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered); extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen); extern void UIKit_DestroyWindow(_THIS, SDL_Window * window); extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo * info); +extern NSUInteger UIKit_GetSupportedOrientations(SDL_Window * window); + @class UIWindow; -struct SDL_WindowData -{ - UIWindow *uiwindow; - SDL_uikitopenglview *view; - SDL_uikitviewcontroller *viewcontroller; -}; +@interface SDL_WindowData : NSObject + +@property (nonatomic, strong) UIWindow *uiwindow; +@property (nonatomic, strong) SDL_uikitviewcontroller *viewcontroller; + +/* Array of SDL_uikitviews owned by this window. */ +@property (nonatomic, copy) NSMutableArray *views; + +@end #endif /* _SDL_uikitwindow_h */ diff --git a/libs/SDL2/src/video/uikit/SDL_uikitwindow.m b/libs/SDL2/src/video/uikit/SDL_uikitwindow.m index 2b156777..3e26113d 100644 --- a/libs/SDL2/src/video/uikit/SDL_uikitwindow.m +++ b/libs/SDL2/src/video/uikit/SDL_uikitwindow.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,89 +37,111 @@ #include "SDL_uikitwindow.h" #import "SDL_uikitappdelegate.h" +#import "SDL_uikitview.h" #import "SDL_uikitopenglview.h" #include +@implementation SDL_WindowData +@synthesize uiwindow; +@synthesize viewcontroller; +@synthesize views; + +- (instancetype)init +{ + if ((self = [super init])) { + views = [NSMutableArray new]; + } + + return self; +} + +@end + +@interface SDL_uikitwindow : UIWindow + +- (void)layoutSubviews; + +@end + +@implementation SDL_uikitwindow + +- (void)layoutSubviews +{ + /* Workaround to fix window orientation issues in iOS 8+. */ + self.frame = self.screen.bounds; + [super layoutSubviews]; +} + +@end static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata; - SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; - SDL_WindowData *data; + SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata; + SDL_uikitview *view; - /* Allocate the window data */ - data = (SDL_WindowData *)SDL_malloc(sizeof(*data)); + CGRect frame = UIKit_ComputeViewFrame(window, displaydata.uiscreen); + int width = (int) frame.size.width; + int height = (int) frame.size.height; + + SDL_WindowData *data = [[SDL_WindowData alloc] init]; if (!data) { return SDL_OutOfMemory(); } - data->uiwindow = uiwindow; - data->viewcontroller = nil; - data->view = nil; - /* Fill in the SDL window with the window data */ - { - window->x = 0; - window->y = 0; + window->driverdata = (void *) CFBridgingRetain(data); - CGRect bounds; - if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) { - bounds = [displaydata->uiscreen bounds]; - } else { - bounds = [displaydata->uiscreen applicationFrame]; - } - - /* Get frame dimensions in pixels */ - int width = (int)(bounds.size.width * displaymodedata->scale); - int height = (int)(bounds.size.height * displaymodedata->scale); - - /* Make sure the width/height are oriented correctly */ - if (UIKit_IsDisplayLandscape(displaydata->uiscreen) != (width > height)) { - int temp = width; - width = height; - height = temp; - } - - window->w = width; - window->h = height; - } - - window->driverdata = data; + data.uiwindow = uiwindow; /* only one window on iOS, always shown */ window->flags &= ~SDL_WINDOW_HIDDEN; - /* SDL_WINDOW_BORDERLESS controls whether status bar is hidden. - * This is only set if the window is on the main screen. Other screens - * just force the window to have the borderless flag. - */ - if (displaydata->uiscreen == [UIScreen mainScreen]) { + if (displaydata.uiscreen == [UIScreen mainScreen]) { window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ - - /* This was setup earlier for our window, and in iOS 7 is controlled by the view, not the application - if ([UIApplication sharedApplication].statusBarHidden) { - window->flags |= SDL_WINDOW_BORDERLESS; - } else { - window->flags &= ~SDL_WINDOW_BORDERLESS; - } - */ } else { - window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizeable */ + window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizable */ window->flags &= ~SDL_WINDOW_INPUT_FOCUS; /* never has input focus */ window->flags |= SDL_WINDOW_BORDERLESS; /* never has a status bar. */ } - /* The View Controller will handle rotating the view when the - * device orientation changes. This will trigger resize events, if - * appropriate. - */ - SDL_uikitviewcontroller *controller; - controller = [SDL_uikitviewcontroller alloc]; - data->viewcontroller = [controller initWithSDLWindow:window]; - [data->viewcontroller setTitle:@"SDL App"]; /* !!! FIXME: hook up SDL_SetWindowTitle() */ + if (displaydata.uiscreen == [UIScreen mainScreen]) { + NSUInteger orients = UIKit_GetSupportedOrientations(window); + BOOL supportsLandscape = (orients & UIInterfaceOrientationMaskLandscape) != 0; + BOOL supportsPortrait = (orients & (UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown)) != 0; + + /* Make sure the width/height are oriented correctly */ + if ((width > height && !supportsLandscape) || (height > width && !supportsPortrait)) { + int temp = width; + width = height; + height = temp; + } + } + + window->x = 0; + window->y = 0; + window->w = width; + window->h = height; + + /* The View Controller will handle rotating the view when the device + * orientation changes. This will trigger resize events, if appropriate. */ + data.viewcontroller = [[SDL_uikitviewcontroller alloc] initWithSDLWindow:window]; + + /* The window will initially contain a generic view so resizes, touch events, + * etc. can be handled without an active OpenGL view/context. */ + view = [[SDL_uikitview alloc] initWithFrame:frame]; + + /* Sets this view as the controller's view, and adds the view to the window + * heirarchy. */ + [view setSDLWindow:window]; + + /* Make this window the current mouse focus for touch input */ + if (displaydata.uiscreen == [UIScreen mainScreen]) { + SDL_SetMouseFocus(window); + SDL_SetKeyboardFocus(window); + } return 0; } @@ -127,173 +149,174 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo int UIKit_CreateWindow(_THIS, SDL_Window *window) { - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; - const BOOL external = ([UIScreen mainScreen] != data->uiscreen); - const CGSize origsize = [[data->uiscreen currentMode] size]; + @autoreleasepool { + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; + const CGSize origsize = data.uiscreen.currentMode.size; - /* SDL currently puts this window at the start of display's linked list. We rely on this. */ - SDL_assert(_this->windows == window); + /* SDL currently puts this window at the start of display's linked list. We rely on this. */ + SDL_assert(_this->windows == window); - /* We currently only handle a single window per display on iOS */ - if (window->next != NULL) { - return SDL_SetError("Only one window allowed per display."); - } - - /* If monitor has a resolution of 0x0 (hasn't been explicitly set by the - * user, so it's in standby), try to force the display to a resolution - * that most closely matches the desired window size. - */ - if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) { - if (display->num_display_modes == 0) { - _this->GetDisplayModes(_this, display); + /* We currently only handle a single window per display on iOS */ + if (window->next != NULL) { + return SDL_SetError("Only one window allowed per display."); } - int i; - const SDL_DisplayMode *bestmode = NULL; - for (i = display->num_display_modes; i >= 0; i--) { - const SDL_DisplayMode *mode = &display->display_modes[i]; - if ((mode->w >= window->w) && (mode->h >= window->h)) - bestmode = mode; - } - - if (bestmode) { - SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)bestmode->driverdata; - [data->uiscreen setCurrentMode:modedata->uiscreenmode]; - - /* desktop_mode doesn't change here (the higher level will - * use it to set all the screens back to their defaults - * upon window destruction, SDL_Quit(), etc. - */ - display->current_mode = *bestmode; - } - } - - if (data->uiscreen == [UIScreen mainScreen]) { - if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) { - [UIApplication sharedApplication].statusBarHidden = YES; - } else { - [UIApplication sharedApplication].statusBarHidden = NO; - } - } - - if (!(window->flags & SDL_WINDOW_RESIZABLE)) { - if (window->w > window->h) { - if (!UIKit_IsDisplayLandscape(data->uiscreen)) { - [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; + /* If monitor has a resolution of 0x0 (hasn't been explicitly set by the + * user, so it's in standby), try to force the display to a resolution + * that most closely matches the desired window size. */ + if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) { + if (display->num_display_modes == 0) { + _this->GetDisplayModes(_this, display); } - } else if (window->w < window->h) { - if (UIKit_IsDisplayLandscape(data->uiscreen)) { - [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; + + int i; + const SDL_DisplayMode *bestmode = NULL; + for (i = display->num_display_modes; i >= 0; i--) { + const SDL_DisplayMode *mode = &display->display_modes[i]; + if ((mode->w >= window->w) && (mode->h >= window->h)) { + bestmode = mode; + } + } + + if (bestmode) { + SDL_DisplayModeData *modedata = (__bridge SDL_DisplayModeData *)bestmode->driverdata; + [data.uiscreen setCurrentMode:modedata.uiscreenmode]; + + /* desktop_mode doesn't change here (the higher level will + * use it to set all the screens back to their defaults + * upon window destruction, SDL_Quit(), etc. */ + display->current_mode = *bestmode; } } - } - /* ignore the size user requested, and make a fullscreen window */ - /* !!! FIXME: can we have a smaller view? */ - UIWindow *uiwindow = [UIWindow alloc]; - uiwindow = [uiwindow initWithFrame:[data->uiscreen bounds]]; + if (data.uiscreen == [UIScreen mainScreen]) { + if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) { + [UIApplication sharedApplication].statusBarHidden = YES; + } else { + [UIApplication sharedApplication].statusBarHidden = NO; + } + } - /* put the window on an external display if appropriate. This implicitly - * does [uiwindow setframe:[uiscreen bounds]], so don't do it on the - * main display, where we land by default, as that would eat the - * status bar real estate. - */ - if (external) { - [uiwindow setScreen:data->uiscreen]; - } + /* ignore the size user requested, and make a fullscreen window */ + /* !!! FIXME: can we have a smaller view? */ + UIWindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds]; - if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) { - [uiwindow release]; - return -1; + /* put the window on an external display if appropriate. */ + if (data.uiscreen != [UIScreen mainScreen]) { + [uiwindow setScreen:data.uiscreen]; + } + + if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) { + return -1; + } } return 1; +} +void +UIKit_SetWindowTitle(_THIS, SDL_Window * window) +{ + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + data.viewcontroller.title = @(window->title); + } } void UIKit_ShowWindow(_THIS, SDL_Window * window) { - UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow; - - [uiwindow makeKeyAndVisible]; + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + [data.uiwindow makeKeyAndVisible]; + } } void UIKit_HideWindow(_THIS, SDL_Window * window) { - UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow; - - uiwindow.hidden = YES; + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + data.uiwindow.hidden = YES; + } } void UIKit_RaiseWindow(_THIS, SDL_Window * window) { /* We don't currently offer a concept of "raising" the SDL window, since - * we only allow one per display, in the iOS fashion. + * we only allow one per display, in the iOS fashion. * However, we use this entry point to rebind the context to the view - * during OnWindowRestored processing. - */ + * during OnWindowRestored processing. */ _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx); } +static void +UIKit_UpdateWindowBorder(_THIS, SDL_Window * window) +{ + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + SDL_uikitviewcontroller *viewcontroller = data.viewcontroller; + + if (data.uiwindow.screen == [UIScreen mainScreen]) { + if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) { + [UIApplication sharedApplication].statusBarHidden = YES; + } else { + [UIApplication sharedApplication].statusBarHidden = NO; + } + + /* iOS 7+ won't update the status bar until we tell it to. */ + if ([viewcontroller respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { + [viewcontroller setNeedsStatusBarAppearanceUpdate]; + } + } + + /* Update the view's frame to account for the status bar change. */ + viewcontroller.view.frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); + +#ifdef SDL_IPHONE_KEYBOARD + /* Make sure the view is offset correctly when the keyboard is visible. */ + [viewcontroller updateKeyboard]; +#endif + + [viewcontroller.view setNeedsLayout]; + [viewcontroller.view layoutIfNeeded]; +} + +void +UIKit_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +{ + @autoreleasepool { + UIKit_UpdateWindowBorder(_this, window); + } +} + void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) { - SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; - SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata; - UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow; - - if (fullscreen) { - [UIApplication sharedApplication].statusBarHidden = YES; - } else { - [UIApplication sharedApplication].statusBarHidden = NO; - } - - CGRect bounds; - if (fullscreen) { - bounds = [displaydata->uiscreen bounds]; - } else { - bounds = [displaydata->uiscreen applicationFrame]; - } - - /* Get frame dimensions in pixels */ - int width = (int)(bounds.size.width * displaymodedata->scale); - int height = (int)(bounds.size.height * displaymodedata->scale); - - /* We can pick either width or height here and we'll rotate the - screen to match, so we pick the closest to what we wanted. - */ - if (window->w >= window->h) { - if (width > height) { - window->w = width; - window->h = height; - } else { - window->w = height; - window->h = width; - } - } else { - if (width > height) { - window->w = height; - window->h = width; - } else { - window->w = width; - window->h = height; - } + @autoreleasepool { + UIKit_UpdateWindowBorder(_this, window); } } void UIKit_DestroyWindow(_THIS, SDL_Window * window) { - SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + @autoreleasepool { + if (window->driverdata != NULL) { + SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata); + NSArray *views = nil; - if (data) { - [data->viewcontroller release]; - [data->uiwindow release]; - SDL_free(data); + [data.viewcontroller stopAnimation]; + + /* Detach all views from this window. We use a copy of the array + * because setSDLWindow will remove the object from the original + * array, which would be undesirable if we were iterating over it. */ + views = [data.views copy]; + for (SDL_uikitview *view in views) { + [view setSDLWindow:NULL]; + } + } } window->driverdata = NULL; } @@ -301,29 +324,118 @@ UIKit_DestroyWindow(_THIS, SDL_Window * window) SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { - UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow; + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; - if (info->version.major <= SDL_MAJOR_VERSION) { - info->subsystem = SDL_SYSWM_UIKIT; - info->info.uikit.window = uiwindow; - return SDL_TRUE; - } else { - SDL_SetError("Application not compiled with SDL %d.%d\n", - SDL_MAJOR_VERSION, SDL_MINOR_VERSION); - return SDL_FALSE; + if (info->version.major <= SDL_MAJOR_VERSION) { + int versionnum = SDL_VERSIONNUM(info->version.major, info->version.minor, info->version.patch); + + info->subsystem = SDL_SYSWM_UIKIT; + info->info.uikit.window = data.uiwindow; + + /* These struct members were added in SDL 2.0.4. */ + if (versionnum >= SDL_VERSIONNUM(2,0,4)) { + if ([data.viewcontroller.view isKindOfClass:[SDL_uikitopenglview class]]) { + SDL_uikitopenglview *glview = (SDL_uikitopenglview *)data.viewcontroller.view; + info->info.uikit.framebuffer = glview.drawableFramebuffer; + info->info.uikit.colorbuffer = glview.drawableRenderbuffer; + info->info.uikit.resolveFramebuffer = glview.msaaResolveFramebuffer; + } else { + info->info.uikit.framebuffer = 0; + info->info.uikit.colorbuffer = 0; + info->info.uikit.resolveFramebuffer = 0; + } + } + + return SDL_TRUE; + } else { + SDL_SetError("Application not compiled with SDL %d.%d\n", + SDL_MAJOR_VERSION, SDL_MINOR_VERSION); + return SDL_FALSE; + } } } +NSUInteger +UIKit_GetSupportedOrientations(SDL_Window * window) +{ + const char *hint = SDL_GetHint(SDL_HINT_ORIENTATIONS); + NSUInteger validOrientations = UIInterfaceOrientationMaskAll; + NSUInteger orientationMask = 0; + + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + UIApplication *app = [UIApplication sharedApplication]; + + /* Get all possible valid orientations. If the app delegate doesn't tell + * us, we get the orientations from Info.plist via UIApplication. */ + if ([app.delegate respondsToSelector:@selector(application:supportedInterfaceOrientationsForWindow:)]) { + validOrientations = [app.delegate application:app supportedInterfaceOrientationsForWindow:data.uiwindow]; + } else if ([app respondsToSelector:@selector(supportedInterfaceOrientationsForWindow:)]) { + validOrientations = [app supportedInterfaceOrientationsForWindow:data.uiwindow]; + } + + if (hint != NULL) { + NSArray *orientations = [@(hint) componentsSeparatedByString:@" "]; + + if ([orientations containsObject:@"LandscapeLeft"]) { + orientationMask |= UIInterfaceOrientationMaskLandscapeLeft; + } + if ([orientations containsObject:@"LandscapeRight"]) { + orientationMask |= UIInterfaceOrientationMaskLandscapeRight; + } + if ([orientations containsObject:@"Portrait"]) { + orientationMask |= UIInterfaceOrientationMaskPortrait; + } + if ([orientations containsObject:@"PortraitUpsideDown"]) { + orientationMask |= UIInterfaceOrientationMaskPortraitUpsideDown; + } + } + + if (orientationMask == 0 && (window->flags & SDL_WINDOW_RESIZABLE)) { + /* any orientation is okay. */ + orientationMask = UIInterfaceOrientationMaskAll; + } + + if (orientationMask == 0) { + if (window->w >= window->h) { + orientationMask |= UIInterfaceOrientationMaskLandscape; + } + if (window->h >= window->w) { + orientationMask |= (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); + } + } + + /* Don't allow upside-down orientation on phones, so answering calls is in the natural orientation */ + if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { + orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown; + } + + /* If none of the specified orientations are actually supported by the + * app, we'll revert to what the app supports. An exception would be + * thrown by the system otherwise. */ + if ((validOrientations & orientationMask) == 0) { + orientationMask = validOrientations; + } + } + + return orientationMask; +} + int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam) { - SDL_WindowData *data = window ? (SDL_WindowData *)window->driverdata : NULL; - - if (!data || !data->view) { - return SDL_SetError("Invalid window or view not set"); + if (!window || !window->driverdata) { + return SDL_SetError("Invalid window"); + } + + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + [data.viewcontroller setAnimationCallback:interval + callback:callback + callbackParam:callbackParam]; } - [data->view setAnimationCallback:interval callback:callback callbackParam:callbackParam]; return 0; } diff --git a/libs/SDL2/src/video/uikit/keyinfotable.h b/libs/SDL2/src/video/uikit/keyinfotable.h index 1d16868c..22a79dce 100644 --- a/libs/SDL2/src/video/uikit/keyinfotable.h +++ b/libs/SDL2/src/video/uikit/keyinfotable.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -169,6 +169,6 @@ static UIKitKeyInfo unicharToUIKeyInfoTable[] = { /* 127 */{ SDL_SCANCODE_BACKSPACE, KMOD_SHIFT } }; -#endif /* UIKitKeyInfo */ +#endif /* _UIKIT_KeyInfo */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/vivante/SDL_vivanteopengles.c b/libs/SDL2/src/video/vivante/SDL_vivanteopengles.c index a5499a9b..96d2f89d 100644 --- a/libs/SDL2/src/video/vivante/SDL_vivanteopengles.c +++ b/libs/SDL2/src/video/vivante/SDL_vivanteopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/vivante/SDL_vivanteopengles.h b/libs/SDL2/src/video/vivante/SDL_vivanteopengles.h index 59ce8200..b7b61803 100644 --- a/libs/SDL2/src/video/vivante/SDL_vivanteopengles.h +++ b/libs/SDL2/src/video/vivante/SDL_vivanteopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/vivante/SDL_vivanteplatform.c b/libs/SDL2/src/video/vivante/SDL_vivanteplatform.c index a779d64c..40579dfa 100644 --- a/libs/SDL2/src/video/vivante/SDL_vivanteplatform.c +++ b/libs/SDL2/src/video/vivante/SDL_vivanteplatform.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/vivante/SDL_vivanteplatform.h b/libs/SDL2/src/video/vivante/SDL_vivanteplatform.h index 27b82afd..b8376283 100644 --- a/libs/SDL2/src/video/vivante/SDL_vivanteplatform.h +++ b/libs/SDL2/src/video/vivante/SDL_vivanteplatform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/vivante/SDL_vivantevideo.c b/libs/SDL2/src/video/vivante/SDL_vivantevideo.c index 5ae3f981..8095cb58 100644 --- a/libs/SDL2/src/video/vivante/SDL_vivantevideo.c +++ b/libs/SDL2/src/video/vivante/SDL_vivantevideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/vivante/SDL_vivantevideo.h b/libs/SDL2/src/video/vivante/SDL_vivantevideo.h index aab7bdf3..030516bd 100644 --- a/libs/SDL2/src/video/vivante/SDL_vivantevideo.h +++ b/libs/SDL2/src/video/vivante/SDL_vivantevideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylanddyn.c b/libs/SDL2/src/video/wayland/SDL_waylanddyn.c index 1ed29db5..edf6e219 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylanddyn.c +++ b/libs/SDL2/src/video/wayland/SDL_waylanddyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylanddyn.h b/libs/SDL2/src/video/wayland/SDL_waylanddyn.h index 8d9313a2..19fd4558 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylanddyn.h +++ b/libs/SDL2/src/video/wayland/SDL_waylanddyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandevents.c b/libs/SDL2/src/video/wayland/SDL_waylandevents.c index e3c9782f..face9d64 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandevents.c +++ b/libs/SDL2/src/video/wayland/SDL_waylandevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -52,6 +52,10 @@ struct SDL_WaylandInput { SDL_WindowData *pointer_focus; SDL_WindowData *keyboard_focus; + /* Last motion location */ + wl_fixed_t sx_w; + wl_fixed_t sy_w; + struct { struct xkb_keymap *keymap; struct xkb_state *state; @@ -119,13 +123,53 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, { struct SDL_WaylandInput *input = data; SDL_WindowData *window = input->pointer_focus; - int sx = wl_fixed_to_int(sx_w); - int sy = wl_fixed_to_int(sy_w); + input->sx_w = sx_w; + input->sy_w = sy_w; if (input->pointer_focus) { + const int sx = wl_fixed_to_int(sx_w); + const int sy = wl_fixed_to_int(sy_w); SDL_SendMouseMotion(window->sdlwindow, 0, 0, sx, sy); } } +static SDL_bool +ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial) +{ + SDL_WindowData *window_data = input->pointer_focus; + SDL_Window *window = window_data->sdlwindow; + + if (window->hit_test) { + const SDL_Point point = { wl_fixed_to_int(input->sx_w), wl_fixed_to_int(input->sy_w) }; + const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data); + static const uint32_t directions[] = { + WL_SHELL_SURFACE_RESIZE_TOP_LEFT, WL_SHELL_SURFACE_RESIZE_TOP, + WL_SHELL_SURFACE_RESIZE_TOP_RIGHT, WL_SHELL_SURFACE_RESIZE_RIGHT, + WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, WL_SHELL_SURFACE_RESIZE_BOTTOM, + WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT, WL_SHELL_SURFACE_RESIZE_LEFT + }; + switch (rc) { + case SDL_HITTEST_DRAGGABLE: + wl_shell_surface_move(window_data->shell_surface, input->seat, serial); + return SDL_TRUE; + + case SDL_HITTEST_RESIZE_TOPLEFT: + case SDL_HITTEST_RESIZE_TOP: + case SDL_HITTEST_RESIZE_TOPRIGHT: + case SDL_HITTEST_RESIZE_RIGHT: + case SDL_HITTEST_RESIZE_BOTTOMRIGHT: + case SDL_HITTEST_RESIZE_BOTTOM: + case SDL_HITTEST_RESIZE_BOTTOMLEFT: + case SDL_HITTEST_RESIZE_LEFT: + wl_shell_surface_resize(window_data->shell_surface, input->seat, serial, directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]); + return SDL_TRUE; + + default: return SDL_FALSE; + } + } + + return SDL_FALSE; +} + static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w) @@ -139,6 +183,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, switch (button) { case BTN_LEFT: sdl_button = SDL_BUTTON_LEFT; + if (ProcessHitTest(data, serial)) { + return; /* don't pass this event on to app. */ + } break; case BTN_MIDDLE: sdl_button = SDL_BUTTON_MIDDLE; @@ -246,7 +293,14 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, struct wl_array *keys) { struct SDL_WaylandInput *input = data; - SDL_WindowData *window = wl_surface_get_user_data(surface); + SDL_WindowData *window; + + if (!surface) { + /* enter event for a window we've just destroyed */ + return; + } + + window = wl_surface_get_user_data(surface); input->keyboard_focus = window; window->keyboard_device = input; @@ -364,7 +418,8 @@ Wayland_display_add_input(SDL_VideoData *d, uint32_t id) input->display = d; input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, 1); - + input->sx_w = wl_fixed_from_int(0); + input->sy_w = wl_fixed_from_int(0); d->input = input; wl_seat_add_listener(input->seat, &seat_listener, input); diff --git a/libs/SDL2/src/video/wayland/SDL_waylandevents_c.h b/libs/SDL2/src/video/wayland/SDL_waylandevents_c.h index 8a6c3fcd..5a914e90 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandevents_c.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandmouse.c b/libs/SDL2/src/video/wayland/SDL_waylandmouse.c index 338f42f8..2d78ebb9 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandmouse.c +++ b/libs/SDL2/src/video/wayland/SDL_waylandmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -347,17 +347,16 @@ Wayland_WarpMouse(SDL_Window *window, int x, int y) SDL_Unsupported(); } -static void +static int Wayland_WarpMouseGlobal(int x, int y) { - SDL_Unsupported(); + return SDL_Unsupported(); } static int Wayland_SetRelativeMouseMode(SDL_bool enabled) { - SDL_Unsupported(); - return -1; + return SDL_Unsupported(); } void diff --git a/libs/SDL2/src/video/wayland/SDL_waylandmouse.h b/libs/SDL2/src/video/wayland/SDL_waylandmouse.h index efd29d6c..3a914a28 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandmouse.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandopengles.c b/libs/SDL2/src/video/wayland/SDL_waylandopengles.c index 45078043..ca301e57 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandopengles.c +++ b/libs/SDL2/src/video/wayland/SDL_waylandopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandopengles.h b/libs/SDL2/src/video/wayland/SDL_waylandopengles.h index 77081f81..42c13f84 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandopengles.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandsym.h b/libs/SDL2/src/video/wayland/SDL_waylandsym.h index c3b4fa50..edac091f 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandsym.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandsym.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandtouch.c b/libs/SDL2/src/video/wayland/SDL_waylandtouch.c index 85f9f0ad..3aa8828d 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandtouch.c +++ b/libs/SDL2/src/video/wayland/SDL_waylandtouch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,12 +88,10 @@ touch_handle_touch(void *data, uint32_t capabilities = flags >> 16; */ - SDL_TouchID deviceId = 0; - if (!SDL_GetTouch(deviceId)) { - if (SDL_AddTouch(deviceId, "qt_touch_extension") < 0) { - SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__); - } - } + SDL_TouchID deviceId = 1; + if (SDL_AddTouch(deviceId, "qt_touch_extension") < 0) { + SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__); + } switch (touchState) { case QtWaylandTouchPointPressed: diff --git a/libs/SDL2/src/video/wayland/SDL_waylandtouch.h b/libs/SDL2/src/video/wayland/SDL_waylandtouch.h index 435fd562..8c0d2036 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandtouch.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandtouch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/wayland/SDL_waylandvideo.c b/libs/SDL2/src/video/wayland/SDL_waylandvideo.c index 43826b83..f509ddc1 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandvideo.c +++ b/libs/SDL2/src/video/wayland/SDL_waylandvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,11 +43,6 @@ #define WAYLANDVID_DRIVER_NAME "wayland" -struct wayland_mode { - SDL_DisplayMode mode; - struct wl_list link; -}; - /* Initialization/Query functions */ static int Wayland_VideoInit(_THIS); @@ -87,7 +82,7 @@ static SDL_VideoDevice * Wayland_CreateDevice(int devindex) { SDL_VideoDevice *device; - + if (!SDL_WAYLAND_LoadSymbols()) { return NULL; } @@ -124,6 +119,7 @@ Wayland_CreateDevice(int devindex) device->SetWindowFullscreen = Wayland_SetWindowFullscreen; device->SetWindowSize = Wayland_SetWindowSize; device->DestroyWindow = Wayland_DestroyWindow; + device->SetWindowHitTest = Wayland_SetWindowHitTest; device->free = Wayland_DeleteDevice; @@ -135,27 +131,6 @@ VideoBootStrap Wayland_bootstrap = { Wayland_Available, Wayland_CreateDevice }; -static void -wayland_add_mode(SDL_VideoData *d, SDL_DisplayMode m) -{ - struct wayland_mode *mode; - - /* Check for duplicate mode */ - wl_list_for_each(mode, &d->modes_list, link) - if (mode->mode.w == m.w && mode->mode.h == m.h && - mode->mode.refresh_rate == m.refresh_rate) - return; - - /* Add new mode to the list */ - mode = (struct wayland_mode *) SDL_calloc(1, sizeof *mode); - - if (!mode) - return; - - mode->mode = m; - WAYLAND_wl_list_insert(&d->modes_list, &mode->link); -} - static void display_handle_geometry(void *data, struct wl_output *output, @@ -168,55 +143,80 @@ display_handle_geometry(void *data, int transform) { - SDL_VideoData *d = data; + SDL_VideoDisplay *display = data; - d->screen_allocation.x = x; - d->screen_allocation.y = y; + display->name = strdup(model); + display->driverdata = output; } static void display_handle_mode(void *data, - struct wl_output *wl_output, + struct wl_output *output, uint32_t flags, int width, int height, int refresh) { - SDL_VideoData *d = data; + SDL_VideoDisplay *display = data; SDL_DisplayMode mode; SDL_zero(mode); mode.w = width; mode.h = height; - mode.refresh_rate = refresh / 1000; - - wayland_add_mode(d, mode); + mode.refresh_rate = refresh / 1000; // mHz to Hz + SDL_AddDisplayMode(display, &mode); if (flags & WL_OUTPUT_MODE_CURRENT) { - d->screen_allocation.width = width; - d->screen_allocation.height = height; + display->current_mode = mode; + display->desktop_mode = mode; } } +static void +display_handle_done(void *data, + struct wl_output *output) +{ + SDL_VideoDisplay *display = data; + SDL_AddVideoDisplay(display); + SDL_free(display->name); + SDL_free(display); +} + +static void +display_handle_scale(void *data, + struct wl_output *output, + int32_t factor) +{ + // TODO: do HiDPI stuff. +} + static const struct wl_output_listener output_listener = { display_handle_geometry, - display_handle_mode + display_handle_mode, + display_handle_done, + display_handle_scale }; static void -shm_handle_format(void *data, - struct wl_shm *shm, - uint32_t format) +Wayland_add_display(SDL_VideoData *d, uint32_t id) { - SDL_VideoData *d = data; + struct wl_output *output; + SDL_VideoDisplay *display = SDL_malloc(sizeof *display); + if (!display) { + SDL_OutOfMemory(); + return; + } + SDL_zero(*display); - d->shm_formats |= (1 << format); + output = wl_registry_bind(d->registry, id, &wl_output_interface, 2); + if (!output) { + SDL_SetError("Failed to retrieve output."); + return; + } + + wl_output_add_listener(output, &output_listener, display); } -static const struct wl_shm_listener shm_listener = { - shm_handle_format -}; - #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH static void windowmanager_hints(void *data, struct qt_windowmanager *qt_windowmanager, @@ -238,15 +238,14 @@ static const struct qt_windowmanager_listener windowmanager_listener = { static void display_handle_global(void *data, struct wl_registry *registry, uint32_t id, - const char *interface, uint32_t version) + const char *interface, uint32_t version) { SDL_VideoData *d = data; - + if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(d->registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_output") == 0) { - d->output = wl_registry_bind(d->registry, id, &wl_output_interface, 1); - wl_output_add_listener(d->output, &output_listener, d); + Wayland_add_display(d, id); } else if (strcmp(interface, "wl_seat") == 0) { Wayland_display_add_input(d, id); } else if (strcmp(interface, "wl_shell") == 0) { @@ -255,8 +254,7 @@ display_handle_global(void *data, struct wl_registry *registry, uint32_t id, d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); d->cursor_theme = WAYLAND_wl_cursor_theme_load(NULL, 32, d->shm); d->default_cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "left_ptr"); - wl_shm_add_listener(d->shm, &shm_listener, d); - + #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH } else if (strcmp(interface, "qt_touch_extension") == 0) { Wayland_touch_create(d, id); @@ -272,73 +270,43 @@ display_handle_global(void *data, struct wl_registry *registry, uint32_t id, } static const struct wl_registry_listener registry_listener = { - display_handle_global + display_handle_global }; int Wayland_VideoInit(_THIS) { - SDL_VideoData *data; - SDL_VideoDisplay display; - SDL_DisplayMode mode; - int i; - - data = malloc(sizeof *data); + SDL_VideoData *data = SDL_malloc(sizeof *data); if (data == NULL) - return 0; + return SDL_OutOfMemory(); memset(data, 0, sizeof *data); _this->driverdata = data; - WAYLAND_wl_list_init(&data->modes_list); - data->display = WAYLAND_wl_display_connect(NULL); if (data->display == NULL) { - SDL_SetError("Failed to connect to a Wayland display"); - return 0; + return SDL_SetError("Failed to connect to a Wayland display"); } data->registry = wl_display_get_registry(data->display); - - if ( data->registry == NULL) { - SDL_SetError("Failed to get the Wayland registry"); - return 0; + if (data->registry == NULL) { + return SDL_SetError("Failed to get the Wayland registry"); } - + wl_registry_add_listener(data->registry, ®istry_listener, data); - for (i=0; i < 100; i++) { - if (data->screen_allocation.width != 0 || WAYLAND_wl_display_get_error(data->display) != 0) { - break; - } - WAYLAND_wl_display_dispatch(data->display); - } - - if (data->screen_allocation.width == 0) { - SDL_SetError("Failed while waiting for screen allocation: %d ", WAYLAND_wl_display_get_error(data->display)); - return 0; - } + // First roundtrip to receive all registry objects. + WAYLAND_wl_display_roundtrip(data->display); + + // Second roundtrip to receive all output events. + WAYLAND_wl_display_roundtrip(data->display); data->xkb_context = WAYLAND_xkb_context_new(0); if (!data->xkb_context) { - SDL_SetError("Failed to create XKB context"); - return 0; + return SDL_SetError("Failed to create XKB context"); } - /* Use a fake 32-bpp desktop mode */ - mode.format = SDL_PIXELFORMAT_RGB888; - mode.w = data->screen_allocation.width; - mode.h = data->screen_allocation.height; - mode.refresh_rate = 0; - mode.driverdata = NULL; - wayland_add_mode(data, mode); - SDL_zero(display); - display.desktop_mode = mode; - display.current_mode = mode; - display.driverdata = NULL; - SDL_AddVideoDisplay(&display); - - Wayland_InitMouse (); + Wayland_InitMouse(); WAYLAND_wl_display_flush(data->display); @@ -348,46 +316,29 @@ Wayland_VideoInit(_THIS) static void Wayland_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display) { - SDL_VideoData *data = _this->driverdata; - SDL_DisplayMode mode; - struct wayland_mode *m; - - Wayland_PumpEvents(_this); - - wl_list_for_each(m, &data->modes_list, link) { - m->mode.format = SDL_PIXELFORMAT_RGB888; - SDL_AddDisplayMode(sdl_display, &m->mode); - m->mode.format = SDL_PIXELFORMAT_RGBA8888; - SDL_AddDisplayMode(sdl_display, &m->mode); - } - - mode.w = data->screen_allocation.width; - mode.h = data->screen_allocation.height; - mode.refresh_rate = 0; - mode.driverdata = NULL; - - mode.format = SDL_PIXELFORMAT_RGB888; - SDL_AddDisplayMode(sdl_display, &mode); - mode.format = SDL_PIXELFORMAT_RGBA8888; - SDL_AddDisplayMode(sdl_display, &mode); + // Nothing to do here, everything was already done in the wl_output + // callbacks. } static int Wayland_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { - return 0; + return SDL_Unsupported(); } void Wayland_VideoQuit(_THIS) { SDL_VideoData *data = _this->driverdata; - struct wayland_mode *t, *m; + int i; Wayland_FiniMouse (); - if (data->output) - wl_output_destroy(data->output); + for (i = 0; i < _this->num_displays; ++i) { + SDL_VideoDisplay *display = &_this->displays[i]; + wl_output_destroy(display->driverdata); + display->driverdata = NULL; + } Wayland_display_destroy_input(data); @@ -417,16 +368,13 @@ Wayland_VideoQuit(_THIS) if (data->compositor) wl_compositor_destroy(data->compositor); + if (data->registry) + wl_registry_destroy(data->registry); + if (data->display) { WAYLAND_wl_display_flush(data->display); WAYLAND_wl_display_disconnect(data->display); } - - wl_list_for_each_safe(m, t, &data->modes_list, link) { - WAYLAND_wl_list_remove(&m->link); - free(m); - } - free(data); _this->driverdata = NULL; diff --git a/libs/SDL2/src/video/wayland/SDL_waylandvideo.h b/libs/SDL2/src/video/wayland/SDL_waylandvideo.h index 77d431e4..6dc736a2 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandvideo.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,33 +40,24 @@ typedef struct { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; - struct wl_output *output; struct wl_shm *shm; struct wl_cursor_theme *cursor_theme; struct wl_cursor *default_cursor; struct wl_pointer *pointer; struct wl_shell *shell; - struct { - int32_t x, y, width, height; - } screen_allocation; - - struct wl_list modes_list; - EGLDisplay edpy; EGLContext context; EGLConfig econf; struct xkb_context *xkb_context; struct SDL_WaylandInput *input; - -#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH + +#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH struct SDL_WaylandTouch *touch; struct qt_surface_extension *surface_extension; struct qt_windowmanager *windowmanager; #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ - - uint32_t shm_formats; } SDL_VideoData; #endif /* _SDL_waylandvideo_h */ diff --git a/libs/SDL2/src/video/wayland/SDL_waylandwindow.c b/libs/SDL2/src/video/wayland/SDL_waylandwindow.c index 81bdc81b..e105408a 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandwindow.c +++ b/libs/SDL2/src/video/wayland/SDL_waylandwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -109,6 +109,12 @@ Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) return SDL_TRUE; } +int +Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) +{ + return 0; /* just succeed, the real work is done elsewhere. */ +} + void Wayland_ShowWindow(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; @@ -116,7 +122,7 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) if (window->flags & SDL_WINDOW_FULLSCREEN) wl_shell_surface_set_fullscreen(wind->shell_surface, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, - 0, NULL); + 0, (struct wl_output *)window->fullscreen_mode.driverdata); else wl_shell_surface_set_toplevel(wind->shell_surface); @@ -132,7 +138,7 @@ Wayland_SetWindowFullscreen(_THIS, SDL_Window * window, if (fullscreen) wl_shell_surface_set_fullscreen(wind->shell_surface, WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE, - 0, NULL); + 0, (struct wl_output *)_display->driverdata); else wl_shell_surface_set_toplevel(wind->shell_surface); @@ -147,7 +153,7 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) data = calloc(1, sizeof *data); if (data == NULL) - return 0; + return SDL_OutOfMemory(); c = _this->driverdata; window->driverdata = data; @@ -179,17 +185,6 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) } #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ - /** - * If the user specified 0x0 as the size (turned to 1x1 by SDL_CreateWindow - * in SDL_video.c), we want to make the window fill the whole screen - **/ - if (window->w == 1) { - window->w = c->screen_allocation.width; - } - if (window->h == 1) { - window->h = c->screen_allocation.height; - } - data->egl_window = WAYLAND_wl_egl_window_create(data->surface, window->w, window->h); @@ -197,8 +192,7 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->egl_window); if (data->egl_surface == EGL_NO_SURFACE) { - SDL_SetError("failed to create a window surface"); - return -1; + return SDL_SetError("failed to create a window surface"); } if (data->shell_surface) { diff --git a/libs/SDL2/src/video/wayland/SDL_waylandwindow.h b/libs/SDL2/src/video/wayland/SDL_waylandwindow.h index c1190d52..e2bed546 100644 --- a/libs/SDL2/src/video/wayland/SDL_waylandwindow.h +++ b/libs/SDL2/src/video/wayland/SDL_waylandwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,6 +55,7 @@ extern void Wayland_DestroyWindow(_THIS, SDL_Window *window); extern SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info); +extern int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); #endif /* _SDL_waylandwindow_h */ diff --git a/libs/SDL2/src/video/windows/SDL_msctf.h b/libs/SDL2/src/video/windows/SDL_msctf.h index 01e732cf..c2368d7a 100644 --- a/libs/SDL2/src/video/windows/SDL_msctf.h +++ b/libs/SDL2/src/video/windows/SDL_msctf.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_vkeys.h b/libs/SDL2/src/video/windows/SDL_vkeys.h index 1ed155a1..4c3d390d 100644 --- a/libs/SDL2/src/video/windows/SDL_vkeys.h +++ b/libs/SDL2/src/video/windows/SDL_vkeys.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsclipboard.c b/libs/SDL2/src/video/windows/SDL_windowsclipboard.c index ae3a104a..d93eceed 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsclipboard.c +++ b/libs/SDL2/src/video/windows/SDL_windowsclipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsclipboard.h b/libs/SDL2/src/video/windows/SDL_windowsclipboard.h index 49c36c4e..3b5e62b4 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsclipboard.h +++ b/libs/SDL2/src/video/windows/SDL_windowsclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsevents.c b/libs/SDL2/src/video/windows/SDL_windowsevents.c index 524e67ad..8f3ec685 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsevents.c +++ b/libs/SDL2/src/video/windows/SDL_windowsevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,6 +24,7 @@ #include "SDL_windowsvideo.h" #include "SDL_windowsshape.h" +#include "SDL_system.h" #include "SDL_syswm.h" #include "SDL_timer.h" #include "SDL_vkeys.h" @@ -31,6 +32,7 @@ #include "../../events/SDL_touch_c.h" #include "../../events/scancodes_windows.h" #include "SDL_assert.h" +#include "SDL_hints.h" /* Dropfile support */ #include @@ -44,6 +46,9 @@ #include "wmmsg.h" #endif +/* For processing mouse WM_*BUTTON* and WM_MOUSEMOVE message-data from GetMessageExtraInfo() */ +#define MOUSEEVENTF_FROMTOUCH 0xFF515700 + /* Masks for processing the windows KEYDOWN and KEYUP messages */ #define REPEATED_KEYMASK (1<<30) #define EXTENDED_KEYMASK (1<<24) @@ -195,7 +200,7 @@ WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam) void -WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button) +WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID) { if (data->focus_click_pending && button == SDL_BUTTON_LEFT && !bwParamMousePressed) { data->focus_click_pending = SDL_FALSE; @@ -203,9 +208,9 @@ WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePress } if (bwParamMousePressed && !bSDLMousePressed) { - SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button); + SDL_SendMouseButton(data->window, mouseID, SDL_PRESSED, button); } else if (!bwParamMousePressed && bSDLMousePressed) { - SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button); + SDL_SendMouseButton(data->window, mouseID, SDL_RELEASED, button); } } @@ -214,15 +219,15 @@ WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePress * so this funciton reconciles our view of the world with the current buttons reported by windows */ void -WIN_CheckWParamMouseButtons(WPARAM wParam, SDL_WindowData *data) +WIN_CheckWParamMouseButtons(WPARAM wParam, SDL_WindowData *data, SDL_MouseID mouseID) { if (wParam != data->mouse_button_flags) { Uint32 mouseFlags = SDL_GetMouseState(NULL, NULL); - WIN_CheckWParamMouseButton((wParam & MK_LBUTTON), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT); - WIN_CheckWParamMouseButton((wParam & MK_MBUTTON), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE); - WIN_CheckWParamMouseButton((wParam & MK_RBUTTON), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT); - WIN_CheckWParamMouseButton((wParam & MK_XBUTTON1), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1); - WIN_CheckWParamMouseButton((wParam & MK_XBUTTON2), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2); + WIN_CheckWParamMouseButton((wParam & MK_LBUTTON), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT, mouseID); + WIN_CheckWParamMouseButton((wParam & MK_MBUTTON), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE, mouseID); + WIN_CheckWParamMouseButton((wParam & MK_RBUTTON), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT, mouseID); + WIN_CheckWParamMouseButton((wParam & MK_XBUTTON1), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1, mouseID); + WIN_CheckWParamMouseButton((wParam & MK_XBUTTON2), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2, mouseID); data->mouse_button_flags = wParam; } } @@ -234,25 +239,25 @@ WIN_CheckRawMouseButtons(ULONG rawButtons, SDL_WindowData *data) if (rawButtons != data->mouse_button_flags) { Uint32 mouseFlags = SDL_GetMouseState(NULL, NULL); if ((rawButtons & RI_MOUSE_BUTTON_1_DOWN)) - WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_1_DOWN), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT); + WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_1_DOWN), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT, 0); if ((rawButtons & RI_MOUSE_BUTTON_1_UP)) - WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_1_UP), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT); + WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_1_UP), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT, 0); if ((rawButtons & RI_MOUSE_BUTTON_2_DOWN)) - WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_2_DOWN), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT); + WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_2_DOWN), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT, 0); if ((rawButtons & RI_MOUSE_BUTTON_2_UP)) - WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_2_UP), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT); + WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_2_UP), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT, 0); if ((rawButtons & RI_MOUSE_BUTTON_3_DOWN)) - WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_3_DOWN), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE); + WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_3_DOWN), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE, 0); if ((rawButtons & RI_MOUSE_BUTTON_3_UP)) - WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_3_UP), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE); + WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_3_UP), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE, 0); if ((rawButtons & RI_MOUSE_BUTTON_4_DOWN)) - WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_4_DOWN), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1); + WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_4_DOWN), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1, 0); if ((rawButtons & RI_MOUSE_BUTTON_4_UP)) - WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_4_UP), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1); + WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_4_UP), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1, 0); if ((rawButtons & RI_MOUSE_BUTTON_5_DOWN)) - WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_5_DOWN), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2); + WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_5_DOWN), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2, 0); if ((rawButtons & RI_MOUSE_BUTTON_5_UP)) - WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_5_UP), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2); + WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_5_UP), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2, 0); data->mouse_button_flags = rawButtons; } } @@ -270,28 +275,28 @@ WIN_CheckAsyncMouseRelease(SDL_WindowData *data) keyState = GetAsyncKeyState(VK_LBUTTON); if (!(keyState & 0x8000)) { - WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT); + WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT, 0); } keyState = GetAsyncKeyState(VK_RBUTTON); if (!(keyState & 0x8000)) { - WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT); + WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT, 0); } keyState = GetAsyncKeyState(VK_MBUTTON); if (!(keyState & 0x8000)) { - WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE); + WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE, 0); } keyState = GetAsyncKeyState(VK_XBUTTON1); if (!(keyState & 0x8000)) { - WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1); + WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1, 0); } keyState = GetAsyncKeyState(VK_XBUTTON2); if (!(keyState & 0x8000)) { - WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2); + WIN_CheckWParamMouseButton(SDL_FALSE, (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2, 0); } data->mouse_button_flags = 0; } -SDL_FORCE_INLINE BOOL +BOOL WIN_ConvertUTF32toUTF8(UINT32 codepoint, char * text) { if (codepoint <= 0x7F) { @@ -318,6 +323,22 @@ WIN_ConvertUTF32toUTF8(UINT32 codepoint, char * text) return SDL_TRUE; } +static SDL_bool +ShouldGenerateWindowCloseOnAltF4(void) +{ + const char *hint; + + hint = SDL_GetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4); + if (hint) { + if (*hint == '0') { + return SDL_TRUE; + } else { + return SDL_FALSE; + } + } + return SDL_TRUE; +} + LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -409,7 +430,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { SDL_Mouse *mouse = SDL_GetMouse(); if (!mouse->relative_mode || mouse->relative_mode_warp) { - SDL_SendMouseMotion(data->window, 0, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); + SDL_MouseID mouseID = (((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH) ? SDL_TOUCH_MOUSEID : 0); + SDL_SendMouseMotion(data->window, mouseID, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); } } /* don't break here, fall through to check the wParam like the button presses */ @@ -428,7 +450,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { SDL_Mouse *mouse = SDL_GetMouse(); if (!mouse->relative_mode || mouse->relative_mode_warp) { - WIN_CheckWParamMouseButtons(wParam, data); + SDL_MouseID mouseID = (((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH) ? SDL_TOUCH_MOUSEID : 0); + WIN_CheckWParamMouseButtons(wParam, data, mouseID); } } break; @@ -548,25 +571,21 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_SYSKEYDOWN: { SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam); + const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); + + /* Detect relevant keyboard shortcuts */ + if (keyboardState[SDL_SCANCODE_LALT] == SDL_PRESSED || keyboardState[SDL_SCANCODE_RALT] == SDL_PRESSED) { + /* ALT+F4: Close window */ + if (code == SDL_SCANCODE_F4 && ShouldGenerateWindowCloseOnAltF4()) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); + } + } + if (code != SDL_SCANCODE_UNKNOWN) { SDL_SendKeyboardKey(SDL_PRESSED, code); } } - if (msg == WM_KEYDOWN) { - BYTE keyboardState[256]; - char text[5]; - UINT32 utf32 = 0; - - GetKeyboardState(keyboardState); - if (ToUnicode(wParam, (lParam >> 16) & 0xff, keyboardState, (LPWSTR)&utf32, 1, 0) > 0) { - if (WIN_ConvertUTF32toUTF8(utf32, text)) { - WORD repetition; - for (repetition = lParam & 0xffff; repetition > 0; repetition--) { - SDL_SendKeyboardText(text); - } - } - } - } + returnCode = 0; break; @@ -576,14 +595,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam); const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); - /* Detect relevant keyboard shortcuts */ - if (keyboardState[SDL_SCANCODE_LALT] == SDL_PRESSED || keyboardState[SDL_SCANCODE_RALT] == SDL_PRESSED) { - /* ALT+F4: Close window */ - if (code == SDL_SCANCODE_F4) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - } - } - if (code != SDL_SCANCODE_UNKNOWN) { if (code == SDL_SCANCODE_PRINTSCREEN && keyboardState[code] == SDL_RELEASED) { @@ -596,9 +607,19 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_UNICHAR: - case WM_CHAR: - /* Ignore WM_CHAR messages that come from TranslateMessage(), since we handle WM_KEY* messages directly */ - returnCode = 0; + if ( wParam == UNICODE_NOCHAR ) { + returnCode = 1; + break; + } + /* otherwise fall through to below */ + case WM_CHAR: + { + char text[5]; + if ( WIN_ConvertUTF32toUTF8( (UINT32)wParam, text ) ) { + SDL_SendKeyboardText( text ); + } + } + returnCode = 0; break; #ifdef WM_INPUTLANGCHANGE @@ -790,9 +811,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } return (1); -#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER) case WM_SYSCOMMAND: { + if ((wParam & 0xFFF0) == SC_KEYMENU) { + return (0); + } + +#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER) /* Don't start the screensaver or blank the monitor in fullscreen apps */ if ((wParam & 0xFFF0) == SC_SCREENSAVE || (wParam & 0xFFF0) == SC_MONITORPOWER) { @@ -800,9 +825,9 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return (0); } } +#endif /* System has screensaver support */ } break; -#endif /* System has screensaver support */ case WM_CLOSE: { @@ -837,10 +862,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) PTOUCHINPUT input = &inputs[i]; const SDL_TouchID touchId = (SDL_TouchID)((size_t)input->hSource); - if (!SDL_GetTouch(touchId)) { - if (SDL_AddTouch(touchId, "") < 0) { - continue; - } + if (SDL_AddTouch(touchId, "") < 0) { + continue; } /* Get the normalized coordinates for the window */ @@ -925,6 +948,16 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } } +/* A message hook called before TranslateMessage() */ +static SDL_WindowsMessageHook g_WindowsMessageHook = NULL; +static void *g_WindowsMessageHookData = NULL; + +void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata) +{ + g_WindowsMessageHook = callback; + g_WindowsMessageHookData = userdata; +} + void WIN_PumpEvents(_THIS) { @@ -934,6 +967,10 @@ WIN_PumpEvents(_THIS) if (g_WindowsEnableMessageLoop) { while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + if (g_WindowsMessageHook) { + g_WindowsMessageHook(g_WindowsMessageHookData, msg.hwnd, msg.message, msg.wParam, msg.lParam); + } + /* Always translate the message in case it's a non-SDL window (e.g. with Qt integration) */ TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/libs/SDL2/src/video/windows/SDL_windowsevents.h b/libs/SDL2/src/video/windows/SDL_windowsevents.h index b9944ee7..3e923aab 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsevents.h +++ b/libs/SDL2/src/video/windows/SDL_windowsevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsframebuffer.c b/libs/SDL2/src/video/windows/SDL_windowsframebuffer.c index 4292db5a..d92a5a1b 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsframebuffer.c +++ b/libs/SDL2/src/video/windows/SDL_windowsframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsframebuffer.h b/libs/SDL2/src/video/windows/SDL_windowsframebuffer.h index daa42b83..ed6837ba 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsframebuffer.h +++ b/libs/SDL2/src/video/windows/SDL_windowsframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowskeyboard.c b/libs/SDL2/src/video/windows/SDL_windowskeyboard.c index 0557b6cd..02f7b630 100644 --- a/libs/SDL2/src/video/windows/SDL_windowskeyboard.c +++ b/libs/SDL2/src/video/windows/SDL_windowskeyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -122,10 +122,9 @@ WIN_UpdateKeymap() } /* If this key is one of the non-mappable keys, ignore it */ - /* Don't allow the number keys right above the qwerty row to translate or the top left key (grave/backquote) */ /* Not mapping numbers fixes the French layout, giving numeric keycodes for the number keys, which is the expected behavior */ if ((keymap[scancode] & SDLK_SCANCODE_MASK) || - scancode == SDL_SCANCODE_GRAVE || + /* scancode == SDL_SCANCODE_GRAVE || */ /* Uncomment this line to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */ (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) ) { continue; } @@ -187,6 +186,7 @@ void WIN_SetTextInputRect(_THIS, SDL_Rect *rect) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + HIMC himc = 0; if (!rect) { SDL_InvalidParamError("rect"); @@ -194,6 +194,17 @@ WIN_SetTextInputRect(_THIS, SDL_Rect *rect) } videodata->ime_rect = *rect; + + himc = ImmGetContext(videodata->ime_hwnd_current); + if (himc) + { + COMPOSITIONFORM cf; + cf.ptCurrentPos.x = videodata->ime_rect.x; + cf.ptCurrentPos.y = videodata->ime_rect.y; + cf.dwStyle = CFS_FORCE_POSITION; + ImmSetCompositionWindow(himc, &cf); + ImmReleaseContext(videodata->ime_hwnd_current, himc); + } } #ifdef SDL_DISABLE_WINDOWS_IME @@ -211,7 +222,12 @@ void IME_Present(SDL_VideoData *videodata) #else -#ifdef __GNUC__ +#ifdef _SDL_msctf_h +#define USE_INIT_GUID +#elif defined(__GNUC__) +#define USE_INIT_GUID +#endif +#ifdef USE_INIT_GUID #undef DEFINE_GUID #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) static const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} DEFINE_GUID(IID_ITfInputProcessorProfileActivationSink, 0x71C6E74E,0x0F28,0x11D8,0xA8,0x2A,0x00,0x06,0x5B,0x84,0x43,0x5C); @@ -722,7 +738,7 @@ IME_SendEditingEvent(SDL_VideoData *videodata) SDL_wcslcpy(buffer, videodata->ime_composition, size); } s = WIN_StringToUTF8(buffer); - SDL_SendEditingText(s, videodata->ime_cursor + SDL_wcslen(videodata->ime_readingstring), 0); + SDL_SendEditingText(s, videodata->ime_cursor + (int)SDL_wcslen(videodata->ime_readingstring), 0); SDL_free(s); } @@ -1387,7 +1403,7 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) if (!*s) break; - GetTextExtentPoint32W(hdc, s, SDL_wcslen(s), &candsizes[i]); + GetTextExtentPoint32W(hdc, s, (int)SDL_wcslen(s), &candsizes[i]); maxcandsize.cx = SDL_max(maxcandsize.cx, candsizes[i].cx); maxcandsize.cy = SDL_max(maxcandsize.cy, candsizes[i].cy); @@ -1479,7 +1495,7 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) } DrawRect(hdc, left, top, right, bottom, candborder); - ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, SDL_wcslen(s), NULL); + ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, (int)SDL_wcslen(s), NULL); } StopDrawToBitmap(hdc, &hbm); diff --git a/libs/SDL2/src/video/windows/SDL_windowskeyboard.h b/libs/SDL2/src/video/windows/SDL_windowskeyboard.h index 3eb0cbf6..5967b511 100644 --- a/libs/SDL2/src/video/windows/SDL_windowskeyboard.h +++ b/libs/SDL2/src/video/windows/SDL_windowskeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsmessagebox.c b/libs/SDL2/src/video/windows/SDL_windowsmessagebox.c index 6cffc8ad..31ffb8fc 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsmessagebox.c +++ b/libs/SDL2/src/video/windows/SDL_windowsmessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsmessagebox.h b/libs/SDL2/src/video/windows/SDL_windowsmessagebox.h index ea709a4a..37f9f4cb 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsmessagebox.h +++ b/libs/SDL2/src/video/windows/SDL_windowsmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsmodes.c b/libs/SDL2/src/video/windows/SDL_windowsmodes.c index f64a5788..f5f2b8a8 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsmodes.c +++ b/libs/SDL2/src/video/windows/SDL_windowsmodes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,9 +29,50 @@ #define CDS_FULLSCREEN 0 #endif -static SDL_bool -WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) +typedef struct _WIN_GetMonitorDPIData { + SDL_VideoData *vid_data; + SDL_DisplayMode *mode; + SDL_DisplayModeData *mode_data; +} WIN_GetMonitorDPIData; + +static BOOL CALLBACK +WIN_GetMonitorDPI(HMONITOR hMonitor, + HDC hdcMonitor, + LPRECT lprcMonitor, + LPARAM dwData) { + WIN_GetMonitorDPIData *data = (WIN_GetMonitorDPIData*) dwData; + UINT hdpi, vdpi; + + if (data->vid_data->GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &hdpi, &vdpi) == S_OK && + hdpi > 0 && + vdpi > 0) { + float hsize, vsize; + + data->mode_data->HorzDPI = (float)hdpi; + data->mode_data->VertDPI = (float)vdpi; + + // Figure out the monitor size and compute the diagonal DPI. + hsize = data->mode->w / data->mode_data->HorzDPI; + vsize = data->mode->h / data->mode_data->VertDPI; + + data->mode_data->DiagDPI = SDL_ComputeDiagonalDPI( data->mode->w, + data->mode->h, + hsize, + vsize ); + + // We can only handle one DPI per display mode so end the enumeration. + return FALSE; + } + + // We didn't get DPI information so keep going. + return TRUE; +} + +static SDL_bool +WIN_GetDisplayMode(_THIS, LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) +{ + SDL_VideoData *vid_data = (SDL_VideoData *) _this->driverdata; SDL_DisplayModeData *data; DEVMODE devmode; HDC hdc; @@ -52,6 +93,9 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) DM_DISPLAYFLAGS); data->ScaleX = 1.0f; data->ScaleY = 1.0f; + data->DiagDPI = 0.0f; + data->HorzDPI = 0.0f; + data->VertDPI = 0.0f; /* Fill in the mode information */ mode->format = SDL_PIXELFORMAT_UNKNOWN; @@ -73,6 +117,35 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) mode->w = logical_width; mode->h = logical_height; + // WIN_GetMonitorDPI needs mode->w and mode->h + // so only call after those are set. + if (vid_data->GetDpiForMonitor) { + WIN_GetMonitorDPIData dpi_data; + RECT monitor_rect; + + dpi_data.vid_data = vid_data; + dpi_data.mode = mode; + dpi_data.mode_data = data; + monitor_rect.left = devmode.dmPosition.x; + monitor_rect.top = devmode.dmPosition.y; + monitor_rect.right = monitor_rect.left + 1; + monitor_rect.bottom = monitor_rect.top + 1; + EnumDisplayMonitors(NULL, &monitor_rect, WIN_GetMonitorDPI, (LPARAM)&dpi_data); + } else { + // We don't have the Windows 8.1 routine so just + // get system DPI. + data->HorzDPI = (float)GetDeviceCaps( hdc, LOGPIXELSX ); + data->VertDPI = (float)GetDeviceCaps( hdc, LOGPIXELSY ); + if (data->HorzDPI == data->VertDPI) { + data->DiagDPI = data->HorzDPI; + } else { + data->DiagDPI = SDL_ComputeDiagonalDPI( mode->w, + mode->h, + (float)GetDeviceCaps( hdc, HORZSIZE ) / 25.4f, + (float)GetDeviceCaps( hdc, VERTSIZE ) / 25.4f ); + } + } + SDL_zero(bmi_data); bmi = (LPBITMAPINFO) bmi_data; bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -131,7 +204,7 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) } static SDL_bool -WIN_AddDisplay(LPTSTR DeviceName) +WIN_AddDisplay(_THIS, LPTSTR DeviceName) { SDL_VideoDisplay display; SDL_DisplayData *displaydata; @@ -141,7 +214,7 @@ WIN_AddDisplay(LPTSTR DeviceName) #ifdef DEBUG_MODES printf("Display: %s\n", WIN_StringToUTF8(DeviceName)); #endif - if (!WIN_GetDisplayMode(DeviceName, ENUM_CURRENT_SETTINGS, &mode)) { + if (!WIN_GetDisplayMode(_this, DeviceName, ENUM_CURRENT_SETTINGS, &mode)) { return SDL_FALSE; } @@ -215,10 +288,10 @@ WIN_InitModes(_THIS) continue; } } - count += WIN_AddDisplay(device.DeviceName); + count += WIN_AddDisplay(_this, device.DeviceName); } if (count == 0) { - WIN_AddDisplay(DeviceName); + WIN_AddDisplay(_this, DeviceName); } } } @@ -241,6 +314,24 @@ WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) return 0; } +int +WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi) +{ + SDL_DisplayModeData *data = (SDL_DisplayModeData *) display->current_mode.driverdata; + + if (ddpi) { + *ddpi = data->DiagDPI; + } + if (hdpi) { + *hdpi = data->HorzDPI; + } + if (vdpi) { + *vdpi = data->VertDPI; + } + + return data->DiagDPI != 0.0f ? 0 : -1; +} + void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display) { @@ -249,7 +340,7 @@ WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display) SDL_DisplayMode mode; for (i = 0;; ++i) { - if (!WIN_GetDisplayMode(data->DeviceName, i, &mode)) { + if (!WIN_GetDisplayMode(_this, data->DeviceName, i, &mode)) { break; } if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) { diff --git a/libs/SDL2/src/video/windows/SDL_windowsmodes.h b/libs/SDL2/src/video/windows/SDL_windowsmodes.h index d16a5e7a..ba0964a3 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsmodes.h +++ b/libs/SDL2/src/video/windows/SDL_windowsmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,10 +33,14 @@ typedef struct DEVMODE DeviceMode; float ScaleX; float ScaleY; + float DiagDPI; + float HorzDPI; + float VertDPI; } SDL_DisplayModeData; extern int WIN_InitModes(_THIS); extern int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); +extern int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi); extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display); extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); extern void WIN_QuitModes(_THIS); diff --git a/libs/SDL2/src/video/windows/SDL_windowsmouse.c b/libs/SDL2/src/video/windows/SDL_windowsmouse.c index c61076c5..69aa7771 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsmouse.c +++ b/libs/SDL2/src/video/windows/SDL_windowsmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -236,7 +236,7 @@ WIN_WarpMouse(SDL_Window * window, int x, int y) SetCursorPos(pt.x, pt.y); } -static void +static int WIN_WarpMouseGlobal(int x, int y) { POINT pt; @@ -244,6 +244,7 @@ WIN_WarpMouseGlobal(int x, int y) pt.x = x; pt.y = y; SetCursorPos(pt.x, pt.y); + return 0; } static int diff --git a/libs/SDL2/src/video/windows/SDL_windowsmouse.h b/libs/SDL2/src/video/windows/SDL_windowsmouse.h index 665cdc57..d3d8f634 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsmouse.h +++ b/libs/SDL2/src/video/windows/SDL_windowsmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsopengl.c b/libs/SDL2/src/video/windows/SDL_windowsopengl.c index 71855c87..dc8cbb8a 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsopengl.c +++ b/libs/SDL2/src/video/windows/SDL_windowsopengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -74,6 +74,13 @@ #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 #endif +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control +#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#endif + typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, @@ -405,6 +412,11 @@ WIN_GL_InitExtensions(_THIS) _this->gl_data->HAS_WGL_EXT_create_context_es2_profile = SDL_TRUE; } + /* Check for GLX_ARB_context_flush_control */ + if (HasExtension("WGL_ARB_context_flush_control", extensions)) { + _this->gl_data->HAS_WGL_ARB_context_flush_control = SDL_TRUE; + } + _this->gl_data->wglMakeCurrent(hdc, NULL); _this->gl_data->wglDeleteContext(hglrc); ReleaseDC(hwnd, hdc); @@ -648,8 +660,8 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) SDL_SetError("GL 3.x is not supported"); context = temp_context; } else { - /* max 8 attributes plus terminator */ - int attribs[9] = { + /* max 10 attributes plus terminator */ + int attribs[11] = { WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version, WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version, 0 @@ -668,6 +680,14 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) attribs[iattr++] = _this->gl_config.flags; } + /* only set if wgl extension is available */ + if( _this->gl_data->HAS_WGL_ARB_context_flush_control ) { + attribs[iattr++] = WGL_CONTEXT_RELEASE_BEHAVIOR_ARB; + attribs[iattr++] = _this->gl_config.release_behavior ? + WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : + WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB; + } + attribs[iattr++] = 0; /* Create the GL 3.x context */ diff --git a/libs/SDL2/src/video/windows/SDL_windowsopengl.h b/libs/SDL2/src/video/windows/SDL_windowsopengl.h index b96e0ac1..71c05db0 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsopengl.h +++ b/libs/SDL2/src/video/windows/SDL_windowsopengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,6 +30,7 @@ struct SDL_GLDriverData SDL_bool HAS_WGL_ARB_pixel_format; SDL_bool HAS_WGL_EXT_swap_control_tear; SDL_bool HAS_WGL_EXT_create_context_es2_profile; + SDL_bool HAS_WGL_ARB_context_flush_control; void *(WINAPI * wglGetProcAddress) (const char *proc); HGLRC(WINAPI * wglCreateContext) (HDC hdc); diff --git a/libs/SDL2/src/video/windows/SDL_windowsopengles.c b/libs/SDL2/src/video/windows/SDL_windowsopengles.c index 544fe525..9125da0e 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsopengles.c +++ b/libs/SDL2/src/video/windows/SDL_windowsopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -111,6 +111,7 @@ WIN_GLES_SetupWindow(_THIS, SDL_Window * window) if (_this->egl_data == NULL) { if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY) < 0) { + SDL_EGL_UnloadLibrary(_this); return -1; } } diff --git a/libs/SDL2/src/video/windows/SDL_windowsopengles.h b/libs/SDL2/src/video/windows/SDL_windowsopengles.h index 8e232177..f6342088 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsopengles.h +++ b/libs/SDL2/src/video/windows/SDL_windowsopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsshape.c b/libs/SDL2/src/video/windows/SDL_windowsshape.c index 9409e2b4..6c38ba1a 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsshape.c +++ b/libs/SDL2/src/video/windows/SDL_windowsshape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsshape.h b/libs/SDL2/src/video/windows/SDL_windowsshape.h index 9405a501..568945c7 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsshape.h +++ b/libs/SDL2/src/video/windows/SDL_windowsshape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/SDL_windowsvideo.c b/libs/SDL2/src/video/windows/SDL_windowsvideo.c index d87b9cff..86c3437c 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsvideo.c +++ b/libs/SDL2/src/video/windows/SDL_windowsvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -78,6 +78,9 @@ WIN_DeleteDevice(SDL_VideoDevice * device) if (data->userDLL) { SDL_UnloadObject(data->userDLL); } + if (data->shcoreDLL) { + SDL_UnloadObject(data->shcoreDLL); + } SDL_free(device->driverdata); SDL_free(device); @@ -112,10 +115,16 @@ WIN_CreateDevice(int devindex) data->RegisterTouchWindow = (BOOL (WINAPI *)(HWND, ULONG)) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow"); } + data->shcoreDLL = SDL_LoadObject("SHCORE.DLL"); + if (data->shcoreDLL) { + data->GetDpiForMonitor = (HRESULT (WINAPI *)(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *)) SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor"); + } + /* Set the function pointers */ device->VideoInit = WIN_VideoInit; device->VideoQuit = WIN_VideoQuit; device->GetDisplayBounds = WIN_GetDisplayBounds; + device->GetDisplayDPI = WIN_GetDisplayDPI; device->GetDisplayModes = WIN_GetDisplayModes; device->SetDisplayMode = WIN_SetDisplayMode; device->PumpEvents = WIN_PumpEvents; diff --git a/libs/SDL2/src/video/windows/SDL_windowsvideo.h b/libs/SDL2/src/video/windows/SDL_windowsvideo.h index aaedc04e..85327a7a 100644 --- a/libs/SDL2/src/video/windows/SDL_windowsvideo.h +++ b/libs/SDL2/src/video/windows/SDL_windowsvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "../SDL_sysvideo.h" -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1500) #include #else #include "SDL_msctf.h" @@ -76,6 +76,17 @@ typedef struct _TOUCHINPUT { #endif /* WINVER < 0x0601 */ +#if WINVER < 0x0603 + +typedef enum MONITOR_DPI_TYPE { + MDT_EFFECTIVE_DPI = 0, + MDT_ANGULAR_DPI = 1, + MDT_RAW_DPI = 2, + MDT_DEFAULT = MDT_EFFECTIVE_DPI +} MONITOR_DPI_TYPE; + +#endif /* WINVER < 0x0603 */ + typedef BOOL (*PFNSHFullScreen)(HWND, DWORD); typedef void (*PFCoordTransform)(SDL_Window*, POINT*); @@ -124,6 +135,12 @@ typedef struct SDL_VideoData BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int ); BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG ); + void* shcoreDLL; + HRESULT (WINAPI *GetDpiForMonitor)( HMONITOR hmonitor, + MONITOR_DPI_TYPE dpiType, + UINT *dpiX, + UINT *dpiY ); + SDL_bool ime_com_initialized; struct ITfThreadMgr *ime_threadmgr; SDL_bool ime_initialized; diff --git a/libs/SDL2/src/video/windows/SDL_windowswindow.c b/libs/SDL2/src/video/windows/SDL_windowswindow.c index 94328339..2dc5386d 100644 --- a/libs/SDL2/src/video/windows/SDL_windowswindow.c +++ b/libs/SDL2/src/video/windows/SDL_windowswindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -371,14 +371,8 @@ void WIN_SetWindowTitle(_THIS, SDL_Window * window) { HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - LPTSTR title; - - if (window->title) { - title = WIN_UTF8ToString(window->title); - } else { - title = NULL; - } - SetWindowText(hwnd, title ? title : TEXT("")); + LPTSTR title = WIN_UTF8ToString(window->title); + SetWindowText(hwnd, title); SDL_free(title); } @@ -621,6 +615,7 @@ WIN_DestroyWindow(_THIS, SDL_Window * window) if (data) { ReleaseDC(data->hwnd, data->hdc); + RemoveProp(data->hwnd, TEXT("SDL_WindowData")); if (data->created) { DestroyWindow(data->hwnd); } else { @@ -643,10 +638,11 @@ WIN_DestroyWindow(_THIS, SDL_Window * window) SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + const SDL_WindowData *data = (const SDL_WindowData *) window->driverdata; if (info->version.major <= SDL_MAJOR_VERSION) { info->subsystem = SDL_SYSWM_WINDOWS; - info->info.win.window = hwnd; + info->info.win.window = data->hwnd; + info->info.win.hdc = data->hdc; return SDL_TRUE; } else { SDL_SetError("Application not compiled with SDL %d.%d\n", diff --git a/libs/SDL2/src/video/windows/SDL_windowswindow.h b/libs/SDL2/src/video/windows/SDL_windowswindow.h index 25d108bd..32ce279e 100644 --- a/libs/SDL2/src/video/windows/SDL_windowswindow.h +++ b/libs/SDL2/src/video/windows/SDL_windowswindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/windows/wmmsg.h b/libs/SDL2/src/video/windows/wmmsg.h index cf373bc2..e8f65ac3 100644 --- a/libs/SDL2/src/video/windows/wmmsg.h +++ b/libs/SDL2/src/video/windows/wmmsg.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtevents.cpp b/libs/SDL2/src/video/winrt/SDL_winrtevents.cpp index 7c0cf49a..5c779d3c 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtevents.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtevents.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtevents_c.h b/libs/SDL2/src/video/winrt/SDL_winrtevents_c.h index 4e3dfb3b..b63c85fa 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtevents_c.h +++ b/libs/SDL2/src/video/winrt/SDL_winrtevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtkeyboard.cpp b/libs/SDL2/src/video/winrt/SDL_winrtkeyboard.cpp index a44e5066..f75dd5f9 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtkeyboard.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.cpp b/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.cpp index a2153ce0..dc38d214 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.h b/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.h index 63e23c5c..8cae479a 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.h +++ b/libs/SDL2/src/video/winrt/SDL_winrtmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtmouse.cpp b/libs/SDL2/src/video/winrt/SDL_winrtmouse.cpp index 4c04a211..cfebe9e0 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtmouse.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtmouse.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtmouse_c.h b/libs/SDL2/src/video/winrt/SDL_winrtmouse_c.h index 676669b3..f97af04d 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtmouse_c.h +++ b/libs/SDL2/src/video/winrt/SDL_winrtmouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,6 +35,6 @@ extern SDL_bool WINRT_UsingRelativeMouseMode; } #endif -#endif /* _SDL_windowsmouse_h */ +#endif /* _SDL_winrtmouse_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/winrt/SDL_winrtopengles.cpp b/libs/SDL2/src/video/winrt/SDL_winrtopengles.cpp index 20a9a0bc..04c61ab9 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtopengles.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtopengles.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,13 +36,15 @@ using namespace Windows::UI::Core; /* ANGLE/WinRT constants */ static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0; -#define EGL_PLATFORM_ANGLE_ANGLE 0x3201 -#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3202 -#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3203 -#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3204 -#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3205 -#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3207 -#define EGL_PLATFORM_ANGLE_USE_WARP_ANGLE 0x3208 +#define EGL_PLATFORM_ANGLE_ANGLE 0x3202 +#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203 +#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204 +#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205 +#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE 0x320B +#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F + #define EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER 0x320B @@ -85,11 +87,11 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) Microsoft::WRL::ComPtr cpp_display = video_data->winrtEglWindow; _this->egl_data->egl_display = ((eglGetDisplay_Old_Function)_this->egl_data->eglGetDisplay)(cpp_display); if (!_this->egl_data->egl_display) { - return SDL_SetError("Could not get EGL display"); + return SDL_SetError("Could not get Windows 8.0 EGL display"); } if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - return SDL_SetError("Could not initialize EGL"); + return SDL_SetError("Could not initialize Windows 8.0 EGL"); } } else { /* Declare some ANGLE/EGL initialization property-sets, as suggested by @@ -98,7 +100,8 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) const EGLint defaultDisplayAttributes[] = { EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, EGL_NONE, }; @@ -107,15 +110,17 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9, EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, EGL_NONE, }; const EGLint warpDisplayAttributes[] = { EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_USE_WARP_ANGLE, EGL_TRUE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, EGL_NONE, }; @@ -136,7 +141,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) */ _this->egl_data->egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes); if (!_this->egl_data->egl_display) { - return SDL_SetError("Could not get EGL display"); + return SDL_SetError("Could not get 10_0+ EGL display"); } if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) @@ -161,7 +166,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) } if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - return SDL_SetError("Could not initialize EGL"); + return SDL_SetError("Could not initialize WinRT 8.x+ EGL"); } } } diff --git a/libs/SDL2/src/video/winrt/SDL_winrtopengles.h b/libs/SDL2/src/video/winrt/SDL_winrtopengles.h index f090f9b2..a0fde81a 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtopengles.h +++ b/libs/SDL2/src/video/winrt/SDL_winrtopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtpointerinput.cpp b/libs/SDL2/src/video/winrt/SDL_winrtpointerinput.cpp index da20cc3c..d900ef48 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtpointerinput.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/winrt/SDL_winrtvideo.cpp b/libs/SDL2/src/video/winrt/SDL_winrtvideo.cpp index 038a26d9..edd56f02 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtvideo.cpp +++ b/libs/SDL2/src/video/winrt/SDL_winrtvideo.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -325,7 +325,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) if (SDL_EGL_ChooseConfig(_this) != 0) { char buf[512]; SDL_snprintf(buf, sizeof(buf), "SDL_EGL_ChooseConfig failed: %s", SDL_GetError()); - return SDL_SetError(buf); + return SDL_SetError("%s", buf); } if (video_data->winrtEglWindow) { /* ... is the 'old' version of ANGLE/WinRT being used? */ diff --git a/libs/SDL2/src/video/winrt/SDL_winrtvideo_cpp.h b/libs/SDL2/src/video/winrt/SDL_winrtvideo_cpp.h index e327280d..a39de826 100644 --- a/libs/SDL2/src/video/winrt/SDL_winrtvideo_cpp.h +++ b/libs/SDL2/src/video/winrt/SDL_winrtvideo_cpp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11clipboard.c b/libs/SDL2/src/video/x11/SDL_x11clipboard.c index 2999d983..eca40f2a 100644 --- a/libs/SDL2/src/video/x11/SDL_x11clipboard.c +++ b/libs/SDL2/src/video/x11/SDL_x11clipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,6 +49,14 @@ GetWindow(_THIS) return None; } +/* We use our own cut-buffer for intermediate storage instead of + XA_CUT_BUFFER0 because their use isn't really defined for holding UTF8. */ +Atom +X11_GetSDLCutBufferClipboardType(Display *display) +{ + return X11_XInternAtom(display, "SDL_CUTBUFFER", False); +} + int X11_SetClipboardText(_THIS, const char *text) { @@ -66,7 +74,7 @@ X11_SetClipboardText(_THIS, const char *text) /* Save the selection on the root window */ format = TEXT_FORMAT; X11_XChangeProperty(display, DefaultRootWindow(display), - XA_CUT_BUFFER0, format, 8, PropModeReplace, + X11_GetSDLCutBufferClipboardType(display), format, 8, PropModeReplace, (const unsigned char *)text, SDL_strlen(text)); if (XA_CLIPBOARD != None && @@ -109,9 +117,14 @@ X11_GetClipboardText(_THIS) window = GetWindow(_this); format = TEXT_FORMAT; owner = X11_XGetSelectionOwner(display, XA_CLIPBOARD); - if ((owner == None) || (owner == window)) { + if (owner == None) { + /* Fall back to ancient X10 cut-buffers which do not support UTF8 strings*/ owner = DefaultRootWindow(display); selection = XA_CUT_BUFFER0; + format = XA_STRING; + } else if (owner == window) { + owner = DefaultRootWindow(display); + selection = X11_GetSDLCutBufferClipboardType(display); } else { /* Request that the selection owner copy the data to our window */ owner = window; diff --git a/libs/SDL2/src/video/x11/SDL_x11clipboard.h b/libs/SDL2/src/video/x11/SDL_x11clipboard.h index 46291cf6..09dcf568 100644 --- a/libs/SDL2/src/video/x11/SDL_x11clipboard.h +++ b/libs/SDL2/src/video/x11/SDL_x11clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,6 +26,7 @@ extern int X11_SetClipboardText(_THIS, const char *text); extern char *X11_GetClipboardText(_THIS); extern SDL_bool X11_HasClipboardText(_THIS); +extern Atom X11_GetSDLCutBufferClipboardType(Display *display); #endif /* _SDL_x11clipboard_h */ diff --git a/libs/SDL2/src/video/x11/SDL_x11dyn.c b/libs/SDL2/src/video/x11/SDL_x11dyn.c index 97760ba3..58e97be7 100644 --- a/libs/SDL2/src/video/x11/SDL_x11dyn.c +++ b/libs/SDL2/src/video/x11/SDL_x11dyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -207,7 +207,7 @@ SDL_X11_LoadSymbols(void) #else /* no dynamic X11 */ #define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */ -#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = fn; +#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) fn; #include "SDL_x11sym.h" #undef SDL_X11_MODULE #undef SDL_X11_SYM diff --git a/libs/SDL2/src/video/x11/SDL_x11dyn.h b/libs/SDL2/src/video/x11/SDL_x11dyn.h index 7d2e077c..2d729b70 100644 --- a/libs/SDL2/src/video/x11/SDL_x11dyn.h +++ b/libs/SDL2/src/video/x11/SDL_x11dyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,6 +50,9 @@ #if SDL_VIDEO_DRIVER_X11_XCURSOR #include #endif +#if SDL_VIDEO_DRIVER_X11_XDBE +#include +#endif #if SDL_VIDEO_DRIVER_X11_XINERAMA #include #endif diff --git a/libs/SDL2/src/video/x11/SDL_x11events.c b/libs/SDL2/src/video/x11/SDL_x11events.c index 02dc8a90..7ec4edf7 100644 --- a/libs/SDL2/src/video/x11/SDL_x11events.c +++ b/libs/SDL2/src/video/x11/SDL_x11events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,6 +40,8 @@ #include +/*#define DEBUG_XEVENTS*/ + #ifndef _NET_WM_MOVERESIZE_SIZE_TOPLEFT #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 #endif @@ -132,7 +134,6 @@ static Atom X11_PickTargetFromAtoms(Display *disp, Atom a0, Atom a1, Atom a2) if (a2 != None) atom[count++] = a2; return X11_PickTarget(disp, atom, count); } -/* #define DEBUG_XEVENTS */ struct KeyRepeatCheckData { @@ -166,46 +167,20 @@ static SDL_bool X11_KeyRepeat(Display *display, XEvent *event) return d.found; } -static Bool X11_IsWheelCheckIfEvent(Display *display, XEvent *chkev, - XPointer arg) +static SDL_bool +X11_IsWheelEvent(Display * display,XEvent * event,int * xticks,int * yticks) { - XEvent *event = (XEvent *) arg; - /* we only handle buttons 4 and 5 - false positive avoidance */ - if (chkev->type == ButtonRelease && - (event->xbutton.button == Button4 || event->xbutton.button == Button5) && - chkev->xbutton.button == event->xbutton.button && - chkev->xbutton.time == event->xbutton.time) - return True; - return False; -} + /* according to the xlib docs, no specific mouse wheel events exist. + However, the defacto standard is that the vertical wheel is X buttons + 4 (up) and 5 (down) and a horizontal wheel is 6 (left) and 7 (right). */ -static SDL_bool X11_IsWheelEvent(Display * display,XEvent * event,int * ticks) -{ - XEvent relevent; - if (X11_XPending(display)) { - /* according to the xlib docs, no specific mouse wheel events exist. - however, mouse wheel events trigger a button press and a button release - immediately. thus, checking if the same button was released at the same - time as it was pressed, should be an adequate hack to derive a mouse - wheel event. - However, there is broken and unusual hardware out there... - - False positive: a button for which a release event is - generated (or synthesised) immediately. - - False negative: a wheel which, when rolled, doesn't have - a release event generated immediately. */ - if (X11_XCheckIfEvent(display, &relevent, X11_IsWheelCheckIfEvent, - (XPointer) event)) { - - /* by default, X11 only knows 5 buttons. on most 3 button + wheel mouse, - Button4 maps to wheel up, Button5 maps to wheel down. */ - if (event->xbutton.button == Button4) { - *ticks = 1; - } - else if (event->xbutton.button == Button5) { - *ticks = -1; - } - return SDL_TRUE; - } + /* Xlib defines "Button1" through 5, so we just use literals here. */ + switch (event->xbutton.button) { + case 4: *yticks = 1; return SDL_TRUE; + case 5: *yticks = -1; return SDL_TRUE; + case 6: *xticks = 1; return SDL_TRUE; + case 7: *xticks = -1; return SDL_TRUE; + default: break; } return SDL_FALSE; } @@ -293,27 +268,27 @@ static char* X11_URIToLocal(char* uri) { if (memcmp(uri,"file:/",6) == 0) uri += 6; /* local file? */ else if (strstr(uri,":/") != NULL) return file; /* wrong scheme */ - local = uri[0] != '/' || ( uri[0] != '\0' && uri[1] == '/' ); + local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/'); /* got a hostname? */ - if ( !local && uri[0] == '/' && uri[2] != '/' ) { - char* hostname_end = strchr( uri+1, '/' ); - if ( hostname_end != NULL ) { + if (!local && uri[0] == '/' && uri[2] != '/') { + char* hostname_end = strchr(uri+1, '/'); + if (hostname_end != NULL) { char hostname[ 257 ]; - if ( gethostname( hostname, 255 ) == 0 ) { + if (gethostname(hostname, 255) == 0) { hostname[ 256 ] = '\0'; - if ( memcmp( uri+1, hostname, hostname_end - ( uri+1 )) == 0 ) { + if (memcmp(uri+1, hostname, hostname_end - (uri+1)) == 0) { uri = hostname_end + 1; local = SDL_TRUE; } } } } - if ( local ) { + if (local) { file = uri; /* Convert URI escape sequences to real characters */ X11_URIDecode(file, 0); - if ( uri[1] == '/' ) { + if (uri[1] == '/') { file++; } else { file--; @@ -334,14 +309,86 @@ static void X11_HandleGenericEvent(SDL_VideoData *videodata,XEvent event) } #endif /* SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ +static unsigned +X11_GetNumLockModifierMask(_THIS) +{ + SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + Display *display = viddata->display; + unsigned num_mask = 0; + int i, j; + XModifierKeymap *xmods; + unsigned n; + + xmods = X11_XGetModifierMapping(display); + n = xmods->max_keypermod; + for(i = 3; i < 8; i++) { + for(j = 0; j < n; j++) { + KeyCode kc = xmods->modifiermap[i * n + j]; + if (viddata->key_layout[kc] == SDL_SCANCODE_NUMLOCKCLEAR) { + num_mask = 1 << i; + break; + } + } + } + X11_XFreeModifiermap(xmods); + + return num_mask; +} static void -X11_DispatchFocusIn(SDL_WindowData *data) +X11_ReconcileKeyboardState(_THIS) +{ + SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + Display *display = viddata->display; + char keys[32]; + int keycode; + Window junk_window; + int x, y; + unsigned int mask; + + X11_XQueryKeymap(display, keys); + + /* Get the keyboard modifier state */ + if (X11_XQueryPointer(display, DefaultRootWindow(display), &junk_window, &junk_window, &x, &y, &x, &y, &mask)) { + unsigned num_mask = X11_GetNumLockModifierMask(_this); + const Uint8 *keystate = SDL_GetKeyboardState(NULL); + Uint8 capslockState = keystate[SDL_SCANCODE_CAPSLOCK]; + Uint8 numlockState = keystate[SDL_SCANCODE_NUMLOCKCLEAR]; + + /* Toggle key mod state if needed */ + if (!!(mask & LockMask) != !!(SDL_GetModState() & KMOD_CAPS)) { + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); + if (capslockState == SDL_RELEASED) { + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); + } + } + + if (!!(mask & num_mask) != !!(SDL_GetModState() & KMOD_NUM)) { + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); + if (numlockState == SDL_RELEASED) { + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); + } + } + } + + for (keycode = 0; keycode < 256; ++keycode) { + if (keys[keycode / 8] & (1 << (keycode % 8))) { + SDL_SendKeyboardKey(SDL_PRESSED, viddata->key_layout[keycode]); + } else { + SDL_SendKeyboardKey(SDL_RELEASED, viddata->key_layout[keycode]); + } + } +} + + +static void +X11_DispatchFocusIn(_THIS, SDL_WindowData *data) { #ifdef DEBUG_XEVENTS printf("window %p: Dispatching FocusIn\n", data); #endif SDL_SetKeyboardFocus(data->window); + X11_ReconcileKeyboardState(_this); #ifdef X_HAVE_UTF8_STRING if (data->ic) { X11_XSetICFocus(data->ic); @@ -353,7 +400,7 @@ X11_DispatchFocusIn(SDL_WindowData *data) } static void -X11_DispatchFocusOut(SDL_WindowData *data) +X11_DispatchFocusOut(_THIS, SDL_WindowData *data) { #ifdef DEBUG_XEVENTS printf("window %p: Dispatching FocusOut\n", data); @@ -448,83 +495,38 @@ static SDL_bool ProcessHitTest(_THIS, const SDL_WindowData *data, const XEvent *xev) { SDL_Window *window = data->window; - SDL_bool ret = SDL_FALSE; if (window->hit_test) { const SDL_Point point = { xev->xbutton.x, xev->xbutton.y }; const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data); + static const int directions[] = { + _NET_WM_MOVERESIZE_SIZE_TOPLEFT, _NET_WM_MOVERESIZE_SIZE_TOP, + _NET_WM_MOVERESIZE_SIZE_TOPRIGHT, _NET_WM_MOVERESIZE_SIZE_RIGHT, + _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT, _NET_WM_MOVERESIZE_SIZE_BOTTOM, + _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT, _NET_WM_MOVERESIZE_SIZE_LEFT + }; + switch (rc) { - case SDL_HITTEST_DRAGGABLE: { - InitiateWindowMove(_this, data, &point); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_TOPLEFT: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_TOPLEFT); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_TOP: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_TOP); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_TOPRIGHT: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_TOPRIGHT); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_RIGHT: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_RIGHT); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_BOTTOMRIGHT: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_BOTTOM: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_BOTTOM); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_BOTTOMLEFT: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT); - ret = SDL_TRUE; - } - break; - case SDL_HITTEST_RESIZE_LEFT: { - InitiateWindowResize(_this, data, &point, _NET_WM_MOVERESIZE_SIZE_LEFT); - ret = SDL_TRUE; - } - break; - default: - break; + case SDL_HITTEST_DRAGGABLE: + InitiateWindowMove(_this, data, &point); + return SDL_TRUE; + + case SDL_HITTEST_RESIZE_TOPLEFT: + case SDL_HITTEST_RESIZE_TOP: + case SDL_HITTEST_RESIZE_TOPRIGHT: + case SDL_HITTEST_RESIZE_RIGHT: + case SDL_HITTEST_RESIZE_BOTTOMRIGHT: + case SDL_HITTEST_RESIZE_BOTTOM: + case SDL_HITTEST_RESIZE_BOTTOMLEFT: + case SDL_HITTEST_RESIZE_LEFT: + InitiateWindowResize(_this, data, &point, directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]); + return SDL_TRUE; + + default: return SDL_FALSE; } } - return ret; -} - -static void -ReconcileKeyboardState(_THIS, const SDL_WindowData *data) -{ - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; - Display *display = viddata->display; - char keys[32]; - int keycode = 0; - - X11_XQueryKeymap( display, keys ); - - while ( keycode < 256 ) { - if ( keys[keycode / 8] & (1 << (keycode % 8)) ) { - SDL_SendKeyboardKey(SDL_PRESSED, viddata->key_layout[keycode]); - } else { - SDL_SendKeyboardKey(SDL_RELEASED, viddata->key_layout[keycode]); - } - keycode++; - } + return SDL_FALSE; } static void @@ -606,6 +608,24 @@ X11_DispatchEvent(_THIS) } } if (!data) { + /* The window for KeymapNotify, etc events is 0 */ + if (xevent.type == KeymapNotify) { + if (SDL_GetKeyboardFocus() != NULL) { + X11_ReconcileKeyboardState(_this); + } + } else if (xevent.type == MappingNotify) { + /* Has the keyboard layout changed? */ + const int request = xevent.xmapping.request; + +#ifdef DEBUG_XEVENTS + printf("window %p: MappingNotify!\n", data); +#endif + if ((request == MappingKeyboard) || (request == MappingModifier)) { + X11_XRefreshKeyboardMapping(&xevent.xmapping); + } + + X11_UpdateKeymap(_this); + } return; } @@ -673,15 +693,11 @@ X11_DispatchEvent(_THIS) #ifdef DEBUG_XEVENTS printf("window %p: FocusIn!\n", data); #endif - if (data->pending_focus == PENDING_FOCUS_OUT && - data->window == SDL_GetKeyboardFocus()) { - ReconcileKeyboardState(_this, data); - } if (!videodata->last_mode_change_deadline) /* no recent mode changes */ { data->pending_focus = PENDING_FOCUS_NONE; data->pending_focus_time = 0; - X11_DispatchFocusIn(data); + X11_DispatchFocusIn(_this, data); } else { @@ -714,7 +730,7 @@ X11_DispatchEvent(_THIS) { data->pending_focus = PENDING_FOCUS_NONE; data->pending_focus_time = 0; - X11_DispatchFocusOut(data); + X11_DispatchFocusOut(_this, data); } else { @@ -724,26 +740,6 @@ X11_DispatchEvent(_THIS) } break; - /* Generated upon EnterWindow and FocusIn */ - case KeymapNotify:{ -#ifdef DEBUG_XEVENTS - printf("window %p: KeymapNotify!\n", data); -#endif - /* FIXME: - X11_SetKeyboardState(SDL_Display, xevent.xkeymap.key_vector); - */ - } - break; - - /* Has the keyboard layout changed? */ - case MappingNotify:{ -#ifdef DEBUG_XEVENTS - printf("window %p: MappingNotify!\n", data); -#endif - X11_UpdateKeymap(_this); - } - break; - /* Key press? */ case KeyPress:{ KeyCode keycode = xevent.xkey.keycode; @@ -762,7 +758,7 @@ X11_DispatchEvent(_THIS) #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0); #else - keysym = XKeycodeToKeysym(display, keycode, 0); + keysym = X11_XKeycodeToKeysym(display, keycode, 0); #endif fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n", @@ -778,21 +774,19 @@ X11_DispatchEvent(_THIS) &keysym, &status); } #else - XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL); + X11_XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL); #endif + #ifdef SDL_USE_IBUS if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ - if(!(handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode))){ -#endif - if(*text){ - SDL_SendKeyboardText(text); - } -#ifdef SDL_USE_IBUS - } + handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode); } #endif if (!handled_by_ime) { SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); + if(*text) { + SDL_SendKeyboardText(text); + } } } @@ -890,11 +884,11 @@ X11_DispatchEvent(_THIS) SDL_bool use_list = xevent.xclient.data.l[1] & 1; data->xdnd_source = xevent.xclient.data.l[0]; - xdnd_version = ( xevent.xclient.data.l[1] >> 24); + xdnd_version = (xevent.xclient.data.l[1] >> 24); #ifdef DEBUG_XEVENTS printf("XID of source window : %ld\n", data->xdnd_source); - printf("Protocol version to use : %ld\n", xdnd_version); - printf("More then 3 data types : %ld\n", use_list); + printf("Protocol version to use : %d\n", xdnd_version); + printf("More then 3 data types : %d\n", (int) use_list); #endif if (use_list) { @@ -1006,22 +1000,37 @@ X11_DispatchEvent(_THIS) break; case ButtonPress:{ - int ticks = 0; - if (X11_IsWheelEvent(display,&xevent,&ticks)) { - SDL_SendMouseWheel(data->window, 0, 0, ticks, SDL_MOUSEWHEEL_NORMAL); + int xticks = 0, yticks = 0; + if (X11_IsWheelEvent(display,&xevent,&xticks, &yticks)) { + SDL_SendMouseWheel(data->window, 0, xticks, yticks, SDL_MOUSEWHEEL_NORMAL); } else { - if(xevent.xbutton.button == Button1) { + int button = xevent.xbutton.button; + if(button == Button1) { if (ProcessHitTest(_this, data, &xevent)) { break; /* don't pass this event on to app. */ } } - SDL_SendMouseButton(data->window, 0, SDL_PRESSED, xevent.xbutton.button); + else if(button > 7) { + /* X button values 4-7 are used for scrolling, so X1 is 8, X2 is 9, ... + => subtract (8-SDL_BUTTON_X1) to get value SDL expects */ + button -= (8-SDL_BUTTON_X1); + } + SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button); } } break; case ButtonRelease:{ - SDL_SendMouseButton(data->window, 0, SDL_RELEASED, xevent.xbutton.button); + int button = xevent.xbutton.button; + /* The X server sends a Release event for each Press for wheels. Ignore them. */ + int xticks = 0, yticks = 0; + if (!X11_IsWheelEvent(display,&xevent,&xticks, &yticks)) { + if (button > 7) { + /* see explanation at case ButtonPress */ + button -= (8-SDL_BUTTON_X1); + } + SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button); + } } break; @@ -1030,7 +1039,7 @@ X11_DispatchEvent(_THIS) unsigned char *propdata; int status, real_format; Atom real_type; - unsigned long items_read, items_left, i; + unsigned long items_read, items_left; char *name = X11_XGetAtomName(display, xevent.xproperty.atom); if (name) { @@ -1082,18 +1091,18 @@ X11_DispatchEvent(_THIS) printf("{"); for (i = 0; i < items_read; i++) { - char *name = X11_XGetAtomName(display, atoms[i]); - if (name) { - printf(" %s", name); - X11_XFree(name); + char *atomname = X11_XGetAtomName(display, atoms[i]); + if (atomname) { + printf(" %s", atomname); + X11_XFree(atomname); } } printf(" }\n"); } else { - char *name = X11_XGetAtomName(display, real_type); - printf("Unknown type: %ld (%s)\n", real_type, name ? name : "UNKNOWN"); - if (name) { - X11_XFree(name); + char *atomname = X11_XGetAtomName(display, real_type); + printf("Unknown type: %ld (%s)\n", real_type, atomname ? atomname : "UNKNOWN"); + if (atomname) { + X11_XFree(atomname); } } } @@ -1125,13 +1134,20 @@ X11_DispatchEvent(_THIS) } else { SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0); } - } - + } + } else if (xevent.xproperty.atom == videodata->XKLAVIER_STATE) { + /* Hack for Ubuntu 12.04 (etc) that doesn't send MappingNotify + events when the keyboard layout changes (for example, + changing from English to French on the menubar's keyboard + icon). Since it changes the XKLAVIER_STATE property, we + notice and reinit our keymap here. This might not be the + right approach, but it seems to work. */ + X11_UpdateKeymap(_this); } } break; - /* Copy the selection from XA_CUT_BUFFER0 to the requested property */ + /* Copy the selection from our own CUTBUFFER to the requested property */ case SelectionRequest: { XSelectionRequestEvent *req; XEvent sevent; @@ -1153,8 +1169,9 @@ X11_DispatchEvent(_THIS) sevent.xselection.property = None; sevent.xselection.requestor = req->requestor; sevent.xselection.time = req->time; + if (X11_XGetWindowProperty(display, DefaultRootWindow(display), - XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target, + X11_GetSDLCutBufferClipboardType(display), 0, INT_MAX/4, False, req->target, &sevent.xselection.target, &seln_format, &nbytes, &overflow, &seln_data) == Success) { Atom XA_TARGETS = X11_XInternAtom(display, "TARGETS", 0); @@ -1164,12 +1181,13 @@ X11_DispatchEvent(_THIS) seln_data, nbytes); sevent.xselection.property = req->property; } else if (XA_TARGETS == req->target) { - Atom SupportedFormats[] = { sevent.xselection.target, XA_TARGETS }; + Atom SupportedFormats[] = { XA_TARGETS, sevent.xselection.target }; X11_XChangeProperty(display, req->requestor, req->property, XA_ATOM, 32, PropModeReplace, (unsigned char*)SupportedFormats, - sizeof(SupportedFormats)/sizeof(*SupportedFormats)); + SDL_arraysize(SupportedFormats)); sevent.xselection.property = req->property; + sevent.xselection.target = XA_TARGETS; } X11_XFree(seln_data); } @@ -1246,6 +1264,16 @@ X11_DispatchEvent(_THIS) } break; + case SelectionClear: { + Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0); + + if (xevent.xselectionclear.selection == XA_PRIMARY || + (XA_CLIPBOARD != None && xevent.xselectionclear.selection == XA_CLIPBOARD)) { + SDL_SendClipboardUpdate(); + } + } + break; + default:{ #ifdef DEBUG_XEVENTS printf("window %p: Unhandled event %d\n", data, xevent.type); @@ -1267,10 +1295,10 @@ X11_HandleFocusChanges(_THIS) if (data && data->pending_focus != PENDING_FOCUS_NONE) { Uint32 now = SDL_GetTicks(); if (SDL_TICKS_PASSED(now, data->pending_focus_time)) { - if ( data->pending_focus == PENDING_FOCUS_IN ) { - X11_DispatchFocusIn(data); + if (data->pending_focus == PENDING_FOCUS_IN) { + X11_DispatchFocusIn(_this, data); } else { - X11_DispatchFocusOut(data); + X11_DispatchFocusOut(_this, data); } data->pending_focus = PENDING_FOCUS_NONE; } @@ -1332,17 +1360,17 @@ X11_PumpEvents(_THIS) } } + /* Keep processing pending events */ + while (X11_Pending(data->display)) { + X11_DispatchEvent(_this); + } + #ifdef SDL_USE_IBUS if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ SDL_IBus_PumpEvents(); } #endif - /* Keep processing pending events */ - while (X11_Pending(data->display)) { - X11_DispatchEvent(_this); - } - /* FIXME: Only need to do this when there are pending focus changes */ X11_HandleFocusChanges(_this); } diff --git a/libs/SDL2/src/video/x11/SDL_x11events.h b/libs/SDL2/src/video/x11/SDL_x11events.h index e27d53ac..a6d434de 100644 --- a/libs/SDL2/src/video/x11/SDL_x11events.h +++ b/libs/SDL2/src/video/x11/SDL_x11events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11framebuffer.c b/libs/SDL2/src/video/x11/SDL_x11framebuffer.c index 19d9d0ba..90a4a6fc 100644 --- a/libs/SDL2/src/video/x11/SDL_x11framebuffer.c +++ b/libs/SDL2/src/video/x11/SDL_x11framebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11framebuffer.h b/libs/SDL2/src/video/x11/SDL_x11framebuffer.h index c73c7487..359ee157 100644 --- a/libs/SDL2/src/video/x11/SDL_x11framebuffer.h +++ b/libs/SDL2/src/video/x11/SDL_x11framebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11keyboard.c b/libs/SDL2/src/video/x11/SDL_x11keyboard.c index 53866ab5..b04830f1 100644 --- a/libs/SDL2/src/video/x11/SDL_x11keyboard.c +++ b/libs/SDL2/src/video/x11/SDL_x11keyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,6 +29,7 @@ #include "../../events/scancodes_xfree86.h" #include +#include #include "imKStoUCS.h" @@ -154,7 +155,7 @@ X11_KeyCodeToSDLScancode(Display *display, KeyCode keycode) #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0); #else - keysym = XKeycodeToKeysym(display, keycode, 0); + keysym = X11_XKeycodeToKeysym(display, keycode, 0); #endif if (keysym == NoSymbol) { return SDL_SCANCODE_UNKNOWN; @@ -177,14 +178,14 @@ X11_KeyCodeToSDLScancode(Display *display, KeyCode keycode) } static Uint32 -X11_KeyCodeToUcs4(Display *display, KeyCode keycode) +X11_KeyCodeToUcs4(Display *display, KeyCode keycode, unsigned char group) { KeySym keysym; #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM - keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0); + keysym = X11_XkbKeycodeToKeysym(display, keycode, group, 0); #else - keysym = XKeycodeToKeysym(display, keycode, 0); + keysym = X11_XKeycodeToKeysym(display, keycode, 0); #endif if (keysym == NoSymbol) { return 0; @@ -252,8 +253,7 @@ X11_InitKeyboard(_THIS) #endif SDL_memcpy(&data->key_layout[min_keycode], scancode_set[best_index].table, sizeof(SDL_Scancode) * scancode_set[best_index].table_size); - } - else { + } else { SDL_Keycode keymap[SDL_NUM_SCANCODES]; printf @@ -266,7 +266,7 @@ X11_InitKeyboard(_THIS) #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM sym = X11_XkbKeycodeToKeysym(data->display, i, 0, 0); #else - sym = XKeycodeToKeysym(data->display, i, 0); + sym = X11_XKeycodeToKeysym(data->display, i, 0); #endif if (sym != NoSymbol) { SDL_Scancode scancode; @@ -301,8 +301,20 @@ X11_UpdateKeymap(_THIS) int i; SDL_Scancode scancode; SDL_Keycode keymap[SDL_NUM_SCANCODES]; + unsigned char group = 0; SDL_GetDefaultKeymap(keymap); + +#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM + { + XkbStateRec state; + if (X11_XkbGetState(data->display, XkbUseCoreKbd, &state) == Success) { + group = state.group; + } + } +#endif + + for (i = 0; i < SDL_arraysize(data->key_layout); i++) { Uint32 key; @@ -313,9 +325,32 @@ X11_UpdateKeymap(_THIS) } /* See if there is a UCS keycode for this scancode */ - key = X11_KeyCodeToUcs4(data->display, (KeyCode)i); + key = X11_KeyCodeToUcs4(data->display, (KeyCode)i, group); if (key) { keymap[scancode] = key; + } else { + SDL_Scancode keyScancode = X11_KeyCodeToSDLScancode(data->display, (KeyCode)i); + + switch (keyScancode) { + case SDL_SCANCODE_RETURN: + keymap[scancode] = SDLK_RETURN; + break; + case SDL_SCANCODE_ESCAPE: + keymap[scancode] = SDLK_ESCAPE; + break; + case SDL_SCANCODE_BACKSPACE: + keymap[scancode] = SDLK_BACKSPACE; + break; + case SDL_SCANCODE_TAB: + keymap[scancode] = SDLK_TAB; + break; + case SDL_SCANCODE_DELETE: + keymap[scancode] = SDLK_DELETE; + break; + default: + keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(keyScancode); + break; + } } } SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); diff --git a/libs/SDL2/src/video/x11/SDL_x11keyboard.h b/libs/SDL2/src/video/x11/SDL_x11keyboard.h index 6037e5c0..1e9c48ca 100644 --- a/libs/SDL2/src/video/x11/SDL_x11keyboard.h +++ b/libs/SDL2/src/video/x11/SDL_x11keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11messagebox.c b/libs/SDL2/src/video/x11/SDL_x11messagebox.c index e8396c56..a52d4c9e 100644 --- a/libs/SDL2/src/video/x11/SDL_x11messagebox.c +++ b/libs/SDL2/src/video/x11/SDL_x11messagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,11 +28,12 @@ #include "SDL_x11dyn.h" #include "SDL_assert.h" +#include #include -#define SDL_FORK_MESSAGEBOX 0 -#define SDL_SET_LOCALE 0 +#define SDL_FORK_MESSAGEBOX 1 +#define SDL_SET_LOCALE 1 #if SDL_FORK_MESSAGEBOX #include @@ -83,6 +84,10 @@ typedef struct SDL_MessageBoxDataX11 Display *display; int screen; Window window; +#if SDL_VIDEO_DRIVER_X11_XDBE + XdbeBackBuffer buf; + SDL_bool xdbe; /* Whether Xdbe is present or not */ +#endif long event_mask; Atom wm_protocols; Atom wm_delete_message; @@ -347,6 +352,12 @@ X11_MessageBoxShutdown( SDL_MessageBoxDataX11 *data ) data->font_struct = NULL; } +#if SDL_VIDEO_DRIVER_X11_XDBE + if ( SDL_X11_HAVE_XDBE && data->xdbe ) { + X11_XdbeDeallocateBackBufferName(data->display, data->buf); + } +#endif + if ( data->display ) { if ( data->window != None ) { X11_XWithdrawWindow( data->display, data->window, data->screen ); @@ -366,7 +377,7 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) int x, y; XSizeHints *sizehints; XSetWindowAttributes wnd_attr; - Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG; + Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_NAME, UTF8_STRING; Display *display = data->display; SDL_WindowData *windowdata = NULL; const SDL_MessageBoxData *messageboxdata = data->messageboxdata; @@ -401,6 +412,11 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) } X11_XStoreName( display, data->window, messageboxdata->title ); + _NET_WM_NAME = X11_XInternAtom(display, "_NET_WM_NAME", False); + UTF8_STRING = X11_XInternAtom(display, "UTF8_STRING", False); + X11_XChangeProperty(display, data->window, _NET_WM_NAME, UTF8_STRING, 8, + PropModeReplace, (unsigned char *) messageboxdata->title, + strlen(messageboxdata->title) + 1 ); /* Let the window manager know this is a dialog box */ _NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); @@ -423,8 +439,16 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) y = attrib.y + ( attrib.height - data->dialog_height ) / 3 ; X11_XTranslateCoordinates(display, windowdata->xwindow, RootWindow(display, data->screen), x, y, &x, &y, &dummy); } else { - x = ( DisplayWidth( display, data->screen ) - data->dialog_width ) / 2; - y = ( DisplayHeight( display, data->screen ) - data->dialog_height ) / 3 ; + const SDL_VideoDevice *dev = SDL_GetVideoDevice(); + if ((dev) && (dev->displays) && (dev->num_displays > 0)) { + const SDL_VideoDisplay *dpy = &dev->displays[0]; + const SDL_DisplayData *dpydata = (SDL_DisplayData *) dpy->driverdata; + x = dpydata->x + (( dpy->current_mode.w - data->dialog_width ) / 2); + y = dpydata->y + (( dpy->current_mode.h - data->dialog_height ) / 3); + } else { /* oh well. This will misposition on a multi-head setup. Init first next time. */ + x = ( DisplayWidth( display, data->screen ) - data->dialog_width ) / 2; + y = ( DisplayHeight( display, data->screen ) - data->dialog_height ) / 3 ; + } } X11_XMoveWindow( display, data->window, x, y ); @@ -445,6 +469,20 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) } X11_XMapRaised( display, data->window ); + +#if SDL_VIDEO_DRIVER_X11_XDBE + /* Initialise a back buffer for double buffering */ + if (SDL_X11_HAVE_XDBE) { + int xdbe_major, xdbe_minor; + if (X11_XdbeQueryExtension(display, &xdbe_major, &xdbe_minor) != 0) { + data->xdbe = SDL_TRUE; + data->buf = X11_XdbeAllocateBackBufferName(display, data->window, XdbeUndefined); + } else { + data->xdbe = SDL_FALSE; + } + } +#endif + return 0; } @@ -453,9 +491,16 @@ static void X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx ) { int i; - Window window = data->window; + Drawable window = data->window; Display *display = data->display; +#if SDL_VIDEO_DRIVER_X11_XDBE + if (SDL_X11_HAVE_XDBE && data->xdbe) { + window = data->buf; + X11_XdbeBeginIdiom(data->display); + } +#endif + X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ] ); X11_XFillRectangle( display, window, ctx, 0, 0, data->dialog_width, data->dialog_height ); @@ -505,6 +550,23 @@ X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx ) buttondata->text, buttondatax11->length ); } } + +#if SDL_VIDEO_DRIVER_X11_XDBE + if (SDL_X11_HAVE_XDBE && data->xdbe) { + XdbeSwapInfo swap_info; + swap_info.swap_window = data->window; + swap_info.swap_action = XdbeUndefined; + X11_XdbeSwapBuffers(data->display, &swap_info, 1); + X11_XdbeEndIdiom(data->display); + } +#endif +} + +static Bool +X11_MessageBoxEventTest(Display *display, XEvent *event, XPointer arg) +{ + const SDL_MessageBoxDataX11 *data = (const SDL_MessageBoxDataX11 *) arg; + return ((event->xany.display == data->display) && (event->xany.window == data->window)) ? True : False; } /* Loop and handle message box event messages until something kills it. */ @@ -539,7 +601,9 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) XEvent e; SDL_bool draw = SDL_TRUE; - X11_XWindowEvent( data->display, data->window, data->event_mask, &e ); + /* can't use XWindowEvent() because it can't handle ClientMessage events. */ + /* can't use XNextEvent() because we only want events for this window. */ + X11_XIfEvent( data->display, &e, X11_MessageBoxEventTest, (XPointer) data ); /* If X11_XFilterEvent returns True, then some input method has filtered the event, and the client should discard the event. */ @@ -568,7 +632,7 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) case MotionNotify: if ( has_focus ) { /* Mouse moved... */ - int previndex = data->mouse_over_index; + const int previndex = data->mouse_over_index; data->mouse_over_index = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y ); if (data->mouse_over_index == previndex) { draw = SDL_FALSE; @@ -718,9 +782,6 @@ X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) int fds[2]; int status = 0; - /* Need to flush here in case someone has turned grab off and it hasn't gone through yet, etc. */ - X11_XFlush(data->display); - if (pipe(fds) == -1) { return X11_ShowMessageBoxImpl(messageboxdata, buttonid); /* oh well. */ } diff --git a/libs/SDL2/src/video/x11/SDL_x11messagebox.h b/libs/SDL2/src/video/x11/SDL_x11messagebox.h index d2d17128..37d8312c 100644 --- a/libs/SDL2/src/video/x11/SDL_x11messagebox.h +++ b/libs/SDL2/src/video/x11/SDL_x11messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11modes.c b/libs/SDL2/src/video/x11/SDL_x11modes.c index 5248f765..eb4bf7e2 100644 --- a/libs/SDL2/src/video/x11/SDL_x11modes.c +++ b/libs/SDL2/src/video/x11/SDL_x11modes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -192,6 +192,21 @@ CheckXinerama(Display * display, int *major, int *minor) #endif return SDL_TRUE; } + +/* !!! FIXME: remove this later. */ +/* we have a weird bug where XineramaQueryScreens() throws an X error, so this + is here to help track it down (and not crash, too!). */ +static SDL_bool xinerama_triggered_error = SDL_FALSE; +static int +X11_XineramaFailed(Display * d, XErrorEvent * e) +{ + xinerama_triggered_error = SDL_TRUE; + fprintf(stderr, "XINERAMA X ERROR: type=%d serial=%lu err=%u req=%u minor=%u\n", + e->type, e->serial, (unsigned int) e->error_code, + (unsigned int) e->request_code, (unsigned int) e->minor_code); + fflush(stderr); + return 0; +} #endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */ #if SDL_VIDEO_DRIVER_X11_XRANDR @@ -229,10 +244,12 @@ CheckXRandR(Display * display, int *major, int *minor) } /* Query the extension version */ + *major = 1; *minor = 3; /* we want 1.3 */ if (!X11_XRRQueryVersion(display, major, minor)) { #ifdef X11MODES_DEBUG printf("XRandR not active on the display\n"); #endif + *major = *minor = 0; return SDL_FALSE; } #ifdef X11MODES_DEBUG @@ -252,20 +269,20 @@ CalculateXRandRRefreshRate(const XRRModeInfo *info) } static SDL_bool -SetXRandRModeInfo(Display *display, XRRScreenResources *res, XRROutputInfo *output_info, +SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, RRMode modeID, SDL_DisplayMode *mode) { int i; for (i = 0; i < res->nmode; ++i) { - if (res->modes[i].id == modeID) { - XRRCrtcInfo *crtc; + const XRRModeInfo *info = &res->modes[i]; + if (info->id == modeID) { + XRRCrtcInfo *crtcinfo; Rotation rotation = 0; - const XRRModeInfo *info = &res->modes[i]; - crtc = X11_XRRGetCrtcInfo(display, res, output_info->crtc); - if (crtc) { - rotation = crtc->rotation; - X11_XRRFreeCrtcInfo(crtc); + crtcinfo = X11_XRRGetCrtcInfo(display, res, crtc); + if (crtcinfo) { + rotation = crtcinfo->rotation; + X11_XRRFreeCrtcInfo(crtcinfo); } if (rotation & (XRANDR_ROTATION_LEFT|XRANDR_ROTATION_RIGHT)) { @@ -285,6 +302,203 @@ SetXRandRModeInfo(Display *display, XRRScreenResources *res, XRROutputInfo *outp } return SDL_FALSE; } + +static void +SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen, RROutput output, const unsigned long widthmm, const unsigned long heightmm) +{ + /* See if we can get the EDID data for the real monitor name */ + int inches; + int nprop; + Atom *props = X11_XRRListOutputProperties(dpy, output, &nprop); + int i; + + for (i = 0; i < nprop; ++i) { + unsigned char *prop; + int actual_format; + unsigned long nitems, bytes_after; + Atom actual_type; + + if (props[i] == EDID) { + if (X11_XRRGetOutputProperty(dpy, output, props[i], 0, 100, False, + False, AnyPropertyType, &actual_type, + &actual_format, &nitems, &bytes_after, + &prop) == Success) { + MonitorInfo *info = decode_edid(prop); + if (info) { +#ifdef X11MODES_DEBUG + printf("Found EDID data for %s\n", name); + dump_monitor_info(info); +#endif + SDL_strlcpy(name, info->dsc_product_name, namelen); + free(info); + } + X11_XFree(prop); + } + break; + } + } + + if (props) { + X11_XFree(props); + } + + inches = (int)((SDL_sqrt(widthmm * widthmm + heightmm * heightmm) / 25.4f) + 0.5f); + if (*name && inches) { + const size_t len = SDL_strlen(name); + SDL_snprintf(&name[len], namelen-len, " %d\"", inches); + } + +#ifdef X11MODES_DEBUG + printf("Display name: %s\n", name); +#endif +} + + +int +X11_InitModes_XRandR(_THIS) +{ + /* In theory, you _could_ have multiple screens (like DISPLAY=:0.0 + and DISPLAY=:0.1) but no XRandR system we care about is like this, + as all the physical displays would be separate XRandR "outputs" on + the one X11 virtual "screen". So we don't use ScreenCount() here. */ + + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + Display *dpy = data->display; + Atom EDID = X11_XInternAtom(dpy, "EDID", False); + const int screen = DefaultScreen(dpy); + RROutput primary; + XRRScreenResources *res = NULL; + Uint32 pixelformat; + XVisualInfo vinfo; + XPixmapFormatValues *pixmapformats; + int looking_for_primary; + int scanline_pad; + int output; + int i, n; + + if (get_visualinfo(dpy, screen, &vinfo) < 0) { + return -1; + } + + pixelformat = X11_GetPixelFormatFromVisualInfo(dpy, &vinfo); + if (SDL_ISPIXELFORMAT_INDEXED(pixelformat)) { + return SDL_SetError("Palettized video modes are no longer supported"); + } + + scanline_pad = SDL_BYTESPERPIXEL(pixelformat) * 8; + pixmapformats = X11_XListPixmapFormats(dpy, &n); + if (pixmapformats) { + for (i = 0; i < n; ++i) { + if (pixmapformats[i].depth == vinfo.depth) { + scanline_pad = pixmapformats[i].scanline_pad; + break; + } + } + X11_XFree(pixmapformats); + } + + res = X11_XRRGetScreenResources(dpy, RootWindow(dpy, screen)); + if (!res) { + return -1; + } + + primary = X11_XRRGetOutputPrimary(dpy, RootWindow(dpy, screen)); + + for (looking_for_primary = 1; looking_for_primary >= 0; looking_for_primary--) { + for (output = 0; output < res->noutput; output++) { + XRROutputInfo *output_info; + int display_x, display_y; + unsigned long display_mm_width, display_mm_height; + SDL_DisplayData *displaydata; + char display_name[128]; + SDL_DisplayMode mode; + SDL_DisplayModeData *modedata; + SDL_VideoDisplay display; + RRMode modeID; + RRCrtc output_crtc; + XRRCrtcInfo *crtc; + + /* The primary output _should_ always be sorted first, but just in case... */ + if ((looking_for_primary && (res->outputs[output] != primary)) || + (!looking_for_primary && (res->outputs[output] == primary))) { + continue; + } + + output_info = X11_XRRGetOutputInfo(dpy, res, res->outputs[output]); + if (!output_info || !output_info->crtc || output_info->connection == RR_Disconnected) { + X11_XRRFreeOutputInfo(output_info); + continue; + } + + SDL_strlcpy(display_name, output_info->name, sizeof(display_name)); + display_mm_width = output_info->mm_width; + display_mm_height = output_info->mm_height; + output_crtc = output_info->crtc; + X11_XRRFreeOutputInfo(output_info); + + crtc = X11_XRRGetCrtcInfo(dpy, res, output_crtc); + if (!crtc) { + continue; + } + + SDL_zero(mode); + modeID = crtc->mode; + mode.w = crtc->width; + mode.h = crtc->height; + mode.format = pixelformat; + + display_x = crtc->x; + display_y = crtc->y; + + X11_XRRFreeCrtcInfo(crtc); + + displaydata = (SDL_DisplayData *) SDL_calloc(1, sizeof(*displaydata)); + if (!displaydata) { + return SDL_OutOfMemory(); + } + + modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData)); + if (!modedata) { + SDL_free(displaydata); + return SDL_OutOfMemory(); + } + modedata->xrandr_mode = modeID; + mode.driverdata = modedata; + + displaydata->screen = screen; + displaydata->visual = vinfo.visual; + displaydata->depth = vinfo.depth; + displaydata->hdpi = ((float) mode.w) * 25.4f / display_mm_width; + displaydata->vdpi = ((float) mode.h) * 25.4f / display_mm_height; + displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float) display_mm_width) / 25.4f,((float) display_mm_height) / 25.4f); + displaydata->scanline_pad = scanline_pad; + displaydata->x = display_x; + displaydata->y = display_y; + displaydata->use_xrandr = 1; + displaydata->xrandr_output = res->outputs[output]; + + SetXRandRModeInfo(dpy, res, output_crtc, modeID, &mode); + SetXRandRDisplayName(dpy, EDID, display_name, sizeof (display_name), res->outputs[output], display_mm_width, display_mm_height); + + SDL_zero(display); + if (*display_name) { + display.name = display_name; + } + display.desktop_mode = mode; + display.current_mode = mode; + display.driverdata = displaydata; + SDL_AddVideoDisplay(&display); + } + } + + X11_XRRFreeScreenResources(res); + + if (_this->num_displays == 0) { + return SDL_SetError("No available displays"); + } + + return 0; +} #endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ #if SDL_VIDEO_DRIVER_X11_XVIDMODE @@ -384,21 +598,39 @@ X11_InitModes(_THIS) #endif #if SDL_VIDEO_DRIVER_X11_XRANDR int xrandr_major, xrandr_minor; - int use_xrandr = 0; - XRRScreenResources *res = NULL; #endif #if SDL_VIDEO_DRIVER_X11_XVIDMODE int vm_major, vm_minor; int use_vidmode = 0; #endif +/* XRandR is the One True Modern Way to do this on X11. If it's enabled and + available, don't even look at other ways of doing things. */ +#if SDL_VIDEO_DRIVER_X11_XRANDR + /* require at least XRandR v1.3 */ + if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) && + (xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 3))) { + return X11_InitModes_XRandR(_this); + } +#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ + +/* !!! FIXME: eventually remove support for Xinerama and XVidMode (everything below here). */ + #if SDL_VIDEO_DRIVER_X11_XINERAMA /* Query Xinerama extention * NOTE: This works with Nvidia Twinview correctly, but you need version 302.17 (released on June 2012) * or newer of the Nvidia binary drivers */ if (CheckXinerama(data->display, &xinerama_major, &xinerama_minor)) { + int (*handler) (Display *, XErrorEvent *); + X11_XSync(data->display, False); + handler = X11_XSetErrorHandler(X11_XineramaFailed); xinerama = X11_XineramaQueryScreens(data->display, &screencount); + X11_XSync(data->display, False); + X11_XSetErrorHandler(handler); + if (xinerama_triggered_error) { + xinerama = 0; + } if (xinerama) { use_xinerama = xinerama_major * 100 + xinerama_minor; } @@ -410,14 +642,6 @@ X11_InitModes(_THIS) screencount = ScreenCount(data->display); #endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */ -#if SDL_VIDEO_DRIVER_X11_XRANDR - /* require at least XRandR v1.2 */ - if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) && - (xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 2))) { - use_xrandr = xrandr_major * 100 + xrandr_minor; - } -#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ - #if SDL_VIDEO_DRIVER_X11_XVIDMODE if (CheckVidMode(data->display, &vm_major, &vm_minor)) { use_vidmode = vm_major * 100 + vm_minor; @@ -510,6 +734,18 @@ X11_InitModes(_THIS) displaydata->visual = vinfo.visual; displaydata->depth = vinfo.depth; + // We use the displaydata screen index here so that this works + // for both the Xinerama case, where we get the overall DPI, + // and the regular X11 screen info case. + displaydata->hdpi = (float)DisplayWidth(data->display, displaydata->screen) * 25.4f / + DisplayWidthMM(data->display, displaydata->screen); + displaydata->vdpi = (float)DisplayHeight(data->display, displaydata->screen) * 25.4f / + DisplayHeightMM(data->display, displaydata->screen); + displaydata->ddpi = SDL_ComputeDiagonalDPI(DisplayWidth(data->display, displaydata->screen), + DisplayHeight(data->display, displaydata->screen), + (float)DisplayWidthMM(data->display, displaydata->screen) / 25.4f, + (float)DisplayHeightMM(data->display, displaydata->screen) / 25.4f); + displaydata->scanline_pad = SDL_BYTESPERPIXEL(mode.format) * 8; pixmapFormats = X11_XListPixmapFormats(data->display, &n); if (pixmapFormats) { @@ -534,106 +770,6 @@ X11_InitModes(_THIS) displaydata->y = 0; } -#if SDL_VIDEO_DRIVER_X11_XRANDR - if (use_xrandr) { - res = X11_XRRGetScreenResources(data->display, RootWindow(data->display, displaydata->screen)); - } - if (res) { - XRROutputInfo *output_info; - XRRCrtcInfo *crtc; - int output; - Atom EDID = X11_XInternAtom(data->display, "EDID", False); - Atom *props; - int nprop; - unsigned long width_mm; - unsigned long height_mm; - int inches = 0; - - for (output = 0; output < res->noutput; output++) { - output_info = X11_XRRGetOutputInfo(data->display, res, res->outputs[output]); - if (!output_info || !output_info->crtc || - output_info->connection == RR_Disconnected) { - X11_XRRFreeOutputInfo(output_info); - continue; - } - - /* Is this the output that corresponds to the current screen? - We're checking the crtc position, but that may not be a valid test - in all cases. Anybody want to give this some love? - */ - crtc = X11_XRRGetCrtcInfo(data->display, res, output_info->crtc); - if (!crtc || crtc->x != displaydata->x || crtc->y != displaydata->y || - crtc->width != mode.w || crtc->height != mode.h) { - X11_XRRFreeOutputInfo(output_info); - X11_XRRFreeCrtcInfo(crtc); - continue; - } - - displaydata->use_xrandr = use_xrandr; - displaydata->xrandr_output = res->outputs[output]; - SetXRandRModeInfo(data->display, res, output_info, crtc->mode, &mode); - - /* Get the name of this display */ - width_mm = output_info->mm_width; - height_mm = output_info->mm_height; - inches = (int)((sqrt(width_mm * width_mm + - height_mm * height_mm) / 25.4f) + 0.5f); - SDL_strlcpy(display_name, output_info->name, sizeof(display_name)); - - /* See if we can get the EDID data for the real monitor name */ - props = X11_XRRListOutputProperties(data->display, res->outputs[output], &nprop); - for (i = 0; i < nprop; ++i) { - unsigned char *prop; - int actual_format; - unsigned long nitems, bytes_after; - Atom actual_type; - - if (props[i] == EDID) { - if (X11_XRRGetOutputProperty(data->display, - res->outputs[output], props[i], - 0, 100, False, False, - AnyPropertyType, - &actual_type, &actual_format, - &nitems, &bytes_after, &prop) == Success ) { - MonitorInfo *info = decode_edid(prop); - if (info) { - #ifdef X11MODES_DEBUG - printf("Found EDID data for %s\n", output_info->name); - dump_monitor_info(info); - #endif - SDL_strlcpy(display_name, info->dsc_product_name, sizeof(display_name)); - free(info); - } - X11_XFree(prop); - } - break; - } - } - if (props) { - X11_XFree(props); - } - - if (*display_name && inches) { - size_t len = SDL_strlen(display_name); - SDL_snprintf(&display_name[len], sizeof(display_name)-len, " %d\"", inches); - } -#ifdef X11MODES_DEBUG - printf("Display name: %s\n", display_name); -#endif - - X11_XRRFreeOutputInfo(output_info); - X11_XRRFreeCrtcInfo(crtc); - break; - } -#ifdef X11MODES_DEBUG - if (output == res->noutput) { - printf("Couldn't find XRandR CRTC at %d,%d\n", displaydata->x, displaydata->y); - } -#endif - X11_XRRFreeScreenResources(res); - } -#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ - #if SDL_VIDEO_DRIVER_X11_XVIDMODE if (!displaydata->use_xrandr && #if SDL_VIDEO_DRIVER_X11_XINERAMA @@ -713,7 +849,9 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata; } mode.driverdata = modedata; - SDL_AddDisplayMode(sdl_display, &mode); + if (!SDL_AddDisplayMode(sdl_display, &mode)) { + SDL_free(modedata); + } } else if (!data->use_xrandr) { @@ -727,7 +865,9 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata; } mode.driverdata = modedata; - SDL_AddDisplayMode(sdl_display, &mode); + if (!SDL_AddDisplayMode(sdl_display, &mode)) { + SDL_free(modedata); + } } } @@ -752,9 +892,8 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) } mode.driverdata = modedata; - if (SetXRandRModeInfo(display, res, output_info, output_info->modes[i], &mode)) { - SDL_AddDisplayMode(sdl_display, &mode); - } else { + if (!SetXRandRModeInfo(display, res, output_info->crtc, output_info->modes[i], &mode) || + !SDL_AddDisplayMode(sdl_display, &mode)) { SDL_free(modedata); } } @@ -787,9 +926,7 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) } mode.driverdata = modedata; - if (SetXVidModeModeInfo(modes[i], &mode)) { - SDL_AddDisplayMode(sdl_display, &mode); - } else { + if (!SetXVidModeModeInfo(modes[i], &mode) || !SDL_AddDisplayMode(sdl_display, &mode)) { SDL_free(modedata); } } @@ -807,7 +944,9 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata; } mode.driverdata = modedata; - SDL_AddDisplayMode(sdl_display, &mode); + if (!SDL_AddDisplayMode(sdl_display, &mode)) { + SDL_free(modedata); + } } } @@ -900,6 +1039,24 @@ X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect) return 0; } +int +X11_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * hdpi, float * vdpi) +{ + SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; + + if (ddpi) { + *ddpi = data->ddpi; + } + if (hdpi) { + *hdpi = data->hdpi; + } + if (vdpi) { + *vdpi = data->vdpi; + } + + return data->ddpi != 0.0f ? 0 : -1; +} + #endif /* SDL_VIDEO_DRIVER_X11 */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/src/video/x11/SDL_x11modes.h b/libs/SDL2/src/video/x11/SDL_x11modes.h index 82af1d2d..769da5a5 100644 --- a/libs/SDL2/src/video/x11/SDL_x11modes.h +++ b/libs/SDL2/src/video/x11/SDL_x11modes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,6 +31,9 @@ typedef struct int scanline_pad; int x; int y; + float ddpi; + float hdpi; + float vdpi; int use_xinerama; int use_xrandr; @@ -74,6 +77,7 @@ extern int X11_GetVisualInfoFromVisual(Display * display, Visual * visual, extern Uint32 X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo); extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect); +extern int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * hdpi, float * vdpi); #endif /* _SDL_x11modes_h */ diff --git a/libs/SDL2/src/video/x11/SDL_x11mouse.c b/libs/SDL2/src/video/x11/SDL_x11mouse.c index 6a0207e9..6cef0a4e 100644 --- a/libs/SDL2/src/video/x11/SDL_x11mouse.c +++ b/libs/SDL2/src/video/x11/SDL_x11mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -318,13 +318,14 @@ X11_WarpMouse(SDL_Window * window, int x, int y) X11_XSync(display, False); } -static void +static int X11_WarpMouseGlobal(int x, int y) { Display *display = GetDisplay(); X11_XWarpPointer(display, None, DefaultRootWindow(display), 0, 0, 0, 0, x, y); X11_XSync(display, False); + return 0; } static int diff --git a/libs/SDL2/src/video/x11/SDL_x11mouse.h b/libs/SDL2/src/video/x11/SDL_x11mouse.h index 8a2dac0e..7c6a5443 100644 --- a/libs/SDL2/src/video/x11/SDL_x11mouse.h +++ b/libs/SDL2/src/video/x11/SDL_x11mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11opengl.c b/libs/SDL2/src/video/x11/SDL_x11opengl.c index f89a9cc0..a431ae74 100644 --- a/libs/SDL2/src/video/x11/SDL_x11opengl.c +++ b/libs/SDL2/src/video/x11/SDL_x11opengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -122,6 +122,13 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, #define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 #endif +#ifndef GLX_ARB_context_flush_control +#define GLX_ARB_context_flush_control +#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#endif + #define OPENGL_REQUIRES_DLOPEN #if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN) #include @@ -375,12 +382,17 @@ X11_GL_InitExtensions(_THIS) if (HasExtension("GLX_EXT_create_context_es2_profile", extensions)) { _this->gl_data->HAS_GLX_EXT_create_context_es2_profile = SDL_TRUE; } + + /* Check for GLX_ARB_context_flush_control */ + if (HasExtension("GLX_ARB_context_flush_control", extensions)) { + _this->gl_data->HAS_GLX_ARB_context_flush_control = SDL_TRUE; + } } /* glXChooseVisual and glXChooseFBConfig have some small differences in * the attribute encoding, it can be chosen with the for_FBConfig parameter. */ -int +static int X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int size, Bool for_FBConfig) { int i = 0; @@ -462,9 +474,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si if (_this->gl_config.framebuffer_srgb_capable) { attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB; - if( for_FBConfig ) { - attribs[i++] = True; - } + attribs[i++] = True; /* always needed, for_FBConfig or not! */ } if (_this->gl_config.accelerated >= 0 && @@ -519,10 +529,11 @@ X11_GL_GetVisual(_THIS, Display * display, int screen) #define GLXBadProfileARB 13 #endif static int (*handler) (Display *, XErrorEvent *) = NULL; +static const char *errorHandlerOperation = NULL; static int errorBase = 0; static int errorCode = 0; static int -X11_GL_CreateContextErrorHandler(Display * d, XErrorEvent * e) +X11_GL_ErrorHandler(Display * d, XErrorEvent * e) { char *x11_error = NULL; char x11_error_locale[256]; @@ -535,12 +546,12 @@ X11_GL_CreateContextErrorHandler(Display * d, XErrorEvent * e) if (x11_error) { - SDL_SetError("Could not create GL context: %s", x11_error); + SDL_SetError("Could not %s: %s", errorHandlerOperation, x11_error); SDL_free(x11_error); } else { - SDL_SetError("Could not create GL context: %i (Base %i)\n", errorCode, errorBase); + SDL_SetError("Could not %s: %i (Base %i)\n", errorHandlerOperation, errorCode, errorBase); } return (0); @@ -566,9 +577,10 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) /* We do this to create a clean separation between X and GLX errors. */ X11_XSync(display, False); + errorHandlerOperation = "create GL context"; errorBase = _this->gl_data->errorBase; errorCode = Success; - handler = X11_XSetErrorHandler(X11_GL_CreateContextErrorHandler); + handler = X11_XSetErrorHandler(X11_GL_ErrorHandler); X11_XGetWindowAttributes(display, data->xwindow, &xattr); v.screen = screen; v.visualid = X11_XVisualIDFromVisual(xattr.visual); @@ -581,8 +593,8 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) context = _this->gl_data->glXCreateContext(display, vinfo, share_context, True); } else { - /* max 8 attributes plus terminator */ - int attribs[9] = { + /* max 10 attributes plus terminator */ + int attribs[11] = { GLX_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version, GLX_CONTEXT_MINOR_VERSION_ARB, @@ -603,6 +615,15 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) attribs[iattr++] = _this->gl_config.flags; } + /* only set if glx extension is available */ + if( _this->gl_data->HAS_GLX_ARB_context_flush_control ) { + attribs[iattr++] = GLX_CONTEXT_RELEASE_BEHAVIOR_ARB; + attribs[iattr++] = + _this->gl_config.release_behavior ? + GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : + GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB; + } + attribs[iattr++] = 0; /* Get a pointer to the context creation function for GL 3.0 */ @@ -657,12 +678,24 @@ X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) Window drawable = (context ? ((SDL_WindowData *) window->driverdata)->xwindow : None); GLXContext glx_context = (GLXContext) context; + int rc; if (!_this->gl_data) { return SDL_SetError("OpenGL not initialized"); } - if (!_this->gl_data->glXMakeCurrent(display, drawable, glx_context)) { + /* We do this to create a clean separation between X and GLX errors. */ + X11_XSync(display, False); + errorHandlerOperation = "make GL context current"; + errorBase = _this->gl_data->errorBase; + errorCode = Success; + handler = X11_XSetErrorHandler(X11_GL_ErrorHandler); + rc = _this->gl_data->glXMakeCurrent(display, drawable, glx_context); + X11_XSetErrorHandler(handler); + + if (errorCode != Success) { /* uhoh, an X error was thrown! */ + return -1; /* the error handler called SDL_SetError() already. */ + } else if (!rc) { /* glxMakeCurrent() failed without throwing an X error */ return SDL_SetError("Unable to make GL context current"); } diff --git a/libs/SDL2/src/video/x11/SDL_x11opengl.h b/libs/SDL2/src/video/x11/SDL_x11opengl.h index b3410fd4..de229735 100644 --- a/libs/SDL2/src/video/x11/SDL_x11opengl.h +++ b/libs/SDL2/src/video/x11/SDL_x11opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,6 +35,7 @@ struct SDL_GLDriverData SDL_bool HAS_GLX_EXT_visual_info; SDL_bool HAS_GLX_EXT_swap_control_tear; SDL_bool HAS_GLX_EXT_create_context_es2_profile; + SDL_bool HAS_GLX_ARB_context_flush_control; Bool (*glXQueryExtension) (Display*,int*,int*); void *(*glXGetProcAddress) (const GLubyte*); diff --git a/libs/SDL2/src/video/x11/SDL_x11opengles.c b/libs/SDL2/src/video/x11/SDL_x11opengles.c index 5310420c..ca57af38 100644 --- a/libs/SDL2/src/video/x11/SDL_x11opengles.c +++ b/libs/SDL2/src/video/x11/SDL_x11opengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11opengles.h b/libs/SDL2/src/video/x11/SDL_x11opengles.h index f6ea71eb..e39e3c01 100644 --- a/libs/SDL2/src/video/x11/SDL_x11opengles.h +++ b/libs/SDL2/src/video/x11/SDL_x11opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11shape.c b/libs/SDL2/src/video/x11/SDL_x11shape.c index 51520946..19c7942d 100644 --- a/libs/SDL2/src/video/x11/SDL_x11shape.c +++ b/libs/SDL2/src/video/x11/SDL_x11shape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11shape.h b/libs/SDL2/src/video/x11/SDL_x11shape.h index 68118cfe..0d3c2107 100644 --- a/libs/SDL2/src/video/x11/SDL_x11shape.h +++ b/libs/SDL2/src/video/x11/SDL_x11shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11sym.h b/libs/SDL2/src/video/x11/SDL_x11sym.h index 9678bac5..4a926a34 100644 --- a/libs/SDL2/src/video/x11/SDL_x11sym.h +++ b/libs/SDL2/src/video/x11/SDL_x11sym.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -152,6 +152,7 @@ SDL_X11_SYM(unsigned long,_XSetLastRequestRead,(Display* a,xGenericReply* b),(a, SDL_X11_SYM(SDL_X11_XSynchronizeRetType,XSynchronize,(Display* a,Bool b),(a,b),return) SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return) SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return) +SDL_X11_SYM(void,XRefreshKeyboardMapping,(XMappingEvent *a),(a),) #if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS SDL_X11_SYM(Bool,XGetEventData,(Display* a,XGenericEventCookie* b),(a,b),return) @@ -164,6 +165,7 @@ SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,unsigned int b,int c,int d),(a #else SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,KeyCode b,int c,int d),(a,b,c,d),return) #endif +SDL_X11_SYM(Status,XkbGetState,(Display* a,unsigned int b,XkbStatePtr c),(a,b,c),return) #endif #if NeedWidePrototypes @@ -203,11 +205,7 @@ SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return) */ #ifdef LONG64 SDL_X11_MODULE(IO_32BIT) -#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return) -#else -SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) -#endif SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),) #endif @@ -230,6 +228,20 @@ SDL_X11_SYM(void,XcursorImageDestroy,(XcursorImage *a),(a),) SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),return) #endif +/* Xdbe support */ +#if SDL_VIDEO_DRIVER_X11_XDBE +SDL_X11_MODULE(XDBE) +SDL_X11_SYM(Status,XdbeQueryExtension,(Display *dpy,int *major_version_return,int *minor_version_return),(dpy,major_version_return,minor_version_return),return) +SDL_X11_SYM(XdbeBackBuffer,XdbeAllocateBackBufferName,(Display *dpy,Window window,XdbeSwapAction swap_action),(dpy,window,swap_action),return) +SDL_X11_SYM(Status,XdbeDeallocateBackBufferName,(Display *dpy,XdbeBackBuffer buffer),(dpy,buffer),return) +SDL_X11_SYM(Status,XdbeSwapBuffers,(Display *dpy,XdbeSwapInfo *swap_info,int num_windows),(dpy,swap_info,num_windows),return) +SDL_X11_SYM(Status,XdbeBeginIdiom,(Display *dpy),(dpy),return) +SDL_X11_SYM(Status,XdbeEndIdiom,(Display *dpy),(dpy),return) +SDL_X11_SYM(XdbeScreenVisualInfo*,XdbeGetVisualInfo,(Display *dpy,Drawable *screen_specifiers,int *num_screens),(dpy,screen_specifiers,num_screens),return) +SDL_X11_SYM(void,XdbeFreeVisualInfo,(XdbeScreenVisualInfo *visual_info),(visual_info),) +SDL_X11_SYM(XdbeBackBufferAttributes*,XdbeGetBackBufferAttributes,(Display *dpy,XdbeBackBuffer buffer),(dpy,buffer),return) +#endif + /* Xinerama support */ #if SDL_VIDEO_DRIVER_X11_XINERAMA SDL_X11_MODULE(XINERAMA) @@ -272,6 +284,7 @@ SDL_X11_SYM(Status,XRRSetCrtcConfig,(Display *dpy, XRRScreenResources *resources SDL_X11_SYM(Atom*,XRRListOutputProperties,(Display *dpy, RROutput output, int *nprop),(dpy,output,nprop),return) SDL_X11_SYM(XRRPropertyInfo*,XRRQueryOutputProperty,(Display *dpy,RROutput output, Atom property),(dpy,output,property),return) SDL_X11_SYM(int,XRRGetOutputProperty,(Display *dpy,RROutput output, Atom property, long offset, long length, Bool _delete, Bool pending, Atom req_type, Atom *actual_type, int *actual_format, unsigned long *nitems, unsigned long *bytes_after, unsigned char **prop),(dpy,output,property,offset,length, _delete, pending, req_type, actual_type, actual_format, nitems, bytes_after, prop),return) +SDL_X11_SYM(RROutput,XRRGetOutputPrimary,(Display *dpy,Window window),(dpy,window),return) #endif /* MIT-SCREEN-SAVER support */ diff --git a/libs/SDL2/src/video/x11/SDL_x11touch.c b/libs/SDL2/src/video/x11/SDL_x11touch.c index a6da0463..2b24027a 100644 --- a/libs/SDL2/src/video/x11/SDL_x11touch.c +++ b/libs/SDL2/src/video/x11/SDL_x11touch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11touch.h b/libs/SDL2/src/video/x11/SDL_x11touch.h index 84de8d63..47645e8f 100644 --- a/libs/SDL2/src/video/x11/SDL_x11touch.h +++ b/libs/SDL2/src/video/x11/SDL_x11touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11video.c b/libs/SDL2/src/video/x11/SDL_x11video.c index 4ede655e..9d07438e 100644 --- a/libs/SDL2/src/video/x11/SDL_x11video.c +++ b/libs/SDL2/src/video/x11/SDL_x11video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -216,6 +216,7 @@ X11_CreateDevice(int devindex) device->VideoQuit = X11_VideoQuit; device->GetDisplayModes = X11_GetDisplayModes; device->GetDisplayBounds = X11_GetDisplayBounds; + device->GetDisplayDPI = X11_GetDisplayDPI; device->SetDisplayMode = X11_SetDisplayMode; device->SuspendScreenSaver = X11_SuspendScreenSaver; device->PumpEvents = X11_PumpEvents; @@ -407,6 +408,7 @@ X11_VideoInit(_THIS) GET_ATOM(XdndDrop); GET_ATOM(XdndFinished); GET_ATOM(XdndSelection); + GET_ATOM(XKLAVIER_STATE); /* Detect the window manager */ X11_CheckWindowManager(_this); diff --git a/libs/SDL2/src/video/x11/SDL_x11video.h b/libs/SDL2/src/video/x11/SDL_x11video.h index ed6b14fa..a544113e 100644 --- a/libs/SDL2/src/video/x11/SDL_x11video.h +++ b/libs/SDL2/src/video/x11/SDL_x11video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,6 +34,9 @@ #if SDL_VIDEO_DRIVER_X11_XCURSOR #include #endif +#if SDL_VIDEO_DRIVER_X11_XDBE +#include +#endif #if SDL_VIDEO_DRIVER_X11_XINERAMA #include #endif @@ -108,6 +111,7 @@ typedef struct SDL_VideoData Atom XdndDrop; Atom XdndFinished; Atom XdndSelection; + Atom XKLAVIER_STATE; SDL_Scancode key_layout[256]; SDL_bool selection_waiting; diff --git a/libs/SDL2/src/video/x11/SDL_x11window.c b/libs/SDL2/src/video/x11/SDL_x11window.c index 05621e0c..2a779970 100644 --- a/libs/SDL2/src/video/x11/SDL_x11window.c +++ b/libs/SDL2/src/video/x11/SDL_x11window.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -54,12 +54,12 @@ static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) { return ev->type == UnmapNotify && ev->xunmap.window == *((Window*)win); } + +/* static Bool isConfigureNotify(Display *dpy, XEvent *ev, XPointer win) { return ev->type == ConfigureNotify && ev->xconfigure.window == *((Window*)win); } - -/* static Bool X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), XPointer arg, int timeoutMS) { @@ -333,7 +333,7 @@ SetWindowBordered(Display *display, int screen, Window window, SDL_bool border) X11_XChangeProperty(display, window, WM_HINTS, WM_HINTS, 32, PropModeReplace, (unsigned char *) &MWMHints, - sizeof(MWMHints) / 4); + sizeof(MWMHints) / sizeof(long)); } else { /* set the transient hints instead, if necessary */ X11_XSetTransientForHint(display, window, RootWindow(display, screen)); } @@ -656,67 +656,39 @@ X11_SetWindowTitle(_THIS, SDL_Window * window) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; - XTextProperty titleprop, iconprop; + XTextProperty titleprop; Status status; - const char *title = window->title; - const char *icon = NULL; + const char *title = window->title ? window->title : ""; + char *title_locale = NULL; #ifdef X_HAVE_UTF8_STRING Atom _NET_WM_NAME = data->videodata->_NET_WM_NAME; - Atom _NET_WM_ICON_NAME = data->videodata->_NET_WM_ICON_NAME; #endif - if (title != NULL) { - char *title_locale = SDL_iconv_utf8_locale(title); - if (!title_locale) { - SDL_OutOfMemory(); - return; - } - status = X11_XStringListToTextProperty(&title_locale, 1, &titleprop); - SDL_free(title_locale); - if (status) { - X11_XSetTextProperty(display, data->xwindow, &titleprop, XA_WM_NAME); + title_locale = SDL_iconv_utf8_locale(title); + if (!title_locale) { + SDL_OutOfMemory(); + return; + } + + status = X11_XStringListToTextProperty(&title_locale, 1, &titleprop); + SDL_free(title_locale); + if (status) { + X11_XSetTextProperty(display, data->xwindow, &titleprop, XA_WM_NAME); + X11_XFree(titleprop.value); + } +#ifdef X_HAVE_UTF8_STRING + if (SDL_X11_HAVE_UTF8) { + status = X11_Xutf8TextListToTextProperty(display, (char **) &title, 1, + XUTF8StringStyle, &titleprop); + if (status == Success) { + X11_XSetTextProperty(display, data->xwindow, &titleprop, + _NET_WM_NAME); X11_XFree(titleprop.value); } -#ifdef X_HAVE_UTF8_STRING - if (SDL_X11_HAVE_UTF8) { - status = - X11_Xutf8TextListToTextProperty(display, (char **) &title, 1, - XUTF8StringStyle, &titleprop); - if (status == Success) { - X11_XSetTextProperty(display, data->xwindow, &titleprop, - _NET_WM_NAME); - X11_XFree(titleprop.value); - } - } -#endif } - if (icon != NULL) { - char *icon_locale = SDL_iconv_utf8_locale(icon); - if (!icon_locale) { - SDL_OutOfMemory(); - return; - } - status = X11_XStringListToTextProperty(&icon_locale, 1, &iconprop); - SDL_free(icon_locale); - if (status) { - X11_XSetTextProperty(display, data->xwindow, &iconprop, - XA_WM_ICON_NAME); - X11_XFree(iconprop.value); - } -#ifdef X_HAVE_UTF8_STRING - if (SDL_X11_HAVE_UTF8) { - status = - X11_Xutf8TextListToTextProperty(display, (char **) &icon, 1, - XUTF8StringStyle, &iconprop); - if (status == Success) { - X11_XSetTextProperty(display, data->xwindow, &iconprop, - _NET_WM_ICON_NAME); - X11_XFree(iconprop.value); - } - } #endif - } + X11_XFlush(display); } @@ -892,7 +864,6 @@ X11_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) SetWindowBordered(display, displaydata->screen, data->xwindow, bordered); X11_XFlush(display); - X11_XIfEvent(display, &event, &isConfigureNotify, (XPointer)&data->xwindow); if (visible) { XWindowAttributes attr; @@ -927,6 +898,12 @@ X11_ShowWindow(_THIS, SDL_Window * window) X11_XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow); X11_XFlush(display); } + + if (!data->videodata->net_wm) { + /* no WM means no FocusIn event, which confuses us. Force it. */ + X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime); + X11_XFlush(display); + } } void diff --git a/libs/SDL2/src/video/x11/SDL_x11window.h b/libs/SDL2/src/video/x11/SDL_x11window.h index ce3f5843..a3424ff6 100644 --- a/libs/SDL2/src/video/x11/SDL_x11window.h +++ b/libs/SDL2/src/video/x11/SDL_x11window.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/src/video/x11/SDL_x11xinput2.c b/libs/SDL2/src/video/x11/SDL_x11xinput2.c index 7c149922..c74e027c 100644 --- a/libs/SDL2/src/video/x11/SDL_x11xinput2.c +++ b/libs/SDL2/src/video/x11/SDL_x11xinput2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -136,15 +136,25 @@ X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie) case XI_RawMotion: { const XIRawEvent *rawev = (const XIRawEvent*)cookie->data; SDL_Mouse *mouse = SDL_GetMouse(); - double relative_cords[2]; + double relative_coords[2]; + static Time prev_time = 0; + static double prev_rel_coords[2]; if (!mouse->relative_mode || mouse->relative_mode_warp) { return 0; } parse_valuators(rawev->raw_values,rawev->valuators.mask, - rawev->valuators.mask_len,relative_cords,2); - SDL_SendMouseMotion(mouse->focus,mouse->mouseID,1,(int)relative_cords[0],(int)relative_cords[1]); + rawev->valuators.mask_len,relative_coords,2); + + if ((rawev->time == prev_time) && (relative_coords[0] == prev_rel_coords[0]) && (relative_coords[1] == prev_rel_coords[1])) { + return 0; /* duplicate event, drop it. */ + } + + SDL_SendMouseMotion(mouse->focus,mouse->mouseID,1,(int)relative_coords[0],(int)relative_coords[1]); + prev_rel_coords[0] = relative_coords[0]; + prev_rel_coords[1] = relative_coords[1]; + prev_time = rawev->time; return 1; } break; @@ -183,7 +193,7 @@ X11_InitXinput2Multitouch(_THIS) SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; XIDeviceInfo *info; int ndevices,i,j; - info = X11_XIQueryDevice(data->display, XIAllMasterDevices, &ndevices); + info = X11_XIQueryDevice(data->display, XIAllDevices, &ndevices); for (i = 0; i < ndevices; i++) { XIDeviceInfo *dev = &info[i]; @@ -197,9 +207,7 @@ X11_InitXinput2Multitouch(_THIS) continue; touchId = t->sourceid; - if (!SDL_GetTouch(touchId)) { - SDL_AddTouch(touchId, dev->name); - } + SDL_AddTouch(touchId, dev->name); } } X11_XIFreeDeviceInfo(info); diff --git a/libs/SDL2/src/video/x11/SDL_x11xinput2.h b/libs/SDL2/src/video/x11/SDL_x11xinput2.h index 3e7178cb..06d3c990 100644 --- a/libs/SDL2/src/video/x11/SDL_x11xinput2.h +++ b/libs/SDL2/src/video/x11/SDL_x11xinput2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/Makefile.in b/libs/SDL2/test/Makefile.in index 078e4eb9..9a1df774 100644 --- a/libs/SDL2/test/Makefile.in +++ b/libs/SDL2/test/Makefile.in @@ -38,6 +38,7 @@ TARGETS = \ testloadso$(EXE) \ testlock$(EXE) \ testmultiaudio$(EXE) \ + testaudiohotplug$(EXE) \ testnative$(EXE) \ testoverlay2$(EXE) \ testplatform$(EXE) \ @@ -59,6 +60,7 @@ TARGETS = \ torturethread$(EXE) \ testrendercopyex$(EXE) \ testmessage$(EXE) \ + testdisplayinfo$(EXE) \ controllermap$(EXE) \ all: Makefile $(TARGETS) @@ -105,6 +107,9 @@ testautomation$(EXE): $(srcdir)/testautomation.c \ testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) +testaudiohotplug$(EXE): $(srcdir)/testaudiohotplug.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + testatomic$(EXE): $(srcdir)/testatomic.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @@ -262,6 +267,9 @@ testrendercopyex$(EXE): $(srcdir)/testrendercopyex.c testmessage$(EXE): $(srcdir)/testmessage.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) +testdisplayinfo$(EXE): $(srcdir)/testdisplayinfo.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + controllermap$(EXE): $(srcdir)/controllermap.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) diff --git a/libs/SDL2/test/checkkeys.c b/libs/SDL2/test/checkkeys.c index 1f03265d..f7a4e3c3 100644 --- a/libs/SDL2/test/checkkeys.c +++ b/libs/SDL2/test/checkkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,6 +88,20 @@ print_modifiers(char **text, size_t *maxlen) print_string(text, maxlen, " MODE"); } +static void +PrintModifierState() +{ + char message[512]; + char *spot; + size_t left; + + spot = message; + left = sizeof(message); + + print_modifiers(&spot, &left); + SDL_Log("Initial state:%s\n", message); +} + static void PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) { @@ -121,7 +135,7 @@ PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) } static void -PrintText(char *text) +PrintText(char *eventtype, char *text) { char *spot, expanded[1024]; @@ -131,7 +145,7 @@ PrintText(char *text) size_t length = SDL_strlen(expanded); SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot); } - SDL_Log("Text (%s): \"%s%s\"\n", expanded, *text == '"' ? "\\" : "", text); + SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text); } void @@ -144,11 +158,14 @@ loop() while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_KEYDOWN: - //case SDL_KEYUP: + case SDL_KEYUP: PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE); break; + case SDL_TEXTEDITING: + PrintText("EDIT", event.text.text); + break; case SDL_TEXTINPUT: - PrintText(event.text.text); + PrintText("INPUT", event.text.text); break; case SDL_MOUSEBUTTONDOWN: /* Any button press quits the app... */ @@ -159,6 +176,11 @@ loop() break; } } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int @@ -192,6 +214,10 @@ main(int argc, char *argv[]) SDL_StartTextInput(); + /* Print initial modifier state */ + SDL_PumpEvents(); + PrintModifierState(); + /* Watch keystrokes */ done = 0; diff --git a/libs/SDL2/test/controllermap.c b/libs/SDL2/test/controllermap.c index 8e5d13e0..eecf0cb3 100644 --- a/libs/SDL2/test/controllermap.c +++ b/libs/SDL2/test/controllermap.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/loopwave.c b/libs/SDL2/test/loopwave.c index e09fe0f7..b3c268de 100644 --- a/libs/SDL2/test/loopwave.c +++ b/libs/SDL2/test/loopwave.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/loopwavequeue.c b/libs/SDL2/test/loopwavequeue.c index 6d712857..e7fb8a29 100644 --- a/libs/SDL2/test/loopwavequeue.c +++ b/libs/SDL2/test/loopwavequeue.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" #if HAVE_SIGNAL_H @@ -45,6 +49,29 @@ poked(int sig) done = 1; } +void +loop() +{ +#ifdef __EMSCRIPTEN__ + if (done || (SDL_GetAudioStatus() != SDL_AUDIO_PLAYING)) { + emscripten_cancel_main_loop(); + } + else +#endif + { + /* The device from SDL_OpenAudio() is always device #1. */ + const Uint32 queued = SDL_GetQueuedAudioSize(1); + SDL_Log("Device has %u bytes queued.\n", (unsigned int) queued); + if (queued <= 8192) { /* time to requeue the whole thing? */ + if (SDL_QueueAudio(1, wave.sound, wave.soundlen) == 0) { + SDL_Log("Device queued %u more bytes.\n", (unsigned int) wave.soundlen); + } else { + SDL_Log("Device FAILED to queue %u more bytes: %s\n", (unsigned int) wave.soundlen, SDL_GetError()); + } + } + } +} + int main(int argc, char *argv[]) { @@ -96,25 +123,22 @@ main(int argc, char *argv[]) /* Let the audio run */ SDL_PauseAudio(0); + done = 0; + /* Note that we stuff the entire audio buffer into the queue in one shot. Most apps would want to feed it a little at a time, as it plays, but we're going for simplicity here. */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING)) { - /* The device from SDL_OpenAudio() is always device #1. */ - const Uint32 queued = SDL_GetQueuedAudioSize(1); - SDL_Log("Device has %u bytes queued.\n", (unsigned int) queued); - if (queued <= 8192) { /* time to requeue the whole thing? */ - if (SDL_QueueAudio(1, wave.sound, wave.soundlen) == 0) { - SDL_Log("Device queued %u more bytes.\n", (unsigned int) wave.soundlen); - } else { - SDL_Log("Device FAILED to queue %u more bytes: %s\n", (unsigned int) wave.soundlen, SDL_GetError()); - } - } + loop(); SDL_Delay(100); /* let it play for awhile. */ } +#endif /* Clean up on signal */ SDL_CloseAudio(); diff --git a/libs/SDL2/test/testatomic.c b/libs/SDL2/test/testatomic.c index 178de7ac..8b6b21a6 100644 --- a/libs/SDL2/test/testatomic.c +++ b/libs/SDL2/test/testatomic.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testaudiohotplug.c b/libs/SDL2/test/testaudiohotplug.c new file mode 100644 index 00000000..af0ecb50 --- /dev/null +++ b/libs/SDL2/test/testaudiohotplug.c @@ -0,0 +1,183 @@ +/* + Copyright (C) 1997-2015 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Program to test hotplugging of audio devices */ + +#include "SDL_config.h" + +#include +#include + +#if HAVE_SIGNAL_H +#include +#endif + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "SDL.h" + +static SDL_AudioSpec spec; +static Uint8 *sound = NULL; /* Pointer to wave data */ +static Uint32 soundlen = 0; /* Length of wave data */ + +static int posindex = 0; +static Uint32 positions[64]; + +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDL_Quit(); + exit(rc); +} + +void SDLCALL +fillerup(void *_pos, Uint8 * stream, int len) +{ + Uint32 pos = *((Uint32 *) _pos); + Uint8 *waveptr; + int waveleft; + + /* Set up the pointers */ + waveptr = sound + pos; + waveleft = soundlen - pos; + + /* Go! */ + while (waveleft <= len) { + SDL_memcpy(stream, waveptr, waveleft); + stream += waveleft; + len -= waveleft; + waveptr = sound; + waveleft = soundlen; + pos = 0; + } + SDL_memcpy(stream, waveptr, len); + pos += len; + *((Uint32 *) _pos) = pos; +} + +static int done = 0; +void +poked(int sig) +{ + done = 1; +} + +static void +iteration() +{ + SDL_Event e; + SDL_AudioDeviceID dev; + while (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) { + done = 1; + } else if (e.type == SDL_AUDIODEVICEADDED) { + const char *name = SDL_GetAudioDeviceName(e.adevice.which, 0); + SDL_Log("New %s audio device: %s\n", e.adevice.iscapture ? "capture" : "output", name); + if (!e.adevice.iscapture) { + positions[posindex] = 0; + spec.userdata = &positions[posindex++]; + spec.callback = fillerup; + dev = SDL_OpenAudioDevice(name, 0, &spec, NULL, 0); + if (!dev) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open '%s': %s\n", name, SDL_GetError()); + } else { + SDL_Log("Opened '%s' as %u\n", name, (unsigned int) dev); + SDL_PauseAudioDevice(dev, 0); + } + } + } else if (e.type == SDL_AUDIODEVICEREMOVED) { + dev = (SDL_AudioDeviceID) e.adevice.which; + SDL_Log("%s device %u removed.\n", e.adevice.iscapture ? "capture" : "output", (unsigned int) dev); + SDL_CloseAudioDevice(dev); + } + } +} + +#ifdef __EMSCRIPTEN__ +void +loop() +{ + if(done) + emscripten_cancel_main_loop(); + else + iteration(); +} +#endif + +int +main(int argc, char *argv[]) +{ + int i; + char filename[4096]; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return (1); + } + + /* Some targets (Mac CoreAudio) need an event queue for audio hotplug, so make and immediately hide a window. */ + SDL_MinimizeWindow(SDL_CreateWindow("testaudiohotplug", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0)); + + if (argc > 1) { + SDL_strlcpy(filename, argv[1], sizeof(filename)); + } else { + SDL_strlcpy(filename, "sample.wav", sizeof(filename)); + } + /* Load the wave file into memory */ + if (SDL_LoadWAV(filename, &spec, &sound, &soundlen) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", filename, SDL_GetError()); + quit(1); + } + +#if HAVE_SIGNAL_H + /* Set the signals */ +#ifdef SIGHUP + signal(SIGHUP, poked); +#endif + signal(SIGINT, poked); +#ifdef SIGQUIT + signal(SIGQUIT, poked); +#endif + signal(SIGTERM, poked); +#endif /* HAVE_SIGNAL_H */ + + /* Show the list of available drivers */ + SDL_Log("Available audio drivers:"); + for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) { + SDL_Log("%i: %s", i, SDL_GetAudioDriver(i)); + } + + SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + SDL_Delay(100); + iteration(); + } +#endif + + /* Clean up on signal */ + SDL_FreeWAV(sound); + SDL_Quit(); + return (0); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/test/testaudioinfo.c b/libs/SDL2/test/testaudioinfo.c index 76ac9428..cd95dc95 100644 --- a/libs/SDL2/test/testaudioinfo.c +++ b/libs/SDL2/test/testaudioinfo.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testautomation.c b/libs/SDL2/test/testautomation.c index ceb352ab..34478a18 100644 --- a/libs/SDL2/test/testautomation.c +++ b/libs/SDL2/test/testautomation.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testautomation_clipboard.c b/libs/SDL2/test/testautomation_clipboard.c index 9ce4f514..f943ffee 100644 --- a/libs/SDL2/test/testautomation_clipboard.c +++ b/libs/SDL2/test/testautomation_clipboard.c @@ -103,6 +103,7 @@ clipboard_testClipboardTextFunctions(void *arg) intResult); charResult = SDL_GetClipboardText(); SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); + SDL_free(charResult); boolResult = SDL_HasClipboardText(); SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); SDLTest_AssertCheck( @@ -137,6 +138,7 @@ clipboard_testClipboardTextFunctions(void *arg) boolResult == SDL_TRUE, "Verify SDL_HasClipboardText returned SDL_TRUE, got %s", (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + SDL_free(charResult); charResult = SDL_GetClipboardText(); SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); SDLTest_AssertCheck( diff --git a/libs/SDL2/test/testdisplayinfo.c b/libs/SDL2/test/testdisplayinfo.c new file mode 100644 index 00000000..d824446e --- /dev/null +++ b/libs/SDL2/test/testdisplayinfo.c @@ -0,0 +1,89 @@ +/* + Copyright (C) 1997-2015 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ + +/* Program to test querying of display info */ + +#include "SDL.h" + +#include +#include + +static void +print_mode(const char *prefix, const SDL_DisplayMode *mode) +{ + if (!mode) + return; + + SDL_Log("%s: fmt=%s w=%d h=%d refresh=%d\n", + prefix, SDL_GetPixelFormatName(mode->format), + mode->w, mode->h, mode->refresh_rate); +} + +int +main(int argc, char *argv[]) +{ + SDL_DisplayMode mode; + int num_displays, dpy; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Load the SDL library */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + + SDL_Log("Using video target '%s'.\n", SDL_GetCurrentVideoDriver()); + num_displays = SDL_GetNumVideoDisplays(); + + SDL_Log("See %d displays.\n", num_displays); + + for (dpy = 0; dpy < num_displays; dpy++) { + const int num_modes = SDL_GetNumDisplayModes(dpy); + SDL_Rect rect = { 0, 0, 0, 0 }; + int m; + + SDL_GetDisplayBounds(dpy, &rect); + SDL_Log("%d: \"%s\" (%dx%d, (%d, %d)), %d modes.\n", dpy, SDL_GetDisplayName(dpy), rect.w, rect.h, rect.x, rect.y, num_modes); + + if (SDL_GetCurrentDisplayMode(dpy, &mode) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " CURRENT: failed to query (%s)\n", SDL_GetError()); + } else { + print_mode("CURRENT", &mode); + } + + if (SDL_GetDesktopDisplayMode(dpy, &mode) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " DESKTOP: failed to query (%s)\n", SDL_GetError()); + } else { + print_mode("DESKTOP", &mode); + } + + for (m = 0; m < num_modes; m++) { + if (SDL_GetDisplayMode(dpy, m, &mode) == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " MODE %d: failed to query (%s)\n", m, SDL_GetError()); + } else { + char prefix[64]; + SDL_snprintf(prefix, sizeof (prefix), " MODE %d", m); + print_mode(prefix, &mode); + } + } + + SDL_Log("\n"); + } + + SDL_Quit(); + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/libs/SDL2/test/testdraw2.c b/libs/SDL2/test/testdraw2.c index 7685e3b2..78245f76 100644 --- a/libs/SDL2/test/testdraw2.c +++ b/libs/SDL2/test/testdraw2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -198,6 +198,11 @@ loop() SDL_RenderPresent(renderer); } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testdrawchessboard.c b/libs/SDL2/test/testdrawchessboard.c index 3272f5ae..33063812 100644 --- a/libs/SDL2/test/testdrawchessboard.c +++ b/libs/SDL2/test/testdrawchessboard.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,7 +39,7 @@ DrawChessBoard(SDL_Renderer * renderer) for( ; row < 8; row++) { column = row%2; - x = x + column; + x = column; for( ; column < 4+(row%2); column++) { SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF); @@ -51,7 +51,6 @@ DrawChessBoard(SDL_Renderer * renderer) x = x + 2; SDL_RenderFillRect(renderer, &rect); } - x=0; } } @@ -59,14 +58,20 @@ void loop() { SDL_Event e; - if (SDL_PollEvent(&e)) { + while (SDL_PollEvent(&e)) { if (e.type == SDL_QUIT) { done = 1; +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif return; } - if(e.key.keysym.sym == SDLK_ESCAPE) { + if ((e.type == SDL_KEYDOWN) && (e.key.keysym.sym == SDLK_ESCAPE)) { done = 1; +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif return; } } @@ -124,6 +129,7 @@ main(int argc, char *argv[]) } #endif + SDL_Quit(); return 0; } diff --git a/libs/SDL2/test/testdropfile.c b/libs/SDL2/test/testdropfile.c index 53821ed8..917e75c1 100644 --- a/libs/SDL2/test/testdropfile.c +++ b/libs/SDL2/test/testdropfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testerror.c b/libs/SDL2/test/testerror.c index 8290680e..181ee11e 100644 --- a/libs/SDL2/test/testerror.c +++ b/libs/SDL2/test/testerror.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testfile.c b/libs/SDL2/test/testfile.c index 38a6bb79..260ac693 100644 --- a/libs/SDL2/test/testfile.c +++ b/libs/SDL2/test/testfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testfilesystem.c b/libs/SDL2/test/testfilesystem.c index 197a5f7c..e1660c8d 100644 --- a/libs/SDL2/test/testfilesystem.c +++ b/libs/SDL2/test/testfilesystem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ main(int argc, char *argv[]) return 0; } - SDL_Log("base path: '%s'\n", SDL_GetBasePath()); + SDL_Log("base path: '%s'\n", base_path); SDL_free(base_path); char *pref_path = SDL_GetPrefPath("libsdl", "testfilesystem"); @@ -41,12 +41,9 @@ main(int argc, char *argv[]) SDL_GetError()); return 0; } - SDL_Log("pref path: '%s'\n", SDL_GetPrefPath("libsdl", "testfilesystem")); + SDL_Log("pref path: '%s'\n", pref_path); SDL_free(pref_path); - SDL_Log("base path: '%s'\n", SDL_GetBasePath()); - SDL_Log("pref path: '%s'\n", SDL_GetPrefPath("libsdl", "testfilesystem")); - SDL_Quit(); return 0; } diff --git a/libs/SDL2/test/testgamecontroller.c b/libs/SDL2/test/testgamecontroller.c index 414872cf..ff08d53d 100644 --- a/libs/SDL2/test/testgamecontroller.c +++ b/libs/SDL2/test/testgamecontroller.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -153,6 +153,12 @@ loop(void *arg) done = SDL_TRUE; retval = SDL_TRUE; /* keep going, wait for reattach. */ } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } SDL_bool @@ -288,10 +294,8 @@ main(int argc, char *argv[]) while (keepGoing) { if (gamecontroller == NULL) { if (!reportederror) { - if (gamecontroller == NULL) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open gamecontroller %d: %s\n", device, SDL_GetError()); - retcode = 1; - } + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open gamecontroller %d: %s\n", device, SDL_GetError()); + retcode = 1; keepGoing = SDL_FALSE; reportederror = SDL_TRUE; } diff --git a/libs/SDL2/test/testgesture.c b/libs/SDL2/test/testgesture.c index 7f766c59..5437c6c4 100644 --- a/libs/SDL2/test/testgesture.c +++ b/libs/SDL2/test/testgesture.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -16,6 +16,7 @@ */ #include "SDL.h" +#include /* for exit() */ #ifdef __EMSCRIPTEN__ #include @@ -265,6 +266,12 @@ void loop() } } DrawScreen(screen, window); + +#ifdef __EMSCRIPTEN__ + if (quitting) { + emscripten_cancel_main_loop(); + } +#endif } int main(int argc, char* argv[]) diff --git a/libs/SDL2/test/testgl2.c b/libs/SDL2/test/testgl2.c index 85148515..8c9c305f 100644 --- a/libs/SDL2/test/testgl2.c +++ b/libs/SDL2/test/testgl2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testgles.c b/libs/SDL2/test/testgles.c index 588cbfb3..b0b47c96 100644 --- a/libs/SDL2/test/testgles.c +++ b/libs/SDL2/test/testgles.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testgles2.c b/libs/SDL2/test/testgles2.c index fedf311a..24deed57 100644 --- a/libs/SDL2/test/testgles2.c +++ b/libs/SDL2/test/testgles2.c @@ -1,5 +1,5 @@ /* - Copyright (r) 1997-2014 Sam Lantinga + Copyright (r) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ #include "SDL_test_common.h" -#if defined(__IPHONEOS__) || defined(__ANDROID__) || defined(__NACL__) +#if defined(__IPHONEOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__NACL__) #define HAVE_OPENGLES2 #endif @@ -466,6 +466,11 @@ void loop() SDL_GL_SwapWindow(state->windows[i]); } } +#ifdef __EMSCRIPTEN__ + else { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testhotplug.c b/libs/SDL2/test/testhotplug.c index 1b68db1e..b98380d9 100644 --- a/libs/SDL2/test/testhotplug.c +++ b/libs/SDL2/test/testhotplug.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testiconv.c b/libs/SDL2/test/testiconv.c index 1ab4c036..6576a87d 100644 --- a/libs/SDL2/test/testiconv.c +++ b/libs/SDL2/test/testiconv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testime.c b/libs/SDL2/test/testime.c index 6f7b6a54..4bddee17 100644 --- a/libs/SDL2/test/testime.c +++ b/libs/SDL2/test/testime.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testintersections.c b/libs/SDL2/test/testintersections.c index 77bb5146..d67b15e6 100644 --- a/libs/SDL2/test/testintersections.c +++ b/libs/SDL2/test/testintersections.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -257,6 +257,11 @@ loop() SDL_RenderPresent(renderer); } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testjoystick.c b/libs/SDL2/test/testjoystick.c index 72f056cc..9f06366c 100644 --- a/libs/SDL2/test/testjoystick.c +++ b/libs/SDL2/test/testjoystick.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -56,6 +56,12 @@ loop(void *arg) while (SDL_PollEvent(&event)) { switch (event.type) { + + case SDL_JOYDEVICEREMOVED: + SDL_Log("Joystick device %d removed.\n", (int) event.jdevice.which); + SDL_Log("Our instance ID is %d\n", (int) SDL_JoystickInstanceID(joystick)); + break; + case SDL_JOYAXISMOTION: SDL_Log("Joystick %d axis %d value: %d\n", event.jaxis.which, @@ -169,6 +175,12 @@ loop(void *arg) done = SDL_TRUE; retval = SDL_TRUE; /* keep going, wait for reattach. */ } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } static SDL_bool diff --git a/libs/SDL2/test/testkeys.c b/libs/SDL2/test/testkeys.c index 97f52a44..1c73df91 100644 --- a/libs/SDL2/test/testkeys.c +++ b/libs/SDL2/test/testkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testloadso.c b/libs/SDL2/test/testloadso.c index da7bab98..8b4e4180 100644 --- a/libs/SDL2/test/testloadso.c +++ b/libs/SDL2/test/testloadso.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testlock.c b/libs/SDL2/test/testlock.c index 92a5e9b3..c787dc31 100644 --- a/libs/SDL2/test/testlock.c +++ b/libs/SDL2/test/testlock.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testmessage.c b/libs/SDL2/test/testmessage.c index b0bf39c8..494bfddb 100644 --- a/libs/SDL2/test/testmessage.c +++ b/libs/SDL2/test/testmessage.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -69,7 +69,7 @@ button_messagebox(void *eventNumber) quit(2); } } - SDL_Log("Pressed button: %d, %s\n", button, button == 1 ? "Cancel" : "OK"); + SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK"); if (eventNumber) { SDL_UserEvent event; @@ -126,6 +126,16 @@ main(int argc, char *argv[]) quit(1); } + /* Google says this is Traditional Chinese for "beef with broccoli" */ + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "牛肉西蘭花", + "Unicode text in the title.", + NULL); + if (success == -1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); + quit(1); + } + button_messagebox(NULL); /* Test showing a message box from a background thread. diff --git a/libs/SDL2/test/testmultiaudio.c b/libs/SDL2/test/testmultiaudio.c index 4f979d53..e6939e0a 100644 --- a/libs/SDL2/test/testmultiaudio.c +++ b/libs/SDL2/test/testmultiaudio.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testnative.c b/libs/SDL2/test/testnative.c index c010445f..ae9bbc90 100644 --- a/libs/SDL2/test/testnative.c +++ b/libs/SDL2/test/testnative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testnative.h b/libs/SDL2/test/testnative.h index fa0bffc3..a373fa98 100644 --- a/libs/SDL2/test/testnative.h +++ b/libs/SDL2/test/testnative.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testnativew32.c b/libs/SDL2/test/testnativew32.c index f43c2209..7ca41500 100644 --- a/libs/SDL2/test/testnativew32.c +++ b/libs/SDL2/test/testnativew32.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testnativex11.c b/libs/SDL2/test/testnativex11.c index b60c999e..fc6fd9ab 100644 --- a/libs/SDL2/test/testnativex11.c +++ b/libs/SDL2/test/testnativex11.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testoverlay2.c b/libs/SDL2/test/testoverlay2.c index 69238fa4..47a633a2 100644 --- a/libs/SDL2/test/testoverlay2.c +++ b/libs/SDL2/test/testoverlay2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -312,6 +312,12 @@ loop() SDL_RenderClear(renderer); SDL_RenderCopy(renderer, MooseTexture, NULL, &displayrect); SDL_RenderPresent(renderer); + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testplatform.c b/libs/SDL2/test/testplatform.c index 232bfe65..51b0f178 100644 --- a/libs/SDL2/test/testplatform.c +++ b/libs/SDL2/test/testplatform.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -167,7 +167,7 @@ TestAssertions(SDL_bool verbose) #endif { - const SDL_assert_data *item = SDL_GetAssertionReport(); + const SDL_AssertData *item = SDL_GetAssertionReport(); while (item) { SDL_Log("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", item->condition, item->function, item->filename, diff --git a/libs/SDL2/test/testpower.c b/libs/SDL2/test/testpower.c index 058a53fc..b400f33b 100644 --- a/libs/SDL2/test/testpower.c +++ b/libs/SDL2/test/testpower.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testrelative.c b/libs/SDL2/test/testrelative.c index 3b6ef810..a8c57444 100644 --- a/libs/SDL2/test/testrelative.c +++ b/libs/SDL2/test/testrelative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ SDL_Event event; static void DrawRects(SDL_Renderer * renderer, SDL_Rect * rect) { - SDL_SetRenderDrawColor(renderer, 255, 127, 0, 255); + SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); SDL_RenderFillRect(renderer, rect); } @@ -53,7 +53,7 @@ loop(){ SDL_Renderer *renderer = state->renderers[i]; if (state->windows[i] == NULL) continue; - SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); SDL_RenderClear(renderer); /* Wrap the cursor rectangle at the screen edges to keep it visible */ @@ -67,6 +67,11 @@ loop(){ SDL_RenderPresent(renderer); } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testrendercopyex.c b/libs/SDL2/test/testrendercopyex.c index 379819ce..cc25dbac 100644 --- a/libs/SDL2/test/testrendercopyex.c +++ b/libs/SDL2/test/testrendercopyex.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -152,6 +152,11 @@ void loop() continue; Draw(&drawstates[i]); } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testrendertarget.c b/libs/SDL2/test/testrendertarget.c index c03e6394..0ae0a824 100644 --- a/libs/SDL2/test/testrendertarget.c +++ b/libs/SDL2/test/testrendertarget.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -241,6 +241,11 @@ loop() if (!Draw(&drawstates[i])) done = 1; } } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testresample.c b/libs/SDL2/test/testresample.c index 78335052..c21e660f 100644 --- a/libs/SDL2/test/testresample.c +++ b/libs/SDL2/test/testresample.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -115,4 +115,4 @@ main(int argc, char **argv) return 0; } /* main */ -/* end of resample_test.c ... */ +/* end of testresample.c ... */ diff --git a/libs/SDL2/test/testrumble.c b/libs/SDL2/test/testrumble.c index d72e5d94..1b05c9d2 100644 --- a/libs/SDL2/test/testrumble.c +++ b/libs/SDL2/test/testrumble.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testscale.c b/libs/SDL2/test/testscale.c index e52eacb4..d3edf676 100644 --- a/libs/SDL2/test/testscale.c +++ b/libs/SDL2/test/testscale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -142,6 +142,11 @@ loop() continue; Draw(&drawstates[i]); } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testsem.c b/libs/SDL2/test/testsem.c index 8d41e083..3431c5cb 100644 --- a/libs/SDL2/test/testsem.c +++ b/libs/SDL2/test/testsem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testshader.c b/libs/SDL2/test/testshader.c index 91ce3313..5daa127e 100644 --- a/libs/SDL2/test/testshader.c +++ b/libs/SDL2/test/testshader.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testshape.c b/libs/SDL2/test/testshape.c index 5538515a..1caf5a5d 100644 --- a/libs/SDL2/test/testshape.c +++ b/libs/SDL2/test/testshape.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testsprite2.c b/libs/SDL2/test/testsprite2.c index 17a9cd5f..ba3ce909 100644 --- a/libs/SDL2/test/testsprite2.c +++ b/libs/SDL2/test/testsprite2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -251,6 +251,11 @@ loop() continue; MoveSprites(state->renderers[i], sprites[i]); } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testspriteminimal.c b/libs/SDL2/test/testspriteminimal.c index fc7d31f1..3980b2fe 100644 --- a/libs/SDL2/test/testspriteminimal.c +++ b/libs/SDL2/test/testspriteminimal.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -136,6 +136,11 @@ void loop() } } MoveSprites(renderer, sprite); +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/teststreaming.c b/libs/SDL2/test/teststreaming.c index da618c4c..95881a7c 100644 --- a/libs/SDL2/test/teststreaming.c +++ b/libs/SDL2/test/teststreaming.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -115,6 +115,12 @@ loop() SDL_RenderClear(renderer); SDL_RenderCopy(renderer, MooseTexture, NULL, NULL); SDL_RenderPresent(renderer); + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testthread.c b/libs/SDL2/test/testthread.c index 75aed83f..3597fb84 100644 --- a/libs/SDL2/test/testthread.c +++ b/libs/SDL2/test/testthread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testtimer.c b/libs/SDL2/test/testtimer.c index f02364cd..95871453 100644 --- a/libs/SDL2/test/testtimer.c +++ b/libs/SDL2/test/testtimer.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testver.c b/libs/SDL2/test/testver.c index e59381f4..dce2167e 100644 --- a/libs/SDL2/test/testver.c +++ b/libs/SDL2/test/testver.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/test/testviewport.c b/libs/SDL2/test/testviewport.c index 2ac8031a..957498a6 100644 --- a/libs/SDL2/test/testviewport.c +++ b/libs/SDL2/test/testviewport.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -129,6 +129,12 @@ loop() SDL_RenderPresent(state->renderers[i]); } } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/testwm2.c b/libs/SDL2/test/testwm2.c index 8d8ff461..102437b9 100644 --- a/libs/SDL2/test/testwm2.c +++ b/libs/SDL2/test/testwm2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -100,6 +100,11 @@ loop() } } } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int diff --git a/libs/SDL2/test/torturethread.c b/libs/SDL2/test/torturethread.c index 2e572b64..efbab5e3 100644 --- a/libs/SDL2/test/torturethread.c +++ b/libs/SDL2/test/torturethread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2014 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/libs/SDL2/visualtest/COPYING.txt b/libs/SDL2/visualtest/COPYING.txt index 05460c3d..0f97d76c 100644 --- a/libs/SDL2/visualtest/COPYING.txt +++ b/libs/SDL2/visualtest/COPYING.txt @@ -15,4 +15,4 @@ freely, subject to the following restrictions: appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. \ No newline at end of file +3. This notice may not be removed or altered from any source distribution. diff --git a/libs/SDL2/visualtest/unittest/testquit.c b/libs/SDL2/visualtest/unittest/testquit.c index ceb83b0a..4393700f 100644 --- a/libs/SDL2/visualtest/unittest/testquit.c +++ b/libs/SDL2/visualtest/unittest/testquit.c @@ -98,4 +98,4 @@ main(int argc, char** argv) } return exit_code; -} \ No newline at end of file +}