diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 9d3ea9ae..7db15279 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ diff --git a/jni/SDL2-2.0.3/Android.mk b/jni/SDL2-2.0.3/Android.mk index fcf6c3dc..35decf32 100755 --- a/jni/SDL2-2.0.3/Android.mk +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/CMakeLists.txt b/jni/SDL2-2.0.3/CMakeLists.txt index b5e560f0..4c75ad61 100644 --- a/jni/SDL2-2.0.3/CMakeLists.txt +++ b/jni/SDL2-2.0.3/CMakeLists.txt @@ -2,7 +2,7 @@ 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) +cmake_minimum_required(VERSION 2.8) project(SDL2 C) include(CheckFunctionExists) include(CheckLibraryExists) @@ -117,6 +117,12 @@ else() set(UNIX_OR_MAC_SYS OFF) endif() +if (UNIX_OR_MAC_SYS AND NOT EMSCRIPTEN) # JavaScript does not yet have threading support, so disable pthreads when building for Emscripten. + set(SDL_PTHREADS_ENABLED_BY_DEFAULT ON) +else() + set(SDL_PTHREADS_ENABLED_BY_DEFAULT OFF) +endif() + # Default option knobs if(APPLE OR ARCH_64) set(OPT_DEF_SSEMATH ON) @@ -144,7 +150,7 @@ if("$ENV{CFLAGS}" STREQUAL "") if(USE_GCC OR USE_CLANG) set(CMAKE_C_FLAGS "-g -O3") endif() -else("$ENV{CFLAGS}" STREQUAL "") +else() set(CMAKE_C_FLAGS "$ENV{CFLAGS}") list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}") endif() @@ -161,7 +167,7 @@ if(MSVC) if(${flag_var} MATCHES "/MD") string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") endif() - endforeach(flag_var) + endforeach() endif() endif() @@ -170,13 +176,19 @@ endif() set(SDL_LIBS "-lSDL2") set(SDL_CFLAGS "") +# Emscripten toolchain has a nonempty default value for this, and the checks +# in this file need to change that, so remember the original value, and +# restore back to that afterwards. For check_function_exists() to work in +# Emscripten, this value must be at its default value. +set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + 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) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) if(HAVE_GCC_NO_CYGWIN) list(APPEND EXTRA_LDFLAGS "-mno-cygwin") list(APPEND SDL_LIBS "-mno-cygwin") @@ -188,12 +200,35 @@ add_definitions(-DUSING_GENERATED_CONFIG_H) # General includes 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 + # loading architecture, low-level CPU inspection or multithreading. + set(OPT_DEF_ASM FALSE) + set(SDL_SHARED_ENABLED_BY_DEFAULT OFF) + set(SDL_ATOMIC_ENABLED_BY_DEFAULT OFF) + set(SDL_THREADS_ENABLED_BY_DEFAULT OFF) + set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF) + set(SDL_CPUINFO_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) - option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON) + if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT) + set(SDL_${_OPT}_ENABLED_BY_DEFAULT ON) + endif() + option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ${SDL_${_OPT}_ENABLED_BY_DEFAULT}) endforeach() option_string(ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto") @@ -212,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" ${UNIX_OR_MAC_SYS}) +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" ON) +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) @@ -236,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) @@ -251,7 +289,7 @@ 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_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 @@ -317,7 +355,7 @@ if(USE_GCC OR USE_CLANG) 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 ${ORIG_CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden -Werror") check_c_source_compiles(" @@ -328,7 +366,7 @@ if(USE_GCC OR USE_CLANG) if(HAVE_GCC_FVISIBILITY) list(APPEND EXTRA_CFLAGS "-fvisibility=hidden") endif() - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) check_c_compiler_flag(-Wall HAVE_GCC_WALL) if(HAVE_GCC_WALL) @@ -376,7 +414,7 @@ if(ASSEMBLY) if(HAVE_MMX) list(APPEND EXTRA_CFLAGS "-mmmx") endif() - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) endif() if(3DNOW) @@ -393,7 +431,7 @@ if(ASSEMBLY) if(HAVE_3DNOW) list(APPEND EXTRA_CFLAGS "-m3dnow") endif() - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) endif() if(SSE) @@ -416,7 +454,7 @@ if(ASSEMBLY) if(HAVE_SSE) list(APPEND EXTRA_CFLAGS "-msse") endif() - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) endif() if(SSE2) @@ -439,7 +477,7 @@ if(ASSEMBLY) if(HAVE_SSE2) list(APPEND EXTRA_CFLAGS "-msse2") endif() - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) endif() if(SSEMATH) @@ -464,7 +502,7 @@ if(ASSEMBLY) return vec_splat_u32(0); } int main(int argc, char **argv) { }" HAVE_ALTIVEC) - set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS ${ORIG_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") @@ -486,7 +524,7 @@ if(ASSEMBLY) set(SDL_ASSEMBLY_ROUTINES 1) endif() # TODO: -#else(ASSEMBLY) +#else() # if(USE_GCC OR USE_CLANG) # list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx") # endif() @@ -518,7 +556,7 @@ if(LIBC) set(HAVE_M_PI 1) add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI set(STDC_HEADERS 1) - else(WINDOWS AND NOT MINGW) + else() set(HAVE_LIBC TRUE) check_include_file(sys/types.h HAVE_SYS_TYPES_H) foreach(_HEADER @@ -555,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}) @@ -567,11 +605,20 @@ 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) endif() -else(LIBC) +else() if(WINDOWS) set(HAVE_STDARG_H 1) set(HAVE_STDDEF_H 1) @@ -642,7 +689,49 @@ if(SDL_VIDEO) endif() # Platform-specific options and settings -if(UNIX AND NOT APPLE) +if(EMSCRIPTEN) + # Hide noisy warnings that intend to aid mostly during initial stages of porting a new + # project. Uncomment at will for verbose cross-compiling -I/../ path info. + add_definitions(-Wno-warn-absolute-paths) + if(SDL_AUDIO) + set(SDL_AUDIO_DRIVER_EMSCRIPTEN 1) + file(GLOB EM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/emscripten/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${EM_AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + endif() + if(SDL_FILESYSTEM) + set(SDL_FILESYSTEM_EMSCRIPTEN 1) + file(GLOB EM_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/emscripten/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${EM_FILESYSTEM_SOURCES}) + set(HAVE_SDL_FILESYSTEM TRUE) + endif() + if(SDL_JOYSTICK) + set(SDL_JOYSTICK_EMSCRIPTEN 1) + file(GLOB EM_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/emscripten/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${EM_JOYSTICK_SOURCES}) + set(HAVE_SDL_JOYSTICK TRUE) + endif() + if(SDL_POWER) + set(SDL_POWER_EMSCRIPTEN 1) + file(GLOB EM_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/emscripten/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${EM_POWER_SOURCES}) + set(HAVE_SDL_POWER TRUE) + endif() + if(SDL_VIDEO) + set(SDL_VIDEO_DRIVER_EMSCRIPTEN 1) + file(GLOB EM_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/emscripten/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${EM_VIDEO_SOURCES}) + set(HAVE_SDL_VIDEO TRUE) + + #enable gles + if(VIDEO_OPENGLES) + set(SDL_VIDEO_OPENGL_EGL 1) + set(HAVE_VIDEO_OPENGLES TRUE) + set(SDL_VIDEO_OPENGL_ES2 1) + set(SDL_VIDEO_RENDER_OGL_ES2 1) + endif() + endif() +elseif(UNIX AND NOT APPLE) if(SDL_AUDIO) if(SYSV5 OR SOLARIS OR HPUX) set(SDL_AUDIO_DRIVER_SUNAUDIO 1) @@ -752,7 +841,7 @@ if(UNIX AND NOT APPLE) if(FOUND_CLOCK_GETTIME) list(APPEND EXTRA_LIBS rt) set(HAVE_CLOCK_GETTIME 1) - else(FOUND_CLOCK_GETTIME) + else() check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME) if(FOUND_CLOCK_GETTIME) set(HAVE_CLOCK_GETTIME 1) @@ -811,25 +900,39 @@ 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\"") + + if(HAVE_WIN32_CC) + # xinput.h may need windows.h, but doesn't include it itself. + check_c_source_compiles(" + #include + #include + int main(int argc, char **argv) { }" HAVE_XINPUT_H) + else() + check_include_file(xinput.h HAVE_XINPUT_H) + endif() + 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 - link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}) - 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) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) endif() if(SDL_AUDIO) @@ -924,6 +1027,13 @@ elseif(WINDOWS) set(SDL_VIDEO_RENDER_OGL 1) set(HAVE_VIDEO_OPENGL TRUE) endif() + + if(VIDEO_OPENGLES) + set(SDL_VIDEO_OPENGL_EGL 1) + set(SDL_VIDEO_OPENGL_ES2 1) + set(SDL_VIDEO_RENDER_OGL_ES2 1) + set(HAVE_VIDEO_OPENGLES TRUE) + endif() endif() if(SDL_JOYSTICK) @@ -931,7 +1041,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) @@ -942,14 +1057,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() @@ -978,7 +1098,7 @@ elseif(APPLE) endif() if(SDL_AUDIO) - set(MACOSX_COREAUDIO 1) + set(SDL_AUDIO_DRIVER_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) @@ -1068,10 +1188,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() @@ -1193,14 +1309,14 @@ if(NOT WINDOWS OR CYGWIN) if(SDL_STATIC) set(ENABLE_STATIC_TRUE "") set(ENABLE_STATIC_FALSE "#") - else(SDL_STATIC) + else() set(ENABLE_STATIC_TRUE "#") set(ENABLE_STATIC_FALSE "") endif() if(SDL_SHARED) set(ENABLE_SHARED_TRUE "") set(ENABLE_SHARED_FALSE "#") - else(SDL_SHARED) + else() set(ENABLE_SHARED_TRUE "#") set(ENABLE_SHARED_FALSE "") endif() @@ -1281,7 +1397,7 @@ if(SDL_SHARED) VERSION ${LT_VERSION} SOVERSION ${LT_REVISION} OUTPUT_NAME "SDL2-${LT_RELEASE}") - else(UNIX) + else() set_target_properties(SDL2 PROPERTIES VERSION ${SDL_VERSION} SOVERSION ${LT_REVISION} @@ -1309,7 +1425,8 @@ endif() ##### Installation targets ##### 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) @@ -1330,17 +1447,13 @@ if(NOT WINDOWS OR CYGWIN) if(FREEBSD) # FreeBSD uses ${PREFIX}/libdata/pkgconfig install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig") - else(FREEBSD) + else() install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig") endif() 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/jni/SDL2-2.0.3/COPYING.txt b/jni/SDL2-2.0.3/COPYING.txt index e0d7cc43..5873af74 100644 --- a/jni/SDL2-2.0.3/COPYING.txt +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/Makefile.in b/jni/SDL2-2.0.3/Makefile.in index 62b9269e..b66e0f5e 100644 --- a/jni/SDL2-2.0.3/Makefile.in +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/SDL2.spec.in b/jni/SDL2-2.0.3/SDL2.spec.in index 2a5c4792..dba24003 100644 --- a/jni/SDL2-2.0.3/SDL2.spec.in +++ b/jni/SDL2-2.0.3/SDL2.spec.in @@ -1,7 +1,7 @@ Summary: Simple DirectMedia Layer Name: SDL2 Version: @SDL_VERSION@ -Release: 1 +Release: 2 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz URL: http://www.libsdl.org/ License: zlib @@ -63,12 +63,12 @@ rm -rf $RPM_BUILD_ROOT %files %{__defattr} -%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt +%doc README*.txt COPYING.txt CREDITS.txt BUGS.txt %{_libdir}/lib*.%{__soext}.* %files devel %{__defattr} -%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew +%doc docs/README*.md %{_bindir}/*-config %{_libdir}/lib*.a %{_libdir}/lib*.la @@ -78,13 +78,19 @@ 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 + * Sun Jan 22 2012 Sam Lantinga - Updated for SDL 2.0 * Tue May 16 2006 Sam Lantinga - Removed support for Darwin, due to build problems on ps2linux -* Mon Jan 03 2004 Anders Bjorklund +* Sat Jan 03 2004 Anders Bjorklund - Added support for Darwin, updated spec file * Wed Jan 19 2000 Sam Lantinga diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj b/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj deleted file mode 100644 index b325cd0b..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj +++ /dev/null @@ -1,439 +0,0 @@ - - - - - Debug - Win32 - - - Debug - ARM - - - Release - Win32 - - - Release - ARM - - - - {33048af1-031a-4ce6-b61e-fad2db832e9e} - SDL - en-US - 11.0 - SDL2-WinPhone80 - - - - DynamicLibrary - true - v110_wp80 - false - - - DynamicLibrary - true - v110_wp80 - false - - - DynamicLibrary - false - true - v110_wp80 - false - - - DynamicLibrary - false - true - v110_wp80 - false - - - - - - - - false - - - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - - _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - NotUsing - pch.h - false - $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) - ..\..\include - false - - - Console - false - false - true - DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies) - - - - - _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;NDEBUG;%(PreprocessorDefinitions) - NotUsing - pch.h - false - $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) - ..\..\include - - - Console - false - false - true - DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies) - - - - - _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - NotUsing - pch.h - false - $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) - ..\..\include - false - - - Console - false - false - true - DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies) - - - - - _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;NDEBUG;%(PreprocessorDefinitions) - NotUsing - pch.h - false - $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) - ..\..\include - - - Console - false - false - true - DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies) - - - - - true - - - true - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters b/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters deleted file mode 100644 index f52e56bf..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters +++ /dev/null @@ -1,654 +0,0 @@ - - - - - {02b21b9a-45a7-41ee-a8a6-e45d14aa28da} - - - {abc3a7e6-f955-4cb5-8340-fae0f653e9c1} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj b/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj deleted file mode 100644 index ae13b9cc..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj +++ /dev/null @@ -1,446 +0,0 @@ - - - - - Debug - ARM - - - Debug - Win32 - - - Release - ARM - - - Release - Win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - {48fadc0e-964d-4dab-bced-372e0ad19577} - SDL_WinRT81 - en-US - 12.0 - true - Windows Phone - 8.1 - CodeSharingDll - SDL2-WinPhone81 - - - - DynamicLibrary - true - v120_wp81 - - - DynamicLibrary - true - v120_wp81 - - - DynamicLibrary - false - true - v120_wp81 - - - DynamicLibrary - false - true - v120_wp81 - - - - - - - - - - - - - - - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies) - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters b/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters deleted file mode 100644 index b0e044d5..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters +++ /dev/null @@ -1,690 +0,0 @@ - - - - - {d54aa32d-ba0b-491f-ac04-c9b87dd4bc69} - - - {6945cfdb-2dd6-4f78-bbcb-f899c2a86e4a} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.sln b/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.sln deleted file mode 100644 index dc3a6dda..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL-WinRT", "SDL-WinRT80.vcxproj", "{AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM = Release|ARM - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|ARM.ActiveCfg = Debug|ARM - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|ARM.Build.0 = Debug|ARM - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|Win32.ActiveCfg = Debug|Win32 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|Win32.Build.0 = Debug|Win32 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|x64.ActiveCfg = Debug|x64 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|x64.Build.0 = Debug|x64 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|ARM.ActiveCfg = Release|ARM - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|ARM.Build.0 = Release|ARM - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|Win32.ActiveCfg = Release|Win32 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|Win32.Build.0 = Release|Win32 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|x64.ActiveCfg = Release|x64 - {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj b/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj deleted file mode 100644 index fbcd94b6..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj +++ /dev/null @@ -1,548 +0,0 @@ - - - - - Debug - ARM - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - true - true - true - true - true - true - - - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {aeaea3a2-d4e6-45b1-8ec6-53d84287fc14} - Win32Proj - SDL2-WinRT80 - SDL_VS2012_WinRT - en-US - 11.0 - true - - - - DynamicLibrary - true - v110 - - - DynamicLibrary - true - v110 - - - DynamicLibrary - true - v110 - - - DynamicLibrary - false - true - v110 - - - DynamicLibrary - false - true - v110 - - - DynamicLibrary - false - true - v110 - - - - - - - - - - - - - - - - - - - - - - - - false - false - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - false - false - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - false - false - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - false - false - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - false - false - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - false - false - SDL2 - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters b/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters deleted file mode 100644 index aa539d37..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters +++ /dev/null @@ -1,726 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - {20773b57-7034-4c24-af5a-334844585f1b} - - - {ddf04d85-6a87-4c5a-bc52-869b38f45a61} - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj b/jni/SDL2-2.0.3/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj deleted file mode 100644 index 7665cc47..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj +++ /dev/null @@ -1,550 +0,0 @@ - - - - - Debug - ARM - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - true - true - - - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - true - true - true - true - true - true - - - - {c8df6173-06a1-4f56-a9bc-2002596b30e9} - SDL_WinRT81 - en-US - 12.0 - true - Windows Store - 8.1 - CodeSharingDll - SDL2-WinRT81 - - - - DynamicLibrary - true - v120 - - - DynamicLibrary - true - v120 - - - DynamicLibrary - true - v120 - - - DynamicLibrary - false - true - v120 - - - DynamicLibrary - false - true - v120 - - - DynamicLibrary - false - true - v120 - - - - - - - - - - - - - - - - - - - - - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - false - false - Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ - SDL2 - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - NotUsing - false - ..\..\include;%(AdditionalIncludeDirectories) - _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - - - Console - false - false - xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies) - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters b/jni/SDL2-2.0.3/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters deleted file mode 100644 index 502f92cf..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters +++ /dev/null @@ -1,717 +0,0 @@ - - - - - {7c1f964c-e351-49dd-8651-5d5b6b603856} - - - {450d92fd-978d-4025-87a9-6f688f946427} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/Logo.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/Logo.png deleted file mode 100644 index e26771cb..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/Logo.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png deleted file mode 100644 index 1eb0d9d5..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png deleted file mode 100644 index c951e031..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png deleted file mode 100644 index dcb67271..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Package.appxmanifest b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Package.appxmanifest deleted file mode 100644 index 3b62bf1b..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/Package.appxmanifest +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - loopwave_VS2012_WinRT - David - Assets\StoreLogo.png - - - - 6.2.1 - 6.2.1 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj deleted file mode 100644 index 44c32813..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj +++ /dev/null @@ -1,170 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - Debug - ARM - - - Release - ARM - - - - {03fcc293-9406-49c2-acf6-6e7d460c3239} - loopwave_VS2012 - en-US - 11.0 - true - loopwave - - - - Application - true - v110 - - - Application - true - v110 - - - Application - true - v110 - - - Application - false - true - v110 - - - Application - false - true - v110 - - - Application - false - true - v110 - - - - - - - - - - - - - - - - - - - - - - - - - loopwave_VS2012_TemporaryKey.pfx - - - - d2d1.lib; d3d11.lib; dxgi.lib; ole32.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);$(ProjectDir)..\..\..\include;%(AdditionalIncludeDirectories) - 4453 - - - - - NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - NotUsing - NotUsing - NotUsing - false - false - false - - - - - _DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - NotUsing - NotUsing - NotUsing - false - false - false - - - - - - - - - - - Designer - - - - - - true - true - true - true - true - true - - - false - false - false - false - false - false - - - - - - - - {aeaea3a2-d4e6-45b1-8ec6-53d84287fc14} - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx b/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx deleted file mode 100644 index 3c07b779..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/Logo.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/Logo.png deleted file mode 100644 index e26771cb..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/Logo.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png deleted file mode 100644 index 1eb0d9d5..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png deleted file mode 100644 index c951e031..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png deleted file mode 100644 index dcb67271..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Package.appxmanifest b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Package.appxmanifest deleted file mode 100644 index f02b3a17..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/Package.appxmanifest +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - testthread_VS2012_WinRT - David - Assets\StoreLogo.png - - - - 6.2.1 - 6.2.1 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj deleted file mode 100644 index ba1dbc05..00000000 --- a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj +++ /dev/null @@ -1,160 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - Debug - ARM - - - Release - ARM - - - - {a8705bee-d01d-46a4-b2ab-feedfb5fdd11} - testthread_VS2012 - en-US - 11.0 - true - testthread - - - - Application - true - v110 - - - Application - true - v110 - - - Application - true - v110 - - - Application - false - true - v110 - - - Application - false - true - v110 - - - Application - false - true - v110 - - - - - - - - - - - - - - - - - - - - - - - - - testthread_VS2012_TemporaryKey.pfx - - - - d2d1.lib; d3d11.lib; dxgi.lib; ole32.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);$(ProjectDir)..\..\..\include;%(AdditionalIncludeDirectories) - 4453 - - - - - NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - NotUsing - NotUsing - NotUsing - false - false - false - - - - - _DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - NotUsing - NotUsing - NotUsing - false - false - false - - - - - - - - - - - Designer - - - - - - true - true - true - true - true - true - - - - - - {aeaea3a2-d4e6-45b1-8ec6-53d84287fc14} - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx b/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx deleted file mode 100644 index 97fd1e19..00000000 Binary files a/jni/SDL2-2.0.3/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx and /dev/null differ diff --git a/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2008.vcproj deleted file mode 100644 index bf33777c..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2008.vcproj +++ /dev/null @@ -1,1526 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2010.vcxproj deleted file mode 100644 index ec073402..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2010.vcxproj +++ /dev/null @@ -1,517 +0,0 @@ - - - - - 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 diff --git a/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2012.vcxproj deleted file mode 100644 index 1dade200..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2012.vcxproj +++ /dev/null @@ -1,521 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/SDL/SDL_VS2013.vcxproj deleted file mode 100644 index 89dbc00a..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/SDL_VS2008.sln b/jni/SDL2-2.0.3/VisualC/SDL_VS2008.sln deleted file mode 100644 index 009df2c7..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDL_VS2008.sln +++ /dev/null @@ -1,202 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2008.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" -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}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2008.vcproj", "{66B32F7E-5716-48D0-B5B9-D832FD052DD5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_VS2008.vcproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2008.vcproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2008.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2008.vcproj", "{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2008.vcproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08304}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2008.vcproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2008.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2008.vcproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2008.vcproj", "{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrumble", "tests\testrumble\testrumble_VS2008.vcproj", "{BFF40245-E9A6-4297-A425-A554E5D767E8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2008.vcproj", "{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2008.vcproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2008.vcproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2008.vcproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" -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|Win32 - {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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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}.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 - {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-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 - 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} - EndGlobalSection -EndGlobal diff --git a/jni/SDL2-2.0.3/VisualC/SDL_VS2010.sln b/jni/SDL2-2.0.3/VisualC/SDL_VS2010.sln deleted file mode 100644 index 9ae8f44f..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/SDL_VS2012.sln b/jni/SDL2-2.0.3/VisualC/SDL_VS2012.sln deleted file mode 100644 index cdf6bafc..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/SDL_VS2013.sln b/jni/SDL2-2.0.3/VisualC/SDL_VS2013.sln deleted file mode 100644 index 0804b5e2..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2008.vcproj deleted file mode 100644 index 33c24171..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2008.vcproj +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2010.vcxproj deleted file mode 100644 index 711f08ac..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2010.vcxproj +++ /dev/null @@ -1,168 +0,0 @@ - - - - - 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 diff --git a/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2012.vcxproj deleted file mode 100644 index c6c65d23..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2012.vcxproj +++ /dev/null @@ -1,172 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/SDLmain/SDLmain_VS2013.vcxproj deleted file mode 100644 index 3b90f23f..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2008.vcproj deleted file mode 100644 index ccaabe2d..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2008.vcproj +++ /dev/null @@ -1,484 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2010.vcxproj deleted file mode 100644 index 9433ff88..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2010.vcxproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDL2test - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - - - - 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 diff --git a/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2012.vcxproj deleted file mode 100644 index 256bbf2f..00000000 --- a/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2012.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/SDLtest/SDLtest_VS2013.vcxproj deleted file mode 100644 index a515ab08..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/clean.sh b/jni/SDL2-2.0.3/VisualC/clean.sh deleted file mode 100755 index f90a11e9..00000000 --- a/jni/SDL2-2.0.3/VisualC/clean.sh +++ /dev/null @@ -1,5 +0,0 @@ -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 {} \; diff --git a/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj deleted file mode 100644 index de0be502..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj deleted file mode 100644 index 76c573a7..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj deleted file mode 100644 index f9ba52a7..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/checkkeys/checkkeys_VS2013.vcxproj deleted file mode 100644 index e02d5a00..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2008.vcproj deleted file mode 100644 index 1a80c413..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2008.vcproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2010.vcxproj deleted file mode 100644 index e2e60e5f..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2012.vcxproj deleted file mode 100644 index 800d1dac..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2012.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - loopwave - loopwave - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} - - - - 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 - - - - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/loopwave/loopwave_VS2013.vcxproj deleted file mode 100644 index 591d587b..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2008.vcproj deleted file mode 100644 index 8d15bfcb..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2010.vcxproj deleted file mode 100644 index 98ef0b24..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2012.vcxproj deleted file mode 100644 index 632b8bf8..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testatomic - {2271060E-98B4-4596-8172-A041E4B2EC7A} - testatomic - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testatomic/testatomic_VS2013.vcxproj deleted file mode 100644 index 8fa361f0..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_VS2008.vcproj deleted file mode 100755 index b4875a3b..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_VS2008.vcproj +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2010.vcxproj deleted file mode 100644 index 36821294..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2010.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2012.vcxproj deleted file mode 100644 index dc2d8102..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testautomation/testautomation_vs2013.vcxproj deleted file mode 100644 index 3c7e3615..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj deleted file mode 100644 index d1ddec6c..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj deleted file mode 100644 index 931aa742..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj +++ /dev/null @@ -1,212 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj deleted file mode 100644 index d8cb3bb9..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testdraw2 - testdraw2 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} - - - - 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} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testdraw2/testdraw2_VS2013.vcxproj deleted file mode 100644 index db05bc18..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2008.vcproj deleted file mode 100644 index 2544d7b7..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2010.vcxproj deleted file mode 100644 index b48d47cd..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2012.vcxproj deleted file mode 100644 index 0eaea935..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testfile - testfile - {CAE4F1D0-314F-4B10-805B-0EFD670133A0} - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testfile/testfile_VS2013.vcxproj deleted file mode 100644 index 3a0e8cb8..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj deleted file mode 100644 index 4fa5e266..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj +++ /dev/null @@ -1,253 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgamecontroller - testgamecontroller - {55812185-D13C-4022-9C81-32E0F4A08336} - - - - 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 - - - - - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj deleted file mode 100644 index 21301a49..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj +++ /dev/null @@ -1,257 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgamecontroller - testgamecontroller - {55812185-D13C-4022-9C81-32E0F4A08336} - - - - 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 - - - - - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgamecontroller/testgamecontroller_VS2013.vcxproj deleted file mode 100644 index b7763fd2..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2008.vcproj deleted file mode 100644 index fbab93f8..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2010.vcxproj deleted file mode 100644 index c600615c..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgesture - testgesture - {55812185-D13C-4022-9C81-32E0F4A08996} - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2012.vcxproj deleted file mode 100644 index ed468f8d..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgesture/testgesture_VS2013.vcxproj deleted file mode 100644 index 754c5950..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2008.vcproj deleted file mode 100644 index a99d68c6..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2008.vcproj +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2010.vcxproj deleted file mode 100644 index 48d9e14e..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2010.vcxproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgl2 - testgl2 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} - - - - 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_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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2012.vcxproj deleted file mode 100644 index 84b81283..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2012.vcxproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgl2 - testgl2 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} - - - - 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_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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2013.vcxproj deleted file mode 100644 index 7a0be7e3..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgl2/testgl2_VS2013.vcxproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2008.vcproj deleted file mode 100644 index a357ca25..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2008.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2010.vcxproj deleted file mode 100644 index 3347870e..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2010.vcxproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2012.vcxproj deleted file mode 100644 index df5dd0ee..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testgles2/testgles2_VS2013.vcxproj deleted file mode 100644 index bc3970a2..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj deleted file mode 100644 index 92b3cf55..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj deleted file mode 100644 index 1828c576..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testjoystick - testjoystick - {55812185-D13C-4022-9C81-32E0F4A08BCC} - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj deleted file mode 100644 index f62bfdce..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testjoystick/testjoystick_VS2013.vcxproj deleted file mode 100644 index dd56e167..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj deleted file mode 100644 index d7d48e87..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj deleted file mode 100644 index e4557563..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj deleted file mode 100644 index ae7b729e..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testoverlay2 - testoverlay2 - {55812185-D13C-4022-9C81-32E0F4A08AAD} - - - - 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} - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testoverlay2/testoverlay2_VS2013.vcxproj deleted file mode 100644 index 339a14c2..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2008.vcproj deleted file mode 100644 index 580f4e1a..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2008.vcproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2010.vcxproj deleted file mode 100644 index 61c3ea36..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2010.vcxproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testplatform - testplatform - {26932B24-EFC6-4E3A-B277-ED653DA37968} - - - - 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) - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2012.vcxproj deleted file mode 100644 index e1e93fe1..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2012.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testplatform - testplatform - {26932B24-EFC6-4E3A-B277-ED653DA37968} - - - - 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) - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2013.vcxproj deleted file mode 100644 index 8cfcbe46..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testplatform/testplatform_VS2013.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2008.vcproj deleted file mode 100644 index 7194270d..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2010.vcxproj deleted file mode 100644 index 5624ff88..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testpower - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} - testpower - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2012.vcxproj deleted file mode 100644 index d7836727..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testpower/testpower_VS2013.vcxproj deleted file mode 100644 index 4055b766..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj deleted file mode 100644 index 9c96c26c..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj deleted file mode 100644 index 23247e5c..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj deleted file mode 100644 index 59c5d45f..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testrendertarget - {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} - testrendertarget - - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - v110 - - - Application - false - 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} - - - {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/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testrendertarget/testrendertarget_VS2013.vcxproj deleted file mode 100644 index ad1a477c..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2008.vcproj deleted file mode 100644 index 07851577..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2010.vcxproj deleted file mode 100644 index b5b571f1..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testrumble - {91B7737A-2A78-4020-820E-81A679DBEC72} - testrumble - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2012.vcxproj deleted file mode 100644 index 59ab8722..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testrumble/testrumble_VS2013.vcxproj deleted file mode 100644 index 384c4f69..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2008.vcproj deleted file mode 100644 index b0ab25d9..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2008.vcproj +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2010.vcxproj deleted file mode 100644 index d0caa69a..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2012.vcxproj deleted file mode 100644 index 482d5797..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2012.vcxproj +++ /dev/null @@ -1,246 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testscale - {E7A6C41C-E059-4C9C-8CCC-73586A540B62} - testscale - - - - 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} - - - {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/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testscale/testscale_VS2013.vcxproj deleted file mode 100644 index 5d2f5937..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2008.vcproj deleted file mode 100644 index e2e163ab..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2008.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2010.vcxproj deleted file mode 100644 index 1e6d769f..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2010.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testshape - testshape - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2012.vcxproj deleted file mode 100644 index 4ff1ec67..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2012.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - 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/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testshape/testshape_VS2013.vcxproj deleted file mode 100644 index 2c4ce12a..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj b/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj deleted file mode 100644 index 7caa579e..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj deleted file mode 100644 index e38038ad..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj +++ /dev/null @@ -1,228 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testsprite2 - testsprite2 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} - - - - 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 - - - - - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj deleted file mode 100644 index 18bf9281..00000000 --- a/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testsprite2 - testsprite2 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} - - - - 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 - - - - - - - - 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} - - - - - - diff --git a/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2013.vcxproj b/jni/SDL2-2.0.3/VisualC/tests/testsprite2/testsprite2_VS2013.vcxproj deleted file mode 100644 index 299a9bd0..00000000 --- a/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj deleted file mode 100755 index 219b864b..00000000 --- a/jni/SDL2-2.0.3/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testquit - testquit - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8} - - - - 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} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/VisualC/visualtest/visualtest_VS2012.vcxproj b/jni/SDL2-2.0.3/VisualC/visualtest/visualtest_VS2012.vcxproj deleted file mode 100755 index 9244b6a2..00000000 --- a/jni/SDL2-2.0.3/VisualC/visualtest/visualtest_VS2012.vcxproj +++ /dev/null @@ -1,304 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - visualtest - visualtest - {13DDF23A-4A8F-4AF9-9734-CC09D9157924} - - - - 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 - - - testharness - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - false - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Shlwapi.lib;%(AdditionalDependencies) - false - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/jni/SDL2-2.0.3/WhatsNew.txt b/jni/SDL2-2.0.3/WhatsNew.txt index 48209e85..b37591d8 100644 --- a/jni/SDL2-2.0.3/WhatsNew.txt +++ b/jni/SDL2-2.0.3/WhatsNew.txt @@ -6,10 +6,91 @@ 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 +* Added SDL_GetDisplayDPI() to get the DPI information for a display +* Added SDL_JoystickCurrentPowerLevel() to get the battery level of a joystick +* Added SDL_JoystickFromInstanceID(), as a helper function, to get the SDL_Joystick* that an event is referring to. +* Added SDL_GameControllerFromInstanceID(), as a helper function, to get the SDL_GameController* that an event is referring to. + +Windows: +* Added support for Windows Phone 8.1 and Windows 10/UWP (Universal Windows Platform) +* 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 a hint SDL_HINT_VIDEO_X11_NET_WM_PING to allow disabling _NET_WM_PING protocol handling in SDL_CreateWindow() +* 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 MFi game controllers +* 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 +* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER +* 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 +* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER +* Added support for SDL_ShowMessageBox() and SDL_ShowSimpleMessageBox() + +Raspberry Pi: +* Added support for the Raspberry Pi 2 + --------------------------------------------------------------------------- 2.0.3: diff --git a/jni/SDL2-2.0.3/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj index 5cff3547..569d2d13 100755 --- a/jni/SDL2-2.0.3/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj @@ -17,6 +17,13 @@ FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; }; FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; }; FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; }; + FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; + FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; + FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; + FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; + FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; + FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; + FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; }; FD15FD690E086911003BDF25 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; FD15FD6A0E086911003BDF25 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; FD15FD6B0E086911003BDF25 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; @@ -177,6 +184,7 @@ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + FAE0E9691BAF96A00098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; FD15FCB20E086866003BDF25 /* Happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Happy.app; sourceTree = BUILT_PRODUCTS_DIR; }; FD1B48920E313154007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; }; FD5F9BE40E0DEBEA008E885B /* Accel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Accel.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -217,6 +225,7 @@ buildActionMask = 2147483647; files = ( FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */, + FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */, FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */, FDF0D7AB0E12D53800247964 /* CoreAudio.framework in Frameworks */, FDF0D7AC0E12D53800247964 /* AudioToolbox.framework in Frameworks */, @@ -233,6 +242,7 @@ buildActionMask = 2147483647; files = ( FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */, + FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */, FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */, FDF0D7A90E12D53500247964 /* CoreAudio.framework in Frameworks */, FDF0D7AA0E12D53500247964 /* AudioToolbox.framework in Frameworks */, @@ -249,6 +259,7 @@ buildActionMask = 2147483647; files = ( FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */, + FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */, FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */, FDF0D7A70E12D53200247964 /* CoreAudio.framework in Frameworks */, FDF0D7A80E12D53200247964 /* AudioToolbox.framework in Frameworks */, @@ -265,6 +276,7 @@ buildActionMask = 2147483647; files = ( FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */, + FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */, FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */, FDB652020E43D1F300F688B5 /* Foundation.framework in Frameworks */, FDB652030E43D1F300F688B5 /* UIKit.framework in Frameworks */, @@ -281,6 +293,7 @@ buildActionMask = 2147483647; files = ( FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */, + FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */, FA8B4BA61967072100F8EB7C /* CoreMotion.framework in Frameworks */, FDF0D7950E12D52900247964 /* CoreAudio.framework in Frameworks */, FDF0D7960E12D52900247964 /* AudioToolbox.framework in Frameworks */, @@ -297,6 +310,7 @@ buildActionMask = 2147483647; files = ( FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */, + FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */, FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */, FDC52ED40E2843D6008D768C /* Foundation.framework in Frameworks */, FDC52ED50E2843D6008D768C /* UIKit.framework in Frameworks */, @@ -313,6 +327,7 @@ buildActionMask = 2147483647; files = ( FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */, + FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */, FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */, FDF0D69C0E12D05400247964 /* Foundation.framework in Frameworks */, FDF0D69D0E12D05400247964 /* UIKit.framework in Frameworks */, @@ -367,6 +382,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + FAE0E9691BAF96A00098DFA4 /* GameController.framework */, FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */, FDF0D7220E12D31800247964 /* AudioToolbox.framework */, FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */, @@ -571,7 +587,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 +834,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/jni/SDL2-2.0.3/Xcode-iOS/Demos/src/fireworks.c b/jni/SDL2-2.0.3/Xcode-iOS/Demos/src/fireworks.c index 6c60dd12..a5beada9 100644 --- a/jni/SDL2-2.0.3/Xcode-iOS/Demos/src/fireworks.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj index 44055cae..9f0d62e8 100755 --- a/jni/SDL2-2.0.3/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj @@ -143,6 +143,7 @@ AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */; }; AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; }; AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */; }; + FAD4F7021BA3C4E8008346CE /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */; settings = {ASSET_TAGS = (); }; }; FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; }; FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; }; FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; }; @@ -339,6 +340,7 @@ AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmessagebox.h; sourceTree = ""; }; AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmessagebox.m; sourceTree = ""; }; AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; }; + FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick_c.h; sourceTree = ""; }; FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitview.h; sourceTree = ""; }; FD3F4A700DEA620800C5B771 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = ""; }; FD3F4A710DEA620800C5B771 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = ""; }; @@ -634,6 +636,7 @@ FD689EFF0E26E5B600F90B21 /* iphoneos */ = { isa = PBXGroup; children = ( + FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */, FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */, ); path = iphoneos; @@ -1037,6 +1040,7 @@ AA7558BE1595D55500BBD41B /* SDL_scancode.h in Headers */, AA7558BF1595D55500BBD41B /* SDL_shape.h in Headers */, AA7558C01595D55500BBD41B /* SDL_stdinc.h in Headers */, + FAD4F7021BA3C4E8008346CE /* SDL_sysjoystick_c.h in Headers */, AA7558C11595D55500BBD41B /* SDL_surface.h in Headers */, AA7558C21595D55500BBD41B /* SDL_system.h in Headers */, AA7558C31595D55500BBD41B /* SDL_syswm.h in Headers */, @@ -1082,7 +1086,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 +1257,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 +1270,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,8 +1279,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; - IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; PRODUCT_NAME = SDL2; SKIP_INSTALL = YES; }; @@ -1284,8 +1294,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; - IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; PRODUCT_NAME = SDL2; SKIP_INSTALL = YES; }; diff --git a/jni/SDL2-2.0.3/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj index 1411ab41..ef12dd88 100755 --- a/jni/SDL2-2.0.3/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 944A656F195747D90094A81E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 944A656E1957463F0094A81E /* libSDL2.a */; }; 945C4F53195AF17F00DBBF61 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 945C4F52195AF17F00DBBF61 /* Default-568h@2x.png */; }; FA8B4B97196703B400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4B96196703B400F8EB7C /* CoreMotion.framework */; }; + FAE0E9651BAF967F0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9641BAF967F0098DFA4 /* GameController.framework */; }; FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; }; FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07C0E26BD8C00F39101 /* Icon.png */; }; FD77A07F0E26BDA900F39101 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07E0E26BDA900F39101 /* Default.png */; }; @@ -42,6 +43,7 @@ 944A65681957463F0094A81E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../../SDL/SDL.xcodeproj; sourceTree = ""; }; 945C4F52195AF17F00DBBF61 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; FA8B4B96196703B400F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + FAE0E9641BAF967F0098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; FD779EDD0E26BA1200F39101 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; FD77A07C0E26BD8C00F39101 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; FD77A07E0E26BDA900F39101 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; @@ -56,6 +58,7 @@ buildActionMask = 2147483647; files = ( 944A656F195747D90094A81E /* libSDL2.a in Frameworks */, + FAE0E9651BAF967F0098DFA4 /* GameController.framework in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */, @@ -112,6 +115,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + FAE0E9641BAF967F0098DFA4 /* GameController.framework */, FA8B4B96196703B400F8EB7C /* CoreMotion.framework */, FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */, FD77A0840E26BDB800F39101 /* AudioToolbox.framework */, diff --git a/jni/SDL2-2.0.3/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj index 6bcdec04..6b13cad1 100755 --- a/jni/SDL2-2.0.3/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj @@ -65,6 +65,30 @@ AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */; }; + FA0EF22E1BAF4654000E07A6 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; settings = {ASSET_TAGS = (); }; }; + FA684F7B1BAF1A4400DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F7F1BAF1A4D00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F801BAF1A5000DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F811BAF1A5300DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F821BAF1A5700DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F831BAF1A5A00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F841BAF1A5C00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F851BAF1A6000DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F861BAF1A6200DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F871BAF1A6500DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F881BAF1A6800DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F891BAF1A6A00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F8A1BAF1A6D00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F8B1BAF1A7100DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F8C1BAF1A7400DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F8D1BAF1A7800DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F8E1BAF1A7B00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F8F1BAF1A7E00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F901BAF1A8100DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F911BAF1A8400DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F921BAF1A8700DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F931BAF1A8A00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FA684F941BAF1A9400DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; FA8B4BAD1967076F00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; FA8B4BC9196766BC00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; FA8B4BCD196766BF00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; @@ -88,6 +112,21 @@ FA8B4BDF196766F100F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; FA8B4BE0196766F400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; FA8B4BE1196766F600F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; + FAE0E9821BAF9B230098DFA4 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + FAE0E9861BAF9B230098DFA4 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FAE0E9871BAF9B230098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; }; + FAE0E9881BAF9B230098DFA4 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; }; + FAE0E9891BAF9B230098DFA4 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FAE0E98A1BAF9B230098DFA4 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FAE0E98B1BAF9B230098DFA4 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FAE0E98C1BAF9B230098DFA4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FAE0E98D1BAF9B230098DFA4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FAE0E98E1BAF9B230098DFA4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FAE0E98F1BAF9B230098DFA4 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FAE0E9951BAF9B510098DFA4 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */; settings = {ASSET_TAGS = (); }; }; + FAE0E9961BAF9B650098DFA4 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; settings = {ASSET_TAGS = (); }; }; + FAE0E9971BAF9B6A0098DFA4 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; settings = {ASSET_TAGS = (); }; }; + FAE0E9981BAF9B6E0098DFA4 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; settings = {ASSET_TAGS = (); }; }; FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75F0E2D0F1600EA573E /* testwm2.c */; }; FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; @@ -188,7 +227,6 @@ FDD2C19F0E2E534F00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; FDD2C1A00E2E534F00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; FDD2C1A10E2E534F00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; - FDD2C1A80E2E536400B7A85F /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; }; FDD2C4540E2E773800B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; FDD2C4550E2E773800B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; FDD2C4560E2E773800B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; @@ -288,7 +326,13 @@ AAE7DF4514CBB43900DF1A0E /* testscale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = ""; }; AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendertarget.app; sourceTree = BUILT_PRODUCTS_DIR; }; AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = ""; }; + FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgamecontroller.c; path = ../../test/testgamecontroller.c; sourceTree = ""; }; + FA0EF2281BAF4487000E07A6 /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = axis.bmp; path = ../../test/axis.bmp; sourceTree = ""; }; + FA0EF2291BAF4487000E07A6 /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = button.bmp; path = ../../test/button.bmp; sourceTree = ""; }; + FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = controllermap.bmp; path = ../../test/controllermap.bmp; sourceTree = ""; }; + FA684F7A1BAF1A4400DCFD1A /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgamecontroller.app; sourceTree = BUILT_PRODUCTS_DIR; }; FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; }; FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; }; FDA8A7470E2D0F1600EA573E /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; }; @@ -347,6 +391,7 @@ buildActionMask = 2147483647; files = ( 046CEF7B13254F23007AD51D /* libSDL2.a in Frameworks */, + FA684F841BAF1A5C00DCFD1A /* GameController.framework in Frameworks */, FA8B4BD1196766C900F8EB7C /* CoreMotion.framework in Frameworks */, 046CEF7C13254F23007AD51D /* AudioToolbox.framework in Frameworks */, 046CEF7D13254F23007AD51D /* QuartzCore.framework in Frameworks */, @@ -364,6 +409,7 @@ files = ( AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */, 047A63E213285C3200CD7973 /* libSDL2.a in Frameworks */, + FA684F7B1BAF1A4400DCFD1A /* GameController.framework in Frameworks */, FA8B4BAD1967076F00F8EB7C /* CoreMotion.framework in Frameworks */, 047A63E313285C3200CD7973 /* AudioToolbox.framework in Frameworks */, 047A63E413285C3200CD7973 /* QuartzCore.framework in Frameworks */, @@ -381,6 +427,7 @@ files = ( AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */, FDBDE5810E313465006BAC0B /* libSDL2.a in Frameworks */, + FA684F931BAF1A8A00DCFD1A /* GameController.framework in Frameworks */, FA8B4BE0196766F400F8EB7C /* CoreMotion.framework in Frameworks */, FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */, FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */, @@ -397,6 +444,7 @@ buildActionMask = 2147483647; files = ( 56ED0502118A8FE400A56AA6 /* libSDL2.a in Frameworks */, + FA684F8B1BAF1A7100DCFD1A /* GameController.framework in Frameworks */, FA8B4BD8196766DD00F8EB7C /* CoreMotion.framework in Frameworks */, 56ED0503118A8FE400A56AA6 /* AudioToolbox.framework in Frameworks */, 56ED0504118A8FE400A56AA6 /* QuartzCore.framework in Frameworks */, @@ -414,6 +462,7 @@ files = ( AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */, AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */, + FA684F8D1BAF1A7800DCFD1A /* GameController.framework in Frameworks */, FA8B4BDA196766E200F8EB7C /* CoreMotion.framework in Frameworks */, AAE7DEE214CBB1E100DF1A0E /* AudioToolbox.framework in Frameworks */, AAE7DEE314CBB1E100DF1A0E /* QuartzCore.framework in Frameworks */, @@ -431,6 +480,7 @@ files = ( AA1EE47517605B930029C7A5 /* libSDL2test.a in Frameworks */, AAE7DFA614CBB54E00DF1A0E /* libSDL2.a in Frameworks */, + FA684F8C1BAF1A7400DCFD1A /* GameController.framework in Frameworks */, FA8B4BD9196766E000F8EB7C /* CoreMotion.framework in Frameworks */, AAE7DFA714CBB54E00DF1A0E /* AudioToolbox.framework in Frameworks */, AAE7DFA814CBB54E00DF1A0E /* QuartzCore.framework in Frameworks */, @@ -442,11 +492,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FAE0E9851BAF9B230098DFA4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FAE0E9861BAF9B230098DFA4 /* libSDL2.a in Frameworks */, + FAE0E9871BAF9B230098DFA4 /* GameController.framework in Frameworks */, + FAE0E9881BAF9B230098DFA4 /* CoreMotion.framework in Frameworks */, + FAE0E9891BAF9B230098DFA4 /* AudioToolbox.framework in Frameworks */, + FAE0E98A1BAF9B230098DFA4 /* QuartzCore.framework in Frameworks */, + FAE0E98B1BAF9B230098DFA4 /* OpenGLES.framework in Frameworks */, + FAE0E98C1BAF9B230098DFA4 /* CoreGraphics.framework in Frameworks */, + FAE0E98D1BAF9B230098DFA4 /* UIKit.framework in Frameworks */, + FAE0E98E1BAF9B230098DFA4 /* Foundation.framework in Frameworks */, + FAE0E98F1BAF9B230098DFA4 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FDA8AAAE0E2D330F00EA573E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( FDBDE5850E313495006BAC0B /* libSDL2.a in Frameworks */, + FA684F7F1BAF1A4D00DCFD1A /* GameController.framework in Frameworks */, FA8B4BC9196766BC00F8EB7C /* CoreMotion.framework in Frameworks */, FDA8AAB10E2D330F00EA573E /* AudioToolbox.framework in Frameworks */, FDA8AAB20E2D330F00EA573E /* QuartzCore.framework in Frameworks */, @@ -463,6 +531,7 @@ buildActionMask = 2147483647; files = ( FDBDE58C0E3134F3006BAC0B /* libSDL2.a in Frameworks */, + FA684F801BAF1A5000DCFD1A /* GameController.framework in Frameworks */, FA8B4BCD196766BF00F8EB7C /* CoreMotion.framework in Frameworks */, FDAAC3C30E2D47E6001DB1D8 /* AudioToolbox.framework in Frameworks */, FDAAC3C40E2D47E6001DB1D8 /* QuartzCore.framework in Frameworks */, @@ -479,6 +548,7 @@ buildActionMask = 2147483647; files = ( FDBDE59B0E31356A006BAC0B /* libSDL2.a in Frameworks */, + FA684F821BAF1A5700DCFD1A /* GameController.framework in Frameworks */, FA8B4BCF196766C400F8EB7C /* CoreMotion.framework in Frameworks */, FDAAC5910E2D5429001DB1D8 /* AudioToolbox.framework in Frameworks */, FDAAC5920E2D5429001DB1D8 /* QuartzCore.framework in Frameworks */, @@ -495,6 +565,7 @@ buildActionMask = 2147483647; files = ( FDBDE59F0E31358D006BAC0B /* libSDL2.a in Frameworks */, + FA684F831BAF1A5A00DCFD1A /* GameController.framework in Frameworks */, FA8B4BD0196766C600F8EB7C /* CoreMotion.framework in Frameworks */, FDAAC5BF0E2D55B5001DB1D8 /* AudioToolbox.framework in Frameworks */, FDAAC5C00E2D55B5001DB1D8 /* QuartzCore.framework in Frameworks */, @@ -512,6 +583,7 @@ files = ( AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */, FDBDE57C0E313445006BAC0B /* libSDL2.a in Frameworks */, + FA684F851BAF1A6000DCFD1A /* GameController.framework in Frameworks */, FA8B4BD2196766CB00F8EB7C /* CoreMotion.framework in Frameworks */, FDAAC61C0E2D5914001DB1D8 /* AudioToolbox.framework in Frameworks */, FDAAC61D0E2D5914001DB1D8 /* QuartzCore.framework in Frameworks */, @@ -529,6 +601,7 @@ files = ( AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */, FDC42FF40F0D866D009C87E1 /* libSDL2.a in Frameworks */, + FA684F811BAF1A5300DCFD1A /* GameController.framework in Frameworks */, FA8B4BCE196766C100F8EB7C /* CoreMotion.framework in Frameworks */, FDC42FF60F0D866D009C87E1 /* AudioToolbox.framework in Frameworks */, FDC42FF70F0D866D009C87E1 /* QuartzCore.framework in Frameworks */, @@ -545,6 +618,7 @@ buildActionMask = 2147483647; files = ( FDBDE5A90E3135C0006BAC0B /* libSDL2.a in Frameworks */, + FA684F901BAF1A8100DCFD1A /* GameController.framework in Frameworks */, FA8B4BDD196766EB00F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C1000E2E4F4B00B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C1010E2E4F4B00B7A85F /* QuartzCore.framework in Frameworks */, @@ -561,6 +635,7 @@ buildActionMask = 2147483647; files = ( FDBDE5AE0E3135E6006BAC0B /* libSDL2.a in Frameworks */, + FA684F861BAF1A6200DCFD1A /* GameController.framework in Frameworks */, FA8B4BD3196766CE00F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C1770E2E52C000B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C1780E2E52C000B7A85F /* QuartzCore.framework in Frameworks */, @@ -577,6 +652,7 @@ buildActionMask = 2147483647; files = ( FDBDE5B60E3135FE006BAC0B /* libSDL2.a in Frameworks */, + FA684F871BAF1A6500DCFD1A /* GameController.framework in Frameworks */, FA8B4BD4196766D100F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C19B0E2E534F00B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C19C0E2E534F00B7A85F /* QuartzCore.framework in Frameworks */, @@ -593,6 +669,7 @@ buildActionMask = 2147483647; files = ( FDBDE5BC0E31364D006BAC0B /* libSDL2.a in Frameworks */, + FA684F881BAF1A6800DCFD1A /* GameController.framework in Frameworks */, FA8B4BD5196766D400F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C4540E2E773800B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C4550E2E773800B7A85F /* QuartzCore.framework in Frameworks */, @@ -609,6 +686,7 @@ buildActionMask = 2147483647; files = ( FDBDE5C20E313663006BAC0B /* libSDL2.a in Frameworks */, + FA684F891BAF1A6A00DCFD1A /* GameController.framework in Frameworks */, FA8B4BD6196766D700F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C4720E2E77D700B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C4730E2E77D700B7A85F /* QuartzCore.framework in Frameworks */, @@ -625,6 +703,7 @@ buildActionMask = 2147483647; files = ( FDBDE5C60E3136F1006BAC0B /* libSDL2.a in Frameworks */, + FA684F8A1BAF1A6D00DCFD1A /* GameController.framework in Frameworks */, FA8B4BD7196766DA00F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C5010E2E7F4800B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C5020E2E7F4800B7A85F /* QuartzCore.framework in Frameworks */, @@ -641,6 +720,7 @@ buildActionMask = 2147483647; files = ( FDBDE5C80E313702006BAC0B /* libSDL2.a in Frameworks */, + FA684F8E1BAF1A7B00DCFD1A /* GameController.framework in Frameworks */, FA8B4BDB196766E500F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C51F0E2E807600B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C5200E2E807600B7A85F /* QuartzCore.framework in Frameworks */, @@ -658,6 +738,7 @@ files = ( AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */, FDBDE5CA0E313712006BAC0B /* libSDL2.a in Frameworks */, + FA684F8F1BAF1A7E00DCFD1A /* GameController.framework in Frameworks */, FA8B4BDC196766E800F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C5440E2E80E400B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C5450E2E80E400B7A85F /* QuartzCore.framework in Frameworks */, @@ -674,6 +755,7 @@ buildActionMask = 2147483647; files = ( FDBDE5CC0E31372B006BAC0B /* libSDL2.a in Frameworks */, + FA684F911BAF1A8400DCFD1A /* GameController.framework in Frameworks */, FA8B4BDE196766EE00F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C57D0E2E8C7400B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C57E0E2E8C7400B7A85F /* QuartzCore.framework in Frameworks */, @@ -690,6 +772,7 @@ buildActionMask = 2147483647; files = ( FDBDE5CE0E31373E006BAC0B /* libSDL2.a in Frameworks */, + FA684F921BAF1A8700DCFD1A /* GameController.framework in Frameworks */, FA8B4BDF196766F100F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C5BB0E2E8CFC00B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C5BC0E2E8CFC00B7A85F /* QuartzCore.framework in Frameworks */, @@ -706,6 +789,7 @@ buildActionMask = 2147483647; files = ( FDBDE5D40E313789006BAC0B /* libSDL2.a in Frameworks */, + FA684F941BAF1A9400DCFD1A /* GameController.framework in Frameworks */, FA8B4BE1196766F600F8EB7C /* CoreMotion.framework in Frameworks */, FDD2C6EA0E2E959E00B7A85F /* AudioToolbox.framework in Frameworks */, FDD2C6EB0E2E959E00B7A85F /* QuartzCore.framework in Frameworks */, @@ -746,6 +830,7 @@ 047A63ED13285C3200CD7973 /* checkkeys.app */, AAE7DEEC14CBB1E100DF1A0E /* testscale.app */, AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */, + FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */, ); name = Products; sourceTree = ""; @@ -788,6 +873,7 @@ FDC430090F0D86BF009C87E1 /* testdraw2.c */, FDA8A7470E2D0F1600EA573E /* testerror.c */, FDA8A7480E2D0F1600EA573E /* testfile.c */, + FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */, 046CEF8913254F63007AD51D /* testgesture.c */, FDAAC6290E2D5960001DB1D8 /* testgles.c */, FDA8A74D0E2D0F1600EA573E /* testiconv.c */, @@ -813,6 +899,7 @@ FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */ = { isa = PBXGroup; children = ( + FA684F7A1BAF1A4400DCFD1A /* GameController.framework */, FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */, FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */, FDA8A8990E2D111A00EA573E /* QuartzCore.framework */, @@ -828,6 +915,9 @@ FDA8AAD60E2D339A00EA573E /* Resources */ = { isa = PBXGroup; children = ( + FA0EF2281BAF4487000E07A6 /* axis.bmp */, + FA0EF2291BAF4487000E07A6 /* button.bmp */, + FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */, FDD2C18A0E2E52FE00B7A85F /* utf8.txt */, FDA8AAD90E2D33B000EA573E /* icon.bmp */, FDA8AADA0E2D33BA00EA573E /* moose.dat */, @@ -943,6 +1033,23 @@ productReference = AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */; productType = "com.apple.product-type.application"; }; + FAE0E9801BAF9B230098DFA4 /* testgamecontroller */ = { + isa = PBXNativeTarget; + buildConfigurationList = FAE0E9901BAF9B230098DFA4 /* Build configuration list for PBXNativeTarget "testgamecontroller" */; + buildPhases = ( + FAE0E9811BAF9B230098DFA4 /* Resources */, + FAE0E9831BAF9B230098DFA4 /* Sources */, + FAE0E9851BAF9B230098DFA4 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testgamecontroller; + productName = Test; + productReference = FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */; + productType = "com.apple.product-type.application"; + }; FDA8AAAA0E2D330F00EA573E /* loopwav */ = { isa = PBXNativeTarget; buildConfigurationList = FDA8AAB80E2D330F00EA573E /* Build configuration list for PBXNativeTarget "loopwav" */; @@ -1238,7 +1345,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0630; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */; compatibilityVersion = "Xcode 3.2"; @@ -1270,6 +1377,7 @@ FDC42FEF0F0D866D009C87E1 /* testdraw2 */, FDAAC58A0E2D5429001DB1D8 /* testerror */, FDAAC5B80E2D55B5001DB1D8 /* testfile */, + FAE0E9801BAF9B230098DFA4 /* testgamecontroller */, 046CEF7513254F23007AD51D /* testgesture */, FDAAC6150E2D5914001DB1D8 /* testgles */, FDD2C1700E2E52C000B7A85F /* testiconv */, @@ -1357,6 +1465,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FAE0E9811BAF9B230098DFA4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FAE0E9961BAF9B650098DFA4 /* controllermap.bmp in Resources */, + FAE0E9821BAF9B230098DFA4 /* icon.bmp in Resources */, + FAE0E9981BAF9B6E0098DFA4 /* axis.bmp in Resources */, + FAE0E9971BAF9B6A0098DFA4 /* button.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FDA8AAAB0E2D330F00EA573E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1533,6 +1652,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FAE0E9831BAF9B230098DFA4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FAE0E9951BAF9B510098DFA4 /* testgamecontroller.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FDA8AAAC0E2D330F00EA573E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1601,7 +1728,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDD2C1A80E2E536400B7A85F /* testjoystick.c in Sources */, + FA0EF22E1BAF4654000E07A6 /* testjoystick.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1774,6 +1901,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; @@ -1793,6 +1921,22 @@ }; name = Release; }; + FAE0E9911BAF9B230098DFA4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + FAE0E9921BAF9B230098DFA4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; FDA8AAB90E2D330F00EA573E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2131,6 +2275,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + FAE0E9901BAF9B230098DFA4 /* Build configuration list for PBXNativeTarget "testgamecontroller" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FAE0E9911BAF9B230098DFA4 /* Debug */, + FAE0E9921BAF9B230098DFA4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; FDA8AAB80E2D330F00EA573E /* Build configuration list for PBXNativeTarget "loopwav" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/jni/SDL2-2.0.3/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 6c618b4e..9fc2a501 100755 --- a/jni/SDL2-2.0.3/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/Xcode/SDL/pkg-support/resources/License.txt b/jni/SDL2-2.0.3/Xcode/SDL/pkg-support/resources/License.txt index 4b6f777e..e6a9ef84 100644 --- a/jni/SDL2-2.0.3/Xcode/SDL/pkg-support/resources/License.txt +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index d6619c2d..59cdd631 100755 --- a/jni/SDL2-2.0.3/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -555,6 +555,20 @@ DB89957918A19ABA0092407C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; DB89957A18A19ABA0092407C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; DB89958418A19B130092407C /* testhotplug.c in Sources */ = {isa = PBXBuildFile; fileRef = DB89958318A19B130092407C /* testhotplug.c */; }; + DBEC54DD1A1A81C3005B1EAB /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; }; + DBEC54DE1A1A81C3005B1EAB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DBEC54DF1A1A81C3005B1EAB /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DBEC54E01A1A81C3005B1EAB /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DBEC54E11A1A81C3005B1EAB /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DBEC54E21A1A81C3005B1EAB /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DBEC54E31A1A81C3005B1EAB /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DBEC54E41A1A81C3005B1EAB /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DBEC54E51A1A81C3005B1EAB /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DBEC54E61A1A81C3005B1EAB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DBEC54EB1A1A8205005B1EAB /* controllermap.c in Sources */ = {isa = PBXBuildFile; fileRef = DBEC54D11A1A811D005B1EAB /* controllermap.c */; }; + DBEC54ED1A1A828A005B1EAB /* axis.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBEC54D61A1A8145005B1EAB /* axis.bmp */; }; + DBEC54EE1A1A828D005B1EAB /* button.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBEC54D71A1A8145005B1EAB /* button.bmp */; }; + DBEC54EF1A1A828F005B1EAB /* controllermap.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBEC54D81A1A8145005B1EAB /* controllermap.bmp */; }; FA73672319A54A90004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; }; FA73672819A54AB6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; }; FA73672919A54AB9004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; }; @@ -1056,6 +1070,18 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DBEC54EC1A1A827C005B1EAB /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 16; + files = ( + DBEC54ED1A1A828A005B1EAB /* axis.bmp in CopyFiles */, + DBEC54EE1A1A828D005B1EAB /* button.bmp in CopyFiles */, + DBEC54EF1A1A828F005B1EAB /* controllermap.bmp in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -1186,6 +1212,11 @@ DB89957E18A19ABA0092407C /* testhotplug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testhotplug; sourceTree = BUILT_PRODUCTS_DIR; }; DB89958318A19B130092407C /* testhotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhotplug.c; path = ../../test/testhotplug.c; sourceTree = ""; }; DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "TestDropFile-Info.plist"; sourceTree = ""; }; + DBEC54D11A1A811D005B1EAB /* controllermap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = controllermap.c; path = ../../test/controllermap.c; sourceTree = ""; }; + DBEC54D61A1A8145005B1EAB /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = axis.bmp; path = ../../test/axis.bmp; sourceTree = ""; }; + DBEC54D71A1A8145005B1EAB /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = button.bmp; path = ../../test/button.bmp; sourceTree = ""; }; + DBEC54D81A1A8145005B1EAB /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = controllermap.bmp; path = ../../test/controllermap.bmp; sourceTree = ""; }; + DBEC54EA1A1A81C3005B1EAB /* controllermap */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = controllermap; sourceTree = BUILT_PRODUCTS_DIR; }; FA73672219A54A90004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1974,6 +2005,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DBEC54DC1A1A81C3005B1EAB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DBEC54DD1A1A81C3005B1EAB /* CoreVideo.framework in Frameworks */, + DBEC54DE1A1A81C3005B1EAB /* Cocoa.framework in Frameworks */, + DBEC54DF1A1A81C3005B1EAB /* libSDL2.a in Frameworks */, + DBEC54E01A1A81C3005B1EAB /* CoreAudio.framework in Frameworks */, + DBEC54E11A1A81C3005B1EAB /* ForceFeedback.framework in Frameworks */, + DBEC54E21A1A81C3005B1EAB /* IOKit.framework in Frameworks */, + DBEC54E31A1A81C3005B1EAB /* AudioToolbox.framework in Frameworks */, + DBEC54E41A1A81C3005B1EAB /* CoreFoundation.framework in Frameworks */, + DBEC54E51A1A81C3005B1EAB /* AudioUnit.framework in Frameworks */, + DBEC54E61A1A81C3005B1EAB /* Carbon.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -2007,13 +2055,16 @@ 00794E4609D207B4003FC8A1 /* Resources */ = { isa = PBXGroup; children = ( - DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */, - DB166ECF16A1D87000A1396C /* shapes */, + DBEC54D61A1A8145005B1EAB /* axis.bmp */, + DBEC54D71A1A8145005B1EAB /* button.bmp */, + DBEC54D81A1A8145005B1EAB /* controllermap.bmp */, 00794E5D09D20839003FC8A1 /* icon.bmp */, 00794E5E09D20839003FC8A1 /* moose.dat */, 00794E5F09D20839003FC8A1 /* picture.xbm */, 00794E6109D20839003FC8A1 /* sample.bmp */, 00794E6209D20839003FC8A1 /* sample.wav */, + DB166ECF16A1D87000A1396C /* shapes */, + DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */, 00794E6309D20839003FC8A1 /* utf8.txt */, ); name = Resources; @@ -2037,6 +2088,7 @@ isa = PBXGroup; children = ( 092D6D10FFB30A2C7F000001 /* checkkeys.c */, + DBEC54D11A1A811D005B1EAB /* controllermap.c */, 083E4872006D84C97F000001 /* loopwave.c */, 0017958F1074216E00F5D044 /* testatomic.c */, 001795B01074222D00F5D044 /* testaudioinfo.c */, @@ -2138,6 +2190,7 @@ DB0F490117CA5212008798C5 /* testfilesystem */, DB89957E18A19ABA0092407C /* testhotplug */, DB445EF818184B7000B306B0 /* testdropfile.app */, + DBEC54EA1A1A81C3005B1EAB /* controllermap */, ); name = Products; sourceTree = ""; @@ -2926,6 +2979,23 @@ productReference = DB89957E18A19ABA0092407C /* testhotplug */; productType = "com.apple.product-type.tool"; }; + DBEC54D91A1A81C3005B1EAB /* controllermap */ = { + isa = PBXNativeTarget; + buildConfigurationList = DBEC54E71A1A81C3005B1EAB /* Build configuration list for PBXNativeTarget "controllermap" */; + buildPhases = ( + DBEC54DA1A1A81C3005B1EAB /* Sources */, + DBEC54DC1A1A81C3005B1EAB /* Frameworks */, + DBEC54EC1A1A827C005B1EAB /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = controllermap; + productName = checkkeys; + productReference = DBEC54EA1A1A81C3005B1EAB /* controllermap */; + productType = "com.apple.product-type.tool"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -2958,6 +3028,7 @@ BEC566920761D90300A33029 /* All */, DB166D7E16A1D12400A1396C /* SDL_test */, BEC566AB0761D90300A33029 /* checkkeys */, + DBEC54D91A1A81C3005B1EAB /* controllermap */, BEC566C50761D90300A33029 /* loopwave */, 0017957410741F7900F5D044 /* testatomic */, 00179595107421BF00F5D044 /* testaudioinfo */, @@ -3422,6 +3493,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DBEC54DA1A1A81C3005B1EAB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DBEC54EB1A1A8205005B1EAB /* controllermap.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -4339,6 +4418,20 @@ }; name = Release; }; + DBEC54E81A1A81C3005B1EAB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = controllermap; + }; + name = Debug; + }; + DBEC54E91A1A81C3005B1EAB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = controllermap; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -4774,6 +4867,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; + DBEC54E71A1A81C3005B1EAB /* Build configuration list for PBXNativeTarget "controllermap" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DBEC54E81A1A81C3005B1EAB /* Debug */, + DBEC54E91A1A81C3005B1EAB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; /* End XCConfigurationList section */ }; rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; diff --git a/jni/SDL2-2.0.3/acinclude/libtool.m4 b/jni/SDL2-2.0.3/acinclude/libtool.m4 index c444a5ed..0eb07c8a 100644 --- a/jni/SDL2-2.0.3/acinclude/libtool.m4 +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/android-project/AndroidManifest.xml b/jni/SDL2-2.0.3/android-project/AndroidManifest.xml index dc8450a6..5dbb5486 100644 --- a/jni/SDL2-2.0.3/android-project/AndroidManifest.xml +++ b/jni/SDL2-2.0.3/android-project/AndroidManifest.xml @@ -8,6 +8,15 @@ android:versionName="1.0" android:installLocation="auto"> + + + + + + + + + + - - - - - - - - diff --git a/jni/SDL2-2.0.3/android-project/src/org/libsdl/app/SDLActivity.java b/jni/SDL2-2.0.3/android-project/src/org/libsdl/app/SDLActivity.java index f850bf52..0a2e5d87 100644 --- a/jni/SDL2-2.0.3/android-project/src/org/libsdl/app/SDLActivity.java +++ b/jni/SDL2-2.0.3/android-project/src/org/libsdl/app/SDLActivity.java @@ -11,6 +11,7 @@ import java.lang.reflect.Method; import android.app.*; import android.content.*; +import android.text.InputType; import android.view.*; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.EditorInfo; @@ -27,6 +28,7 @@ import android.graphics.*; import android.graphics.drawable.Drawable; import android.media.*; import android.hardware.*; +import android.content.pm.ActivityInfo; /** SDL Activity @@ -38,6 +40,13 @@ public class SDLActivity extends Activity { public static boolean mIsPaused, mIsSurfaceReady, mHasFocus; public static boolean mExitCalledFromJava; + /** 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; @@ -47,22 +56,37 @@ 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; - // Load the .so - static { - System.loadLibrary("SDL2"); - //System.loadLibrary("SDL2_image"); - //System.loadLibrary("SDL2_mixer"); - //System.loadLibrary("SDL2_net"); - //System.loadLibrary("SDL2_ttf"); - System.loadLibrary("main"); - } - /** - * This method is called by SDL using JNI. + * This method is called by SDL before loading the native shared libraries. + * It can be overridden to provide names of shared libraries to be loaded. + * The default implementation returns the defaults. It never returns null. + * An array returned by a new implementation must at least contain "SDL2". + * Also keep in mind that the order the libraries are loaded may matter. + * @return names of shared libraries to be loaded (e.g. "SDL2", "main"). + */ + protected String[] getLibraries() { + return new String[] { + "SDL2", + // "SDL2_image", + // "SDL2_mixer", + // "SDL2_net", + // "SDL2_ttf", + "main" + }; + } + + // Load the .so + public void loadLibraries() { + for (String lib : getLibraries()) { + 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. * The default implementation returns an empty array. It never returns null. @@ -71,7 +95,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 @@ -83,6 +107,7 @@ public class SDLActivity extends Activity { mSDLThread = null; mAudioTrack = null; mExitCalledFromJava = false; + mBrokenLibraries = false; mIsPaused = false; mIsSurfaceReady = false; mHasFocus = true; @@ -91,16 +116,54 @@ 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; + // Load shared libraries + String errorMsgBrokenLib = ""; + try { + loadLibraries(); + } catch(UnsatisfiedLinkError e) { + System.err.println(e.getMessage()); + mBrokenLibraries = true; + errorMsgBrokenLib = e.getMessage(); + } catch(Exception e) { + System.err.println(e.getMessage()); + mBrokenLibraries = true; + errorMsgBrokenLib = e.getMessage(); + } + + if (mBrokenLibraries) + { + AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this); + dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall." + + System.getProperty("line.separator") + + System.getProperty("line.separator") + + "Error: " + errorMsgBrokenLib); + dlgAlert.setTitle("SDL Error"); + dlgAlert.setPositiveButton("Exit", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog,int id) { + // if this button is clicked, close current activity + SDLActivity.mSingleton.finish(); + } + }); + dlgAlert.setCancelable(false); + dlgAlert.create().show(); + + return; + } + // Set up the surface mSurface = new SDLSurface(getApplication()); - + if(Build.VERSION.SDK_INT >= 12) { mJoystickHandler = new SDLJoystickHandler_API12(); } @@ -112,20 +175,41 @@ 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) { + return; + } + SDLActivity.handlePause(); } @Override protected void onResume() { - Log.v("SDL", "onResume()"); + Log.v(TAG, "onResume()"); super.onResume(); + + if (SDLActivity.mBrokenLibraries) { + return; + } + SDLActivity.handleResume(); } @@ -133,7 +217,11 @@ 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; + } SDLActivity.mHasFocus = hasFocus; if (hasFocus) { @@ -143,14 +231,27 @@ public class SDLActivity extends Activity { @Override public void onLowMemory() { - Log.v("SDL", "onLowMemory()"); + Log.v(TAG, "onLowMemory()"); super.onLowMemory(); + + if (SDLActivity.mBrokenLibraries) { + return; + } + SDLActivity.nativeLowMemory(); } @Override protected void onDestroy() { - Log.v("SDL", "onDestroy()"); + Log.v(TAG, "onDestroy()"); + + if (SDLActivity.mBrokenLibraries) { + super.onDestroy(); + // Reset everything in case the user re opens the app + SDLActivity.initialize(); + return; + } + // Send a quit message to the application SDLActivity.mExitCalledFromJava = true; SDLActivity.nativeQuit(); @@ -160,13 +261,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(); @@ -174,6 +275,11 @@ public class SDLActivity extends Activity { @Override public boolean dispatchKeyEvent(KeyEvent event) { + + if (SDLActivity.mBrokenLibraries) { + return false; + } + int keyCode = event.getKeyCode(); // Ignore certain special keys so they're handled by Android if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || @@ -195,7 +301,7 @@ public class SDLActivity extends Activity { if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) { SDLActivity.mIsPaused = true; SDLActivity.nativePause(); - mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false); + mSurface.handlePause(); } } @@ -210,7 +316,7 @@ public class SDLActivity extends Activity { mSurface.handleResume(); } } - + /* The native thread has finished */ public static void handleNativeExit() { SDLActivity.mSDLThread = null; @@ -304,7 +410,8 @@ public class SDLActivity extends Activity { public static native void nativeQuit(); public static native void nativePause(); public static native void nativeResume(); - public static native void onNativeResize(int x, int y, int format); + 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); public static native void onNativeJoy(int device_id, int axis, @@ -314,26 +421,19 @@ 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); - /** - * This method is called by SDL using JNI. - */ - public static void flipBuffers() { - SDLActivity.nativeFlipBuffers(); - } - /** * This method is called by SDL using JNI. */ @@ -447,33 +547,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; } @@ -492,7 +592,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; } } @@ -513,7 +613,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; } } @@ -562,7 +662,7 @@ public class SDLActivity extends Activity { } } - // APK extension files support + // APK expansion files support /** com.android.vending.expansion.zipfile.ZipResourceFile object or null. */ private Object expansionFile; @@ -571,16 +671,43 @@ public class SDLActivity extends Activity { private Method expansionFileMethod; /** - * This method is called by SDL using JNI. + * This method was called by SDL using JNI. + * @deprecated because of an incorrect name */ + @Deprecated public InputStream openAPKExtensionInputStream(String fileName) throws IOException { + return openAPKExpansionInputStream(fileName); + } + + /** + * This method is called by SDL using JNI. + * @return an InputStream on success or null if no expansion file was used. + * @throws IOException on errors. Message is set for the SDL error message. + */ + public InputStream openAPKExpansionInputStream(String fileName) throws IOException { // Get a ZipResourceFile representing a merger of both the main and patch files if (expansionFile == null) { - Integer mainVersion = Integer.valueOf(nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION")); - Integer patchVersion = Integer.valueOf(nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION")); + String mainHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"); + if (mainHint == null) { + return null; // no expansion use if no main version was set + } + String patchHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"); + if (patchHint == null) { + return null; // no expansion use if no patch version was set + } + + Integer mainVersion; + Integer patchVersion; + try { + mainVersion = Integer.valueOf(mainHint); + patchVersion = Integer.valueOf(patchHint); + } catch (NumberFormatException ex) { + ex.printStackTrace(); + throw new IOException("No valid file versions set for APK expansion files", ex); + } try { - // To avoid direct dependency on Google APK extension library that is + // To avoid direct dependency on Google APK expansion library that is // not a part of Android SDK we access it using reflection expansionFile = Class.forName("com.android.vending.expansion.zipfile.APKExpansionSupport") .getMethod("getAPKExpansionZipFile", Context.class, int.class, int.class) @@ -592,6 +719,7 @@ public class SDLActivity extends Activity { ex.printStackTrace(); expansionFile = null; expansionFileMethod = null; + throw new IOException("Could not access APK expansion support library", ex); } } @@ -600,12 +728,14 @@ public class SDLActivity extends Activity { try { fileStream = (InputStream)expansionFileMethod.invoke(expansionFile, fileName); } catch (Exception ex) { + // calling "getInputStream" failed ex.printStackTrace(); - fileStream = null; + throw new IOException("Could not open stream from APK expansion file", ex); } if (fileStream == null) { - throw new IOException(); + // calling "getInputStream" was successful but null was returned + throw new IOException("Could not find path in APK expansion file"); } return fileStream; @@ -833,11 +963,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 @@ -847,20 +977,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()); } @@ -869,7 +999,11 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mWidth = 1.0f; mHeight = 1.0f; } - + + public void handlePause() { + enableSensor(Sensor.TYPE_ACCELEROMETER, false); + } + public void handleResume() { setFocusable(true); setFocusableInTouchMode(true); @@ -878,7 +1012,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, setOnTouchListener(this); enableSensor(Sensor.TYPE_ACCELEROMETER, true); } - + public Surface getNativeSurface() { return getHolder().getSurface(); } @@ -953,8 +1087,44 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mWidth = width; mHeight = height; - SDLActivity.onNativeResize(width, height, sdlFormat); - Log.v("SDL", "Window size:" + width + "x"+height); + SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate()); + 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; @@ -968,7 +1138,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 @@ -977,31 +1147,30 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, sdlThread.join(); } catch(Exception e){} - finally{ + finally{ // Native thread has finished if (! SDLActivity.mExitCalledFromJava) { SDLActivity.handleNativeExit(); } } } - }); + }, "SDLThreadListener"); SDLActivity.mSDLThread.start(); } + + if (SDLActivity.mHasFocus) { + SDLActivity.handleResume(); + } } - // unused - @Override - public void onDraw(Canvas canvas) {} - - // Key events @Override public boolean onKey(View v, int keyCode, KeyEvent event) { // 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) { @@ -1013,7 +1182,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); @@ -1026,7 +1195,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, return true; } } - + return false; } @@ -1038,68 +1207,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 @@ -1131,7 +1330,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 @@ -1173,7 +1372,7 @@ class DummyEdit extends View implements View.OnKeyListener { return false; } - + // @Override public boolean onKeyPreIme (int keyCode, KeyEvent event) { @@ -1195,6 +1394,7 @@ class DummyEdit extends View implements View.OnKeyListener { public InputConnection onCreateInputConnection(EditorInfo outAttrs) { ic = new SDLInputConnection(this, true); + outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI | 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */; @@ -1252,7 +1452,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 @@ -1266,7 +1466,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. @@ -1298,11 +1498,11 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { return arg0.getAxis() - arg1.getAxis(); } } - + private ArrayList mJoysticks; - + public SDLJoystickHandler_API12() { - + mJoysticks = new ArrayList(); } @@ -1313,18 +1513,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 ) { @@ -1338,14 +1544,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++) { @@ -1358,7 +1564,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); @@ -1368,9 +1574,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) { @@ -1378,9 +1584,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(); @@ -1394,7 +1600,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 ) ); @@ -1407,14 +1613,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 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; + } + break; + + default: + break; + } + + // Event was not managed + return false; } } diff --git a/jni/SDL2-2.0.3/build-scripts/androidbuild.sh b/jni/SDL2-2.0.3/build-scripts/androidbuild.sh index ea6e6b1b..8ca3c916 100755 --- a/jni/SDL2-2.0.3/build-scripts/androidbuild.sh +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/build-scripts/config.guess b/jni/SDL2-2.0.3/build-scripts/config.guess index ddb36220..68c1be32 100644 --- a/jni/SDL2-2.0.3/build-scripts/config.guess +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/build-scripts/config.sub b/jni/SDL2-2.0.3/build-scripts/config.sub index ce5e0e68..53273f2b 100644 --- a/jni/SDL2-2.0.3/build-scripts/config.sub +++ b/jni/SDL2-2.0.3/build-scripts/config.sub @@ -1534,6 +1534,8 @@ case $os in -pnacl*) os=-pnacl ;; + -emscripten*) + ;; -none) ;; *) diff --git a/jni/SDL2-2.0.3/build-scripts/emscripten-buildbot.sh b/jni/SDL2-2.0.3/build-scripts/emscripten-buildbot.sh new file mode 100755 index 00000000..db5fb818 --- /dev/null +++ b/jni/SDL2-2.0.3/build-scripts/emscripten-buildbot.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +SDKDIR="/emsdk_portable" +ENVSCRIPT="$SDKDIR/emsdk_env.sh" +if [ ! -f "$ENVSCRIPT" ]; then + echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2 + exit 1 +fi + +TARBALL="$1" +if [ -z $1 ]; then + TARBALL=sdl-emscripten.tar.xz +fi + +cd `dirname "$0"` +cd .. +SDLBASE=`pwd` + +if [ -z "$MAKE" ]; then + OSTYPE=`uname -s` + if [ "$OSTYPE" == "Linux" ]; then + NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l` + let NCPU=$NCPU+1 + elif [ "$OSTYPE" = "Darwin" ]; then + NCPU=`sysctl -n hw.ncpu` + elif [ "$OSTYPE" = "SunOS" ]; then + NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'` + else + NCPU=1 + fi + + if [ -z "$NCPU" ]; then + NCPU=1 + elif [ "$NCPU" = "0" ]; then + NCPU=1 + fi + + MAKE="make -j$NCPU" +fi + +echo "\$MAKE is '$MAKE'" + +echo "Setting up Emscripten SDK environment..." +source "$ENVSCRIPT" + +echo "Setting up..." +set -x +cd "$SDLBASE" +rm -rf buildbot +mkdir buildbot +pushd buildbot + +echo "Configuring..." +emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" + +echo "Building..." +emmake $MAKE + +echo "Moving things around..." +emmake $MAKE install +# Fix up a few things to a real install path +perl -w -pi -e "s#$PWD/emscripten-sdl2-installed#/usr/local#g;" ./emscripten-sdl2-installed/lib/libSDL2.la ./emscripten-sdl2-installed/lib/pkgconfig/sdl2.pc ./emscripten-sdl2-installed/bin/sdl2-config +mkdir -p ./usr +mv ./emscripten-sdl2-installed ./usr/local +popd +tar -cJvvf $TARBALL -C buildbot usr +rm -rf buildbot + +exit 0 + +# end of emscripten-buildbot.sh ... + diff --git a/jni/SDL2-2.0.3/build-scripts/g++-fat.sh b/jni/SDL2-2.0.3/build-scripts/g++-fat.sh index 6e4f53e7..29b04302 100755 --- a/jni/SDL2-2.0.3/build-scripts/g++-fat.sh +++ b/jni/SDL2-2.0.3/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" @@ -34,7 +34,7 @@ while test x$1 != x; do compile=no; link=no;; -c) link=no;; -o) output=$2;; - *.c|*.cc|*.cpp|*.S) source=$1;; + *.c|*.cc|*.cpp|*.S|*.m|*.mm) source=$1;; esac shift done diff --git a/jni/SDL2-2.0.3/build-scripts/gcc-fat.sh b/jni/SDL2-2.0.3/build-scripts/gcc-fat.sh index edabb0d8..e556c1dd 100755 --- a/jni/SDL2-2.0.3/build-scripts/gcc-fat.sh +++ b/jni/SDL2-2.0.3/build-scripts/gcc-fat.sh @@ -35,7 +35,7 @@ while test x$1 != x; do compile=no; link=no;; -c) link=no;; -o) output=$2;; - *.c|*.cc|*.cpp|*.S) source=$1;; + *.c|*.cc|*.cpp|*.S|*.m|*.mm) source=$1;; esac shift done diff --git a/jni/SDL2-2.0.3/build-scripts/update-copyright.sh b/jni/SDL2-2.0.3/build-scripts/update-copyright.sh new file mode 100755 index 00000000..fdfb5ca9 --- /dev/null +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/build-scripts/windows-buildbot-zipper.bat b/jni/SDL2-2.0.3/build-scripts/windows-buildbot-zipper.bat new file mode 100644 index 00000000..7548cdd8 --- /dev/null +++ b/jni/SDL2-2.0.3/build-scripts/windows-buildbot-zipper.bat @@ -0,0 +1,31 @@ +@echo off +rem just a helper batch file for collecting up files and zipping them. +rem usage: windows-buildbot-zipper.bat +rem must be run from root of SDL source tree. + +IF EXIST VisualC\Win32\Release GOTO okaydir +echo Please run from root of source tree after doing a Release build. +GOTO done + +:okaydir +erase /q /f /s zipper +IF EXIST zipper GOTO zippermade +mkdir zipper +:zippermade +cd zipper +mkdir SDL +cd SDL +mkdir include +mkdir lib +mkdir lib\win32 +copy ..\..\include\*.h include\ +copy ..\..\VisualC\Win32\Release\SDL2.dll lib\win32\ +copy ..\..\VisualC\Win32\Release\SDL2.lib lib\win32\ +copy ..\..\VisualC\Win32\Release\SDL2main.lib lib\win32\ +cd .. +zip -9r ..\%1 SDL +cd .. +erase /q /f /s zipper + +:done + diff --git a/jni/SDL2-2.0.3/build-scripts/winrtbuild.bat b/jni/SDL2-2.0.3/build-scripts/winrtbuild.bat new file mode 100644 index 00000000..fb8df481 --- /dev/null +++ b/jni/SDL2-2.0.3/build-scripts/winrtbuild.bat @@ -0,0 +1,8 @@ +@ECHO OFF +REM +REM winrtbuild.bat: a batch file to help launch the winrtbuild.ps1 +REM Powershell script, either from Windows Explorer, or through Buildbot. +REM +SET ThisScriptsDirectory=%~dp0 +SET PowerShellScriptPath=%ThisScriptsDirectory%winrtbuild.ps1 +PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'"; \ No newline at end of file diff --git a/jni/SDL2-2.0.3/build-scripts/winrtbuild.ps1 b/jni/SDL2-2.0.3/build-scripts/winrtbuild.ps1 new file mode 100644 index 00000000..0045ee0a --- /dev/null +++ b/jni/SDL2-2.0.3/build-scripts/winrtbuild.ps1 @@ -0,0 +1,240 @@ +# +# winrtbuild.ps1 -- A Powershell script to build all SDL/WinRT variants, +# across all WinRT platforms, in all of their supported, CPU architectures. +# +# Initial version written by David Ludwig +# +# This script can be launched from Windows Explorer by double-clicking +# on winrtbuild.bat +# +# Output will be placed in the following subdirectories of the SDL source +# tree: +# * VisualC-WinRT\lib\ -- final .dll, .lib, and .pdb files +# * VisualC-WinRT\obj\ -- intermediate build files +# +# Recommended Dependencies: +# * Windows 8.1 or higher +# * Powershell 4.0 or higher (included as part of Windows 8.1) +# * Visual C++ 2012, for building Windows 8.0 and Windows Phone 8.0 binaries. +# * Visual C++ 2013, for building Windows 8.1 and Windows Phone 8.1 binaries +# * SDKs for Windows 8.0, Windows 8.1, Windows Phone 8.0, and +# Windows Phone 8.1, as needed +# +# Commom parameters/variables may include, but aren't strictly limited to: +# * PlatformToolset: the name of one of Visual Studio's build platforms. +# Different PlatformToolsets output different binaries. One +# PlatformToolset exists for each WinRT platform. Possible values +# may include: +# - "v110": Visual Studio 2012 build tools, plus the Windows 8.0 SDK +# - "v110_wp80": Visual Studio 2012 build tools, plus the Windows Phone 8.0 SDK +# - "v120": Visual Studio 2013 build tools, plus the Windows 8.1 SDK +# - "v120_wp81": Visual Studio 2013 build tools, plus the Windows Phone 8.1 SDK +# * VSProjectPath: the full path to a Visual Studio or Visual C++ project file +# * VSProjectName: the internal name of a Visual Studio or Visual C++ project +# file. Some of Visual Studio's own build tools use this name when +# calculating paths for build-output. +# * Platform: a Visual Studio platform name, which often maps to a CPU +# CPU architecture. Possible values may include: "Win32" (for 32-bit x86), +# "ARM", or "x64" (for 64-bit x86). +# + + +# Gets the .bat file that sets up an MSBuild environment, given one of +# Visual Studio's, "PlatformToolset"s. +function Get-MSBuild-Env-Launcher +{ + param( + [Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset + ) + + if ($PlatformToolset -eq "v110") { # Windows 8.0 (not Windows Phone), via VS 2012 + return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" + } + if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012 + return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\vcvarsphoneall.bat" + } + if ($PlatformToolset -eq "v120") { # Windows 8.1 (not Windows Phone), via VS 2013 + return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" + } + if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013 + return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" + } + if ($PlatformToolset -eq "v140") { # Windows 10, via VS 2015 + return "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" + } + return "" +} + +# Gets a string that identifies the build-variant of SDL/WinRT that is specific +# to a particular Visual Studio PlatformToolset. +function Get-SDL-WinRT-Variant-Name +{ + param( + [Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset, + + # If true, append a string to this function's output, identifying the + # build-variant's minimum-supported version of Visual Studio. + [switch]$IncludeVSSuffix = $false + ) + + if ($PlatformToolset -eq "v110") { # Windows 8.0 (not Windows Phone), via VS 2012 project files + if ($IncludeVSSuffix) { + return "WinRT80_VS2012" + } else { + return "WinRT80" + } + } + if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012 project files + if ($IncludeVSSuffix) { + return "WinPhone80_VS2012" + } else { + return "WinPhone80" + } + } + if ($PlatformToolset -eq "v120") { # Windows 8.1 (not Windows Phone), via VS 2013 project files + if ($IncludeVSSuffix) { + return "WinRT81_VS2013" + } else { + return "WinRT81" + } + } + if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013 project files + if ($IncludeVSSuffix) { + return "WinPhone81_VS2013" + } else { + return "WinPhone81" + } + } + if ($PlatformToolset -eq "v140") { # Windows 10, via VS 2015 project files + if ($IncludeVSSuffix) { + return "UWP_VS2015" + } else { + return "UWP" + } + } + return "" +} + +# Returns the internal name of a Visual Studio Project. +# +# The internal name of a VS Project is encoded inside the project file +# itself, inside a set of XML tags. +function Get-VS-ProjectName +{ + param( + [Parameter(Mandatory=$true,Position=1)]$VSProjectPath + ) + + # For now, just do a regex for the project name: + $matches = (Get-Content $VSProjectPath | Select-String -Pattern ".*([^<]+)<.*").Matches + foreach ($match in $matches) { + if ($match.Groups.Count -ge 1) { + return $match.Groups[1].Value + } + } + return $null +} + +# Build a specific variant of SDL/WinRT +function Build-SDL-WinRT-Variant +{ + # + # Read in arguments: + # + param ( + # name of an SDL project file, minus extensions and + # platform-identifying suffixes + [Parameter(Mandatory=$true,Position=1)][string]$SDLProjectName, + + [Parameter(Mandatory=$true,Position=2)][string]$PlatformToolset, + + [Parameter(Mandatory=$true,Position=3)][string]$Platform + ) + + # + # Derive other properties from read-in arguments: + # + + # The .bat file to setup a platform-appropriate MSBuild environment: + $BatchFileForMSBuildEnv = Get-MSBuild-Env-Launcher $PlatformToolset + + # The full path to the VS Project that'll be built: + $VSProjectPath = "$PSScriptRoot\..\VisualC-WinRT\$(Get-SDL-WinRT-Variant-Name $PlatformToolset -IncludeVSSuffix)\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset).vcxproj" + + # The internal name of the VS Project, used in some post-build steps: + $VSProjectName = Get-VS-ProjectName $VSProjectPath + + # Where to place output binaries (.dll, .lib, and .pdb files): + $OutDir = "$PSScriptRoot\..\VisualC-WinRT\lib\$PlatformToolset\$Platform" + + # Where to place intermediate build files: + $IntermediateDir = "$PSScriptRoot\..\VisualC-WinRT\obj\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset)\$Platform" + + # + # Build the VS Project: + # + cmd.exe /c " ""$BatchFileForMSBuildEnv"" x86 & msbuild ""$VSProjectPath"" /p:Configuration=Release /p:Platform=$Platform /p:OutDir=""$OutDir\\"" /p:IntDir=""$IntermediateDir\\""" | Out-Host + $BuildResult = $? + + # + # Move .dll files into place. This fixes a problem whereby MSBuild may + # put output files into a sub-directory of $OutDir, rather than $OutDir + # itself. + # + if (Test-Path "$OutDir\$VSProjectName\") { + Move-Item -Force "$OutDir\$VSProjectName\*" "$OutDir" + } + + # + # Clean up unneeded files in $OutDir: + # + if (Test-Path "$OutDir\$VSProjectName\") { + Remove-Item -Recurse "$OutDir\$VSProjectName" + } + Remove-Item "$OutDir\*.exp" + Remove-Item "$OutDir\*.ilk" + Remove-Item "$OutDir\*.pri" + + # + # All done. Indicate success, or failure, to the caller: + # + #echo "RESULT: $BuildResult" | Out-Host + return $BuildResult +} + + +# +# Build each variant, with corresponding .dll, .lib, and .pdb files: +# +$DidAnyFail = $false + +# Build for Windows Phone 8.0, via VC++ 2012: +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "ARM")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "Win32")) { $DidAnyFail = $true } + +# Build for Windows Phone 8.1, via VC++ 2013: +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "ARM")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "Win32")) { $DidAnyFail = $true } + +# Build for Windows 8.0 and Windows RT 8.0, via VC++ 2012: +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "ARM")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "Win32")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "x64")) { $DidAnyFail = $true } + +# Build for Windows 8.1 and Windows RT 8.1, via VC++ 2013: +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "ARM")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "Win32")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "x64")) { $DidAnyFail = $true } + +# Build for Windows 10, via VC++ 2015 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v140" "ARM")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v140" "Win32")) { $DidAnyFail = $true } +if ( ! (Build-SDL-WinRT-Variant "SDL" "v140" "x64")) { $DidAnyFail = $true } + +# Let the script's caller know whether or not any errors occurred. +# Exit codes compatible with Buildbot are used (1 for error, 0 for success). +if ($DidAnyFail -eq $true) { + exit 1 +} else { + exit 0 +} diff --git a/jni/SDL2-2.0.3/cmake/macros.cmake b/jni/SDL2-2.0.3/cmake/macros.cmake index c234a566..96a7ce8b 100644 --- a/jni/SDL2-2.0.3/cmake/macros.cmake +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/cmake/sdlchecks.cmake b/jni/SDL2-2.0.3/cmake/sdlchecks.cmake index 63aceda3..7ff0985f 100644 --- a/jni/SDL2-2.0.3/cmake/sdlchecks.cmake +++ b/jni/SDL2-2.0.3/cmake/sdlchecks.cmake @@ -39,7 +39,7 @@ macro(CheckDLOPEN) set(_DLLIB ${_LIBNAME}) set(HAVE_DLOPEN TRUE) break() - endif(DLOPEN_LIB) + endif() endforeach() endif() @@ -63,7 +63,7 @@ macro(CheckDLOPEN) set(SOURCE_FILES ${SOURCE_FILES} ${DLOPEN_SOURCES}) set(HAVE_SDL_LOADSO TRUE) endif() -endmacro(CheckDLOPEN) +endmacro() # Requires: # - n/a @@ -78,23 +78,23 @@ macro(CheckOSS) check_c_source_compiles(" #include int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND) - endif(NOT OSS_FOUND) + endif() if(OSS_FOUND) set(HAVE_OSS TRUE) file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c) if(OSS_HEADER_FILE STREQUAL "soundcard.h") set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1) - endif(OSS_HEADER_FILE STREQUAL "soundcard.h") + endif() set(SDL_AUDIO_DRIVER_OSS 1) set(SOURCE_FILES ${SOURCE_FILES} ${OSS_SOURCES}) if(NETBSD OR OPENBSD) list(APPEND EXTRA_LIBS ossaudio) - endif(NETBSD OR OPENBSD) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(OSS_FOUND) - endif(OSS) -endmacro(CheckOSS) + endif() + endif() +endmacro() # Requires: # - n/a @@ -117,14 +117,14 @@ macro(CheckALSA) FindLibraryAndSONAME("asound") set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"") set(HAVE_ALSA_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(ALSA_SHARED) + endif() + else() list(APPEND EXTRA_LIBS asound) - endif(ALSA_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(HAVE_ASOUNDLIB_H) - endif(ALSA) -endmacro(CheckALSA) + endif() + endif() +endmacro() # Requires: # - PkgCheckModules @@ -147,14 +147,14 @@ macro(CheckPulseAudio) FindLibraryAndSONAME("pulse-simple") set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${PULSE_SIMPLE_LIB_SONAME}\"") set(HAVE_PULSEAUDIO_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(PULSEAUDIO_SHARED) + endif() + else() list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS}) - endif(PULSEAUDIO_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(PKG_PULSEAUDIO_FOUND) - endif(PULSEAUDIO) -endmacro(CheckPulseAudio) + endif() + endif() +endmacro() # Requires: # - PkgCheckModules @@ -177,14 +177,14 @@ macro(CheckESD) FindLibraryAndSONAME(esd) set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${ESD_LIB_SONAME}\"") set(HAVE_ESD_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(ESD_SHARED) + endif() + else() list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS}) - endif(ESD_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(PKG_ESD_FOUND) - endif(ESD) -endmacro(CheckESD) + endif() + endif() +endmacro() # Requires: # - n/a @@ -212,14 +212,14 @@ macro(CheckARTS) FindLibraryAndSONAME(artsc) set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${ARTSC_LIB_SONAME}\"") set(HAVE_ARTS_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(ARTS_SHARED) + endif() + else() list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS}) - endif(ARTS_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(ARTS_CONFIG) - endif(ARTS) -endmacro(CheckARTS) + endif() + endif() +endmacro() # Requires: # - n/a @@ -243,14 +243,14 @@ macro(CheckNAS) FindLibraryAndSONAME("audio") set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${AUDIO_LIB_SONAME}\"") set(HAVE_NAS_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(NAS_SHARED) + endif() + else() list(APPEND EXTRA_LIBS ${D_NAS_LIB}) - endif(NAS_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(HAVE_NAS_H AND D_NAS_LIB) - endif(NAS) -endmacro(CheckNAS) + endif() + endif() +endmacro() # Requires: # - n/a @@ -274,14 +274,14 @@ macro(CheckSNDIO) FindLibraryAndSONAME("sndio") set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"") set(HAVE_SNDIO_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(SNDIO_SHARED) + endif() + else() list(APPEND EXTRA_LIBS ${D_SNDIO_LIB}) - endif(SNDIO_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(HAVE_SNDIO_H AND D_SNDIO_LIB) - endif(SNDIO) -endmacro(CheckSNDIO) + endif() + endif() +endmacro() # Requires: # - PkgCheckModules @@ -304,14 +304,14 @@ macro(CheckFusionSound) FindLibraryAndSONAME("fusionsound") set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${FUSIONSOUND_LIB_SONAME}\"") set(HAVE_FUSIONSOUND_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(FUSIONSOUND_SHARED) + endif() + else() list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS}) - endif(FUSIONSOUND_SHARED) + endif() set(HAVE_SDL_AUDIO TRUE) - endif(PKG_FUSIONSOUND_FOUND) - endif(FUSIONSOUND) -endmacro(CheckFusionSound) + endif() + endif() +endmacro() # Requires: # - n/a @@ -353,34 +353,34 @@ macro(CheckX11) if(APPLE) set(X11_SHARED OFF) - endif(APPLE) + endif() check_function_exists("shmat" HAVE_SHMAT) if(NOT HAVE_SHMAT) check_library_exists(ipc shmat "" HAVE_SHMAT) if(HAVE_SHMAT) list(APPEND EXTRA_LIBS ipc) - endif(HAVE_SHMAT) + endif() if(NOT HAVE_SHMAT) add_definitions(-DNO_SHARED_MEMORY) set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY") - endif(NOT HAVE_SHMAT) - endif(NOT HAVE_SHMAT) + endif() + endif() if(X11_SHARED) if(NOT HAVE_DLOPEN) message_warn("You must have SDL_LoadObject() support for dynamic X11 loading") set(HAVE_X11_SHARED FALSE) - else(NOT HAVE_DLOPEN) + else() set(HAVE_X11_SHARED TRUE) endif() if(HAVE_X11_SHARED) set(SDL_VIDEO_DRIVER_X11_DYNAMIC "\"${X11_LIB_SONAME}\"") set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB_SONAME}\"") - else(HAVE_X11_SHARED) + else() list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB}) - endif(HAVE_X11_SHARED) - endif(X11_SHARED) + endif() + endif() set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}") @@ -394,7 +394,7 @@ macro(CheckX11) int main(int argc, char **argv) {}" HAVE_CONST_XEXT_ADDDISPLAY) if(HAVE_CONST_XEXT_ADDDISPLAY) set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1) - endif(HAVE_CONST_XEXT_ADDDISPLAY) + endif() check_c_source_compiles(" #include @@ -407,15 +407,7 @@ macro(CheckX11) XFreeEventData(display, cookie); }" HAVE_XGENERICEVENT) if(HAVE_XGENERICEVENT) set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1) - endif(HAVE_XGENERICEVENT) - - 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(HAVE_CONST_XDATA32) + endif() check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM) @@ -423,29 +415,29 @@ macro(CheckX11) set(HAVE_VIDEO_X11_XCURSOR TRUE) if(HAVE_X11_SHARED AND XCURSOR_LIB) set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"") - else(HAVE_X11_SHARED AND XCURSOR_LIB) + else() list(APPEND EXTRA_LIBS ${XCURSOR_LIB}) - endif(HAVE_X11_SHARED AND XCURSOR_LIB) + endif() set(SDL_VIDEO_DRIVER_X11_XCURSOR 1) - endif(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H) + endif() if(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H) set(HAVE_VIDEO_X11_XINERAMA TRUE) if(HAVE_X11_SHARED AND XINERAMA_LIB) set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "\"${XINERAMA_LIB_SONAME}\"") - else(HAVE_X11_SHARED AND XINERAMA_LIB) + else() list(APPEND EXTRA_LIBS ${XINERAMA_LIB}) - endif(HAVE_X11_SHARED AND XINERAMA_LIB) + endif() set(SDL_VIDEO_DRIVER_X11_XINERAMA 1) - endif(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H) + endif() if(VIDEO_X11_XINPUT AND HAVE_XINPUT_H) set(HAVE_VIDEO_X11_XINPUT TRUE) if(HAVE_X11_SHARED AND XI_LIB) set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"") - else(HAVE_X11_SHARED AND XI_LIB) + else() list(APPEND EXTRA_LIBS ${XI_LIB}) - endif(HAVE_X11_SHARED AND XI_LIB) + endif() set(SDL_VIDEO_DRIVER_X11_XINPUT2 1) # Check for multitouch @@ -462,51 +454,56 @@ macro(CheckX11) int main(int argc, char **argv) {}" HAVE_XINPUT2_MULTITOUCH) if(HAVE_XINPUT2_MULTITOUCH) set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1) - endif(HAVE_XINPUT2_MULTITOUCH) - endif(VIDEO_X11_XINPUT AND HAVE_XINPUT_H) + endif() + endif() if(VIDEO_X11_XRANDR AND HAVE_XRANDR_H) if(HAVE_X11_SHARED AND XRANDR_LIB) set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"") - else(HAVE_X11_SHARED AND XRANDR_LIB) + else() list(APPEND EXTRA_LIBS ${XRANDR_LIB}) - endif(HAVE_X11_SHARED AND XRANDR_LIB) + endif() set(SDL_VIDEO_DRIVER_X11_XRANDR 1) set(HAVE_VIDEO_X11_XRANDR TRUE) - endif(VIDEO_X11_XRANDR AND HAVE_XRANDR_H) + endif() if(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H) if(HAVE_X11_SHARED AND XSS_LIB) set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"") - else(HAVE_X11_SHARED AND XSS_LIB) + else() list(APPEND EXTRA_LIBS ${XSS_LIB}) - endif(HAVE_X11_SHARED AND XSS_LIB) + endif() set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1) set(HAVE_VIDEO_X11_XSCRNSAVER TRUE) - endif(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H) + endif() if(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H) set(SDL_VIDEO_DRIVER_X11_XSHAPE 1) set(HAVE_VIDEO_X11_XSHAPE TRUE) - endif(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H) + endif() if(VIDEO_X11_XVM AND HAVE_XF86VM_H) if(HAVE_X11_SHARED AND XXF86VM_LIB) set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "\"${XXF86VM_LIB_SONAME}\"") - else(HAVE_X11_SHARED AND XXF86VM_LIB) + else() list(APPEND EXTRA_LIBS ${XXF86VM_LIB}) - endif(HAVE_X11_SHARED AND XXF86VM_LIB) + endif() set(SDL_VIDEO_DRIVER_X11_XVIDMODE 1) set(HAVE_VIDEO_X11_XVM TRUE) - endif(VIDEO_X11_XVM AND HAVE_XF86VM_H) + endif() set(CMAKE_REQUIRED_LIBRARIES) - endif(X11_LIB) - endif(VIDEO_X11) -endmacro(CheckX11) + endif() + 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) - endif(VIDEO_MIR) -endmacro(CheckMir) + + 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,16 +553,38 @@ 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(WAYLAND_FOUND) - endif(VIDEO_WAYLAND) -endmacro(CheckWayland) + endif() + endif() +endmacro() # Requires: # - n/a @@ -558,16 +593,16 @@ macro(CheckCOCOA) if(VIDEO_COCOA) if(APPLE) # Apple always has Cocoa. set(HAVE_VIDEO_COCOA TRUE) - endif(APPLE) + endif() if(HAVE_VIDEO_COCOA) file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m) set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C) set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES}) set(SDL_VIDEO_DRIVER_COCOA 1) set(HAVE_SDL_VIDEO TRUE) - endif(HAVE_VIDEO_COCOA) - endif(VIDEO_COCOA) -endmacro(CheckCOCOA) + endif() + endif() +endmacro() # Requires: # - PkgCheckModules @@ -591,14 +626,14 @@ macro(CheckDirectFB) FindLibraryAndSONAME("directfb") set(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "\"${DIRECTFB_LIB_SONAME}\"") set(HAVE_DIRECTFB_SHARED TRUE) - endif(NOT HAVE_DLOPEN) - else(DIRECTFB_SHARED) + endif() + else() list(APPEND EXTRA_LDFLAGS ${PKG_DIRECTFB_LDFLAGS}) - endif(DIRECTFB_SHARED) + endif() set(HAVE_SDL_VIDEO TRUE) - endif(PKG_DIRECTFB_FOUND) - endif(VIDEO_DIRECTFB) -endmacro(CheckDirectFB) + endif() + endif() +endmacro() # Requires: # - n/a @@ -645,9 +680,9 @@ macro(CheckOpenGLX11) set(SDL_VIDEO_OPENGL_GLX 1) set(SDL_VIDEO_RENDER_OGL 1) list(APPEND EXTRA_LIBS GL) - endif(HAVE_VIDEO_OPENGL) - endif(VIDEO_OPENGL) -endmacro(CheckOpenGLX11) + endif() + endif() +endmacro() # Requires: # - nada @@ -659,7 +694,7 @@ macro(CheckOpenGLESX11) int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL) if(HAVE_VIDEO_OPENGL_EGL) set(SDL_VIDEO_OPENGL_EGL 1) - endif(HAVE_VIDEO_OPENGL_EGL) + endif() check_c_source_compiles(" #include #include @@ -668,7 +703,7 @@ macro(CheckOpenGLESX11) set(HAVE_VIDEO_OPENGLES TRUE) set(SDL_VIDEO_OPENGL_ES 1) set(SDL_VIDEO_RENDER_OGL_ES 1) - endif(HAVE_VIDEO_OPENGLES_V1) + endif() check_c_source_compiles(" #include #include @@ -677,12 +712,12 @@ macro(CheckOpenGLESX11) set(HAVE_VIDEO_OPENGLES TRUE) set(SDL_VIDEO_OPENGL_ES2 1) set(SDL_VIDEO_RENDER_OGL_ES2 1) - endif(HAVE_VIDEO_OPENGLES_V2) + endif() - endif(VIDEO_OPENGLES) -endmacro(CheckOpenGLESX11) + endif() +endmacro() -# Rquires: +# Requires: # - nada # Optional: # - THREADS opt @@ -729,17 +764,21 @@ macro(CheckPTHREAD) else() set(PTHREAD_CFLAGS "-D_REENTRANT") set(PTHREAD_LDFLAGS "-lpthread") - endif(LINUX) + endif() # 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}) @@ -756,7 +795,7 @@ macro(CheckPTHREAD) }" HAVE_RECURSIVE_MUTEXES) if(HAVE_RECURSIVE_MUTEXES) set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1) - else(HAVE_RECURSIVE_MUTEXES) + else() check_c_source_compiles(" #include int main(int argc, char **argv) { @@ -766,8 +805,8 @@ macro(CheckPTHREAD) }" HAVE_RECURSIVE_MUTEXES_NP) if(HAVE_RECURSIVE_MUTEXES_NP) set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1) - endif(HAVE_RECURSIVE_MUTEXES_NP) - endif(HAVE_RECURSIVE_MUTEXES) + endif() + endif() if(PTHREADS_SEM) check_c_source_compiles("#include @@ -781,15 +820,15 @@ macro(CheckPTHREAD) sem_timedwait(NULL, NULL); return 0; }" HAVE_SEM_TIMEDWAIT) - endif(HAVE_PTHREADS_SEM) - endif(PTHREADS_SEM) + endif() + endif() check_c_source_compiles(" #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} @@ -801,14 +840,14 @@ macro(CheckPTHREAD) if(HAVE_PTHREADS_SEM) set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c) - else(HAVE_PTHREADS_SEM) + else() set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syssem.c) - endif(HAVE_PTHREADS_SEM) + endif() set(HAVE_SDL_THREADS TRUE) - endif(HAVE_PTHREADS) - endif(PTHREADS) -endmacro(CheckPTHREAD) + endif() + endif() +endmacro() # Requires # - nada @@ -822,27 +861,27 @@ macro(CheckUSBHID) check_include_file(usbhid.h HAVE_USBHID_H) if(HAVE_USBHID_H) set(USB_CFLAGS "-DHAVE_USBHID_H") - endif(HAVE_USBHID_H) + endif() check_include_file(libusbhid.h HAVE_LIBUSBHID_H) if(HAVE_LIBUSBHID_H) set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSBHID_H") - endif(HAVE_LIBUSBHID_H) + endif() set(USB_LIBS ${USB_LIBS} usbhid) - else(LIBUSBHID) + else() check_include_file(usb.h HAVE_USB_H) if(HAVE_USB_H) set(USB_CFLAGS "-DHAVE_USB_H") - endif(HAVE_USB_H) + endif() check_include_file(libusb.h HAVE_LIBUSB_H) if(HAVE_LIBUSB_H) set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSB_H") - endif(HAVE_LIBUSB_H) + endif() check_library_exists(usb hid_init "" LIBUSB) if(LIBUSB) set(USB_LIBS ${USB_LIBS} usb) - endif(LIBUSB) - endif(LIBUSBHID) + endif() + endif() set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}") set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}") @@ -898,7 +937,7 @@ macro(CheckUSBHID) }" HAVE_USBHID_UCR_DATA) if(HAVE_USBHID_UCR_DATA) set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_UCR_DATA") - endif(HAVE_USBHID_UCR_DATA) + endif() check_c_source_compiles(" #include @@ -926,7 +965,7 @@ macro(CheckUSBHID) }" HAVE_USBHID_NEW) if(HAVE_USBHID_NEW) set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_NEW") - endif(HAVE_USBHID_NEW) + endif() check_c_source_compiles(" #include @@ -936,7 +975,7 @@ macro(CheckUSBHID) }" HAVE_MACHINE_JOYSTICK) if(HAVE_MACHINE_JOYSTICK) set(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1) - endif(HAVE_MACHINE_JOYSTICK) + endif() set(SDL_JOYSTICK_USBHID 1) file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${BSD_JOYSTICK_SOURCES}) @@ -946,8 +985,8 @@ macro(CheckUSBHID) set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_FLAGS) - endif(HAVE_USBHID) -endmacro(CheckUSBHID) + endif() +endmacro() # Requires: # - n/a diff --git a/jni/SDL2-2.0.3/configure b/jni/SDL2-2.0.3/configure index 3e2d8e54..047af8da 100755 --- a/jni/SDL2-2.0.3/configure +++ b/jni/SDL2-2.0.3/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 @@ -15728,7 +15737,7 @@ find_lib() else host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" fi - for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do + for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do lib=`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1` if test x$lib != x; then echo $lib @@ -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; @@ -21385,6 +21353,78 @@ $as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h fi } +CheckEmscriptenGLES() +{ + if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL support" >&5 +$as_echo_n "checking for EGL support... " >&6; } + video_opengl_egl=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + video_opengl_egl=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengl_egl" >&5 +$as_echo "$video_opengl_egl" >&6; } + if test x$video_opengl_egl = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL_EGL 1" >>confdefs.h + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v2 headers" >&5 +$as_echo_n "checking for OpenGL ES v2 headers... " >&6; } + video_opengles_v2=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + video_opengles_v2=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v2" >&5 +$as_echo "$video_opengles_v2" >&6; } + if test x$video_opengles_v2 = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL_ES2 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h + + SUMMARY_video="${SUMMARY_video} opengl_es2" + fi + fi +} + CheckInputEvents() { { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux 2.4 unified input interface" >&5 @@ -21829,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" @@ -21844,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 @@ -21857,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 @@ -21865,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 @@ -21884,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 @@ -21892,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; } @@ -22865,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*) @@ -22879,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 @@ -22922,8 +22968,12 @@ case "$host" in CheckLibUDev CheckDBus CheckIBus - CheckInputEvents - CheckInputKD + case $ARCH in + linux) + CheckInputEvents + CheckInputKD + ;; + esac CheckTslib CheckUSBHID CheckPTHREAD @@ -23019,11 +23069,22 @@ $as_echo "#define SDL_POWER_ANDROID 1" >>confdefs.h fi # Set up files for the filesystem library if test x$enable_filesystem = xyes; then + case $ARCH in + android) + +$as_echo "#define SDL_FILESYSTEM_ANDROID 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c" + have_filesystem=yes + ;; + *) $as_echo "#define SDL_FILESYSTEM_UNIX 1" >>confdefs.h - SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c" - have_filesystem=yes + SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c" + have_filesystem=yes + ;; + esac fi # Set up files for the timer library if test x$enable_timers = xyes; then @@ -23192,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" @@ -23372,6 +23433,7 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController" ;; *-*-darwin* ) # This could be either full "Mac OS X", or plain "Darwin" which is @@ -23483,7 +23545,68 @@ $as_echo "#define SDL_FILESYSTEM_NACL 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c" have_filesystem=yes fi + ;; + *-*-emscripten* ) + if test x$enable_video = xyes; then +$as_echo "#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c" + have_video=yes + SUMMARY_video="${SUMMARY_video} emscripten" + fi + + if test x$enable_audio = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c" + have_audio=yes + SUMMARY_audio="${SUMMARY_audio} emscripten" + fi + + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckClockGettime + CheckEmscriptenGLES + + # Set up files for the power library + if test x$enable_power = xyes; then + +$as_echo "#define SDL_POWER_EMSCRIPTEN 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c" + have_power=yes + fi + + # Set up files for the power library + if test x$enable_joystick = xyes; then + +$as_echo "#define SDL_JOYSTICK_EMSCRIPTEN 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c" + have_joystick=yes + fi + + # Set up files for the filesystem library + if test x$enable_filesystem = xyes; then + +$as_echo "#define SDL_FILESYSTEM_EMSCRIPTEN 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c" + have_filesystem=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + +$as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi ;; *) as_fn_error $? " @@ -23493,7 +23616,6 @@ $as_echo "#define SDL_FILESYSTEM_NACL 1" >>confdefs.h esac CheckWarnAll -CheckWarnShadow # Verify that we have all the platform specific files we need @@ -23643,7 +23765,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" @@ -24762,6 +24884,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/jni/SDL2-2.0.3/configure.in b/jni/SDL2-2.0.3/configure.in index 4653c7da..265be964 100644 --- a/jni/SDL2-2.0.3/configure.in +++ b/jni/SDL2-2.0.3/configure.in @@ -142,7 +142,7 @@ find_lib() else host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" fi - for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do + for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`] if test x$lib != x; then echo $lib @@ -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) @@ -2130,6 +2110,40 @@ CheckMacGL() fi } +CheckEmscriptenGLES() +{ + if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then + AC_MSG_CHECKING(for EGL support) + video_opengl_egl=no + AC_TRY_COMPILE([ + #include + ],[ + ],[ + video_opengl_egl=yes + ]) + AC_MSG_RESULT($video_opengl_egl) + if test x$video_opengl_egl = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ]) + fi + + AC_MSG_CHECKING(for OpenGL ES v2 headers) + video_opengles_v2=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_opengles_v2=yes + ]) + AC_MSG_RESULT($video_opengles_v2) + if test x$video_opengles_v2 = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ]) + SUMMARY_video="${SUMMARY_video} opengl_es2" + fi + fi +} + dnl See if we can use the new unified event interface in Linux 2.4 CheckInputEvents() { @@ -2379,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" @@ -2390,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; @@ -2401,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; @@ -2801,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*) @@ -2815,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 @@ -2858,8 +2876,12 @@ case "$host" in CheckLibUDev CheckDBus CheckIBus - CheckInputEvents - CheckInputKD + case $ARCH in + linux) + CheckInputEvents + CheckInputKD + ;; + esac CheckTslib CheckUSBHID CheckPTHREAD @@ -2937,9 +2959,18 @@ case "$host" in fi # Set up files for the filesystem library if test x$enable_filesystem = xyes; then - AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c" - have_filesystem=yes + case $ARCH in + android) + AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c" + have_filesystem=yes + ;; + *) + AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c" + have_filesystem=yes + ;; + esac fi # Set up files for the timer library if test x$enable_timers = xyes; then @@ -3070,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" @@ -3206,6 +3237,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController" ;; *-*-darwin* ) # This could be either full "Mac OS X", or plain "Darwin" which is @@ -3302,7 +3334,56 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c" have_filesystem=yes fi + ;; + *-*-emscripten* ) + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c" + have_video=yes + SUMMARY_video="${SUMMARY_video} emscripten" + fi + + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c" + have_audio=yes + SUMMARY_audio="${SUMMARY_audio} emscripten" + fi + + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckClockGettime + CheckEmscriptenGLES + + # Set up files for the power library + if test x$enable_power = xyes; then + AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c" + have_power=yes + fi + # Set up files for the power library + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c" + have_joystick=yes + fi + + # Set up files for the filesystem library + if test x$enable_filesystem = xyes; then + AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c" + have_filesystem=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + AC_DEFINE(SDL_TIMER_UNIX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi ;; *) AC_MSG_ERROR([ @@ -3313,7 +3394,6 @@ esac dnl Do this on all platforms, after everything else. CheckWarnAll -CheckWarnShadow # Verify that we have all the platform specific files we need @@ -3454,7 +3534,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/jni/SDL2-2.0.3/debian/copyright b/jni/SDL2-2.0.3/debian/copyright index 53254644..31860bbe 100644 --- a/jni/SDL2-2.0.3/debian/copyright +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/docs/README-dynapi.md b/jni/SDL2-2.0.3/docs/README-dynapi.md index 5669fd76..bfaecb34 100644 --- a/jni/SDL2-2.0.3/docs/README-dynapi.md +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/docs/README-gesture.md b/jni/SDL2-2.0.3/docs/README-gesture.md index 7b90b54d..7e9f95bc 100644 --- a/jni/SDL2-2.0.3/docs/README-gesture.md +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/docs/README-ios.md b/jni/SDL2-2.0.3/docs/README-ios.md index af33e03b..69c35d6f 100644 --- a/jni/SDL2-2.0.3/docs/README-ios.md +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/docs/README-macosx.md b/jni/SDL2-2.0.3/docs/README-macosx.md index 768a33e3..747e1e60 100644 --- a/jni/SDL2-2.0.3/docs/README-macosx.md +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/docs/README-platforms.md b/jni/SDL2-2.0.3/docs/README-platforms.md index 4bf77b20..14454ec5 100644 --- a/jni/SDL2-2.0.3/docs/README-platforms.md +++ b/jni/SDL2-2.0.3/docs/README-platforms.md @@ -1,34 +1,8 @@ Platforms ========= - -This is a list of the platforms SDL supports, and who maintains them. - -Officially supported platforms -============================== -(code compiles, and thoroughly tested for release) -============================== -* Windows XP/Vista/7/8 -* Mac OS X 10.5+ -* Linux 2.6+ -* iOS 5.1.1+ -* Android 2.3.3+ - -Unofficially supported platforms -================================ -(code compiles, but not thoroughly tested) -================================ -* FreeBSD -* NetBSD -* OpenBSD -* Solaris - -Platforms supported by volunteers -================================= -* Haiku - maintained by Axel Dörfler -* PSP - maintained by 527721088@qq.com -* Pandora - maintained by Scott Smith -* NaCl - maintained by Gabriel Jacobo - -Platforms that need maintainers -=============================== +We maintain the list of supported platforms on our wiki now, and how to +build and install SDL for those platforms: + + https://wiki.libsdl.org/Installation + diff --git a/jni/SDL2-2.0.3/docs/README-porting.md b/jni/SDL2-2.0.3/docs/README-porting.md index d93c65bd..f13f83b8 100644 --- a/jni/SDL2-2.0.3/docs/README-porting.md +++ b/jni/SDL2-2.0.3/docs/README-porting.md @@ -15,7 +15,7 @@ There are two basic ways of building SDL at the moment: If you have a GNUish system, then you might try this. Edit configure.in, take a look at the large section labelled: - "Set up the configuration based on the target platform!" + "Set up the configuration based on the host platform!" Add a section for your platform, and then re-run autogen.sh and build! 2. Using an IDE: @@ -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/jni/SDL2-2.0.3/docs/README-raspberrypi.md b/jni/SDL2-2.0.3/docs/README-raspberrypi.md index c14dbf1a..ade3c81c 100644 --- a/jni/SDL2-2.0.3/docs/README-raspberrypi.md +++ b/jni/SDL2-2.0.3/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 @@ -150,6 +150,23 @@ this determining the CAPS LOCK behavior: sudo dpkg-reconfigure locales +================================================================================ + 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: + + ./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 + ================================================================================ Notes ================================================================================ diff --git a/jni/SDL2-2.0.3/docs/README-winrt.md b/jni/SDL2-2.0.3/docs/README-winrt.md index a5ea78b6..741def67 100644 --- a/jni/SDL2-2.0.3/docs/README-winrt.md +++ b/jni/SDL2-2.0.3/docs/README-winrt.md @@ -10,6 +10,7 @@ primarily, via a Microsoft-run online store (of the same name). Some of the operating systems that include WinRT, are: +* Windows 10, via its Universal Windows Platform (UWP) APIs * Windows 8.x * Windows RT 8.x (aka. Windows 8.x for ARM processors) * Windows Phone 8.x @@ -18,22 +19,25 @@ Some of the operating systems that include WinRT, are: Requirements ------------ -* Microsoft Visual C++ (aka Visual Studio), either 2013 or 2012 versions - - Free, "Express" editions may be used, so long as they include support for - either "Windows Store" or "Windows Phone" apps. Versions marked as - supporting "Windows Desktop" development typically do not include support - for creating WinRT apps. - - Visual C++ 2012 can only build apps that target versions 8.0 of Windows, or - Windows Phone. 8.0-targetted apps will still run on devices running - 8.1 editions of Windows, however they will not be able to take advantage of +* Microsoft Visual C++ (aka Visual Studio), either 2015, 2013, or 2012 + - Free, "Community" or "Express" editions may be used, so long as they + include support for either "Windows Store" or "Windows Phone" apps. + "Express" versions marked as supporting "Windows Desktop" development + typically do not include support for creating WinRT apps, to note. + (The "Community" editions of Visual C++ do, however, support both + desktop/Win32 and WinRT development). + - Visual C++ 2012 can only build apps that target versions 8.0 of Windows, + or Windows Phone. 8.0-targetted apps will run on devices running 8.1 + editions of Windows, however they will not be able to take advantage of 8.1-specific features. - - Visual C++ 2013 can only create app projects that target 8.1 versions - of Windows, which do NOT run on 8.0 devices. An optional Visual Studio - add-in, "Tools for Maintaining Store apps for Windows 8", allows projects - that are created with Visual C++ 2012, which can create Windows 8.0 apps, - to be loaded and built with non-Express editions of Visual C++ 2013. More - details on targeting different versions of Windows can found at the - following web pages: + - Visual C++ 2013 cannot create app projects that target Windows 8.0. + Visual C++ 2013 Update 4, can create app projects for Windows Phone 8.0, + Windows Phone 8.1, and Windows 8.1, but not Windows 8.0. An optional + Visual Studio add-in, "Tools for Maintaining Store apps for Windows 8", + allows Visual C++ 2013 to load and build Windows 8.0 projects that were + created with Visual C++ 2012, so long as Visual C++ 2012 is installed + on the same machine. More details on targeting different versions of + Windows can found at the following web pages: - [Develop apps by using Visual Studio 2013](http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx) - [To add the Tools for Maintaining Store apps for Windows 8](http://msdn.microsoft.com/en-us/library/windows/apps/dn263114.aspx#AddMaintenanceTools) * A valid Microsoft account - This requirement is not imposed by SDL, but @@ -41,6 +45,107 @@ Requirements debug apps. +Status +------ + +Here is a rough list of what works, and what doens't: + +* What works: + * compilation via Visual C++ 2012 through 2015 + * compile-time platform detection for SDL programs. The C/C++ #define, + `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT. + * GPU-accelerated 2D rendering, via SDL_Renderer. + * OpenGL ES 2, via the ANGLE library (included separately from SDL) + * software rendering, via either SDL_Surface (optionally in conjunction with + SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the + SDL_Renderer APIs + * threads + * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(), + SDL_GetPerformanceFrequency(), etc.) + * file I/O via SDL_RWops + * mouse input (unsupported on Windows Phone) + * audio, via a modified version of SDL's XAudio2 backend + * .DLL file loading. Libraries *MUST* be packaged inside applications. Loading + anything outside of the app is not supported. + * system path retrieval via SDL's filesystem APIs + * game controllers. Support is provided via the SDL_Joystick and + SDL_GameController APIs, and is backed by Microsoft's XInput API. + * multi-touch input + * app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as + appropriate. + * window events + * using Direct3D 11.x APIs outside of SDL. Non-XAML / Direct3D-only apps can + choose to render content directly via Direct3D, using SDL to manage the + internal WinRT window, as well as input and audio. (Use + SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into + IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.) + +* What partially works: + * keyboard input. Most of WinRT's documented virtual keys are supported, as + well as many keys with documented hardware scancodes. + * 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() + functions to be called. + +* What doesn't work: + * compilation with anything other than Visual C++ + * programmatically-created custom cursors. These don't appear to be supported + by WinRT. Different OS-provided cursors can, however, be created via + SDL_CreateSystemCursor() (unsupported on Windows Phone) + * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal(). This are not currently + supported by WinRT itself. + * joysticks and game controllers that aren't supported by Microsoft's XInput + API. + * turning off VSync when rendering on Windows Phone. Attempts to turn VSync + off on Windows Phone result either in Direct3D not drawing anything, or it + forcing VSync back on. As such, SDL_RENDERER_PRESENTVSYNC will always get + turned-on on Windows Phone. This limitation is not present in non-Phone + WinRT (such as Windows 8.x), where turning off VSync appears to work. + * probably anything else that's not listed as supported + + + +Upgrade Notes +------------- + +#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3 + +SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath(). +The fixes may affect older, SDL 2.0.3-based apps' save data. Please note +that these changes only apply to SDL-based WinRT apps, and not to apps for +any other platform. + +1. SDL_GetPrefPath() would return an invalid path, one in which the path's + directory had not been created. Attempts to create files there + (via fopen(), for example), would fail, unless that directory was + explicitly created beforehand. + +2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside + a WinRT 'Roaming' folder, the contents of which get automatically + synchronized across multiple devices. This process can occur while an + application runs, and can cause existing save-data to be overwritten + at unexpected times, with data from other devices. (Windows Phone apps + written with SDL 2.0.3 did not utilize a Roaming folder, due to API + restrictions in Windows Phone 8.0). + + +SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by: + +1. making sure that SDL_GetPrefPath() returns a directory in which data + can be written to immediately, without first needing to create directories. + +2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the + contents of which do not automatically get synchronized across devices + (and which require less work to use safely, in terms of data integrity). + +Apps that wish to get their Roaming folder's path can do so either by using +SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a +UCS-2/wide-char string), or directly through the WinRT class, +Windows.Storage.ApplicationData. + + + Setup, High-Level Steps ----------------------- @@ -114,10 +219,10 @@ To set this up for SDL/WinRT, you'll need to run through the following steps: 4. find SDL/WinRT's Visual C++ project file and open it. Different project files exist for different WinRT platforms. All of them are in SDL's source distribution, in the following directories: - * `VisualC-WinRT/WinPhone80_VS2012/` - for Windows Phone 8.0 apps + * `VisualC-WinRT/UWP_VS2015/` - for Windows 10 / UWP apps * `VisualC-WinRT/WinPhone81_VS2013/` - for Windows Phone 8.1 apps - * `VisualC-WinRT/WinRT80_VS2012/` - for Windows 8.0 apps - * `VisualC-WinRT/WinRT81_VS2013/` - for Windows 8.1 apps + * `VisualC-WinRT/WinRT80_VS2012/` - for Windows 8.0 apps + * `VisualC-WinRT/WinRT81_VS2013/` - for Windows 8.1 apps 5. once the project has been added, right-click on your app's project and select, "References..." 6. click on the button titled, "Add New Reference..." @@ -278,11 +383,11 @@ A list of unsupported C APIs can be found at General information on using the C runtime in WinRT can be found at - + -A list of supported Win32 APIs for Windows 8/RT apps can be found at +A list of supported Win32 APIs for WinRT apps can be found at . To note, -the list of supported Win32 APIs for Windows Phone 8 development is different. +the list of supported Win32 APIs for Windows Phone 8.0 is different. That list can be found at @@ -300,7 +405,12 @@ Simulator. Once you do that, any time you build and run the app, the app will launch in window, rather than full-screen. -#### 7.A. Running apps on ARM-based devices #### +#### 7.A. Running apps on older, ARM-based, "Windows RT" devices #### + +**These instructions do not include Windows Phone, despite Windows Phone +typically running on ARM processors.** They are specifically for devices +that use the "Windows RT" operating system, which was a modified version of +Windows 8.x that ran primarily on ARM-based tablet computers. To build and run the app on ARM-based, "Windows RT" devices, you'll need to: @@ -311,9 +421,9 @@ To build and run the app on ARM-based, "Windows RT" devices, you'll need to: Windows RT device (on the network). Microsoft's Remote Debugger can be found at -. Please note +. Please note that separate versions of this debugger exist for different versions of Visual -C++, one for debugging with MSVC 2012, another for debugging with MSVC 2013. +C++, one each for MSVC 2015, 2013, and 2012. To setup Visual C++ to launch your app on an ARM device: @@ -327,7 +437,8 @@ To setup Visual C++ to launch your app on an ARM device: 2. select "Debugging" 3. next to "Machine Name", enter the hostname or IP address of the ARM device - 4. if, and only if, you've turned off authentication in the Remote Debugger, then change the setting for "Require Authentication" to No + 4. if, and only if, you've turned off authentication in the Remote Debugger, + then change the setting for "Require Authentication" to No 5. click "OK" 4. build and run the app (from Visual C++). The first time you do this, a prompt will show up on the ARM device, asking for a Microsoft Account. You @@ -337,14 +448,21 @@ To setup Visual C++ to launch your app on an ARM device: C++. -TODO ----- +Troubleshooting +--------------- + +#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'" + +Try adding the following to your linker flags. In MSVC, this can be done by +right-clicking on the app project, navigating to Configuration Properties -> +Linker -> Command Line, then adding them to the Additional Options +section. + +* For Release builds / MSVC-Configurations, add: + + /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib + +* For Debug builds / MSVC-Configurations, add: + + /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib -- Document details of SDL satellite library support -- Make [NuGet](https://www.nuget.org) packages for SDL/WinRT -- Create templates for both MSVC 2012 and MSVC 2013, and have the corresponding - VSIX packages either include pre-built copies of SDL, or reference binaries - available via MSVC's NuGet servers - - Write setup instructions that use MSVC 201x templates -- Write a list of caveats found in SDL/WinRT, such as APIs that don't work due - to platform restrictions, or things that need further work diff --git a/jni/SDL2-2.0.3/docs/README.md b/jni/SDL2-2.0.3/docs/README.md index de173bd2..4e310692 100644 --- a/jni/SDL2-2.0.3/docs/README.md +++ b/jni/SDL2-2.0.3/docs/README.md @@ -33,6 +33,7 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd - [CMake](README-cmake.md) - [DirectFB](README-directfb.md) - [DynAPI](README-dynapi.md) +- [Emscripten](README-emscripten.md) - [Gesture](README-gesture.md) - [Mercurial](README-hg.md) - [iOS](README-ios.md) diff --git a/jni/SDL2-2.0.3/docs/doxyfile b/jni/SDL2-2.0.3/docs/doxyfile index f17838d1..baf1c98d 100644 --- a/jni/SDL2-2.0.3/docs/doxyfile +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL.h b/jni/SDL2-2.0.3/include/SDL.h index 703dc3d9..9d1ede33 100644 --- a/jni/SDL2-2.0.3/include/SDL.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_assert.h b/jni/SDL2-2.0.3/include/SDL_assert.h index 94d99877..6889514d 100644 --- a/jni/SDL2-2.0.3/include/SDL_assert.h +++ b/jni/SDL2-2.0.3/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 @@ -102,9 +104,9 @@ typedef enum SDL_ASSERTION_ABORT, /**< Terminate the program. */ SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ -} SDL_assert_state; +} SDL_AssertState; -typedef struct SDL_assert_data +typedef struct SDL_AssertData { int always_ignore; unsigned int trigger_count; @@ -112,13 +114,13 @@ typedef struct SDL_assert_data const char *filename; int linenum; const char *function; - const struct SDL_assert_data *next; -} SDL_assert_data; + const struct SDL_AssertData *next; +} SDL_AssertData; #if (SDL_ASSERT_LEVEL > 0) /* Never call this directly. Use the SDL_assert* macros. */ -extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, +extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, const char *, const char *, int) #if defined(__clang__) @@ -141,10 +143,10 @@ extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, #define SDL_enabled_assert(condition) \ do { \ while ( !(condition) ) { \ - static struct SDL_assert_data sdl_assert_data = { \ + static struct SDL_AssertData sdl_assert_data = { \ 0, 0, #condition, 0, 0, 0, 0 \ }; \ - const SDL_assert_state sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ + const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ continue; /* go again. */ \ } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ @@ -181,8 +183,8 @@ extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, #define SDL_assert_always(condition) SDL_enabled_assert(condition) -typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)( - const SDL_assert_data* data, void* userdata); +typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( + const SDL_AssertData* data, void* userdata); /** * \brief Set an application-defined assertion handler. @@ -199,7 +201,7 @@ typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)( * * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! * - * \return SDL_assert_state value of how to handle the assertion failure. + * \return SDL_AssertState value of how to handle the assertion failure. * * \param handler Callback function, called when an assertion fails. * \param userdata A pointer passed to the callback as-is. @@ -246,7 +248,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse * The proper way to examine this data looks something like this: * * - * const SDL_assert_data *item = SDL_GetAssertionReport(); + * const SDL_AssertData *item = SDL_GetAssertionReport(); * while (item) { * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", * item->condition, item->function, item->filename, @@ -259,7 +261,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse * \return List of all assertions. * \sa SDL_ResetAssertionReport */ -extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void); +extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); /** * \brief Reset the list of all assertion failures. @@ -270,6 +272,12 @@ extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void); */ extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); + +/* these had wrong naming conventions until 2.0.4. Please update your app! */ +#define SDL_assert_state SDL_AssertState +#define SDL_assert_data SDL_AssertData + + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/jni/SDL2-2.0.3/include/SDL_atomic.h b/jni/SDL2-2.0.3/include/SDL_atomic.h index 6f308ce8..bb01eb9e 100644 --- a/jni/SDL2-2.0.3/include/SDL_atomic.h +++ b/jni/SDL2-2.0.3/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 @@ -122,7 +122,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); void _ReadWriteBarrier(void); #pragma intrinsic(_ReadWriteBarrier) #define SDL_CompilerBarrier() _ReadWriteBarrier() -#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) /* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ #define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") #else diff --git a/jni/SDL2-2.0.3/include/SDL_audio.h b/jni/SDL2-2.0.3/include/SDL_audio.h index 5c04b0bf..359005d0 100644 --- a/jni/SDL2-2.0.3/include/SDL_audio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_bits.h b/jni/SDL2-2.0.3/include/SDL_bits.h index 341524fd..c62766d9 100644 --- a/jni/SDL2-2.0.3/include/SDL_bits.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_blendmode.h b/jni/SDL2-2.0.3/include/SDL_blendmode.h index 8c257be9..c7fa09f7 100644 --- a/jni/SDL2-2.0.3/include/SDL_blendmode.h +++ b/jni/SDL2-2.0.3/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 @@ -58,6 +58,6 @@ typedef enum #endif #include "close_code.h" -#endif /* _SDL_video_h */ +#endif /* _SDL_blendmode_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/include/SDL_clipboard.h b/jni/SDL2-2.0.3/include/SDL_clipboard.h index 74e2b32f..3ad20548 100644 --- a/jni/SDL2-2.0.3/include/SDL_clipboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config.h b/jni/SDL2-2.0.3/include/SDL_config.h index 9a2e51c5..eda76602 100644 --- a/jni/SDL2-2.0.3/include/SDL_config.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config.h.cmake b/jni/SDL2-2.0.3/include/SDL_config.h.cmake index a0e4cb0e..3d5e3abf 100644 --- a/jni/SDL2-2.0.3/include/SDL_config.h.cmake +++ b/jni/SDL2-2.0.3/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 @@ -47,6 +47,13 @@ #cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ #cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ +#cmakedefine HAVE_D3D_H @HAVE_D3D_H@ +#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ +#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@ +#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@ +#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@ +#cmakedefine HAVE_XAUDIO2_H @HAVE_XAUDIO2_H@ +#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ #cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ /* Comment this if you want to build without any C library requirements */ @@ -217,6 +224,7 @@ #cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ #cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ #cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@ /* Enable various input drivers */ #cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ @@ -224,16 +232,20 @@ #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_MFI @SDL_JOYSTICK_MFI@ #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ #cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ #cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ #cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ #cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ #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@ @@ -267,18 +279,16 @@ #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@ #cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@ +#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@ #cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ @@ -289,6 +299,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@ @@ -297,7 +308,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@ @@ -325,6 +335,7 @@ #cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ #cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ #cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ +#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ #cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ /* Enable system filesystem support */ @@ -333,6 +344,7 @@ #cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@ #cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ #cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ +#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ /* Enable assembly routines */ #cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@ diff --git a/jni/SDL2-2.0.3/include/SDL_config.h.in b/jni/SDL2-2.0.3/include/SDL_config.h.in index 300149ea..2c74868b 100644 --- a/jni/SDL2-2.0.3/include/SDL_config.h.in +++ b/jni/SDL2-2.0.3/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 @@ -228,6 +228,7 @@ #undef SDL_AUDIO_DRIVER_WINMM #undef SDL_AUDIO_DRIVER_FUSIONSOUND #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC +#undef SDL_AUDIO_DRIVER_EMSCRIPTEN /* Enable various input drivers */ #undef SDL_INPUT_LINUXEV @@ -243,6 +244,7 @@ #undef SDL_JOYSTICK_WINMM #undef SDL_JOYSTICK_USBHID #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_JOYSTICK_EMSCRIPTEN #undef SDL_HAPTIC_DUMMY #undef SDL_HAPTIC_LINUX #undef SDL_HAPTIC_IOKIT @@ -287,6 +289,7 @@ #undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_RPI #undef SDL_VIDEO_DRIVER_ANDROID +#undef SDL_VIDEO_DRIVER_EMSCRIPTEN #undef SDL_VIDEO_DRIVER_X11_DYNAMIC #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @@ -296,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 @@ -304,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 @@ -336,6 +339,7 @@ #undef SDL_POWER_MACOSX #undef SDL_POWER_HAIKU #undef SDL_POWER_ANDROID +#undef SDL_POWER_EMSCRIPTEN #undef SDL_POWER_HARDWIRED /* Enable system filesystem support */ @@ -345,6 +349,8 @@ #undef SDL_FILESYSTEM_UNIX #undef SDL_FILESYSTEM_WINDOWS #undef SDL_FILESYSTEM_NACL +#undef SDL_FILESYSTEM_ANDROID +#undef SDL_FILESYSTEM_EMSCRIPTEN /* Enable assembly routines */ #undef SDL_ASSEMBLY_ROUTINES diff --git a/jni/SDL2-2.0.3/include/SDL_config_android.h b/jni/SDL2-2.0.3/include/SDL_config_android.h index 569ff1d5..8d5f1e5f 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_android.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config_iphoneos.h b/jni/SDL2-2.0.3/include/SDL_config_iphoneos.h index 4e3eb2c9..2d741c38 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_iphoneos.h +++ b/jni/SDL2-2.0.3/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 @@ -115,8 +115,11 @@ /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ #define SDL_HAPTIC_DUMMY 1 +/* Enable MFi joystick support */ +#define SDL_JOYSTICK_MFI 1 + /* Enable Unix style SO loading */ -/* Technically this works, but it violates the iPhone developer agreement */ +/* Technically this works, but violates the iOS dev agreement prior to iOS 8 */ /* #define SDL_LOADSO_DLOPEN 1 */ /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ @@ -145,8 +148,8 @@ /* enable iPhone keyboard support */ #define SDL_IPHONE_KEYBOARD 1 -/* enable joystick subsystem */ -#define SDL_JOYSTICK_DISABLED 0 +/* enable iOS extended launch screen */ +#define SDL_IPHONE_LAUNCHSCREEN 1 /* Set max recognized G-force from accelerometer See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed diff --git a/jni/SDL2-2.0.3/include/SDL_config_macosx.h b/jni/SDL2-2.0.3/include/SDL_config_macosx.h index b6af492d..e4ce82fc 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_macosx.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config_minimal.h b/jni/SDL2-2.0.3/include/SDL_config_minimal.h index 1bddafea..7721abc9 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_minimal.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config_pandora.h b/jni/SDL2-2.0.3/include/SDL_config_pandora.h index aead1ff9..530e78f1 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_pandora.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config_psp.h b/jni/SDL2-2.0.3/include/SDL_config_psp.h index 617d691f..26bf9d1a 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_psp.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config_windows.h b/jni/SDL2-2.0.3/include/SDL_config_windows.h index 8bc7ffe0..067d7f31 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_windows.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_config_winrt.h b/jni/SDL2-2.0.3/include/SDL_config_winrt.h index d70a0bcd..29bf79fe 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_winrt.h +++ b/jni/SDL2-2.0.3/include/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Copyright (C) 1997-2015 Sam Lantinga 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,11 +19,26 @@ 3. This notice may not be removed or altered from any source distribution. */ -#ifndef _SDL_config_windows_h -#define _SDL_config_windows_h +#ifndef _SDL_config_winrt_h +#define _SDL_config_winrt_h #include "SDL_platform.h" +/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used + by SDL to determine which version of the Windows SDK is being used. +*/ +#include + +/* Define possibly-undefined NTDDI values (used when compiling SDL against + older versions of the Windows SDK. +*/ +#ifndef NTDDI_WINBLUE +#define NTDDI_WINBLUE 0x06030000 +#endif +#ifndef NTDDI_WIN10 +#define NTDDI_WIN10 0x0A000000 +#endif + /* This is a set of defines to configure the SDL features */ #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) @@ -163,7 +178,12 @@ typedef unsigned int uintptr_t; #define SDL_LOADSO_WINDOWS 1 /* Enable various threading systems */ +#if (NTDDI_VERSION >= NTDDI_WINBLUE) +#define SDL_THREAD_WINDOWS 1 +#else +/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ #define SDL_THREAD_STDCPP 1 +#endif /* Enable various timer systems */ #define SDL_TIMER_WINDOWS 1 @@ -173,10 +193,8 @@ typedef unsigned int uintptr_t; #define SDL_VIDEO_DRIVER_DUMMY 1 /* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP /* TODO, WinRT: try adding OpenGL ES 2 support for Windows Phone 8 */ #define SDL_VIDEO_OPENGL_ES2 1 #define SDL_VIDEO_OPENGL_EGL 1 -#endif /* Enable appropriate renderer(s) */ #define SDL_VIDEO_RENDER_D3D11 1 @@ -193,4 +211,4 @@ typedef unsigned int uintptr_t; #define SDL_ASSEMBLY_ROUTINES 1 #endif -#endif /* _SDL_config_windows_h */ +#endif /* _SDL_config_winrt_h */ diff --git a/jni/SDL2-2.0.3/include/SDL_config_wiz.h b/jni/SDL2-2.0.3/include/SDL_config_wiz.h index 9204567c..4b3c5a2a 100644 --- a/jni/SDL2-2.0.3/include/SDL_config_wiz.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_copying.h b/jni/SDL2-2.0.3/include/SDL_copying.h index 0964da84..6fd65219 100644 --- a/jni/SDL2-2.0.3/include/SDL_copying.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_cpuinfo.h b/jni/SDL2-2.0.3/include/SDL_cpuinfo.h index 5b2c7a45..30d09cce 100644 --- a/jni/SDL2-2.0.3/include/SDL_cpuinfo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_egl.h b/jni/SDL2-2.0.3/include/SDL_egl.h index ed49a92f..358d869b 100644 --- a/jni/SDL2-2.0.3/include/SDL_egl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_endian.h b/jni/SDL2-2.0.3/include/SDL_endian.h index 161c418d..ec7841c4 100644 --- a/jni/SDL2-2.0.3/include/SDL_endian.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_error.h b/jni/SDL2-2.0.3/include/SDL_error.h index 001abb0f..1720c43f 100644 --- a/jni/SDL2-2.0.3/include/SDL_error.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_events.h b/jni/SDL2-2.0.3/include/SDL_events.h index f5136424..8a364c2a 100644 --- a/jni/SDL2-2.0.3/include/SDL_events.h +++ b/jni/SDL2-2.0.3/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 @@ -94,6 +94,9 @@ typedef enum SDL_KEYUP, /**< Key released */ SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ SDL_TEXTINPUT, /**< Keyboard text input */ + SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an + input language or keyboard layout change. + */ /* Mouse events */ SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ @@ -134,6 +137,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 */ @@ -260,6 +267,7 @@ typedef struct SDL_MouseWheelEvent Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ + Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ } SDL_MouseWheelEvent; /** @@ -381,6 +389,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.*) @@ -393,8 +415,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; @@ -421,7 +443,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; @@ -434,8 +456,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 { @@ -515,6 +537,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/jni/SDL2-2.0.3/include/SDL_filesystem.h b/jni/SDL2-2.0.3/include/SDL_filesystem.h index de3e227d..15bda498 100644 --- a/jni/SDL2-2.0.3/include/SDL_filesystem.h +++ b/jni/SDL2-2.0.3/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 @@ -131,6 +131,6 @@ extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); #endif #include "close_code.h" -#endif /* _SDL_system_h */ +#endif /* _SDL_filesystem_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/include/SDL_gamecontroller.h b/jni/SDL2-2.0.3/include/SDL_gamecontroller.h index b00ad713..5459387b 100644 --- a/jni/SDL2-2.0.3/include/SDL_gamecontroller.h +++ b/jni/SDL2-2.0.3/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 @@ -43,7 +43,7 @@ extern "C" { * \file SDL_gamecontroller.h * * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system * for game controllers, and load appropriate drivers. * * If you would like to receive controller updates while the application @@ -163,13 +163,19 @@ 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. */ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); +/** + * Return the SDL_GameController associated with an instance id. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); + /** * Return the name for this currently opened controller */ @@ -241,7 +247,8 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, /** * Get the current state of an axis control on a game controller. * - * The state is a value ranging from -32768 to 32767. + * The state is a value ranging from -32768 to 32767 (except for the triggers, + * which range from 0 to 32767). * * The axis indices start at index 0. */ diff --git a/jni/SDL2-2.0.3/include/SDL_gesture.h b/jni/SDL2-2.0.3/include/SDL_gesture.h index dbc16924..44983486 100644 --- a/jni/SDL2-2.0.3/include/SDL_gesture.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_haptic.h b/jni/SDL2-2.0.3/include/SDL_haptic.h index 569c635e..0e6f523b 100644 --- a/jni/SDL2-2.0.3/include/SDL_haptic.h +++ b/jni/SDL2-2.0.3/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 @@ -347,6 +342,9 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \brief Structure that represents a haptic direction. * + * This is the direction where the force comes from, + * instead of the direction in which the force is exerted. + * * Directions can be specified by: * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. @@ -555,7 +553,7 @@ typedef struct SDL_HapticPeriodic Uint16 period; /**< Period of the wave. */ Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ Sint16 offset; /**< Mean value of the wave. */ - Uint16 phase; /**< Horizontal shift given by hundredth of a degree. */ + Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ /* Envelope */ Uint16 attack_length; /**< Duration of the attack. */ @@ -897,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 @@ -954,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/jni/SDL2-2.0.3/include/SDL_hints.h b/jni/SDL2-2.0.3/include/SDL_hints.h index 673d347e..c28cbad8 100644 --- a/jni/SDL2-2.0.3/include/SDL_hints.h +++ b/jni/SDL2-2.0.3/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 @@ -185,6 +185,20 @@ extern "C" { */ #define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" +/** + * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. + * + * This variable can be set to the following values: + * "0" - Disable _NET_WM_PING + * "1" - Enable _NET_WM_PING + * + * By default SDL will use _NET_WM_PING, but for applications that know they + * will not always be able to respond to ping requests in a timely manner they can + * turn it off to avoid the window manager thinking the app is hung. + * The hint is checked in CreateWindow. + */ +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + /** * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden * @@ -243,6 +257,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 +278,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 +362,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,13 +539,35 @@ 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. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. */ #define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" /** * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. */ #define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" @@ -532,6 +583,53 @@ 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 + * + * This hint only applies to the emscripten platform + * + * The variable can be one of + * "#window" - The javascript window object (this is the default) + * "#document" - The javascript document object + * "#screen" - the javascript window.screen object + * "#canvas" - the WebGL canvas element + * any other string without a leading # sign applies to the element on the page with that ID. + */ +#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/jni/SDL2-2.0.3/include/SDL_joystick.h b/jni/SDL2-2.0.3/include/SDL_joystick.h index b0b1c667..78176321 100644 --- a/jni/SDL2-2.0.3/include/SDL_joystick.h +++ b/jni/SDL2-2.0.3/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 @@ -71,6 +71,16 @@ typedef struct { typedef Sint32 SDL_JoystickID; +typedef enum +{ + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, + SDL_JOYSTICK_POWER_LOW, + SDL_JOYSTICK_POWER_MEDIUM, + SDL_JOYSTICK_POWER_FULL, + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX +} SDL_JoystickPowerLevel; /* Function prototypes */ /** @@ -87,14 +97,20 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); /** * Open a joystick for use. - * The index passed as an argument refers tothe N'th joystick on the system. - * This index is the value which will identify this joystick in future joystick - * events. + * The index passed as an argument refers to the N'th joystick on the system. + * 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. */ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); +/** + * Return the SDL_Joystick associated with an instance id. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID joyid); + /** * Return the name for this currently opened joystick. * If no name can be found, this function returns NULL. @@ -189,7 +205,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 @@ -241,6 +257,10 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, */ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); +/** + * Return the battery level of this joystick + */ +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/jni/SDL2-2.0.3/include/SDL_keyboard.h b/jni/SDL2-2.0.3/include/SDL_keyboard.h index 586a26cf..1ad58ee3 100644 --- a/jni/SDL2-2.0.3/include/SDL_keyboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_keycode.h b/jni/SDL2-2.0.3/include/SDL_keycode.h index d5f5dd0a..66980cef 100644 --- a/jni/SDL2-2.0.3/include/SDL_keycode.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_loadso.h b/jni/SDL2-2.0.3/include/SDL_loadso.h index 0359eae1..db7493ad 100644 --- a/jni/SDL2-2.0.3/include/SDL_loadso.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_log.h b/jni/SDL2-2.0.3/include/SDL_log.h index ef4d443c..6ffbfc99 100644 --- a/jni/SDL2-2.0.3/include/SDL_log.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_main.h b/jni/SDL2-2.0.3/include/SDL_main.h index 5dd73a9f..c5168ba6 100644 --- a/jni/SDL2-2.0.3/include/SDL_main.h +++ b/jni/SDL2-2.0.3/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 @@ -142,14 +142,11 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); * \brief Initializes and launches an SDL/WinRT application. * * \param mainFunction The SDL app's C-style main(). - * \param xamlBackgroundPanel An optional, XAML-based, background panel. - * For Non-XAML apps, this value must be set to NULL. For XAML apps, - * pass in a pointer to a SwapChainBackgroundPanel, casted to an - * IInspectable (via reinterpret_cast). - * \ret 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more + * \param reserved Reserved for future use; should be NULL + * \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 * xamlBackgroundPanel); +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved); #endif /* __WINRT__ */ diff --git a/jni/SDL2-2.0.3/include/SDL_messagebox.h b/jni/SDL2-2.0.3/include/SDL_messagebox.h index 6004da0f..44d458f4 100644 --- a/jni/SDL2-2.0.3/include/SDL_messagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_mouse.h b/jni/SDL2-2.0.3/include/SDL_mouse.h index e71a0c9e..1ae31269 100644 --- a/jni/SDL2-2.0.3/include/SDL_mouse.h +++ b/jni/SDL2-2.0.3/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 @@ -60,6 +60,15 @@ typedef enum SDL_NUM_SYSTEM_CURSORS } SDL_SystemCursor; +/** + * \brief Scroll direction types for the Scroll event + */ +typedef enum +{ + SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ + SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ +} SDL_MouseWheelDirection; + /* Function prototypes */ /** @@ -128,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/jni/SDL2-2.0.3/include/SDL_mutex.h b/jni/SDL2-2.0.3/include/SDL_mutex.h index 3e8b4dbe..2765210a 100644 --- a/jni/SDL2-2.0.3/include/SDL_mutex.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_name.h b/jni/SDL2-2.0.3/include/SDL_name.h index 719666ff..b6a413a2 100644 --- a/jni/SDL2-2.0.3/include/SDL_name.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_opengl.h b/jni/SDL2-2.0.3/include/SDL_opengl.h index 35e9f308..aebe30eb 100644 --- a/jni/SDL2-2.0.3/include/SDL_opengl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_opengl_glext.h b/jni/SDL2-2.0.3/include/SDL_opengl_glext.h index 7e840f72..cd3869fe 100644 --- a/jni/SDL2-2.0.3/include/SDL_opengl_glext.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_opengles.h b/jni/SDL2-2.0.3/include/SDL_opengles.h index d88e1573..49c709c1 100644 --- a/jni/SDL2-2.0.3/include/SDL_opengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_opengles2.h b/jni/SDL2-2.0.3/include/SDL_opengles2.h index d245b8eb..13ebd9dc 100644 --- a/jni/SDL2-2.0.3/include/SDL_opengles2.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_pixels.h b/jni/SDL2-2.0.3/include/SDL_pixels.h index 61e97c8d..ba24a47d 100644 --- a/jni/SDL2-2.0.3/include/SDL_pixels.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_platform.h b/jni/SDL2-2.0.3/include/SDL_platform.h index adafde52..75e4c653 100644 --- a/jni/SDL2-2.0.3/include/SDL_platform.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_power.h b/jni/SDL2-2.0.3/include/SDL_power.h index cf71c982..89eb1718 100644 --- a/jni/SDL2-2.0.3/include/SDL_power.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_quit.h b/jni/SDL2-2.0.3/include/SDL_quit.h index 8a786445..0108ff04 100644 --- a/jni/SDL2-2.0.3/include/SDL_quit.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_rect.h b/jni/SDL2-2.0.3/include/SDL_rect.h index 6bfce311..ebe51674 100644 --- a/jni/SDL2-2.0.3/include/SDL_rect.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_render.h b/jni/SDL2-2.0.3/include/SDL_render.h index 192e502e..de2749cc 100644 --- a/jni/SDL2-2.0.3/include/SDL_render.h +++ b/jni/SDL2-2.0.3/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 @@ -81,8 +81,8 @@ typedef struct SDL_RendererInfo Uint32 flags; /**< Supported ::SDL_RendererFlags */ Uint32 num_texture_formats; /**< The number of available texture formats */ Uint32 texture_formats[16]; /**< The available texture formats */ - int max_texture_width; /**< The maximimum texture width */ - int max_texture_height; /**< The maximimum texture height */ + int max_texture_width; /**< The maximum texture width */ + int max_texture_height; /**< The maximum texture height */ } SDL_RendererInfo; /** @@ -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. * @@ -371,7 +371,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, * \param rect A pointer to the rectangle of pixels to update, or NULL to * update the entire texture. * \param pixels The raw pixel data. - * \param pitch The number of bytes between rows of pixel data. + * \param pitch The number of bytes in a row of pixel data, including padding between lines. * * \return 0 on success, or -1 if the texture is not valid. * @@ -552,7 +552,7 @@ extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect); /** - * \brief Get wether clipping is enabled on the given renderer + * \brief Get whether clipping is enabled on the given renderer. * * \param renderer The renderer from which clip state should be queried. * @@ -792,7 +792,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, * \param dstrect A pointer to the destination rectangle, or NULL for the * entire rendering target. * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect - * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done aroud dstrect.w/2, dstrect.h/2) + * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture * * \return 0 on success, or -1 on error diff --git a/jni/SDL2-2.0.3/include/SDL_rwops.h b/jni/SDL2-2.0.3/include/SDL_rwops.h index b007fb63..c8b024be 100644 --- a/jni/SDL2-2.0.3/include/SDL_rwops.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_scancode.h b/jni/SDL2-2.0.3/include/SDL_scancode.h index 4b3be28f..4bf86180 100644 --- a/jni/SDL2-2.0.3/include/SDL_scancode.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_shape.h b/jni/SDL2-2.0.3/include/SDL_shape.h index 53029306..157d6127 100644 --- a/jni/SDL2-2.0.3/include/SDL_shape.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_stdinc.h b/jni/SDL2-2.0.3/include/SDL_stdinc.h index 78d3402e..c1f2b6dd 100644 --- a/jni/SDL2-2.0.3/include/SDL_stdinc.h +++ b/jni/SDL2-2.0.3/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 @@ -172,7 +172,9 @@ typedef uint64_t Uint64; #ifdef PRIs64 #define SDL_PRIs64 PRIs64 #elif defined(__WIN32__) -#define SDL_PRIs64 "I64" +#define SDL_PRIs64 "I64d" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIs64 "ld" #else #define SDL_PRIs64 "lld" #endif @@ -182,10 +184,34 @@ typedef uint64_t Uint64; #define SDL_PRIu64 PRIu64 #elif defined(__WIN32__) #define SDL_PRIu64 "I64u" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIu64 "lu" #else #define SDL_PRIu64 "llu" #endif #endif +#ifndef SDL_PRIx64 +#ifdef PRIx64 +#define SDL_PRIx64 PRIx64 +#elif defined(__WIN32__) +#define SDL_PRIx64 "I64x" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIx64 "lx" +#else +#define SDL_PRIx64 "llx" +#endif +#endif +#ifndef SDL_PRIX64 +#ifdef PRIX64 +#define SDL_PRIX64 PRIX64 +#elif defined(__WIN32__) +#define SDL_PRIX64 "I64X" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIX64 "lX" +#else +#define SDL_PRIX64 "llX" +#endif +#endif /* Annotations to help code analysis tools */ #ifdef SDL_DISABLE_ANALYZE_MACROS @@ -200,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) @@ -361,11 +387,6 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); -SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) -{ - return SDL_memcpy(dst, src, dwords * 4); -} - extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); @@ -462,6 +483,39 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, #define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +/* force builds using Clang's static analysis tools to use literal C runtime + here, since there are possibly tests that are ineffective otherwise. */ +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_malloc malloc +#define SDL_calloc calloc +#define SDL_realloc realloc +#define SDL_free free +#define SDL_memset memset +#define SDL_memcpy memcpy +#define SDL_memmove memmove +#define SDL_memcmp memcmp +#define SDL_strlen strlen +#define SDL_strlcpy strlcpy +#define SDL_strlcat strlcat +#define SDL_strdup strdup +#define SDL_strchr strchr +#define SDL_strrchr strrchr +#define SDL_strstr strstr +#define SDL_strcmp strcmp +#define SDL_strncmp strncmp +#define SDL_strcasecmp strcasecmp +#define SDL_strncasecmp strncasecmp +#define SDL_sscanf sscanf +#define SDL_vsscanf vsscanf +#define SDL_snprintf snprintf +#define SDL_vsnprintf vsnprintf +#endif + +SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) +{ + return SDL_memcpy(dst, src, dwords * 4); +} + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/jni/SDL2-2.0.3/include/SDL_surface.h b/jni/SDL2-2.0.3/include/SDL_surface.h index aa8d8217..3634f7d3 100644 --- a/jni/SDL2-2.0.3/include/SDL_surface.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_system.h b/jni/SDL2-2.0.3/include/SDL_system.h index 78d5b0d0..bdc4f968 100644 --- a/jni/SDL2-2.0.3/include/SDL_system.h +++ b/jni/SDL2-2.0.3/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,20 +42,32 @@ 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. -/* Returns the D3D9 adapter index that matches the specified display index. This adapter index can be passed to IDirect3D9::CreateDevice and controls on which monitor a full screen application will appear. */ extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); -/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. +typedef struct IDirect3DDevice9 IDirect3DDevice9; +/** + \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. + Once you are done using the device, you should release it to avoid a resource leak. */ -typedef struct IDirect3DDevice9 IDirect3DDevice9; extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); -/* Returns the DXGI Adapter and Output indices for the specified display index. +/** + \brief Returns the DXGI Adapter and Output indices for the specified display index. + These can be passed to EnumAdapters and EnumOutputs respectively to get the objects required to create a DX10 or DX11 device and swap chain. */ @@ -67,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__ */ @@ -76,12 +91,16 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); /* Platform specific functions for Android */ #if defined(__ANDROID__) && __ANDROID__ -/* Get the JNI environment for the current thread +/** + \brief Get the JNI environment for the current thread + This returns JNIEnv*, but the prototype is void* so we don't need jni.h */ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); -/* Get the SDL Activity object for the application +/** + \brief Get the SDL Activity object for the application + This returns jobject, but the prototype is void* so we don't need jni.h The jobject returned by SDL_AndroidGetActivity is a local reference. It is the caller's responsibility to properly release it @@ -89,26 +108,33 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); */ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(); -/* See the official Android developer guide for more information: +/** + See the official Android developer guide for more information: http://developer.android.com/guide/topics/data/data-storage.html */ #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 -/* Get the path used for internal storage for this application. +/** + \brief Get the path used for internal storage for this application. + This path is unique to your application and cannot be written to by other applications. */ extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(); -/* Get the current state of external storage, a bitmask of these values: +/** + \brief Get the current state of external storage, a bitmask of these values: SDL_ANDROID_EXTERNAL_STORAGE_READ SDL_ANDROID_EXTERNAL_STORAGE_WRITE + If external storage is currently unavailable, this will return 0. */ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(); -/* Get the path used for external storage for this application. +/** + \brief Get the path used for external storage for this application. + This path is unique to your application, but is public and can be written to by other applications. */ @@ -151,7 +177,7 @@ typedef enum * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * * \param pathType The type of path to retrieve. - * \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL + * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL * if the path is not available for any reason. Not all paths are * available on all versions of Windows. This is especially true on * Windows Phone. Check the documentation for the given @@ -168,7 +194,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * * \param pathType The type of path to retrieve. - * \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL + * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL * if the path is not available for any reason. Not all paths are * available on all versions of Windows. This is especially true on * Windows Phone. Check the documentation for the given diff --git a/jni/SDL2-2.0.3/include/SDL_syswm.h b/jni/SDL2-2.0.3/include/SDL_syswm.h index 03c3b025..a3441fdc 100644 --- a/jni/SDL2-2.0.3/include/SDL_syswm.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test.h b/jni/SDL2-2.0.3/include/SDL_test.h index ae649a42..77b350bd 100644 --- a/jni/SDL2-2.0.3/include/SDL_test.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test_assert.h b/jni/SDL2-2.0.3/include/SDL_test_assert.h index 5b38f7ee..a800a384 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_assert.h +++ b/jni/SDL2-2.0.3/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 @@ -71,7 +71,7 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * \brief Explicitely pass without checking an assertion condition. Updates assertion counter. + * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. * * \param assertDescription Message to log with the assert describing it. */ diff --git a/jni/SDL2-2.0.3/include/SDL_test_common.h b/jni/SDL2-2.0.3/include/SDL_test_common.h index 45c9edaf..bb671fa5 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_common.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test_compare.h b/jni/SDL2-2.0.3/include/SDL_test_compare.h index f1353a8d..bc121336 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_compare.h +++ b/jni/SDL2-2.0.3/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 @@ -51,9 +51,9 @@ extern "C" { * * \param surface Surface used in comparison * \param referenceSurface Test Surface used in comparison - * \param allowable_error Allowable difference (squared) in blending accuracy. + * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. * - * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. + * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. */ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); diff --git a/jni/SDL2-2.0.3/include/SDL_test_crc32.h b/jni/SDL2-2.0.3/include/SDL_test_crc32.h index a180fe3b..cf9ea23d 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_crc32.h +++ b/jni/SDL2-2.0.3/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 @@ -70,27 +70,27 @@ extern "C" { /* ---------- Function Prototypes ------------- */ /** - * /brief Initialize the CRC context + * \brief Initialize the CRC context * * Note: The function initializes the crc table required for all crc calculations. * - * /param crcContext pointer to context variable + * \param crcContext pointer to context variable * - * /returns 0 for OK, -1 on error + * \returns 0 for OK, -1 on error * */ int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); /** - * /brief calculate a crc32 from a data block + * \brief calculate a crc32 from a data block * - * /param crcContext pointer to context variable - * /param inBuf input buffer to checksum - * /param inLen length of input buffer - * /param crc32 pointer to Uint32 to store the final CRC into + * \param crcContext pointer to context variable + * \param inBuf input buffer to checksum + * \param inLen length of input buffer + * \param crc32 pointer to Uint32 to store the final CRC into * - * /returns 0 for OK, -1 on error + * \returns 0 for OK, -1 on error * */ int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); @@ -102,11 +102,11 @@ int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, /** - * /brief clean up CRC context + * \brief clean up CRC context * - * /param crcContext pointer to context variable + * \param crcContext pointer to context variable * - * /returns 0 for OK, -1 on error + * \returns 0 for OK, -1 on error * */ diff --git a/jni/SDL2-2.0.3/include/SDL_test_font.h b/jni/SDL2-2.0.3/include/SDL_test_font.h index 8d51d4a9..42696d74 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_font.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test_fuzzer.h b/jni/SDL2-2.0.3/include/SDL_test_fuzzer.h index 64018039..59c89a50 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_fuzzer.h +++ b/jni/SDL2-2.0.3/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 @@ -57,7 +57,7 @@ extern "C" { /** * Initializes the fuzzer for a test * - * /param execKey Execution "Key" that initializes the random number generator uniquely for the test. + * \param execKey Execution "Key" that initializes the random number generator uniquely for the test. * */ void SDLTest_FuzzerInit(Uint64 execKey); @@ -318,7 +318,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL /** * Returns integer in range [min, max] (inclusive). * Min and max values can be negative values. - * If Max in smaller tham min, then the values are swapped. + * If Max in smaller than min, then the values are swapped. * Min and max are the same value, that value will be returned. * * \param min Minimum inclusive value of returned random number diff --git a/jni/SDL2-2.0.3/include/SDL_test_harness.h b/jni/SDL2-2.0.3/include/SDL_test_harness.h index 2c1e2ade..b3389315 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_harness.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test_images.h b/jni/SDL2-2.0.3/include/SDL_test_images.h index 05627996..9b9f979b 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_images.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test_log.h b/jni/SDL2-2.0.3/include/SDL_test_log.h index 2157954b..968d9b32 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_log.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_test_md5.h b/jni/SDL2-2.0.3/include/SDL_test_md5.h index 029e164b..52ea2c9a 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_md5.h +++ b/jni/SDL2-2.0.3/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 @@ -78,9 +78,9 @@ extern "C" { /* ---------- Function Prototypes ------------- */ /** - * /brief initialize the context + * \brief initialize the context * - * /param mdContext pointer to context variable + * \param mdContext pointer to context variable * * Note: The function initializes the message-digest context * mdContext. Call before each new use of the context - @@ -90,11 +90,11 @@ extern "C" { /** - * /brief update digest from variable length data + * \brief update digest from variable length data * - * /param mdContext pointer to context variable - * /param inBuf pointer to data array/string - * /param inLen length of data array/string + * \param mdContext pointer to context variable + * \param inBuf pointer to data array/string + * \param inLen length of data array/string * * Note: The function updates the message-digest context to account * for the presence of each of the characters inBuf[0..inLen-1] @@ -105,10 +105,10 @@ extern "C" { unsigned int inLen); -/* - * /brief complete digest computation +/** + * \brief complete digest computation * - * /param mdContext pointer to context variable + * \param mdContext pointer to context variable * * Note: The function terminates the message-digest computation and * ends with the desired message digest in mdContext.digest[0..15]. diff --git a/jni/SDL2-2.0.3/include/SDL_test_random.h b/jni/SDL2-2.0.3/include/SDL_test_random.h index 6c5660d8..925205df 100644 --- a/jni/SDL2-2.0.3/include/SDL_test_random.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_thread.h b/jni/SDL2-2.0.3/include/SDL_thread.h index 9e534141..797767f8 100644 --- a/jni/SDL2-2.0.3/include/SDL_thread.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_timer.h b/jni/SDL2-2.0.3/include/SDL_timer.h index a48e0466..1f2a0206 100644 --- a/jni/SDL2-2.0.3/include/SDL_timer.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_touch.h b/jni/SDL2-2.0.3/include/SDL_touch.h index 017deb28..68ff1714 100644 --- a/jni/SDL2-2.0.3/include/SDL_touch.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_types.h b/jni/SDL2-2.0.3/include/SDL_types.h index cd3ba33c..1a1877fa 100644 --- a/jni/SDL2-2.0.3/include/SDL_types.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_version.h b/jni/SDL2-2.0.3/include/SDL_version.h index b74e24c9..0b364d07 100644 --- a/jni/SDL2-2.0.3/include/SDL_version.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/SDL_video.h b/jni/SDL2-2.0.3/include/SDL_video.h index 4a2fb045..f466165b 100644 --- a/jni/SDL2-2.0.3/include/SDL_video.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/begin_code.h b/jni/SDL2-2.0.3/include/begin_code.h index b058bf36..c032400f 100644 --- a/jni/SDL2-2.0.3/include/begin_code.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/include/close_code.h b/jni/SDL2-2.0.3/include/close_code.h index 9826f147..73f6c818 100644 --- a/jni/SDL2-2.0.3/include/close_code.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/Linux/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/Linux/SDL_config_premake.h index 01a13580..c865684b 100644 --- a/jni/SDL2-2.0.3/premake/Linux/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/MinGW/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/MinGW/SDL_config_premake.h index 6df21585..7ec79a3b 100644 --- a/jni/SDL2-2.0.3/premake/MinGW/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/README-ios.txt b/jni/SDL2-2.0.3/premake/README-ios.txt index 75510c04..7e08f47e 100755 --- a/jni/SDL2-2.0.3/premake/README-ios.txt +++ b/jni/SDL2-2.0.3/premake/README-ios.txt @@ -26,6 +26,7 @@ Xcode-iOS project. Those are: -Foundation.framework -CoreAudio.framework -CoreMotion.framework + -GameController.framework All of these frameworks are part of the iOS SDK, not part of the core OS X system. diff --git a/jni/SDL2-2.0.3/premake/VisualC/VS2008/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/VisualC/VS2008/SDL_config_premake.h index d570b015..7139c23c 100644 --- a/jni/SDL2-2.0.3/premake/VisualC/VS2008/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/VisualC/VS2010/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/VisualC/VS2010/SDL_config_premake.h index d570b015..7139c23c 100644 --- a/jni/SDL2-2.0.3/premake/VisualC/VS2010/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/VisualC/VS2012/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/VisualC/VS2012/SDL_config_premake.h index d570b015..7139c23c 100644 --- a/jni/SDL2-2.0.3/premake/VisualC/VS2012/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/Xcode-iOS/Demos/happy/happy.xcodeproj/project.pbxproj b/jni/SDL2-2.0.3/premake/Xcode-iOS/Demos/happy/happy.xcodeproj/project.pbxproj index fdac9bda..6eb3b55e 100755 --- a/jni/SDL2-2.0.3/premake/Xcode-iOS/Demos/happy/happy.xcodeproj/project.pbxproj +++ b/jni/SDL2-2.0.3/premake/Xcode-iOS/Demos/happy/happy.xcodeproj/project.pbxproj @@ -3,55 +3,55 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ - 43587E112FDE41E3486A5141 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 67E105821F9D19C248BF17B6 /* icon.bmp */; }; - 2F5A7AB72FA52C3D029335B6 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 49AD32CF351438B316C15B7A /* common.c */; }; - 66455D1E7E3179156E546AA8 /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = 1F0270E77CC100E968633EBA /* happy.c */; }; - 04CE7E9842C4612763496460 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C147BCA187412202A676460 /* AudioToolbox.framework */; }; - 5DC8148934C32F3407541C0F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DDB080C0C872DF96CEE0B62 /* QuartzCore.framework */; }; 039E2FCB749D2AE6705435A4 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B210870772357A20E4576EE /* OpenGLES.framework */; }; - 263A59BA6D20796421AC3870 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 603E37DB4001230953C943FD /* CoreGraphics.framework */; }; - 7E2000C447ED370218691A83 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49C87CB0268927E071506CEA /* UIKit.framework */; }; + 04CE7E9842C4612763496460 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C147BCA187412202A676460 /* AudioToolbox.framework */; }; 081D5E427A420BEA66DF6129 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 489C1A076394164C7F853083 /* Foundation.framework */; }; - 65AC30DF305741C6521420A7 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AF1729947305D7E10DA777D /* CoreAudio.framework */; }; + 263A59BA6D20796421AC3870 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 603E37DB4001230953C943FD /* CoreGraphics.framework */; }; + 2F5A7AB72FA52C3D029335B6 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 49AD32CF351438B316C15B7A /* common.c */; }; 424C13DC60653FEE6370536B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 327333F1228F1B0D0A582BEC /* libSDL2.a */; }; + 43587E112FDE41E3486A5141 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 67E105821F9D19C248BF17B6 /* icon.bmp */; }; + 5DC8148934C32F3407541C0F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DDB080C0C872DF96CEE0B62 /* QuartzCore.framework */; }; + 65AC30DF305741C6521420A7 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AF1729947305D7E10DA777D /* CoreAudio.framework */; }; + 66455D1E7E3179156E546AA8 /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = 1F0270E77CC100E968633EBA /* happy.c */; }; + 7E2000C447ED370218691A83 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49C87CB0268927E071506CEA /* UIKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 73DD36916E01179F50147B85 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 45B64B000539221732843506 /* SDL2.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 224D2C85085A7BA60E532655; - remoteInfo = "libSDL2.a"; - }; 6D92213A249742C860667923 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 45B64B000539221732843506 /* SDL2.xcodeproj */; proxyType = 1; remoteGlobalIDString = 515D4C462ACD2DA8180E7783; - remoteInfo = "libSDL2.a"; + remoteInfo = libSDL2.a; + }; + 73DD36916E01179F50147B85 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 45B64B000539221732843506 /* SDL2.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 224D2C85085A7BA60E532655; + remoteInfo = libSDL2.a; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 4E8504577F0B2DC43C2073B9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info.plist"; path = "../../../../Xcode-iOS/Demos/Info.plist"; sourceTree = ""; }; - 67E105821F9D19C248BF17B6 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = "icon.bmp"; path = "../../../../Xcode-iOS/Demos/data/icon.bmp"; sourceTree = ""; }; - 49AD32CF351438B316C15B7A /* common.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "common.c"; path = "../../../../Xcode-iOS/Demos/src/common.c"; sourceTree = ""; }; - 4346585005E47029491C60D0 /* common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "common.h"; path = "../../../../Xcode-iOS/Demos/src/common.h"; sourceTree = ""; }; - 1F0270E77CC100E968633EBA /* happy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "happy.c"; path = "../../../../Xcode-iOS/Demos/src/happy.c"; sourceTree = ""; }; - 2C147BCA187412202A676460 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "AudioToolbox.framework"; path = "System/Library/Frameworks/AudioToolbox.framework"; sourceTree = "SDKROOT"; }; - 5DDB080C0C872DF96CEE0B62 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "QuartzCore.framework"; path = "System/Library/Frameworks/QuartzCore.framework"; sourceTree = "SDKROOT"; }; - 3B210870772357A20E4576EE /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "OpenGLES.framework"; path = "System/Library/Frameworks/OpenGLES.framework"; sourceTree = "SDKROOT"; }; - 603E37DB4001230953C943FD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "CoreGraphics.framework"; path = "System/Library/Frameworks/CoreGraphics.framework"; sourceTree = "SDKROOT"; }; - 49C87CB0268927E071506CEA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "UIKit.framework"; path = "System/Library/Frameworks/UIKit.framework"; sourceTree = "SDKROOT"; }; - 489C1A076394164C7F853083 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "Foundation.framework"; path = "System/Library/Frameworks/Foundation.framework"; sourceTree = "SDKROOT"; }; - 7AF1729947305D7E10DA777D /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "CoreAudio.framework"; path = "System/Library/Frameworks/CoreAudio.framework"; sourceTree = "SDKROOT"; }; - 65F833BA06B514AD0EE36218 /* happy */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "happy"; path = "happy"; sourceTree = BUILT_PRODUCTS_DIR; }; - 45B64B000539221732843506 /* SDL2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "SDL2.xcodeproj"; path = "../../SDL2/SDL2.xcodeproj"; sourceTree = SOURCE_ROOT; }; + 1F0270E77CC100E968633EBA /* happy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = happy.c; path = "../../../../Xcode-iOS/Demos/src/happy.c"; sourceTree = ""; }; + 2C147BCA187412202A676460 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 3B210870772357A20E4576EE /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 4346585005E47029491C60D0 /* common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = common.h; path = "../../../../Xcode-iOS/Demos/src/common.h"; sourceTree = ""; }; + 45B64B000539221732843506 /* SDL2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL2.xcodeproj; path = ../../SDL2/SDL2.xcodeproj; sourceTree = SOURCE_ROOT; }; + 489C1A076394164C7F853083 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 49AD32CF351438B316C15B7A /* common.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = common.c; path = "../../../../Xcode-iOS/Demos/src/common.c"; sourceTree = ""; }; + 49C87CB0268927E071506CEA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 4E8504577F0B2DC43C2073B9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "../../../../Xcode-iOS/Demos/Info.plist"; sourceTree = ""; }; + 5DDB080C0C872DF96CEE0B62 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 603E37DB4001230953C943FD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 65F833BA06B514AD0EE36218 /* happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = happy.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 67E105821F9D19C248BF17B6 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = "../../../../Xcode-iOS/Demos/data/icon.bmp"; sourceTree = ""; }; + 7AF1729947305D7E10DA777D /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -73,41 +73,12 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3555679049400DAA17916DD7 /* happy */ = { - isa = PBXGroup; - children = ( - 7CFE361B495F31F009A616F6 /* Xcode-iOS */, - 532F72873A65662513E35533 /* Frameworks */, - 343C7E606DE365001C7D0B84 /* Products */, - 20D87CCB7D1E6AC128B72992 /* Projects */, - ); - name = "happy"; - sourceTree = ""; - }; - 7CFE361B495F31F009A616F6 /* Xcode-iOS */ = { - isa = PBXGroup; - children = ( - 224D240956AC3D2636C95904 /* Demos */, - ); - name = "Xcode-iOS"; - sourceTree = ""; - }; - 224D240956AC3D2636C95904 /* Demos */ = { - isa = PBXGroup; - children = ( - 4E8504577F0B2DC43C2073B9 /* Info.plist */, - 1EEF027C57A725660BCF6FB9 /* data */, - 1F3D1DBD7857554A0C1C1965 /* src */, - ); - name = "Demos"; - sourceTree = ""; - }; 1EEF027C57A725660BCF6FB9 /* data */ = { isa = PBXGroup; children = ( 67E105821F9D19C248BF17B6 /* icon.bmp */, ); - name = "data"; + name = data; sourceTree = ""; }; 1F3D1DBD7857554A0C1C1965 /* src */ = { @@ -117,7 +88,52 @@ 4346585005E47029491C60D0 /* common.h */, 1F0270E77CC100E968633EBA /* happy.c */, ); - name = "src"; + name = src; + sourceTree = ""; + }; + 20D87CCB7D1E6AC128B72992 /* Projects */ = { + isa = PBXGroup; + children = ( + 45B64B000539221732843506 /* SDL2.xcodeproj */, + ); + name = Projects; + sourceTree = ""; + }; + 224D240956AC3D2636C95904 /* Demos */ = { + isa = PBXGroup; + children = ( + 4E8504577F0B2DC43C2073B9 /* Info.plist */, + 1EEF027C57A725660BCF6FB9 /* data */, + 1F3D1DBD7857554A0C1C1965 /* src */, + ); + name = Demos; + sourceTree = ""; + }; + 343C7E606DE365001C7D0B84 /* Products */ = { + isa = PBXGroup; + children = ( + 65F833BA06B514AD0EE36218 /* happy.app */, + ); + name = Products; + sourceTree = ""; + }; + 3555679049400DAA17916DD7 /* happy */ = { + isa = PBXGroup; + children = ( + 7CFE361B495F31F009A616F6 /* Xcode-iOS */, + 532F72873A65662513E35533 /* Frameworks */, + 343C7E606DE365001C7D0B84 /* Products */, + 20D87CCB7D1E6AC128B72992 /* Projects */, + ); + name = happy; + sourceTree = ""; + }; + 452A4F211058019E46671F0C /* Products */ = { + isa = PBXGroup; + children = ( + 327333F1228F1B0D0A582BEC /* libSDL2.a */, + ); + name = Products; sourceTree = ""; }; 532F72873A65662513E35533 /* Frameworks */ = { @@ -131,31 +147,15 @@ 489C1A076394164C7F853083 /* Foundation.framework */, 7AF1729947305D7E10DA777D /* CoreAudio.framework */, ); - name = "Frameworks"; + name = Frameworks; sourceTree = ""; }; - 343C7E606DE365001C7D0B84 /* Products */ = { + 7CFE361B495F31F009A616F6 /* Xcode-iOS */ = { isa = PBXGroup; children = ( - 65F833BA06B514AD0EE36218 /* happy */, + 224D240956AC3D2636C95904 /* Demos */, ); - name = "Products"; - sourceTree = ""; - }; - 20D87CCB7D1E6AC128B72992 /* Projects */ = { - isa = PBXGroup; - children = ( - 45B64B000539221732843506 /* SDL2.xcodeproj */, - ); - name = "Projects"; - sourceTree = ""; - }; - 452A4F211058019E46671F0C /* Products */ = { - isa = PBXGroup; - children = ( - 327333F1228F1B0D0A582BEC /* libSDL2.a */, - ); - name = Products; + name = "Xcode-iOS"; sourceTree = ""; }; /* End PBXGroup section */ @@ -174,10 +174,10 @@ dependencies = ( 1F023F2F3EDE66E20BCC17E1 /* PBXTargetDependency */, ); - name = "happy"; + name = happy; productInstallPath = "$(HOME)/Applications"; - productName = "happy"; - productReference = 65F833BA06B514AD0EE36218 /* happy */; + productName = happy; + productReference = 65F833BA06B514AD0EE36218 /* happy.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -185,9 +185,15 @@ /* Begin PBXProject section */ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; + attributes = { + }; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "happy" */; compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; hasScannedForEncodings = 1; + knownRegions = ( + en, + ); mainGroup = 3555679049400DAA17916DD7 /* happy */; projectDirPath = ""; projectReferences = ( @@ -207,7 +213,7 @@ 327333F1228F1B0D0A582BEC /* libSDL2.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = "Build/Debug/libSDL2.a"; + path = libSDL2.a; remoteRef = 73DD36916E01179F50147B85 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -236,50 +242,19 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ -/* End PBXVariantGroup section */ - /* Begin PBXTargetDependency section */ 1F023F2F3EDE66E20BCC17E1 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "libSDL2.a"; + name = libSDL2.a; targetProxy = 6D92213A249742C860667923 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 563C339925F445BB2F1E01DB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CONFIGURATION_BUILD_DIR = Build/Debug; - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = "../../../../Xcode-iOS/Demos/Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "happy"; - }; - name = "Debug"; - }; - 205A208D2C4F2495443E582F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - CONFIGURATION_BUILD_DIR = Build/Release; - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = "../../../../Xcode-iOS/Demos/Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "happy"; - }; - name = "Release"; - }; 115846ED1EDF44EA13E06D02 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; - SDKROOT = iphoneos; CODE_SIGN_IDENTITY = "iPhone Developer"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; @@ -289,27 +264,41 @@ GCC_ENABLE_OBJC_EXCEPTIONS = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "USING_PREMAKE_CONFIG_H", - "_DEBUG", + USING_PREMAKE_CONFIG_H, + _DEBUG, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "../..", - "../../../../include", + ../.., + ../../../../include, ); - OBJROOT = "obj/iOS/Debug"; + OBJROOT = obj/iOS/Debug; ONLY_ACTIVE_ARCH = YES; - SYMROOT = "Build/Debug"; + SDKROOT = iphoneos; + SYMROOT = Build/Debug; }; - name = "Debug"; + name = Debug; + }; + 205A208D2C4F2495443E582F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CONFIGURATION_BUILD_DIR = Build/Release; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_MODEL_TUNING = G5; + INFOPLIST_FILE = "../../../../Xcode-iOS/Demos/Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = happy; + }; + name = Release; }; 3536279D443370B3347E7CB6 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; - SDKROOT = iphoneos; CODE_SIGN_IDENTITY = "iPhone Developer"; CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; @@ -318,34 +307,39 @@ GCC_ENABLE_OBJC_EXCEPTIONS = NO; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = ( - "USING_PREMAKE_CONFIG_H", - "NDEBUG", + USING_PREMAKE_CONFIG_H, + NDEBUG, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "../..", - "../../../../include", + ../.., + ../../../../include, ); - OBJROOT = "obj/iOS/Release"; + OBJROOT = obj/iOS/Release; ONLY_ACTIVE_ARCH = NO; - SYMROOT = "Build/Release"; + SDKROOT = iphoneos; + SYMROOT = Build/Release; }; - name = "Release"; + name = Release; + }; + 563C339925F445BB2F1E01DB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CONFIGURATION_BUILD_DIR = Build/Debug; + GCC_DYNAMIC_NO_PIC = NO; + GCC_MODEL_TUNING = G5; + INFOPLIST_FILE = "../../../../Xcode-iOS/Demos/Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = happy; + }; + name = Debug; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 233F10BA36C35A146C6A4B3E /* Build configuration list for PBXNativeTarget "happy" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 563C339925F445BB2F1E01DB /* Debug */, - 205A208D2C4F2495443E582F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = "Debug"; - }; 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "happy" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -353,10 +347,18 @@ 3536279D443370B3347E7CB6 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = "Debug"; + defaultConfigurationName = Debug; + }; + 233F10BA36C35A146C6A4B3E /* Build configuration list for PBXNativeTarget "happy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 563C339925F445BB2F1E01DB /* Debug */, + 205A208D2C4F2495443E582F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ - }; rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; } diff --git a/jni/SDL2-2.0.3/premake/Xcode-iOS/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/Xcode-iOS/SDL_config_premake.h index e0a86417..47b47ef7 100644 --- a/jni/SDL2-2.0.3/premake/Xcode-iOS/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/Xcode/Xcode3/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/Xcode/Xcode3/SDL_config_premake.h index e48e8797..878b3c20 100644 --- a/jni/SDL2-2.0.3/premake/Xcode/Xcode3/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/Xcode/Xcode4/SDL_config_premake.h b/jni/SDL2-2.0.3/premake/Xcode/Xcode4/SDL_config_premake.h index e48e8797..878b3c20 100644 --- a/jni/SDL2-2.0.3/premake/Xcode/Xcode4/SDL_config_premake.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/config/SDL_config_cygwin.template.h b/jni/SDL2-2.0.3/premake/config/SDL_config_cygwin.template.h index 651989eb..8f38d44c 100644 --- a/jni/SDL2-2.0.3/premake/config/SDL_config_cygwin.template.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/config/SDL_config_iphoneos.template.h b/jni/SDL2-2.0.3/premake/config/SDL_config_iphoneos.template.h index 227c3768..2a965947 100644 --- a/jni/SDL2-2.0.3/premake/config/SDL_config_iphoneos.template.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/config/SDL_config_linux.template.h b/jni/SDL2-2.0.3/premake/config/SDL_config_linux.template.h index 8a62fdb9..d35037cf 100644 --- a/jni/SDL2-2.0.3/premake/config/SDL_config_linux.template.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/config/SDL_config_macosx.template.h b/jni/SDL2-2.0.3/premake/config/SDL_config_macosx.template.h index 9264681f..1a4d8d56 100644 --- a/jni/SDL2-2.0.3/premake/config/SDL_config_macosx.template.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/config/SDL_config_minimal.template.h b/jni/SDL2-2.0.3/premake/config/SDL_config_minimal.template.h index d7c62db2..adf60ed9 100644 --- a/jni/SDL2-2.0.3/premake/config/SDL_config_minimal.template.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/config/SDL_config_windows.template.h b/jni/SDL2-2.0.3/premake/config/SDL_config_windows.template.h index 58726909..9274f620 100644 --- a/jni/SDL2-2.0.3/premake/config/SDL_config_windows.template.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/premake4.lua b/jni/SDL2-2.0.3/premake/premake4.lua index 1ebbaf5d..eb2dfcd1 100755 --- a/jni/SDL2-2.0.3/premake/premake4.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/SDL2.lua b/jni/SDL2-2.0.3/premake/projects/SDL2.lua index 0eaab6bb..923f953a 100755 --- a/jni/SDL2-2.0.3/premake/projects/SDL2.lua +++ b/jni/SDL2-2.0.3/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, @@ -366,7 +367,7 @@ SDL_project "SDL2" SDL_config { ["SDL_AUDIO_DRIVER_COREAUDIO"] = 1, - ["SDL_JOYSTICK_DISABLED"] = 0, + ["SDL_JOYSTICK_MFI"] = 1, ["SDL_HAPTIC_DISABLED"] = 1, ["SDL_LOADSO_DISABLED"] = 1, ["SDL_THREAD_PTHREAD"] = 1, @@ -403,5 +404,6 @@ SDL_project "SDL2" "$(SDKROOT)/UIKit.framework", "$(SDKROOT)/Foundation.framework", "$(SDKROOT)/CoreAudio.framework", - "$(SDKROOT)/CoreMotion.framework" + "$(SDKROOT)/CoreMotion.framework", + "$(SDKROOT)/GameController.framework" } diff --git a/jni/SDL2-2.0.3/premake/projects/SDL2main.lua b/jni/SDL2-2.0.3/premake/projects/SDL2main.lua index 5cc59d4d..771a169c 100755 --- a/jni/SDL2-2.0.3/premake/projects/SDL2main.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/SDL2test.lua b/jni/SDL2-2.0.3/premake/projects/SDL2test.lua index 2b9c652a..0ac6382c 100755 --- a/jni/SDL2-2.0.3/premake/projects/SDL2test.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/accelerometer.lua b/jni/SDL2-2.0.3/premake/projects/accelerometer.lua index 93cffb5c..df24a7ba 100755 --- a/jni/SDL2-2.0.3/premake/projects/accelerometer.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/checkkeys.lua b/jni/SDL2-2.0.3/premake/projects/checkkeys.lua index 7907c5e3..e1709403 100755 --- a/jni/SDL2-2.0.3/premake/projects/checkkeys.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/fireworks.lua b/jni/SDL2-2.0.3/premake/projects/fireworks.lua index d5a69a1f..110c6547 100755 --- a/jni/SDL2-2.0.3/premake/projects/fireworks.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/happy.lua b/jni/SDL2-2.0.3/premake/projects/happy.lua index b6104c64..b2764801 100755 --- a/jni/SDL2-2.0.3/premake/projects/happy.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/keyboard.lua b/jni/SDL2-2.0.3/premake/projects/keyboard.lua index 88f7567b..6cd31d1b 100755 --- a/jni/SDL2-2.0.3/premake/projects/keyboard.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/loopwave.lua b/jni/SDL2-2.0.3/premake/projects/loopwave.lua index d267ed9e..391dbdad 100755 --- a/jni/SDL2-2.0.3/premake/projects/loopwave.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/mixer.lua b/jni/SDL2-2.0.3/premake/projects/mixer.lua index 9a8fd02c..bfcd5e64 100755 --- a/jni/SDL2-2.0.3/premake/projects/mixer.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/rectangles.lua b/jni/SDL2-2.0.3/premake/projects/rectangles.lua index aa46ff4c..071f8383 100755 --- a/jni/SDL2-2.0.3/premake/projects/rectangles.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testatomic.lua b/jni/SDL2-2.0.3/premake/projects/testatomic.lua index 816f46ef..ecf5adb4 100755 --- a/jni/SDL2-2.0.3/premake/projects/testatomic.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testaudioinfo.lua b/jni/SDL2-2.0.3/premake/projects/testaudioinfo.lua index a43b1261..9ee89f48 100755 --- a/jni/SDL2-2.0.3/premake/projects/testaudioinfo.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testautomation.lua b/jni/SDL2-2.0.3/premake/projects/testautomation.lua index de6c45b7..43e6dd83 100755 --- a/jni/SDL2-2.0.3/premake/projects/testautomation.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testdraw2.lua b/jni/SDL2-2.0.3/premake/projects/testdraw2.lua index 99f4cda4..2431484f 100755 --- a/jni/SDL2-2.0.3/premake/projects/testdraw2.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testdrawchessboard.lua b/jni/SDL2-2.0.3/premake/projects/testdrawchessboard.lua index de9d78cb..b074d7f4 100755 --- a/jni/SDL2-2.0.3/premake/projects/testdrawchessboard.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testerror.lua b/jni/SDL2-2.0.3/premake/projects/testerror.lua index 6e53f8b1..17b7638f 100755 --- a/jni/SDL2-2.0.3/premake/projects/testerror.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testfile.lua b/jni/SDL2-2.0.3/premake/projects/testfile.lua index c791041a..8ed28188 100755 --- a/jni/SDL2-2.0.3/premake/projects/testfile.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testfilesystem.lua b/jni/SDL2-2.0.3/premake/projects/testfilesystem.lua index 5128d528..f135bbd4 100755 --- a/jni/SDL2-2.0.3/premake/projects/testfilesystem.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testgamecontroller.lua b/jni/SDL2-2.0.3/premake/projects/testgamecontroller.lua index 53a9358b..322654f6 100755 --- a/jni/SDL2-2.0.3/premake/projects/testgamecontroller.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testgesture.lua b/jni/SDL2-2.0.3/premake/projects/testgesture.lua index 6c216682..2a8ca3dc 100755 --- a/jni/SDL2-2.0.3/premake/projects/testgesture.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testgl2.lua b/jni/SDL2-2.0.3/premake/projects/testgl2.lua index 69e93336..b2a4e64a 100755 --- a/jni/SDL2-2.0.3/premake/projects/testgl2.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testgles.lua b/jni/SDL2-2.0.3/premake/projects/testgles.lua index ea77c1f7..de180d47 100755 --- a/jni/SDL2-2.0.3/premake/projects/testgles.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testhaptic.lua b/jni/SDL2-2.0.3/premake/projects/testhaptic.lua index 70aeb3af..a230f923 100755 --- a/jni/SDL2-2.0.3/premake/projects/testhaptic.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testiconv.lua b/jni/SDL2-2.0.3/premake/projects/testiconv.lua index db60ab75..db4ca57c 100755 --- a/jni/SDL2-2.0.3/premake/projects/testiconv.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testime.lua b/jni/SDL2-2.0.3/premake/projects/testime.lua index 6744d1d1..dbcc7d18 100755 --- a/jni/SDL2-2.0.3/premake/projects/testime.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testintersection.lua b/jni/SDL2-2.0.3/premake/projects/testintersection.lua index 11cdfe1b..0e910285 100755 --- a/jni/SDL2-2.0.3/premake/projects/testintersection.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testjoystick.lua b/jni/SDL2-2.0.3/premake/projects/testjoystick.lua index c4abcb0e..d6c6ca3c 100755 --- a/jni/SDL2-2.0.3/premake/projects/testjoystick.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testkeys.lua b/jni/SDL2-2.0.3/premake/projects/testkeys.lua index d95b458d..33753f2e 100755 --- a/jni/SDL2-2.0.3/premake/projects/testkeys.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testloadso.lua b/jni/SDL2-2.0.3/premake/projects/testloadso.lua index 99621eea..cc38996c 100755 --- a/jni/SDL2-2.0.3/premake/projects/testloadso.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testlock.lua b/jni/SDL2-2.0.3/premake/projects/testlock.lua index 94ef0223..22afa3ef 100755 --- a/jni/SDL2-2.0.3/premake/projects/testlock.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testmessage.lua b/jni/SDL2-2.0.3/premake/projects/testmessage.lua index 1c71bd6c..4bcc976a 100755 --- a/jni/SDL2-2.0.3/premake/projects/testmessage.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testmultiaudio.lua b/jni/SDL2-2.0.3/premake/projects/testmultiaudio.lua index cd761f97..ef7c86df 100755 --- a/jni/SDL2-2.0.3/premake/projects/testmultiaudio.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testnative.lua b/jni/SDL2-2.0.3/premake/projects/testnative.lua index 4354d385..b9b22d74 100755 --- a/jni/SDL2-2.0.3/premake/projects/testnative.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testoverlay2.lua b/jni/SDL2-2.0.3/premake/projects/testoverlay2.lua index 4d4049af..00d1c4e2 100755 --- a/jni/SDL2-2.0.3/premake/projects/testoverlay2.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testplatform.lua b/jni/SDL2-2.0.3/premake/projects/testplatform.lua index 3db191e8..4715fd75 100755 --- a/jni/SDL2-2.0.3/premake/projects/testplatform.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testpower.lua b/jni/SDL2-2.0.3/premake/projects/testpower.lua index cc993530..391f9503 100755 --- a/jni/SDL2-2.0.3/premake/projects/testpower.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testrelative.lua b/jni/SDL2-2.0.3/premake/projects/testrelative.lua index 69104d06..c72c5e1a 100755 --- a/jni/SDL2-2.0.3/premake/projects/testrelative.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testrendercopyex.lua b/jni/SDL2-2.0.3/premake/projects/testrendercopyex.lua index 15f3b596..768e7ff0 100755 --- a/jni/SDL2-2.0.3/premake/projects/testrendercopyex.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testrendertarget.lua b/jni/SDL2-2.0.3/premake/projects/testrendertarget.lua index 6bee7061..4a2968e4 100755 --- a/jni/SDL2-2.0.3/premake/projects/testrendertarget.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testresample.lua b/jni/SDL2-2.0.3/premake/projects/testresample.lua index 703d3dd6..beb379ce 100755 --- a/jni/SDL2-2.0.3/premake/projects/testresample.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testrumble.lua b/jni/SDL2-2.0.3/premake/projects/testrumble.lua index 60dffec5..30eecf7e 100755 --- a/jni/SDL2-2.0.3/premake/projects/testrumble.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testscale.lua b/jni/SDL2-2.0.3/premake/projects/testscale.lua index 9e25e6a5..7508e5b1 100755 --- a/jni/SDL2-2.0.3/premake/projects/testscale.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testsem.lua b/jni/SDL2-2.0.3/premake/projects/testsem.lua index 29995e94..b53a68ea 100755 --- a/jni/SDL2-2.0.3/premake/projects/testsem.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testshader.lua b/jni/SDL2-2.0.3/premake/projects/testshader.lua index 08cec95a..cda0baaa 100755 --- a/jni/SDL2-2.0.3/premake/projects/testshader.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testshape.lua b/jni/SDL2-2.0.3/premake/projects/testshape.lua index ca5ecefb..b78de30a 100755 --- a/jni/SDL2-2.0.3/premake/projects/testshape.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testsprite2.lua b/jni/SDL2-2.0.3/premake/projects/testsprite2.lua index 3f1d284d..5096f3f3 100755 --- a/jni/SDL2-2.0.3/premake/projects/testsprite2.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testspriteminimal.lua b/jni/SDL2-2.0.3/premake/projects/testspriteminimal.lua index c51c213e..847d8bb4 100755 --- a/jni/SDL2-2.0.3/premake/projects/testspriteminimal.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/teststreaming.lua b/jni/SDL2-2.0.3/premake/projects/teststreaming.lua index ad3e426a..a3410134 100755 --- a/jni/SDL2-2.0.3/premake/projects/teststreaming.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testthread.lua b/jni/SDL2-2.0.3/premake/projects/testthread.lua index 2b223163..f1404f99 100755 --- a/jni/SDL2-2.0.3/premake/projects/testthread.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testtimer.lua b/jni/SDL2-2.0.3/premake/projects/testtimer.lua index 5bf92fba..039dff96 100755 --- a/jni/SDL2-2.0.3/premake/projects/testtimer.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testver.lua b/jni/SDL2-2.0.3/premake/projects/testver.lua index 346dcc4f..70aba2dd 100755 --- a/jni/SDL2-2.0.3/premake/projects/testver.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/testwm2.lua b/jni/SDL2-2.0.3/premake/projects/testwm2.lua index 65fd3123..12e62457 100755 --- a/jni/SDL2-2.0.3/premake/projects/testwm2.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/torturethread.lua b/jni/SDL2-2.0.3/premake/projects/torturethread.lua index 864f49af..eca1b044 100755 --- a/jni/SDL2-2.0.3/premake/projects/torturethread.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/projects/touch.lua b/jni/SDL2-2.0.3/premake/projects/touch.lua index c871ce60..da9f98dc 100755 --- a/jni/SDL2-2.0.3/premake/projects/touch.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_check_compile.lua b/jni/SDL2-2.0.3/premake/util/sdl_check_compile.lua index a8a8fc7c..668754a5 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_check_compile.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_dependency_checkers.lua b/jni/SDL2-2.0.3/premake/util/sdl_dependency_checkers.lua index dc5d9b7f..2e8e7fcd 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_dependency_checkers.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_depends.lua b/jni/SDL2-2.0.3/premake/util/sdl_depends.lua index 254eb587..c7367971 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_depends.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_file.lua b/jni/SDL2-2.0.3/premake/util/sdl_file.lua index e4fb156c..74a15e57 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_file.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_gen_config.lua b/jni/SDL2-2.0.3/premake/util/sdl_gen_config.lua index a0150ac5..0e030c46 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_gen_config.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_projects.lua b/jni/SDL2-2.0.3/premake/util/sdl_projects.lua index 7bc752cd..ec26fbf3 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_projects.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/premake/util/sdl_string.lua b/jni/SDL2-2.0.3/premake/util/sdl_string.lua index 470d7cd9..aa3b5895 100755 --- a/jni/SDL2-2.0.3/premake/util/sdl_string.lua +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/SDL.c b/jni/SDL2-2.0.3/src/SDL.c index 1e2707d9..6318bbe6 100644 --- a/jni/SDL2-2.0.3/src/SDL.c +++ b/jni/SDL2-2.0.3/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 @@ -405,6 +405,8 @@ SDL_GetPlatform() return "BSDI"; #elif __DREAMCAST__ return "Dreamcast"; +#elif __EMSCRIPTEN__ + return "Emscripten"; #elif __FREEBSD__ return "FreeBSD"; #elif __HAIKU__ @@ -439,6 +441,8 @@ SDL_GetPlatform() return "Solaris"; #elif __WIN32__ return "Windows"; +#elif __WINRT__ + return "WinRT"; #elif __IPHONEOS__ return "iOS"; #elif __PSP__ diff --git a/jni/SDL2-2.0.3/src/SDL_assert.c b/jni/SDL2-2.0.3/src/SDL_assert.c index 98e75844..e1d267a9 100644 --- a/jni/SDL2-2.0.3/src/SDL_assert.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/SDL_assert_c.h b/jni/SDL2-2.0.3/src/SDL_assert_c.h index f94b24c2..6f05c925 100644 --- a/jni/SDL2-2.0.3/src/SDL_assert_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/SDL_error.c b/jni/SDL2-2.0.3/src/SDL_error.c index 2df29aa1..79e9347a 100644 --- a/jni/SDL2-2.0.3/src/SDL_error.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/SDL_error_c.h b/jni/SDL2-2.0.3/src/SDL_error_c.h index 98c20c49..946281d2 100644 --- a/jni/SDL2-2.0.3/src/SDL_error_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/SDL_hints.c b/jni/SDL2-2.0.3/src/SDL_hints.c index 365459ec..7026ac5d 100644 --- a/jni/SDL2-2.0.3/src/SDL_hints.c +++ b/jni/SDL2-2.0.3/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 @@ -137,6 +137,10 @@ SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) SDL_DelHintCallback(name, callback, userdata); entry = (SDL_HintWatch *)SDL_malloc(sizeof(*entry)); + if (!entry) { + SDL_OutOfMemory(); + return; + } entry->callback = callback; entry->userdata = userdata; @@ -149,6 +153,8 @@ SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) /* Need to add a hint entry for this watcher */ hint = (SDL_Hint *)SDL_malloc(sizeof(*hint)); if (!hint) { + SDL_OutOfMemory(); + SDL_free(entry); return; } hint->name = SDL_strdup(name); diff --git a/jni/SDL2-2.0.3/src/SDL_internal.h b/jni/SDL2-2.0.3/src/SDL_internal.h index cb66abd8..a3ccb363 100644 --- a/jni/SDL2-2.0.3/src/SDL_internal.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/SDL_log.c b/jni/SDL2-2.0.3/src/SDL_log.c index 5ebab015..b5ab601e 100644 --- a/jni/SDL2-2.0.3/src/SDL_log.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/atomic/SDL_atomic.c b/jni/SDL2-2.0.3/src/atomic/SDL_atomic.c index c6029c2c..30b4ccca 100644 --- a/jni/SDL2-2.0.3/src/atomic/SDL_atomic.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/atomic/SDL_spinlock.c b/jni/SDL2-2.0.3/src/atomic/SDL_spinlock.c index 29b5190e..1681aa78 100644 --- a/jni/SDL2-2.0.3/src/atomic/SDL_spinlock.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_audio.c b/jni/SDL2-2.0.3/src/audio/SDL_audio.c index 7559d6ca..04f1e7ec 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audio.c +++ b/jni/SDL2-2.0.3/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 @@ -51,9 +51,7 @@ extern AudioBootStrap QSAAUDIO_bootstrap; extern AudioBootStrap SUNAUDIO_bootstrap; extern AudioBootStrap ARTS_bootstrap; extern AudioBootStrap ESD_bootstrap; -#if SDL_AUDIO_DRIVER_NACL extern AudioBootStrap NACLAUD_bootstrap; -#endif extern AudioBootStrap NAS_bootstrap; extern AudioBootStrap XAUDIO2_bootstrap; extern AudioBootStrap DSOUND_bootstrap; @@ -71,6 +69,7 @@ extern AudioBootStrap FUSIONSOUND_bootstrap; extern AudioBootStrap ANDROIDAUD_bootstrap; extern AudioBootStrap PSPAUD_bootstrap; extern AudioBootStrap SNDIO_bootstrap; +extern AudioBootStrap EmscriptenAudio_bootstrap; /* Available audio drivers */ @@ -140,6 +139,9 @@ static const AudioBootStrap *const bootstrap[] = { #endif #if SDL_AUDIO_DRIVER_PSP &PSPAUD_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_EMSCRIPTEN + &EmscriptenAudio_bootstrap, #endif NULL }; @@ -159,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 @@ -205,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 @@ -265,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... */ @@ -506,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); @@ -534,197 +609,60 @@ 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); + return 0; } @@ -757,16 +695,16 @@ SDL_ParseAudioFormat(const char *string) int SDL_GetNumAudioDrivers(void) { - return (SDL_arraysize(bootstrap) - 1); + return SDL_arraysize(bootstrap) - 1; } const char * SDL_GetAudioDriver(int index) { if (index >= 0 && index < SDL_GetNumAudioDrivers()) { - return (bootstrap[index]->name); + return bootstrap[index]->name; } - return (NULL); + return NULL; } int @@ -780,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) { @@ -797,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); @@ -813,13 +751,18 @@ SDL_AudioInit(const char *driver_name) } } - SDL_memset(¤t_audio, 0, sizeof(current_audio)); - return (-1); /* No driver was available, so fail. */ + SDL_zero(current_audio); + return -1; /* No driver was available, so fail. */ } + current_audio.detectionLock = SDL_CreateMutex(); + finalize_audio_entry_points(); - return (0); + /* Make sure we have a list of devices available at startup. */ + current_audio.impl.DetectDevices(); + + return 0; } /* @@ -831,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; } @@ -887,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; } @@ -918,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; @@ -928,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; } @@ -968,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); } @@ -1061,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)) { @@ -1073,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; } @@ -1108,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; @@ -1123,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)); @@ -1131,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) { @@ -1146,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) { @@ -1224,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; @@ -1243,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 @@ -1274,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; } @@ -1292,14 +1223,14 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) /* Start up the audio driver, if necessary. This is legacy behaviour! */ if (!SDL_WasInit(SDL_INIT_AUDIO)) { if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { - return (-1); + return -1; } } /* SDL_OpenAudio() is legacy and can only act on Device ID #1. */ if (open_devices[0] != NULL) { SDL_SetError("Audio device is already opened"); - return (-1); + return -1; } if (obtained) { @@ -1310,7 +1241,7 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) } SDL_assert((id == 0) || (id == 1)); - return ((id == 0) ? -1 : 0); + return (id == 0) ? -1 : 0; } SDL_AudioDeviceID @@ -1334,7 +1265,7 @@ SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) status = SDL_AUDIO_PLAYING; } } - return (status); + return status; } @@ -1425,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 @@ -1470,16 +1403,16 @@ SDL_FirstAudioFormat(SDL_AudioFormat format) } } format_idx_sub = 0; - return (SDL_NextAudioFormat()); + return SDL_NextAudioFormat(); } SDL_AudioFormat SDL_NextAudioFormat(void) { if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) { - return (0); + return 0; } - return (format_list[format_idx][format_idx_sub++]); + return format_list[format_idx][format_idx_sub++]; } void diff --git a/jni/SDL2-2.0.3/src/audio/SDL_audio_c.h b/jni/SDL2-2.0.3/src/audio/SDL_audio_c.h index 2ea4e148..b1fab65f 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audio_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_audiocvt.c b/jni/SDL2-2.0.3/src/audio/SDL_audiocvt.c index 518735bf..092839b8 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audiocvt.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_audiodev.c b/jni/SDL2-2.0.3/src/audio/SDL_audiodev.c index e9af6211..dd89af74 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audiodev.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_audiodev_c.h b/jni/SDL2-2.0.3/src/audio/SDL_audiodev_c.h index 1ad0dc10..2208d9c4 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audiodev_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_audiomem.h b/jni/SDL2-2.0.3/src/audio/SDL_audiomem.h index 3711ac94..a65b44b7 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audiomem.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_audiotypecvt.c b/jni/SDL2-2.0.3/src/audio/SDL_audiotypecvt.c index 6f07d628..1e3a6447 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_audiotypecvt.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_mixer.c b/jni/SDL2-2.0.3/src/audio/SDL_mixer.c index 42a1c687..38fda0bf 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_mixer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_sysaudio.h b/jni/SDL2-2.0.3/src/audio/SDL_sysaudio.h index 4f933205..c220f582 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_sysaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_wave.c b/jni/SDL2-2.0.3/src/audio/SDL_wave.c index 988e4b72..e898115c 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_wave.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/SDL_wave.h b/jni/SDL2-2.0.3/src/audio/SDL_wave.h index 6c20c60f..ccfa0448 100644 --- a/jni/SDL2-2.0.3/src/audio/SDL_wave.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/alsa/SDL_alsa_audio.c b/jni/SDL2-2.0.3/src/audio/alsa/SDL_alsa_audio.c index 1f3def3f..fac51978 100644 --- a/jni/SDL2-2.0.3/src/audio/alsa/SDL_alsa_audio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/alsa/SDL_alsa_audio.h b/jni/SDL2-2.0.3/src/audio/alsa/SDL_alsa_audio.h index 45353883..c5d3aeee 100644 --- a/jni/SDL2-2.0.3/src/audio/alsa/SDL_alsa_audio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/android/SDL_androidaudio.c b/jni/SDL2-2.0.3/src/audio/android/SDL_androidaudio.c index fe66763b..f35878cd 100644 --- a/jni/SDL2-2.0.3/src/audio/android/SDL_androidaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/android/SDL_androidaudio.h b/jni/SDL2-2.0.3/src/audio/android/SDL_androidaudio.h index 77bb219d..38bb1905 100644 --- a/jni/SDL2-2.0.3/src/audio/android/SDL_androidaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/arts/SDL_artsaudio.c b/jni/SDL2-2.0.3/src/audio/arts/SDL_artsaudio.c index 72fba70c..ca97c0af 100644 --- a/jni/SDL2-2.0.3/src/audio/arts/SDL_artsaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/arts/SDL_artsaudio.h b/jni/SDL2-2.0.3/src/audio/arts/SDL_artsaudio.h index fb7706fc..54b86f6b 100644 --- a/jni/SDL2-2.0.3/src/audio/arts/SDL_artsaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/bsd/SDL_bsdaudio.c b/jni/SDL2-2.0.3/src/audio/bsd/SDL_bsdaudio.c index f415fe04..b684f9eb 100644 --- a/jni/SDL2-2.0.3/src/audio/bsd/SDL_bsdaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/bsd/SDL_bsdaudio.h b/jni/SDL2-2.0.3/src/audio/bsd/SDL_bsdaudio.h index 625bdb54..7eee944f 100644 --- a/jni/SDL2-2.0.3/src/audio/bsd/SDL_bsdaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.c b/jni/SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.c index 7fc9ea94..f75bc784 100644 --- a/jni/SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.c +++ b/jni/SDL2-2.0.3/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 @@ -19,6 +19,9 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "../../SDL_internal.h" + +#if SDL_AUDIO_DRIVER_COREAUDIO + #include "SDL_audio.h" #include "../SDL_audio_c.h" #include "../SDL_sysaudio.h" @@ -37,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)); } } @@ -74,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; @@ -89,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; @@ -102,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) @@ -133,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; @@ -166,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 @@ -314,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; @@ -352,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; @@ -373,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 @@ -451,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); @@ -516,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()... */ } @@ -524,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; @@ -554,4 +693,6 @@ AudioBootStrap COREAUDIO_bootstrap = { "coreaudio", "CoreAudio", COREAUDIO_Init, 0 }; +#endif /* SDL_AUDIO_DRIVER_COREAUDIO */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.h b/jni/SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.h index 41e8cea2..119d2582 100644 --- a/jni/SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/directsound/SDL_directsound.c b/jni/SDL2-2.0.3/src/audio/directsound/SDL_directsound.c index 067683cc..10c32f83 100644 --- a/jni/SDL2-2.0.3/src/audio/directsound/SDL_directsound.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/directsound/SDL_directsound.h b/jni/SDL2-2.0.3/src/audio/directsound/SDL_directsound.h index ae7faa45..718cbab3 100644 --- a/jni/SDL2-2.0.3/src/audio/directsound/SDL_directsound.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/disk/SDL_diskaudio.c b/jni/SDL2-2.0.3/src/audio/disk/SDL_diskaudio.c index cc4e3efc..ef8bc0dc 100644 --- a/jni/SDL2-2.0.3/src/audio/disk/SDL_diskaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/disk/SDL_diskaudio.h b/jni/SDL2-2.0.3/src/audio/disk/SDL_diskaudio.h index 9c5a7afa..0c1af3a5 100644 --- a/jni/SDL2-2.0.3/src/audio/disk/SDL_diskaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/dsp/SDL_dspaudio.c b/jni/SDL2-2.0.3/src/audio/dsp/SDL_dspaudio.c index eea5a5f8..678c74fe 100644 --- a/jni/SDL2-2.0.3/src/audio/dsp/SDL_dspaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/dsp/SDL_dspaudio.h b/jni/SDL2-2.0.3/src/audio/dsp/SDL_dspaudio.h index 5cbb563b..054c4d9a 100644 --- a/jni/SDL2-2.0.3/src/audio/dsp/SDL_dspaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/dummy/SDL_dummyaudio.c b/jni/SDL2-2.0.3/src/audio/dummy/SDL_dummyaudio.c index 671e222c..ec9c40fa 100644 --- a/jni/SDL2-2.0.3/src/audio/dummy/SDL_dummyaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/dummy/SDL_dummyaudio.h b/jni/SDL2-2.0.3/src/audio/dummy/SDL_dummyaudio.h index 18540111..9415c122 100644 --- a/jni/SDL2-2.0.3/src/audio/dummy/SDL_dummyaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c b/jni/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c index e675272d..906728cb 100644 --- a/jni/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h b/jni/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h index e0d5d4cd..ad8159ee 100644 --- a/jni/SDL2-2.0.3/src/audio/esd/SDL_esdaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c b/jni/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c index b8367715..6bab5a78 100644 --- a/jni/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h b/jni/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h index 1f9d6bd2..aa2ae192 100644 --- a/jni/SDL2-2.0.3/src/audio/fusionsound/SDL_fsaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc b/jni/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc index dddb7792..c4765e37 100644 --- a/jni/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h b/jni/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h index c6c019e9..21418618 100644 --- a/jni/SDL2-2.0.3/src/audio/haiku/SDL_haikuaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/nacl/SDL_naclaudio.c b/jni/SDL2-2.0.3/src/audio/nacl/SDL_naclaudio.c index d9179f27..5c5b0bcf 100644 --- a/jni/SDL2-2.0.3/src/audio/nacl/SDL_naclaudio.c +++ b/jni/SDL2-2.0.3/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 @@ -20,6 +20,9 @@ */ #include "../../SDL_internal.h" + +#if SDL_AUDIO_DRIVER_NACL + #include "SDL_naclaudio.h" #include "SDL_audio.h" @@ -40,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); @@ -82,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(); @@ -127,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; @@ -145,3 +146,7 @@ AudioBootStrap NACLAUD_bootstrap = { NACLAUD_DRIVER_NAME, "SDL NaCl Audio Driver", NACLAUD_Init, 0 }; + +#endif /* SDL_AUDIO_DRIVER_NACL */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/audio/nacl/SDL_naclaudio.h b/jni/SDL2-2.0.3/src/audio/nacl/SDL_naclaudio.h index 4683c785..c2636f0c 100644 --- a/jni/SDL2-2.0.3/src/audio/nacl/SDL_naclaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c b/jni/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c index a41a480f..596ca752 100644 --- a/jni/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h b/jni/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h index e1ee6a52..715f1fb2 100644 --- a/jni/SDL2-2.0.3/src/audio/nas/SDL_nasaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/paudio/SDL_paudio.c b/jni/SDL2-2.0.3/src/audio/paudio/SDL_paudio.c index 032d8d2c..79c71645 100644 --- a/jni/SDL2-2.0.3/src/audio/paudio/SDL_paudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/paudio/SDL_paudio.h b/jni/SDL2-2.0.3/src/audio/paudio/SDL_paudio.h index 5a1a6488..2bcb706c 100644 --- a/jni/SDL2-2.0.3/src/audio/paudio/SDL_paudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/psp/SDL_pspaudio.c b/jni/SDL2-2.0.3/src/audio/psp/SDL_pspaudio.c index 5b170592..60b7993a 100644 --- a/jni/SDL2-2.0.3/src/audio/psp/SDL_pspaudio.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,9 @@ 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_AUDIO_DRIVER_PSP #include #include @@ -40,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 *) @@ -191,5 +194,6 @@ AudioBootStrap PSPAUD_bootstrap = { /* SDL_AUDI */ +#endif /* SDL_AUDIO_DRIVER_PSP */ - +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/audio/psp/SDL_pspaudio.h b/jni/SDL2-2.0.3/src/audio/psp/SDL_pspaudio.h index 8e420f31..c6332744 100644 --- a/jni/SDL2-2.0.3/src/audio/psp/SDL_pspaudio.h +++ b/jni/SDL2-2.0.3/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 @@ -24,7 +24,7 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ +/* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *this #define NUM_BUFFERS 2 diff --git a/jni/SDL2-2.0.3/src/audio/pulseaudio/SDL_pulseaudio.c b/jni/SDL2-2.0.3/src/audio/pulseaudio/SDL_pulseaudio.c index c3e1238b..30ca984e 100644 --- a/jni/SDL2-2.0.3/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/pulseaudio/SDL_pulseaudio.h b/jni/SDL2-2.0.3/src/audio/pulseaudio/SDL_pulseaudio.h index a75409bc..995c53c6 100644 --- a/jni/SDL2-2.0.3/src/audio/pulseaudio/SDL_pulseaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/qsa/SDL_qsa_audio.c b/jni/SDL2-2.0.3/src/audio/qsa/SDL_qsa_audio.c index d6b8a680..784466ca 100644 --- a/jni/SDL2-2.0.3/src/audio/qsa/SDL_qsa_audio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/qsa/SDL_qsa_audio.h b/jni/SDL2-2.0.3/src/audio/qsa/SDL_qsa_audio.h index 66650d2a..363feb47 100644 --- a/jni/SDL2-2.0.3/src/audio/qsa/SDL_qsa_audio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/sdlgenaudiocvt.pl b/jni/SDL2-2.0.3/src/audio/sdlgenaudiocvt.pl index d4c2c502..b012df80 100755 --- a/jni/SDL2-2.0.3/src/audio/sdlgenaudiocvt.pl +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/sndio/SDL_sndioaudio.c b/jni/SDL2-2.0.3/src/audio/sndio/SDL_sndioaudio.c index 5c063650..ba4fc4fa 100644 --- a/jni/SDL2-2.0.3/src/audio/sndio/SDL_sndioaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/sndio/SDL_sndioaudio.h b/jni/SDL2-2.0.3/src/audio/sndio/SDL_sndioaudio.h index b8dadb7d..6956674b 100644 --- a/jni/SDL2-2.0.3/src/audio/sndio/SDL_sndioaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/sun/SDL_sunaudio.c b/jni/SDL2-2.0.3/src/audio/sun/SDL_sunaudio.c index 7efe30ec..9cdefbdb 100644 --- a/jni/SDL2-2.0.3/src/audio/sun/SDL_sunaudio.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/sun/SDL_sunaudio.h b/jni/SDL2-2.0.3/src/audio/sun/SDL_sunaudio.h index df05e6fc..02ac6cbd 100644 --- a/jni/SDL2-2.0.3/src/audio/sun/SDL_sunaudio.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/winmm/SDL_winmm.c b/jni/SDL2-2.0.3/src/audio/winmm/SDL_winmm.c index 88a8154e..37debb90 100644 --- a/jni/SDL2-2.0.3/src/audio/winmm/SDL_winmm.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/winmm/SDL_winmm.h b/jni/SDL2-2.0.3/src/audio/winmm/SDL_winmm.h index 47996c1a..a0dec010 100644 --- a/jni/SDL2-2.0.3/src/audio/winmm/SDL_winmm.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2.c b/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2.c index 85ac1460..ec1967a8 100644 --- a/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2.c +++ b/jni/SDL2-2.0.3/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 @@ -58,13 +58,23 @@ /* The configure script already did any necessary checking */ # define SDL_XAUDIO2_HAS_SDK 1 #elif defined(__WINRT__) -/* WinRT always has access to the XAudio 2 SDK */ +/* WinRT always has access to the XAudio 2 SDK (albeit with a header file + that doesn't compile as C code). +*/ # define SDL_XAUDIO2_HAS_SDK +#include "SDL_xaudio2.h" /* ... compiles as C code, in contrast to XAudio2 headers + in the Windows SDK, v.10.0.10240.0 (Win 10's initial SDK) + */ #else /* XAudio2 exists as of the March 2008 DirectX SDK 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 +82,7 @@ # define SDL_XAUDIO2_HAS_SDK 1 #endif #endif +#endif /* 0 */ #ifdef SDL_XAUDIO2_HAS_SDK @@ -82,17 +93,10 @@ #endif #endif -/* The XAudio header file, when #include'd on WinRT, will only compile in C++ - files, but not C. A few preprocessor-based hacks are defined below in order - to get xaudio2.h to compile in the C/non-C++ file, SDL_xaudio2.c. - */ -#ifdef __WINRT__ -#define uuid(x) -#define DX_BUILD -#endif - +#if !defined(_SDL_XAUDIO2_H) #define INITGUID 1 #include +#endif /* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *this @@ -126,16 +130,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 +150,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 +170,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 +222,7 @@ XAUDIO2_PlayDevice(_THIS) if (result != S_OK) { /* uhoh, panic! */ IXAudio2SourceVoice_FlushSourceBuffers(source); - this->enabled = 0; + SDL_OpenedAudioDeviceDisconnected(this); } } @@ -289,7 +290,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 +316,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 +341,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 +507,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/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp b/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp index 69eb5ad1..e4fb8e84 100644 --- a/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h b/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h index 3db04cf9..6f14f17a 100644 --- a/jni/SDL2-2.0.3/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/android/SDL_android.c b/jni/SDL2-2.0.3/src/core/android/SDL_android.c index 24442fd2..be948d22 100644 --- a/jni/SDL2-2.0.3/src/core/android/SDL_android.c +++ b/jni/SDL2-2.0.3/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" @@ -44,8 +45,8 @@ #define LOG_TAG "SDL_android" /* #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) */ /* #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) */ -#define LOGI(...) do {} while (false) -#define LOGE(...) do {} while (false) +#define LOGI(...) do {} while (0) +#define LOGE(...) do {} while (0) /* Uncomment this to log messages entering and exiting methods in this file */ /* #define DEBUG_JNI */ @@ -57,7 +58,6 @@ static void Android_JNI_ThreadDestroyed(void*); *******************************************************************************/ #include #include -#include /******************************************************************************* @@ -71,7 +71,6 @@ static jclass mActivityClass; /* method signatures */ static jmethodID midGetNativeSurface; -static jmethodID midFlipBuffers; static jmethodID midAudioInit; static jmethodID midAudioWriteShortBuffer; static jmethodID midAudioWriteByteBuffer; @@ -80,7 +79,7 @@ static jmethodID midPollInputDevices; /* Accelerometer data storage */ static float fLastAccelerometer[3]; -static bool bHasNewData; +static SDL_bool bHasNewData; /******************************************************************************* Functions called by JNI @@ -119,8 +118,6 @@ JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls) midGetNativeSurface = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "getNativeSurface","()Landroid/view/Surface;"); - midFlipBuffers = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, - "flipBuffers","()V"); midAudioInit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "audioInit", "(IZZI)I"); midAudioWriteShortBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, @@ -132,25 +129,35 @@ JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls) midPollInputDevices = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "pollInputDevices", "()V"); - bHasNewData = false; + bHasNewData = SDL_FALSE; - if(!midGetNativeSurface || !midFlipBuffers || !midAudioInit || + if (!midGetNativeSurface || !midAudioInit || !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit || !midPollInputDevices) { __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly"); } __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, - jint width, jint height, jint format) + jint width, jint height, jint format, jfloat rate) { - Android_SetScreenResolution(width, height, format); + Android_SetScreenResolution(width, height, format, rate); } /* Paddown */ -JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadDown( +JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_onNativePadDown( JNIEnv* env, jclass jcls, jint device_id, jint keycode) { @@ -158,7 +165,7 @@ JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadDown( } /* Padup */ -JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadUp( +JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_onNativePadUp( JNIEnv* env, jclass jcls, jint device_id, jint keycode) { @@ -182,7 +189,7 @@ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeHat( } -JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick( +JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick( JNIEnv* env, jclass jcls, jint device_id, jstring device_name, jint is_accelerometer, jint nbuttons, jint naxes, jint nhats, jint nballs) @@ -197,7 +204,7 @@ JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick( return retval; } -JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick( +JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick( JNIEnv* env, jclass jcls, jint device_id) { return Android_RemoveJoystick(device_id); @@ -257,11 +264,6 @@ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed( } -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls) -{ - SDL_GL_SwapWindow(Android_Window); -} - /* Keydown */ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyDown( JNIEnv* env, jclass jcls, jint keycode) @@ -294,6 +296,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, @@ -302,7 +312,7 @@ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel( fLastAccelerometer[0] = x; fLastAccelerometer[1] = y; fLastAccelerometer[2] = z; - bHasNewData = true; + bHasNewData = SDL_TRUE; } /* Low memory */ @@ -386,7 +396,7 @@ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeSetComposing (*env)->ReleaseStringUTFChars(env, text, utftext); } -jstring Java_org_libsdl_app_SDLActivity_nativeGetHint(JNIEnv* env, jclass cls, jstring name) { +JNIEXPORT jstring JNICALL Java_org_libsdl_app_SDLActivity_nativeGetHint(JNIEnv* env, jclass cls, jstring name) { const char *utfname = (*env)->GetStringUTFChars(env, name, NULL); const char *hint = SDL_GetHint(utfname); @@ -442,7 +452,7 @@ static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder) } } -static SDL_bool LocalReferenceHolder_IsActive() +static SDL_bool LocalReferenceHolder_IsActive(void) { return s_active > 0; } @@ -460,12 +470,6 @@ ANativeWindow* Android_JNI_GetNativeWindow(void) return anw; } -void Android_JNI_SwapWindow() -{ - JNIEnv *mEnv = Android_JNI_GetEnv(); - (*mEnv)->CallStaticVoidMethod(mEnv, mActivityClass, midFlipBuffers); -} - void Android_JNI_SetActivityTitle(const char *title) { jmethodID mid; @@ -487,7 +491,7 @@ SDL_bool Android_JNI_GetAccelerometerValues(float values[3]) for (i = 0; i < 3; ++i) { values[i] = fLastAccelerometer[i]; } - bHasNewData = false; + bHasNewData = SDL_FALSE; retval = SDL_TRUE; } @@ -549,12 +553,12 @@ int Android_JNI_SetupThread(void) * Audio support */ static jboolean audioBuffer16Bit = JNI_FALSE; -static jboolean audioBufferStereo = JNI_FALSE; static jobject audioBuffer = NULL; static void* audioBufferPinned = NULL; int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames) { + jboolean audioBufferStereo; int audioBufferFrames; JNIEnv *env = Android_JNI_GetEnv(); @@ -612,12 +616,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(); @@ -632,7 +636,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(); @@ -647,7 +651,7 @@ void Android_JNI_CloseAudioDevice() /* Test for an exception and call SDL_SetError with its detail if one occurs */ /* If the parameter silent is truthy then SDL_SetError() will not be called. */ -static bool Android_JNI_ExceptionOccurred(bool silent) +static SDL_bool Android_JNI_ExceptionOccurred(SDL_bool silent) { SDL_assert(LocalReferenceHolder_IsActive()); JNIEnv *mEnv = Android_JNI_GetEnv(); @@ -681,10 +685,10 @@ static bool Android_JNI_ExceptionOccurred(bool silent) (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionName, exceptionNameUTF8); } - return true; + return SDL_TRUE; } - return false; + return SDL_FALSE; } static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx) @@ -728,19 +732,19 @@ static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx) */ mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager), "openFd", "(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;"); inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString); - if (Android_JNI_ExceptionOccurred(true)) { + if (Android_JNI_ExceptionOccurred(SDL_TRUE)) { goto fallback; } mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getStartOffset", "()J"); ctx->hidden.androidio.offset = (*mEnv)->CallLongMethod(mEnv, inputStream, mid); - if (Android_JNI_ExceptionOccurred(true)) { + if (Android_JNI_ExceptionOccurred(SDL_TRUE)) { goto fallback; } mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getDeclaredLength", "()J"); ctx->hidden.androidio.size = (*mEnv)->CallLongMethod(mEnv, inputStream, mid); - if (Android_JNI_ExceptionOccurred(true)) { + if (Android_JNI_ExceptionOccurred(SDL_TRUE)) { goto fallback; } @@ -754,7 +758,7 @@ static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx) /* Seek to the correct offset in the file. */ lseek(ctx->hidden.androidio.fd, (off_t)ctx->hidden.androidio.offset, SEEK_SET); - if (false) { + if (0) { fallback: /* Disabled log message because of spam on the Nexus 7 */ /* __android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file"); */ @@ -766,13 +770,20 @@ fallback: mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager), "open", "(Ljava/lang/String;I)Ljava/io/InputStream;"); inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /* ACCESS_RANDOM */); - if (Android_JNI_ExceptionOccurred(false)) { - // Try fallback to APK Extension files + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { + /* Try fallback to APK expansion files */ mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context), - "openAPKExtensionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;"); + "openAPKExpansionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;"); + if (!mid) { + SDL_SetError("No openAPKExpansionInputStream() in Java class"); + goto failure; /* Java class is missing the required method */ + } inputStream = (*mEnv)->CallObjectMethod(mEnv, context, mid, fileNameJString); - if (Android_JNI_ExceptionOccurred(false)) { + /* Exception is checked first because it always needs to be cleared. + * If no exception occurred then the last SDL error message is kept. + */ + if (Android_JNI_ExceptionOccurred(SDL_FALSE) || !inputStream) { goto failure; } } @@ -790,7 +801,7 @@ fallback: mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "available", "()I"); ctx->hidden.androidio.size = (long)(*mEnv)->CallIntMethod(mEnv, inputStream, mid); - if (Android_JNI_ExceptionOccurred(false)) { + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { goto failure; } @@ -801,7 +812,7 @@ fallback: "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;"); readableByteChannel = (*mEnv)->CallStaticObjectMethod( mEnv, channels, mid, inputStream); - if (Android_JNI_ExceptionOccurred(false)) { + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { goto failure; } @@ -814,7 +825,7 @@ fallback: ctx->hidden.androidio.readMethod = mid; } - if (false) { + if (0) { failure: result = -1; @@ -907,7 +918,7 @@ size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, /* result = readableByteChannel.read(...); */ int result = (*mEnv)->CallIntMethod(mEnv, readableByteChannel, readMethod, byteBuffer); - if (Android_JNI_ExceptionOccurred(false)) { + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { LocalReferenceHolder_Cleanup(&refs); return 0; } @@ -932,7 +943,7 @@ size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer, return 0; } -static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, bool release) +static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, SDL_bool release) { struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); @@ -955,7 +966,7 @@ static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, bool release) "close", "()V"); (*mEnv)->CallVoidMethod(mEnv, inputStream, mid); (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef); - if (Android_JNI_ExceptionOccurred(false)) { + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { result = -1; } } @@ -968,7 +979,7 @@ static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, bool release) (*mEnv)->CallVoidMethod(mEnv, inputStream, mid); (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.inputStreamRef); (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.readableByteChannelRef); - if (Android_JNI_ExceptionOccurred(false)) { + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { result = -1; } } @@ -1059,7 +1070,7 @@ Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence) } else if (movement < 0) { /* We can't seek backwards so we have to reopen the file and seek */ /* forwards which obviously isn't very efficient */ - Internal_Android_JNI_FileClose(ctx, false); + Internal_Android_JNI_FileClose(ctx, SDL_FALSE); Internal_Android_JNI_FileOpen(ctx); Android_JNI_FileSeek(ctx, newPosition, RW_SEEK_SET); } @@ -1071,7 +1082,7 @@ Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence) int Android_JNI_FileClose(SDL_RWops* ctx) { - return Internal_Android_JNI_FileClose(ctx, true); + return Internal_Android_JNI_FileClose(ctx, SDL_TRUE); } /* returns a new global reference which needs to be released later */ @@ -1134,7 +1145,7 @@ int Android_JNI_SetClipboardText(const char* text) return 0; } -char* Android_JNI_GetClipboardText() +char* Android_JNI_GetClipboardText(void) { SETUP_CLIPBOARD(SDL_strdup("")) @@ -1160,7 +1171,7 @@ char* Android_JNI_GetClipboardText() return SDL_strdup(""); } -SDL_bool Android_JNI_HasClipboardText() +SDL_bool Android_JNI_HasClipboardText(void) { SETUP_CLIPBOARD(SDL_FALSE) @@ -1296,7 +1307,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); @@ -1343,7 +1354,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; @@ -1353,6 +1364,7 @@ void Android_JNI_HideTextInput() int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { JNIEnv *env; + jclass clazz; jmethodID mid; jobject context; jstring title; @@ -1361,6 +1373,7 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu jintArray button_ids; jobjectArray button_texts; jintArray colors; + jobject text; jint temp; int i; @@ -1368,19 +1381,23 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu /* convert parameters */ + clazz = (*env)->FindClass(env, "java/lang/String"); + title = (*env)->NewStringUTF(env, messageboxdata->title); message = (*env)->NewStringUTF(env, messageboxdata->message); button_flags = (*env)->NewIntArray(env, messageboxdata->numbuttons); button_ids = (*env)->NewIntArray(env, messageboxdata->numbuttons); button_texts = (*env)->NewObjectArray(env, messageboxdata->numbuttons, - (*env)->FindClass(env, "java/lang/String"), NULL); + clazz, NULL); for (i = 0; i < messageboxdata->numbuttons; ++i) { temp = messageboxdata->buttons[i].flags; (*env)->SetIntArrayRegion(env, button_flags, i, 1, &temp); temp = messageboxdata->buttons[i].buttonid; (*env)->SetIntArrayRegion(env, button_ids, i, 1, &temp); - (*env)->SetObjectArrayElement(env, button_texts, i, (*env)->NewStringUTF(env, messageboxdata->buttons[i].text)); + text = (*env)->NewStringUTF(env, messageboxdata->buttons[i].text); + (*env)->SetObjectArrayElement(env, button_texts, i, text); + (*env)->DeleteLocalRef(env, text); } if (messageboxdata->colorScheme) { @@ -1396,13 +1413,17 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu colors = NULL; } + (*env)->DeleteLocalRef(env, clazz); + /* call function */ mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext","()Landroid/content/Context;"); context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); - mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), + clazz = (*env)->GetObjectClass(env, context); + + mid = (*env)->GetMethodID(env, clazz, "messageboxShowMessageBox", "(ILjava/lang/String;Ljava/lang/String;[I[I[Ljava/lang/String;[I)I"); *buttonid = (*env)->CallIntMethod(env, context, mid, messageboxdata->flags, @@ -1413,16 +1434,15 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu button_texts, colors); + (*env)->DeleteLocalRef(env, context); + (*env)->DeleteLocalRef(env, clazz); + /* delete parameters */ (*env)->DeleteLocalRef(env, title); (*env)->DeleteLocalRef(env, message); (*env)->DeleteLocalRef(env, button_flags); (*env)->DeleteLocalRef(env, button_ids); - for (i = 0; i < messageboxdata->numbuttons; ++i) { - (*env)->DeleteLocalRef(env, (*env)->GetObjectArrayElement(env, button_texts, i)); - (*env)->SetObjectArrayElement(env, button_texts, i, NULL); - } (*env)->DeleteLocalRef(env, button_texts); (*env)->DeleteLocalRef(env, colors); @@ -1593,6 +1613,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/jni/SDL2-2.0.3/src/core/android/SDL_android.h b/jni/SDL2-2.0.3/src/core/android/SDL_android.h index 051958a4..758e3023 100644 --- a/jni/SDL2-2.0.3/src/core/android/SDL_android.h +++ b/jni/SDL2-2.0.3/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 @@ -33,20 +33,17 @@ extern "C" { #include "SDL_rect.h" /* 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_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 +56,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 +75,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/jni/SDL2-2.0.3/src/core/linux/SDL_dbus.c b/jni/SDL2-2.0.3/src/core/linux/SDL_dbus.c index d9dbd961..cc7b3d37 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_dbus.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/linux/SDL_dbus.h b/jni/SDL2-2.0.3/src/core/linux/SDL_dbus.h index 0fbb2142..dcfec77e 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_dbus.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/linux/SDL_evdev.c b/jni/SDL2-2.0.3/src/core/linux/SDL_evdev.c index c4a7d05c..b9246745 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_evdev.c +++ b/jni/SDL2-2.0.3/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); } @@ -681,10 +680,10 @@ SDL_EVDEV_Poll(void) SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_TRUE, 0, events[i].value); break; case REL_WHEEL: - SDL_SendMouseWheel(mouse->focus, mouse->mouseID, 0, events[i].value); + SDL_SendMouseWheel(mouse->focus, mouse->mouseID, 0, events[i].value, SDL_MOUSEWHEEL_NORMAL); break; case REL_HWHEEL: - SDL_SendMouseWheel(mouse->focus, mouse->mouseID, events[i].value, 0); + SDL_SendMouseWheel(mouse->focus, mouse->mouseID, events[i].value, 0, SDL_MOUSEWHEEL_NORMAL); break; default: break; @@ -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/jni/SDL2-2.0.3/src/core/linux/SDL_evdev.h b/jni/SDL2-2.0.3/src/core/linux/SDL_evdev.h index f6398ea5..670a5cb2 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_evdev.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/linux/SDL_ibus.c b/jni/SDL2-2.0.3/src/core/linux/SDL_ibus.c index 1a0729f2..46d602af 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_ibus.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/linux/SDL_ibus.h b/jni/SDL2-2.0.3/src/core/linux/SDL_ibus.h index d982e684..24765223 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_ibus.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/linux/SDL_udev.c b/jni/SDL2-2.0.3/src/core/linux/SDL_udev.c index 58501838..cf66331e 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_udev.c +++ b/jni/SDL2-2.0.3/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 */ } } @@ -371,10 +373,10 @@ guess_device_class(struct udev_device *dev) devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */ } - /* the first 32 bits are ESC, numbers, and Q to D; if we have all of - * those, consider it a full keyboard; do not test KEY_RESERVED, though */ + /* the first 32 bits are ESC, numbers, and Q to D; if we have any of + * those, consider it a keyboard device; do not test KEY_RESERVED, though */ keyboard_mask = 0xFFFFFFFE; - if ((bitmask_key[0] & keyboard_mask) == keyboard_mask) + if ((bitmask_key[0] & keyboard_mask) != 0) devclass |= SDL_UDEV_DEVICE_KEYBOARD; /* ID_INPUT_KEYBOARD */ return devclass; @@ -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/jni/SDL2-2.0.3/src/core/linux/SDL_udev.h b/jni/SDL2-2.0.3/src/core/linux/SDL_udev.h index 5ec86de2..9242870c 100644 --- a/jni/SDL2-2.0.3/src/core/linux/SDL_udev.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/windows/SDL_directx.h b/jni/SDL2-2.0.3/src/core/windows/SDL_directx.h index f37bccef..10692643 100644 --- a/jni/SDL2-2.0.3/src/core/windows/SDL_directx.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/windows/SDL_windows.c b/jni/SDL2-2.0.3/src/core/windows/SDL_windows.c index 1e5d0ff4..aff6e6d2 100644 --- a/jni/SDL2-2.0.3/src/core/windows/SDL_windows.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/windows/SDL_windows.h b/jni/SDL2-2.0.3/src/core/windows/SDL_windows.h index bb563ccd..863971b6 100644 --- a/jni/SDL2-2.0.3/src/core/windows/SDL_windows.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/windows/SDL_xinput.c b/jni/SDL2-2.0.3/src/core/windows/SDL_xinput.c index 9dcac364..1e13faea 100644 --- a/jni/SDL2-2.0.3/src/core/windows/SDL_xinput.c +++ b/jni/SDL2-2.0.3/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 @@ -29,6 +29,7 @@ XInputGetState_t SDL_XInputGetState = NULL; XInputSetState_t SDL_XInputSetState = NULL; XInputGetCapabilities_t SDL_XInputGetCapabilities = NULL; +XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation = NULL; DWORD SDL_XInputVersion = 0; static HANDLE s_pXInputDLL = 0; @@ -55,6 +56,7 @@ WIN_LoadXInputDLL(void) SDL_XInputGetState = (XInputGetState_t)XInputGetState; SDL_XInputSetState = (XInputSetState_t)XInputSetState; SDL_XInputGetCapabilities = (XInputGetCapabilities_t)XInputGetCapabilities; + SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)XInputGetBatteryInformation; /* XInput 1.4 ships with Windows 8 and 8.1: */ SDL_XInputVersion = (1 << 16) | 4; @@ -84,11 +86,15 @@ WIN_LoadXInputDLL(void) s_pXInputDLL = LoadLibrary(L"XInput1_4.dll"); /* 1.4 Ships with Windows 8. */ if (!s_pXInputDLL) { version = (1 << 16) | 3; - s_pXInputDLL = LoadLibrary(L"XInput1_3.dll"); /* 1.3 Ships with Vista and Win7, can be installed as a redistributable component. */ + s_pXInputDLL = LoadLibrary(L"XInput1_3.dll"); /* 1.3 can be installed as a redistributable component. */ } if (!s_pXInputDLL) { s_pXInputDLL = LoadLibrary(L"bin\\XInput1_3.dll"); } + if (!s_pXInputDLL) { + /* "9.1.0" Ships with Vista and Win7, and is more limited than 1.3+ (e.g. XInputGetStateEx is not available.) */ + s_pXInputDLL = LoadLibrary(L"XInput9_1_0.dll"); + } if (!s_pXInputDLL) { return -1; } @@ -99,8 +105,12 @@ WIN_LoadXInputDLL(void) /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */ SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100); + if (!SDL_XInputGetState) { + SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState"); + } SDL_XInputSetState = (XInputSetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState"); SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities"); + SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" ); if (!SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities) { WIN_UnloadXInputDLL(); return -1; diff --git a/jni/SDL2-2.0.3/src/core/windows/SDL_xinput.h b/jni/SDL2-2.0.3/src/core/windows/SDL_xinput.h index 721c3811..c22b1ebe 100644 --- a/jni/SDL2-2.0.3/src/core/windows/SDL_xinput.h +++ b/jni/SDL2-2.0.3/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 @@ -76,6 +76,29 @@ #define XINPUT_GAMEPAD_GUIDE 0x0400 #endif +#ifndef BATTERY_DEVTYPE_GAMEPAD +#define BATTERY_DEVTYPE_GAMEPAD 0x00 +#endif +#ifndef BATTERY_TYPE_WIRED +#define BATTERY_TYPE_WIRED 0x01 +#endif + +#ifndef BATTERY_TYPE_UNKNOWN +#define BATTERY_TYPE_UNKNOWN 0xFF +#endif +#ifndef BATTERY_LEVEL_EMPTY +#define BATTERY_LEVEL_EMPTY 0x00 +#endif +#ifndef BATTERY_LEVEL_LOW +#define BATTERY_LEVEL_LOW 0x01 +#endif +#ifndef BATTERY_LEVEL_MEDIUM +#define BATTERY_LEVEL_MEDIUM 0x02 +#endif +#ifndef BATTERY_LEVEL_FULL +#define BATTERY_LEVEL_FULL 0x03 +#endif + /* typedef's for XInput structs we use */ typedef struct { @@ -95,6 +118,12 @@ typedef struct XINPUT_GAMEPAD_EX Gamepad; } XINPUT_STATE_EX; +typedef struct +{ + BYTE BatteryType; + BYTE BatteryLevel; +} XINPUT_BATTERY_INFORMATION_EX; + /* Forward decl's for XInput API's we load dynamically and use if available */ typedef DWORD (WINAPI *XInputGetState_t) ( @@ -115,17 +144,26 @@ typedef DWORD (WINAPI *XInputGetCapabilities_t) XINPUT_CAPABILITIES* pCapabilities /* [out] Receives the capabilities */ ); +typedef DWORD (WINAPI *XInputGetBatteryInformation_t) + ( + DWORD dwUserIndex, + BYTE devType, + XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation + ); + extern int WIN_LoadXInputDLL(void); extern void WIN_UnloadXInputDLL(void); extern XInputGetState_t SDL_XInputGetState; extern XInputSetState_t SDL_XInputSetState; extern XInputGetCapabilities_t SDL_XInputGetCapabilities; +extern XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation; extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */ #define XINPUTGETSTATE SDL_XInputGetState #define XINPUTSETSTATE SDL_XInputSetState #define XINPUTGETCAPABILITIES SDL_XInputGetCapabilities +#define XINPUTGETBATTERYINFORMATION SDL_XInputGetBatteryInformation #endif /* HAVE_XINPUT_H */ diff --git a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_common.cpp b/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_common.cpp index 0758ad92..c8ac4813 100644 --- a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_common.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_common.h b/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_common.h index e49e615e..e905139c 100644 --- a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_common.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_direct3d.cpp b/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_direct3d.cpp index fc5909aa..df650cd8 100644 --- a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/jni/SDL2-2.0.3/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 @@ -126,6 +126,16 @@ static void WINRT_SetDisplayOrientationsPreference(void *userdata, const char *n { SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0); + /* HACK: prevent SDL from altering an app's .appxmanifest-set orientation + * from being changed on startup, by detecting when SDL_HINT_ORIENTATIONS + * is getting registered. + * + * TODO, WinRT: consider reading in an app's .appxmanifest file, and apply its orientation when 'newValue == NULL'. + */ + if ((oldValue == NULL) && (newValue == NULL)) { + return; + } + // Start with no orientation flags, then add each in as they're parsed // from newValue. unsigned int orientationFlags = 0; @@ -174,97 +184,48 @@ static void WINRT_SetDisplayOrientationsPreference(void *userdata, const char *n } static void -WINRT_ProcessWindowSizeChange() +WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing into WINRT_ProcessWindowSizeChange() { - SDL_VideoDevice *_this = SDL_GetVideoDevice(); + CoreWindow ^ coreWindow = CoreWindow::GetForCurrentThread(); + if (coreWindow) { + if (WINRT_GlobalSDLWindow) { + SDL_Window * window = WINRT_GlobalSDLWindow; + SDL_WindowData * data = (SDL_WindowData *) window->driverdata; - // Make the new window size be the one true fullscreen mode. - // This change was initially done, in part, to allow the Direct3D 11.1 - // renderer to receive window-resize events as a device rotates. - // Before, rotating a device from landscape, to portrait, and then - // back to landscape would cause the Direct3D 11.1 swap buffer to - // not get resized appropriately. SDL would, on the rotation from - // landscape to portrait, re-resize the SDL window to it's initial - // size (landscape). On the subsequent rotation, SDL would drop the - // window-resize event as it appeared the SDL window didn't change - // size, and the Direct3D 11.1 renderer wouldn't resize its swap - // chain. - SDL_DisplayMode newDisplayMode; - if (WINRT_CalcDisplayModeUsingNativeWindow(&newDisplayMode) != 0) { - return; - } + int x = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Left); + int y = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Top); + int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); + int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); - // Make note of the old display mode, and it's old driverdata. - SDL_DisplayMode oldDisplayMode; - SDL_zero(oldDisplayMode); - if (_this) { - oldDisplayMode = _this->displays[0].desktop_mode; - } +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION == NTDDI_WIN8) + /* WinPhone 8.0 always keeps its native window size in portrait, + regardless of orientation. This changes in WinPhone 8.1, + in which the native window's size changes along with + orientation. - // Setup the new display mode in the appropriate spots. - if (_this) { - // Make a full copy of the display mode for display_modes[0], - // one with with a separately malloced 'driverdata' field. - // SDL_VideoQuit(), if called, will attempt to free the driverdata - // fields in 'desktop_mode' and each entry in the 'display_modes' - // array. - if (_this->displays[0].display_modes[0].driverdata) { - // Free the previous mode's memory - SDL_free(_this->displays[0].display_modes[0].driverdata); - _this->displays[0].display_modes[0].driverdata = NULL; - } - if (WINRT_DuplicateDisplayMode(&(_this->displays[0].display_modes[0]), &newDisplayMode) != 0) { - // Uh oh, something went wrong. A malloc call probably failed. - SDL_free(newDisplayMode.driverdata); - return; - } - - // Install 'newDisplayMode' into 'current_mode' and 'desktop_mode'. - _this->displays[0].current_mode = newDisplayMode; - _this->displays[0].desktop_mode = newDisplayMode; - } - - if (WINRT_GlobalSDLWindow) { - // If the window size changed, send a resize event to SDL and its host app: - int window_w = 0; - int window_h = 0; - SDL_GetWindowSize(WINRT_GlobalSDLWindow, &window_w, &window_h); - if ((window_w != newDisplayMode.w) || (window_h != newDisplayMode.h)) { - SDL_SendWindowEvent( - WINRT_GlobalSDLWindow, - SDL_WINDOWEVENT_RESIZED, - newDisplayMode.w, - newDisplayMode.h); - } else { -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP - // HACK: Make sure that orientation changes - // lead to the Direct3D renderer's viewport getting updated: - // - // For some reason, this doesn't seem to need to be done on Windows 8.x, - // even when going from Landscape to LandscapeFlipped. It only seems to - // be needed on Windows Phone, at least when I tested on my devices. - // I'm not currently sure why this is, but it seems to work fine. -- David L. - // - // TODO, WinRT: do more extensive research into why orientation changes on Win 8.x don't need D3D changes, or if they might, in some cases - const DisplayOrientations oldOrientation = ((SDL_DisplayModeData *)oldDisplayMode.driverdata)->currentOrientation; - const DisplayOrientations newOrientation = ((SDL_DisplayModeData *)newDisplayMode.driverdata)->currentOrientation; - if (oldOrientation != newOrientation) - { - SDL_SendWindowEvent( - WINRT_GlobalSDLWindow, - SDL_WINDOWEVENT_SIZE_CHANGED, - newDisplayMode.w, - newDisplayMode.h); + Attempt to emulate WinPhone 8.1's behavior on WinPhone 8.0, with + regards to window size. This fixes a rendering bug that occurs + when a WinPhone 8.0 app is rotated to either 90 or 270 degrees. + */ + const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); + switch (currentOrientation) { + case DisplayOrientations::Landscape: + case DisplayOrientations::LandscapeFlipped: { + int tmp = w; + w = h; + h = tmp; + } break; } #endif + + WINRT_UpdateWindowFlags(window, SDL_WINDOW_MAXIMIZED | SDL_WINDOW_FULLSCREEN_DESKTOP); + + /* The window can move during a resize event, such as when maximizing + or resizing from a corner */ + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h); } } - - // Finally, free the 'driverdata' field of the old 'desktop_mode'. - if (oldDisplayMode.driverdata) { - SDL_free(oldDisplayMode.driverdata); - oldDisplayMode.driverdata = NULL; - } } SDL_WinRTApp::SDL_WinRTApp() : @@ -276,7 +237,7 @@ SDL_WinRTApp::SDL_WinRTApp() : void SDL_WinRTApp::Initialize(CoreApplicationView^ applicationView) { applicationView->Activated += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnActivated); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnAppActivated); CoreApplication::Suspending += ref new EventHandler(this, &SDL_WinRTApp::OnSuspending); @@ -295,35 +256,61 @@ void SDL_WinRTApp::OnOrientationChanged(Object^ sender) #endif { #if LOG_ORIENTATION_EVENTS==1 - CoreWindow^ window = CoreWindow::GetForCurrentThread(); - if (window) { - SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, CoreWindow Size={%f,%f}\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - window->Bounds.Width, - window->Bounds.Height); - } else { - SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences)); + { + CoreWindow^ window = CoreWindow::GetForCurrentThread(); + if (window) { + SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, CoreWindow Bounds={%f,%f,%f,%f}\n", + __FUNCTION__, + WINRT_DISPLAY_PROPERTY(CurrentOrientation), + WINRT_DISPLAY_PROPERTY(NativeOrientation), + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), + window->Bounds.X, + window->Bounds.Y, + window->Bounds.Width, + window->Bounds.Height); + } else { + SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d\n", + __FUNCTION__, + WINRT_DISPLAY_PROPERTY(CurrentOrientation), + WINRT_DISPLAY_PROPERTY(NativeOrientation), + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences)); + } } #endif WINRT_ProcessWindowSizeChange(); + +#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP + // HACK: Make sure that orientation changes + // lead to the Direct3D renderer's viewport getting updated: + // + // For some reason, this doesn't seem to need to be done on Windows 8.x, + // even when going from Landscape to LandscapeFlipped. It only seems to + // be needed on Windows Phone, at least when I tested on my devices. + // I'm not currently sure why this is, but it seems to work fine. -- David L. + // + // TODO, WinRT: do more extensive research into why orientation changes on Win 8.x don't need D3D changes, or if they might, in some cases + SDL_Window * window = WINRT_GlobalSDLWindow; + if (window) { + SDL_WindowData * data = (SDL_WindowData *)window->driverdata; + int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); + int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); + SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_SIZE_CHANGED, w, h); + } +#endif + } void SDL_WinRTApp::SetWindow(CoreWindow^ window) { #if LOG_WINDOW_EVENTS==1 - SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, window Size={%f,%f}\n", + SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, window bounds={%f, %f, %f,%f}\n", __FUNCTION__, WINRT_DISPLAY_PROPERTY(CurrentOrientation), WINRT_DISPLAY_PROPERTY(NativeOrientation), WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), + window->Bounds.X, + window->Bounds.Y, window->Bounds.Width, window->Bounds.Height); #endif @@ -334,6 +321,9 @@ void SDL_WinRTApp::SetWindow(CoreWindow^ window) window->VisibilityChanged += ref new TypedEventHandler(this, &SDL_WinRTApp::OnVisibilityChanged); + window->Activated += + ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowActivated); + window->Closed += ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowClosed); @@ -350,6 +340,12 @@ void SDL_WinRTApp::SetWindow(CoreWindow^ window) window->PointerReleased += ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerReleased); + window->PointerEntered += + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerEntered); + + window->PointerExited += + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerExited); + window->PointerWheelChanged += ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerWheelChanged); @@ -365,6 +361,9 @@ void SDL_WinRTApp::SetWindow(CoreWindow^ window) window->KeyUp += ref new TypedEventHandler(this, &SDL_WinRTApp::OnKeyUp); + window->CharacterReceived += + ref new TypedEventHandler(this, &SDL_WinRTApp::OnCharacterReceived); + #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP HardwareButtons::BackPressed += ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); @@ -382,7 +381,7 @@ void SDL_WinRTApp::SetWindow(CoreWindow^ window) // TODO, WinRT: see if an app's default orientation can be found out via WinRT API(s), then set the initial value of SDL_HINT_ORIENTATIONS accordingly. SDL_AddHintCallback(SDL_HINT_ORIENTATIONS, WINRT_SetDisplayOrientationsPreference, NULL); -#if WINAPI_FAMILY == WINAPI_FAMILY_APP // for Windows 8/8.1/RT apps... (and not Phone apps) +#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) // Make sure we know when a user has opened the app's settings pane. // This is needed in order to display a privacy policy, which needs // to be done for network-enabled apps, as per Windows Store requirements. @@ -475,7 +474,7 @@ void SDL_WinRTApp::Uninitialize() { } -#if WINAPI_FAMILY == WINAPI_FAMILY_APP +#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) void SDL_WinRTApp::OnSettingsPaneCommandsRequested( Windows::UI::ApplicationSettings::SettingsPane ^p, Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^args) @@ -517,14 +516,15 @@ void SDL_WinRTApp::OnSettingsPaneCommandsRequested( args->Request->ApplicationCommands->Append(cmd); } } -#endif // if WINAPI_FAMILY == WINAPI_FAMILY_APP +#endif // if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) { #if LOG_WINDOW_EVENTS==1 - SDL_Log("%s, size={%f,%f}, current orientation=%d, native orientation=%d, auto rot. pref=%d, WINRT_GlobalSDLWindow?=%s\n", + SDL_Log("%s, size={%f,%f}, bounds={%f,%f,%f,%f}, current orientation=%d, native orientation=%d, auto rot. pref=%d, WINRT_GlobalSDLWindow?=%s\n", __FUNCTION__, args->Size.Width, args->Size.Height, + sender->Bounds.X, sender->Bounds.Y, sender->Bounds.Width, sender->Bounds.Height, WINRT_DISPLAY_PROPERTY(CurrentOrientation), WINRT_DISPLAY_PROPERTY(NativeOrientation), WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), @@ -537,20 +537,26 @@ void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEven void SDL_WinRTApp::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) { #if LOG_WINDOW_EVENTS==1 - SDL_Log("%s, visible?=%s, WINRT_GlobalSDLWindow?=%s\n", + SDL_Log("%s, visible?=%s, bounds={%f,%f,%f,%f}, WINRT_GlobalSDLWindow?=%s\n", __FUNCTION__, (args->Visible ? "yes" : "no"), + sender->Bounds.X, sender->Bounds.Y, + sender->Bounds.Width, sender->Bounds.Height, (WINRT_GlobalSDLWindow ? "yes" : "no")); #endif m_windowVisible = args->Visible; if (WINRT_GlobalSDLWindow) { SDL_bool wasSDLWindowSurfaceValid = WINRT_GlobalSDLWindow->surface_valid; - + Uint32 latestWindowFlags = WINRT_DetectWindowFlags(WINRT_GlobalSDLWindow); if (args->Visible) { SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_SHOWN, 0, 0); SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_RESTORED, 0, 0); + if (latestWindowFlags & SDL_WINDOW_MAXIMIZED) { + SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + } else { + SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_RESTORED, 0, 0); + } } else { SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_HIDDEN, 0, 0); SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); @@ -567,6 +573,59 @@ void SDL_WinRTApp::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEven } } +void SDL_WinRTApp::OnWindowActivated(CoreWindow^ sender, WindowActivatedEventArgs^ args) +{ +#if LOG_WINDOW_EVENTS==1 + SDL_Log("%s, WINRT_GlobalSDLWindow?=%s\n\n", + __FUNCTION__, + (WINRT_GlobalSDLWindow ? "yes" : "no")); +#endif + + /* There's no property in Win 8.x to tell whether a window is active or + not. [De]activation events are, however, sent to the app. We'll just + record those, in case the CoreWindow gets wrapped by an SDL_Window at + some future time. + */ + sender->CustomProperties->Insert("SDLHelperWindowActivationState", args->WindowActivationState); + + SDL_Window * window = WINRT_GlobalSDLWindow; + if (window) { + if (args->WindowActivationState != CoreWindowActivationState::Deactivated) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0); + if (SDL_GetKeyboardFocus() != window) { + SDL_SetKeyboardFocus(window); + } + + /* Send a mouse-motion event as appropriate. + This doesn't work when called from OnPointerEntered, at least + not in WinRT CoreWindow apps (as OnPointerEntered doesn't + appear to be called after window-reactivation, at least not + in Windows 10, Build 10586.3 (November 2015 update, non-beta). + + Don't do it on WinPhone 8.0 though, as CoreWindow's 'PointerPosition' + property isn't available. + */ +#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION >= NTDDI_WINBLUE) + Point cursorPos = WINRT_TransformCursorPosition(window, sender->PointerPosition, TransformToSDLWindowSize); + SDL_SendMouseMotion(window, 0, 0, (int)cursorPos.X, (int)cursorPos.Y); +#endif + + /* TODO, WinRT: see if the Win32 bugfix from https://hg.libsdl.org/SDL/rev/d278747da408 needs to be applied (on window activation) */ + //WIN_CheckAsyncMouseRelease(data); + + /* TODO, WinRT: implement clipboard support, if possible */ + ///* + // * FIXME: Update keyboard state + // */ + //WIN_CheckClipboardUpdate(data->videodata); + } else { + if (SDL_GetKeyboardFocus() == window) { + SDL_SetKeyboardFocus(NULL); + } + } + } +} + void SDL_WinRTApp::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) { #if LOG_WINDOW_EVENTS==1 @@ -575,7 +634,7 @@ void SDL_WinRTApp::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) m_windowClosed = true; } -void SDL_WinRTApp::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) +void SDL_WinRTApp::OnAppActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) { CoreWindow::GetForCurrentThread()->Activate(); } @@ -675,10 +734,28 @@ void SDL_WinRTApp::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer released", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); #endif - + WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } +void SDL_WinRTApp::OnPointerEntered(CoreWindow^ sender, PointerEventArgs^ args) +{ +#if LOG_POINTER_EVENTS + WINRT_LogPointerEvent("pointer entered", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); +#endif + + WINRT_ProcessPointerEnteredEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); +} + +void SDL_WinRTApp::OnPointerExited(CoreWindow^ sender, PointerEventArgs^ args) +{ +#if LOG_POINTER_EVENTS + WINRT_LogPointerEvent("pointer exited", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); +#endif + + WINRT_ProcessPointerExitedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); +} + void SDL_WinRTApp::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args) { #if LOG_POINTER_EVENTS @@ -703,6 +780,11 @@ void SDL_WinRTApp::OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::C WINRT_ProcessKeyUpEvent(args); } +void SDL_WinRTApp::OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args) +{ + WINRT_ProcessCharacterReceivedEvent(args); +} + #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP void SDL_WinRTApp::OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args) { diff --git a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_direct3d.h b/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_direct3d.h index 714d41c7..90fb7026 100644 --- a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_direct3d.h +++ b/jni/SDL2-2.0.3/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 @@ -43,11 +43,11 @@ protected: // Event Handlers. -#if WINAPI_FAMILY == WINAPI_FAMILY_APP // for Windows 8/8.1/RT apps... (and not Phone apps) +#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) void OnSettingsPaneCommandsRequested( Windows::UI::ApplicationSettings::SettingsPane ^p, Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^args); -#endif // if WINAPI_FAMILY == WINAPI_FAMILY_APP +#endif // if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) #if NTDDI_VERSION > NTDDI_WIN8 void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args); @@ -56,19 +56,23 @@ protected: #endif void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args); void OnLogicalDpiChanged(Platform::Object^ sender); - void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args); + void OnAppActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args); void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args); void OnResuming(Platform::Object^ sender, Platform::Object^ args); void OnExiting(Platform::Object^ sender, Platform::Object^ args); + void OnWindowActivated(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowActivatedEventArgs^ args); void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); + void OnPointerEntered(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); + void OnPointerExited(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args); void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args); void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args); + void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args); #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args); diff --git a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_xaml.cpp b/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_xaml.cpp index 38694e11..9f943309 100644 --- a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_xaml.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_xaml.h b/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_xaml.h index 2296475b..7537710e 100644 --- a/jni/SDL2-2.0.3/src/core/winrt/SDL_winrtapp_xaml.h +++ b/jni/SDL2-2.0.3/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 @@ -23,7 +23,7 @@ #ifndef _SDL_winrtapp_xaml_h #define _SDL_winrtapp_xaml_h -#include "SDL_types.h" +#include "SDL_stdinc.h" #ifdef __cplusplus extern SDL_bool WINRT_XAMLWasEnabled; diff --git a/jni/SDL2-2.0.3/src/cpuinfo/SDL_cpuinfo.c b/jni/SDL2-2.0.3/src/cpuinfo/SDL_cpuinfo.c index c725c01a..ed839ccc 100644 --- a/jni/SDL2-2.0.3/src/cpuinfo/SDL_cpuinfo.c +++ b/jni/SDL2-2.0.3/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 @@ -79,6 +79,7 @@ CPU_haveCPUID(void) { int has_CPUID = 0; /* *INDENT-OFF* */ +#ifndef SDL_CPUINFO_DISABLED #if defined(__GNUC__) && defined(i386) __asm__ ( " pushfl # Get original EFLAGS \n" @@ -165,6 +166,7 @@ done: "1: \n" ); #endif +#endif /* *INDENT-ON* */ return has_CPUID; } @@ -272,6 +274,7 @@ static int CPU_haveAltiVec(void) { volatile int altivec = 0; +#ifndef SDL_CPUINFO_DISABLED #if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) #ifdef __OpenBSD__ int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC }; @@ -291,6 +294,7 @@ CPU_haveAltiVec(void) altivec = 1; } signal(SIGILL, handler); +#endif #endif return altivec; } @@ -418,6 +422,7 @@ int SDL_GetCPUCount(void) { if (!SDL_CPUCount) { +#ifndef SDL_CPUINFO_DISABLED #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) if (SDL_CPUCount <= 0) { SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN); @@ -435,6 +440,7 @@ SDL_GetCPUCount(void) GetSystemInfo(&info); SDL_CPUCount = info.dwNumberOfProcessors; } +#endif #endif /* There has to be at least 1, right? :) */ if (SDL_CPUCount <= 0) { @@ -452,10 +458,11 @@ SDL_GetCPUType(void) if (!SDL_CPUType[0]) { int i = 0; - int a, b, c, d; if (CPU_haveCPUID()) { + int a, b, c, d; cpuid(0x00000000, a, b, c, d); + (void) a; SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; @@ -557,15 +564,12 @@ int SDL_GetCPUCacheLineSize(void) { const char *cpuType = SDL_GetCPUType(); - + int a, b, c, d; + (void) a; (void) b; (void) c; (void) d; if (SDL_strcmp(cpuType, "GenuineIntel") == 0) { - int a, b, c, d; - cpuid(0x00000001, a, b, c, d); return (((b >> 8) & 0xff) * 8); } else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0) { - int a, b, c, d; - cpuid(0x80000005, a, b, c, d); return (c & 0xff); } else { @@ -723,6 +727,7 @@ int SDL_GetSystemRAM(void) { if (!SDL_SystemRAM) { +#ifndef SDL_CPUINFO_DISABLED #if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) if (SDL_SystemRAM <= 0) { SDL_SystemRAM = (int)((Sint64)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / (1024*1024)); @@ -756,6 +761,7 @@ SDL_GetSystemRAM(void) SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024)); } } +#endif #endif } return SDL_SystemRAM; diff --git a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi.c b/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi.c index c378699d..02e5c787 100644 --- a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi.c +++ b/jni/SDL2-2.0.3/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 @@ -206,7 +206,14 @@ SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize) static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) { HANDLE lib = LoadLibraryA(fname); - return lib ? GetProcAddress(lib, sym) : NULL; + void *retval = NULL; + if (lib) { + retval = GetProcAddress(lib, sym); + if (retval == NULL) { + FreeLibrary(lib); + } + } + return retval; } #elif defined(__HAIKU__) @@ -215,8 +222,11 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) { image_id lib = load_add_on(fname); void *retval = NULL; - if ((lib < 0) || (get_image_symbol(lib, sym, B_SYMBOL_TYPE_TEXT, &retval) != B_NO_ERROR)) { - retval = NULL; + if (lib >= 0) { + if (get_image_symbol(lib, sym, B_SYMBOL_TYPE_TEXT, &retval) != B_NO_ERROR) { + unload_add_on(lib); + retval = NULL; + } } return retval; } @@ -225,7 +235,14 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) { void *lib = dlopen(fname, RTLD_NOW | RTLD_LOCAL); - return lib ? dlsym(lib, sym) : NULL; + void *retval = NULL; + if (lib != NULL) { + retval = dlsym(lib, sym); + if (retval == NULL) { + dlclose(lib); + } + } + return retval; } #else #error Please define your platform. diff --git a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi.h b/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi.h index 2a5403a4..fa9a0c7f 100644 --- a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi.h +++ b/jni/SDL2-2.0.3/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 @@ -43,13 +43,16 @@ #include "TargetConditionals.h" #endif -#if TARGET_OS_IPHONE || __native_client__ /* probably not useful on iOS or NACL. */ +#if TARGET_OS_IPHONE || __native_client__ || __EMSCRIPTEN__ /* probably not useful on iOS, NACL or Emscripten. */ #define SDL_DYNAMIC_API 0 #elif SDL_BUILDING_WINRT /* probaly not useful on WinRT, given current .dll loading restrictions */ #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/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi_overrides.h b/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi_overrides.h index 8bcde631..75f31ced 100644 --- a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi_overrides.h +++ b/jni/SDL2-2.0.3/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,8 @@ #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 +#define SDL_JoystickCurrentPowerLevel SDL_JoystickCurrentPowerLevel_REAL +#define SDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_REAL +#define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_REAL diff --git a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi_procs.h b/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi_procs.h index c41cdc9f..57bbba6d 100644 --- a/jni/SDL2-2.0.3/src/dynapi/SDL_dynapi_procs.h +++ b/jni/SDL2-2.0.3/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,11 @@ 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) +SDL_DYNAPI_PROC(SDL_JoystickPowerLevel,SDL_JoystickCurrentPowerLevel,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(SDL_GameController*,SDL_GameControllerFromInstanceID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_Joystick*,SDL_JoystickFromInstanceID,(SDL_JoystickID a),(a),return) diff --git a/jni/SDL2-2.0.3/src/dynapi/gendynapi.pl b/jni/SDL2-2.0.3/src/dynapi/gendynapi.pl index 091a08c7..192889fd 100755 --- a/jni/SDL2-2.0.3/src/dynapi/gendynapi.pl +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_clipboardevents.c b/jni/SDL2-2.0.3/src/events/SDL_clipboardevents.c index 3ef7bed2..5df8aa1c 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_clipboardevents.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_clipboardevents_c.h b/jni/SDL2-2.0.3/src/events/SDL_clipboardevents_c.h index c71da2a4..6c58ee43 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_clipboardevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_dropevents.c b/jni/SDL2-2.0.3/src/events/SDL_dropevents.c index 4830d14f..0c8c7bea 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_dropevents.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_dropevents_c.h b/jni/SDL2-2.0.3/src/events/SDL_dropevents_c.h index cb5e1dc5..3e8615e8 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_dropevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_events.c b/jni/SDL2-2.0.3/src/events/SDL_events.c index 963b9bd7..513cb55e 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_events.c +++ b/jni/SDL2-2.0.3/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 */ @@ -634,4 +649,10 @@ SDL_SendSysWMEvent(SDL_SysWMmsg * message) return (posted); } +int +SDL_SendKeymapChangedEvent(void) +{ + return SDL_SendAppEvent(SDL_KEYMAPCHANGED); +} + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/events/SDL_events_c.h b/jni/SDL2-2.0.3/src/events/SDL_events_c.h index 11d6e304..0ead5f30 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_events_c.h +++ b/jni/SDL2-2.0.3/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 @@ -38,11 +38,14 @@ extern void SDL_QuitInterrupt(void); extern int SDL_SendAppEvent(SDL_EventType eventType); extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message); +extern int SDL_SendKeymapChangedEvent(void); 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/jni/SDL2-2.0.3/src/events/SDL_gesture.c b/jni/SDL2-2.0.3/src/events/SDL_gesture.c index 46a55463..b7980ede 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_gesture.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_gesture_c.h b/jni/SDL2-2.0.3/src/events/SDL_gesture_c.h index 3f1ed9b1..f94dc715 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_gesture_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_keyboard.c b/jni/SDL2-2.0.3/src/events/SDL_keyboard.c index ed4043e9..d4dc0e7b 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_keyboard.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_keyboard_c.h b/jni/SDL2-2.0.3/src/events/SDL_keyboard_c.h index 05b52538..50fb06da 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_keyboard_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_mouse.c b/jni/SDL2-2.0.3/src/events/SDL_mouse.c index 21fb8777..716384a1 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_mouse.c +++ b/jni/SDL2-2.0.3/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; } @@ -303,10 +308,11 @@ static SDL_MouseClickState *GetMouseClickState(SDL_Mouse *mouse, Uint8 button) { if (button >= mouse->num_clickstates) { int i, count = button + 1; - mouse->clickstate = (SDL_MouseClickState *)SDL_realloc(mouse->clickstate, count * sizeof(*mouse->clickstate)); - if (!mouse->clickstate) { + SDL_MouseClickState *clickstate = (SDL_MouseClickState *)SDL_realloc(mouse->clickstate, count * sizeof(*mouse->clickstate)); + if (!clickstate) { return NULL; } + mouse->clickstate = clickstate; for (i = mouse->num_clickstates; i < count; ++i) { SDL_zero(mouse->clickstate[i]); @@ -397,7 +403,7 @@ SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 } int -SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y) +SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction) { SDL_Mouse *mouse = SDL_GetMouse(); int posted; @@ -419,6 +425,7 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y) event.wheel.which = mouseID; event.wheel.x = x; event.wheel.y = y; + event.wheel.direction = (Uint32)direction; posted = (SDL_PushEvent(&event) > 0); } return posted; @@ -528,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/jni/SDL2-2.0.3/src/events/SDL_mouse_c.h b/jni/SDL2-2.0.3/src/events/SDL_mouse_c.h index df95e1e5..b12bec35 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_mouse_c.h +++ b/jni/SDL2-2.0.3/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); @@ -120,7 +120,7 @@ extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int rel extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button); /* Send a mouse wheel event */ -extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y); +extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction); /* Shutdown the mouse subsystem */ extern void SDL_MouseQuit(void); diff --git a/jni/SDL2-2.0.3/src/events/SDL_quit.c b/jni/SDL2-2.0.3/src/events/SDL_quit.c index db7af98f..d2b215bc 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_quit.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_sysevents.h b/jni/SDL2-2.0.3/src/events/SDL_sysevents.h index a5be7bc3..f1d460d8 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_sysevents.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_touch.c b/jni/SDL2-2.0.3/src/events/SDL_touch.c index 14a337a9..1b477ea7 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_touch.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_touch_c.h b/jni/SDL2-2.0.3/src/events/SDL_touch_c.h index f9781789..3e4b8bbf 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_touch_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_windowevents.c b/jni/SDL2-2.0.3/src/events/SDL_windowevents.c index 146cbc54..0e480f27 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_windowevents.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/SDL_windowevents_c.h b/jni/SDL2-2.0.3/src/events/SDL_windowevents_c.h index 9ad34a34..140b38c3 100644 --- a/jni/SDL2-2.0.3/src/events/SDL_windowevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/blank_cursor.h b/jni/SDL2-2.0.3/src/events/blank_cursor.h index 423fa138..17501293 100644 --- a/jni/SDL2-2.0.3/src/events/blank_cursor.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/default_cursor.h b/jni/SDL2-2.0.3/src/events/default_cursor.h index 6e09380e..e292cbf5 100644 --- a/jni/SDL2-2.0.3/src/events/default_cursor.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/scancodes_darwin.h b/jni/SDL2-2.0.3/src/events/scancodes_darwin.h index 42fcbdfa..5677a894 100644 --- a/jni/SDL2-2.0.3/src/events/scancodes_darwin.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/scancodes_linux.h b/jni/SDL2-2.0.3/src/events/scancodes_linux.h index dbf7a7a5..532a2a98 100644 --- a/jni/SDL2-2.0.3/src/events/scancodes_linux.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/scancodes_windows.h b/jni/SDL2-2.0.3/src/events/scancodes_windows.h index fa894e48..f712d5a0 100644 --- a/jni/SDL2-2.0.3/src/events/scancodes_windows.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/events/scancodes_xfree86.h b/jni/SDL2-2.0.3/src/events/scancodes_xfree86.h index 8b10c3d9..e6155525 100644 --- a/jni/SDL2-2.0.3/src/events/scancodes_xfree86.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/file/SDL_rwops.c b/jni/SDL2-2.0.3/src/file/SDL_rwops.c index 41f6c6d0..b3b445d2 100644 --- a/jni/SDL2-2.0.3/src/file/SDL_rwops.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.h b/jni/SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.h index 9a8a9662..387428f3 100644 --- a/jni/SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.m b/jni/SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.m index 1ae399c2..1d665edb 100644 --- a/jni/SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/android/SDL_sysfilesystem.c b/jni/SDL2-2.0.3/src/filesystem/android/SDL_sysfilesystem.c index b3937449..0401773e 100644 --- a/jni/SDL2-2.0.3/src/filesystem/android/SDL_sysfilesystem.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/cocoa/SDL_sysfilesystem.m b/jni/SDL2-2.0.3/src/filesystem/cocoa/SDL_sysfilesystem.m index dab51c50..1e6a2067 100644 --- a/jni/SDL2-2.0.3/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/dummy/SDL_sysfilesystem.c b/jni/SDL2-2.0.3/src/filesystem/dummy/SDL_sysfilesystem.c index 7e860939..2cb9e21e 100644 --- a/jni/SDL2-2.0.3/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/haiku/SDL_sysfilesystem.cc b/jni/SDL2-2.0.3/src/filesystem/haiku/SDL_sysfilesystem.cc index b83d4d0a..3a0ea348 100644 --- a/jni/SDL2-2.0.3/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/nacl/SDL_sysfilesystem.c b/jni/SDL2-2.0.3/src/filesystem/nacl/SDL_sysfilesystem.c index ff55b2ba..4efda46e 100644 --- a/jni/SDL2-2.0.3/src/filesystem/nacl/SDL_sysfilesystem.c +++ b/jni/SDL2-2.0.3/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 @@ -38,4 +38,5 @@ SDL_GetPrefPath(const char *org, const char *app) return NULL; } -#endif /* __NACL__ */ \ No newline at end of file +#endif /* SDL_FILESYSTEM_NACL */ + diff --git a/jni/SDL2-2.0.3/src/filesystem/unix/SDL_sysfilesystem.c b/jni/SDL2-2.0.3/src/filesystem/unix/SDL_sysfilesystem.c index cd11a67d..b3264949 100644 --- a/jni/SDL2-2.0.3/src/filesystem/unix/SDL_sysfilesystem.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/windows/SDL_sysfilesystem.c b/jni/SDL2-2.0.3/src/filesystem/windows/SDL_sysfilesystem.c index 2791fb39..2d1c7819 100644 --- a/jni/SDL2-2.0.3/src/filesystem/windows/SDL_sysfilesystem.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/filesystem/winrt/SDL_sysfilesystem.cpp b/jni/SDL2-2.0.3/src/filesystem/winrt/SDL_sysfilesystem.cpp index 48c21e10..a70c7fe4 100644 --- a/jni/SDL2-2.0.3/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/jni/SDL2-2.0.3/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 @@ -20,8 +20,7 @@ */ #include "../../SDL_internal.h" -/* TODO, WinRT: include copyright info in SDL_winrtpaths.cpp - TODO, WinRT: remove the need to compile this with C++/CX (/ZW) extensions, and if possible, without C++ at all +/* TODO, WinRT: remove the need to compile this with C++/CX (/ZW) extensions, and if possible, without C++ at all */ #ifdef __WINRT__ @@ -29,6 +28,7 @@ extern "C" { #include "SDL_filesystem.h" #include "SDL_error.h" +#include "SDL_hints.h" #include "SDL_stdinc.h" #include "SDL_system.h" #include "../../core/windows/SDL_windows.h" @@ -62,7 +62,7 @@ SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType) return path.c_str(); } -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP +#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8) case SDL_WINRT_PATH_ROAMING_FOLDER: { static wstring path; @@ -144,31 +144,78 @@ SDL_GetPrefPath(const char *org, const char *app) * without violating Microsoft's app-store requirements. */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP - /* A 'Roaming' folder is not available in Windows Phone 8, however a 'Local' folder is. */ - const char * srcPath = SDL_WinRTGetFSPathUTF8(SDL_WINRT_PATH_LOCAL_FOLDER); -#else - /* A 'Roaming' folder is available on Windows 8 and 8.1. Use that. */ - const char * srcPath = SDL_WinRTGetFSPathUTF8(SDL_WINRT_PATH_ROAMING_FOLDER); -#endif + const WCHAR * srcPath = NULL; + WCHAR path[MAX_PATH]; + char *retval = NULL; + WCHAR* worg = NULL; + WCHAR* wapp = NULL; + size_t new_wpath_len = 0; + BOOL api_result = FALSE; - size_t destPathLen; - char * destPath = NULL; - - if (!srcPath) { - SDL_SetError("Couldn't locate our basepath: %s", SDL_GetError()); + srcPath = SDL_WinRTGetFSPathUNICODE(SDL_WINRT_PATH_LOCAL_FOLDER); + if ( ! srcPath) { + SDL_SetError("Unable to find a source path"); return NULL; } - destPathLen = SDL_strlen(srcPath) + SDL_strlen(org) + SDL_strlen(app) + 4; - destPath = (char *) SDL_malloc(destPathLen); - if (!destPath) { + if (SDL_wcslen(srcPath) >= MAX_PATH) { + SDL_SetError("Path too long."); + return NULL; + } + SDL_wcslcpy(path, srcPath, SDL_arraysize(path)); + + worg = WIN_UTF8ToString(org); + if (worg == NULL) { SDL_OutOfMemory(); return NULL; } - SDL_snprintf(destPath, destPathLen, "%s\\%s\\%s\\", srcPath, org, app); - return destPath; + wapp = WIN_UTF8ToString(app); + if (wapp == NULL) { + SDL_free(worg); + SDL_OutOfMemory(); + return NULL; + } + + new_wpath_len = SDL_wcslen(worg) + SDL_wcslen(wapp) + SDL_wcslen(path) + 3; + + if ((new_wpath_len + 1) > MAX_PATH) { + SDL_free(worg); + SDL_free(wapp); + SDL_SetError("Path too long."); + return NULL; + } + + SDL_wcslcat(path, L"\\", new_wpath_len + 1); + SDL_wcslcat(path, worg, new_wpath_len + 1); + SDL_free(worg); + + api_result = CreateDirectoryW(path, NULL); + if (api_result == FALSE) { + if (GetLastError() != ERROR_ALREADY_EXISTS) { + SDL_free(wapp); + WIN_SetError("Couldn't create a prefpath."); + return NULL; + } + } + + SDL_wcslcat(path, L"\\", new_wpath_len + 1); + SDL_wcslcat(path, wapp, new_wpath_len + 1); + SDL_free(wapp); + + api_result = CreateDirectoryW(path, NULL); + if (api_result == FALSE) { + if (GetLastError() != ERROR_ALREADY_EXISTS) { + WIN_SetError("Couldn't create a prefpath."); + return NULL; + } + } + + SDL_wcslcat(path, L"\\", new_wpath_len + 1); + + retval = WIN_StringToUTF8(path); + + return retval; } #endif /* __WINRT__ */ diff --git a/jni/SDL2-2.0.3/src/haptic/SDL_haptic.c b/jni/SDL2-2.0.3/src/haptic/SDL_haptic.c index 596b26e6..0d5c0ef5 100644 --- a/jni/SDL2-2.0.3/src/haptic/SDL_haptic.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/SDL_haptic_c.h b/jni/SDL2-2.0.3/src/haptic/SDL_haptic_c.h index b318fff1..24389c7e 100644 --- a/jni/SDL2-2.0.3/src/haptic/SDL_haptic_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/SDL_syshaptic.h b/jni/SDL2-2.0.3/src/haptic/SDL_syshaptic.h index c808adc3..a364f8a8 100644 --- a/jni/SDL2-2.0.3/src/haptic/SDL_syshaptic.h +++ b/jni/SDL2-2.0.3/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 @@ -27,12 +27,6 @@ #include "SDL_haptic.h" -/* - * Number of haptic devices on the system. - */ -extern Uint8 SDL_numhaptics; - - struct haptic_effect { SDL_HapticEffect effect; /* The current event */ @@ -212,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/jni/SDL2-2.0.3/src/haptic/darwin/SDL_syshaptic.c b/jni/SDL2-2.0.3/src/haptic/darwin/SDL_syshaptic.c index 6d85bf0e..152f779d 100644 --- a/jni/SDL2-2.0.3/src/haptic/darwin/SDL_syshaptic.c +++ b/jni/SDL2-2.0.3/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."); } } } @@ -551,7 +551,7 @@ SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) FFReleaseDevice(haptic->hwdata->device); creat_err: if (haptic->hwdata != NULL) { - free(haptic->hwdata); + SDL_free(haptic->hwdata); haptic->hwdata = NULL; } return -1; @@ -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/jni/SDL2-2.0.3/src/haptic/darwin/SDL_syshaptic_c.h b/jni/SDL2-2.0.3/src/haptic/darwin/SDL_syshaptic_c.h index f8072071..0af04487 100644 --- a/jni/SDL2-2.0.3/src/haptic/darwin/SDL_syshaptic_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/dummy/SDL_syshaptic.c b/jni/SDL2-2.0.3/src/haptic/dummy/SDL_syshaptic.c index 09839c6d..ebff7dae 100644 --- a/jni/SDL2-2.0.3/src/haptic/dummy/SDL_syshaptic.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/linux/SDL_syshaptic.c b/jni/SDL2-2.0.3/src/haptic/linux/SDL_syshaptic.c index 459d0ab2..659252b5 100644 --- a/jni/SDL2-2.0.3/src/haptic/linux/SDL_syshaptic.c +++ b/jni/SDL2-2.0.3/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); @@ -288,12 +281,13 @@ MaybeAddDevice(const char *path) } item->fname = SDL_strdup(path); - if ( (item->fname == NULL) ) { - SDL_free(item->fname); + if (item->fname == NULL) { SDL_free(item); 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; @@ -302,8 +296,6 @@ MaybeAddDevice(const char *path) SDL_hapticlist_tail = item; } - dev_nums[numhaptics] = sb.st_rdev; - ++numhaptics; /* !!! TODO: Send a haptic add event? */ @@ -391,8 +383,8 @@ SDL_SYS_HapticName(int index) /* No name found, return device character device */ name = item->fname; } + close(fd); } - close(fd); return name; } @@ -441,7 +433,7 @@ SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) open_err: close(fd); if (haptic->hwdata != NULL) { - free(haptic->hwdata); + SDL_free(haptic->hwdata); haptic->hwdata = NULL; } return -1; @@ -473,7 +465,7 @@ SDL_SYS_HapticOpen(SDL_Haptic * haptic) } /* Set the fname. */ - haptic->hwdata->fname = item->fname; + haptic->hwdata->fname = SDL_strdup( item->fname ); return 0; } @@ -547,15 +539,15 @@ 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) { - haptic->index = device_index; break; } ++device_index; } + haptic->index = device_index; + if (device_index >= MAX_HAPTICS) { return SDL_SetError("Haptic: Joystick doesn't have Haptic capabilities"); } @@ -570,7 +562,8 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) return -1; } - haptic->hwdata->fname = item->fname; + haptic->hwdata->fname = SDL_strdup( joystick->hwdata->fname ); + return 0; } @@ -592,6 +585,7 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) close(haptic->hwdata->fd); /* Free */ + SDL_free(haptic->hwdata->fname); SDL_free(haptic->hwdata); haptic->hwdata = NULL; } @@ -669,6 +663,8 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src) 90 deg -> 0x4000 (left) 180 deg -> 0x8000 (up) 270 deg -> 0xC000 (right) + The force pulls into the direction specified by Linux directions, + i.e. the opposite convention of SDL directions. */ tmp = ((src->dir[0] % 36000) * 0x8000) / 18000; /* convert to range [0,0xFFFF] */ *dest = (Uint16) tmp; @@ -727,7 +723,6 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src) static int SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) { - Uint32 tmp; SDL_HapticConstant *constant; SDL_HapticPeriodic *periodic; SDL_HapticCondition *condition; @@ -805,9 +800,8 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) dest->u.periodic.period = CLAMP(periodic->period); dest->u.periodic.magnitude = periodic->magnitude; dest->u.periodic.offset = periodic->offset; - /* Phase is calculated based of offset from period and then clamped. */ - tmp = ((periodic->phase % 36000) * dest->u.periodic.period) / 36000; - dest->u.periodic.phase = CLAMP(tmp); + /* Linux phase is defined in interval "[0x0000, 0x10000[", corresponds with "[0deg, 360deg[" phase shift. */ + dest->u.periodic.phase = ((Uint32)periodic->phase * 0x10000U) / 36000; /* Envelope */ dest->u.periodic.envelope.attack_length = @@ -959,7 +953,7 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, return 0; new_effect_err: - free(effect->hweffect); + SDL_free(effect->hweffect); effect->hweffect = NULL; return -1; } @@ -1163,5 +1157,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) return 0; } - #endif /* SDL_HAPTIC_LINUX */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/haptic/windows/SDL_dinputhaptic.c b/jni/SDL2-2.0.3/src/haptic/windows/SDL_dinputhaptic.c index 9ff46a9d..1cd70425 100644 --- a/jni/SDL2-2.0.3/src/haptic/windows/SDL_dinputhaptic.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/windows/SDL_dinputhaptic_c.h b/jni/SDL2-2.0.3/src/haptic/windows/SDL_dinputhaptic_c.h index 9801fe27..d587ab72 100644 --- a/jni/SDL2-2.0.3/src/haptic/windows/SDL_dinputhaptic_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/windows/SDL_windowshaptic.c b/jni/SDL2-2.0.3/src/haptic/windows/SDL_windowshaptic.c index 26095dc5..a0b6c554 100644 --- a/jni/SDL2-2.0.3/src/haptic/windows/SDL_windowshaptic.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/windows/SDL_windowshaptic_c.h b/jni/SDL2-2.0.3/src/haptic/windows/SDL_windowshaptic_c.h index e715339d..e3de1336 100644 --- a/jni/SDL2-2.0.3/src/haptic/windows/SDL_windowshaptic_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/windows/SDL_xinputhaptic.c b/jni/SDL2-2.0.3/src/haptic/windows/SDL_xinputhaptic.c index 2e76a959..b5fb2e34 100644 --- a/jni/SDL2-2.0.3/src/haptic/windows/SDL_xinputhaptic.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/haptic/windows/SDL_xinputhaptic_c.h b/jni/SDL2-2.0.3/src/haptic/windows/SDL_xinputhaptic_c.h index c3062b6e..7917128d 100644 --- a/jni/SDL2-2.0.3/src/haptic/windows/SDL_xinputhaptic_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/joystick/SDL_gamecontroller.c b/jni/SDL2-2.0.3/src/joystick/SDL_gamecontroller.c index c60f3918..37e0a8bd 100644 --- a/jni/SDL2-2.0.3/src/joystick/SDL_gamecontroller.c +++ b/jni/SDL2-2.0.3/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 @@ -89,6 +89,7 @@ typedef struct _ControllerMapping_t static ControllerMapping_t *s_pSupportedControllers = NULL; static ControllerMapping_t *s_pXInputMapping = NULL; +static ControllerMapping_t *s_pEmscriptenMapping = NULL; /* The SDL game controller structure */ struct _SDL_GameController @@ -258,16 +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 /* SDL_JOYSTICK_XINPUT */ - { - SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index); - return SDL_PrivateGetControllerMappingForGUID(&jGUID); +#endif +#if defined(SDL_JOYSTICK_EMSCRIPTEN) + if (!mapping && s_pEmscriptenMapping) { + mapping = s_pEmscriptenMapping; } +#endif + 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[] = { @@ -606,7 +620,7 @@ SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw) if (freerw) { SDL_RWclose(rw); } - return SDL_SetError("Could allocate space to not read DB into memory"); + return SDL_SetError("Could not allocate space to read DB into memory"); } if (SDL_RWread(rw, buf, db_size, 1) != 1) { @@ -668,6 +682,11 @@ SDL_GameControllerAddMapping(const char *mappingString) SDL_JoystickGUID jGUID; ControllerMapping_t *pControllerMapping; SDL_bool is_xinput_mapping = SDL_FALSE; + SDL_bool is_emscripten_mapping = SDL_FALSE; + + if (!mappingString) { + return SDL_InvalidParamError("mappingString"); + } pchGUID = SDL_PrivateGetControllerGUIDFromMappingString(mappingString); if (!pchGUID) { @@ -676,6 +695,9 @@ SDL_GameControllerAddMapping(const char *mappingString) if (!SDL_strcasecmp(pchGUID, "xinput")) { is_xinput_mapping = SDL_TRUE; } + if (!SDL_strcasecmp(pchGUID, "emscripten")) { + is_emscripten_mapping = SDL_TRUE; + } jGUID = SDL_JoystickGetGUIDFromString(pchGUID); SDL_free(pchGUID); @@ -711,6 +733,9 @@ SDL_GameControllerAddMapping(const char *mappingString) if (is_xinput_mapping) { s_pXInputMapping = pControllerMapping; } + if (is_emscripten_mapping) { + s_pEmscriptenMapping = pControllerMapping; + } pControllerMapping->guid = jGUID; pControllerMapping->name = pchName; pControllerMapping->mapping = pchMapping; @@ -735,6 +760,10 @@ SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid) /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; pMappingString = SDL_malloc(needed); + if (!pMappingString) { + SDL_OutOfMemory(); + return NULL; + } SDL_snprintf(pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); } return pMappingString; @@ -746,6 +775,10 @@ SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid) char * SDL_GameControllerMapping(SDL_GameController * gamecontroller) { + if (!gamecontroller) { + return NULL; + } + return SDL_GameControllerMappingForGUID(gamecontroller->mapping.guid); } @@ -992,9 +1025,6 @@ SDL_GameControllerGetAttached(SDL_GameController * gamecontroller) } -/* - * Get the number of multi-dimensional axis controls on a joystick - */ const char * SDL_GameControllerName(SDL_GameController * gamecontroller) { @@ -1016,6 +1046,25 @@ SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController * gamecontroller) return gamecontroller->joystick; } + +/* + * Find the SDL_GameController that owns this instance id + */ +SDL_GameController * +SDL_GameControllerFromInstanceID(SDL_JoystickID joyid) +{ + SDL_GameController *gamecontroller = SDL_gamecontrollers; + while (gamecontroller) { + if (gamecontroller->joystick->instance_id == joyid) { + return gamecontroller; + } + gamecontroller = gamecontroller->next; + } + + return NULL; +} + + /** * Get the SDL joystick layer binding for this controller axis mapping */ @@ -1066,9 +1115,6 @@ SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameControll } -/* - * Close a joystick previously opened with SDL_JoystickOpen() - */ void SDL_GameControllerClose(SDL_GameController * gamecontroller) { diff --git a/jni/SDL2-2.0.3/src/joystick/SDL_gamecontrollerdb.h b/jni/SDL2-2.0.3/src/joystick/SDL_gamecontrollerdb.h index fe3a1671..8f42f6b5 100644 --- a/jni/SDL2-2.0.3/src/joystick/SDL_gamecontrollerdb.h +++ b/jni/SDL2-2.0.3/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 @@ -36,8 +36,10 @@ static const char *s_ControllerMappings [] = #endif #if SDL_JOYSTICK_DINPUT "341a3608000000000000504944564944,Afterglow 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,", + "e8206058000000000000504944564944,Cideko AK08b,a:b2,b:b1,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:b3,y:b0,", "ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,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,", "6d0416c2000000000000504944564944,Generic DirectInput Controller,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,", + "6d0418c2000000000000504944564944,Logitech F510 Gamepad,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,", "6d0419c2000000000000504944564944,Logitech F710 Gamepad,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. */ "4d6963726f736f66742050432d6a6f79,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a5,righty:a4,x:b1,y:b2,", "88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,", @@ -46,6 +48,7 @@ static const char *s_ControllerMappings [] = "4c05c405000000000000504944564944,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,", #endif #if defined(__MACOSX__) + "830500000000000031b0000000000000,Cideko AK08b,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,", "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,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,", "6d0400000000000016c2000000000000,Logitech F310 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. */ "6d0400000000000018c2000000000000,Logitech F510 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,", @@ -53,29 +56,47 @@ static const char *s_ControllerMappings [] = "6d0400000000000019c2000000000000,Logitech Wireless 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,", /* This includes F710 in DInput mode and the "Logitech Cordless RumblePad 2", at the very least. */ "4c050000000000006802000000000000,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,", "4c05000000000000c405000000000000,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,", + "11010000000000002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,", + "11010000000000001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,", "5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,", #endif #if defined(__LINUX__) + "03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,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:b3,y:b0,", "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,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,", + "030000006f0e00000104000000010000,Gamestop Logic3 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,", "03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,", "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,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,", "030000006d0400001dc2000014400000,Logitech F310 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,", "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,", + "050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b1,b:b0,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,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,", + "03000000c6240000045d000025010000,Razer Sabertooth,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,", + "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,", + "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_MFI) + "4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", + "4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,", +#endif +#if defined(SDL_JOYSTICK_EMSCRIPTEN) + "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/jni/SDL2-2.0.3/src/joystick/SDL_joystick.c b/jni/SDL2-2.0.3/src/joystick/SDL_joystick.c index 2a60c003..8516c03a 100644 --- a/jni/SDL2-2.0.3/src/joystick/SDL_joystick.c +++ b/jni/SDL2-2.0.3/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 @@ -178,6 +178,7 @@ SDL_JoystickOpen(int device_index) if (joystick->buttons) { SDL_memset(joystick->buttons, 0, joystick->nbuttons * sizeof(Uint8)); } + joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN; /* Add joystick to list */ ++joystick->ref_count; @@ -206,10 +207,6 @@ SDL_PrivateJoystickValid(SDL_Joystick * joystick) valid = 1; } - if (joystick && joystick->closed) { - valid = 0; - } - return valid; } @@ -376,6 +373,23 @@ SDL_JoystickInstanceID(SDL_Joystick * joystick) return (joystick->instance_id); } +/* + * Find the SDL_Joystick that owns this instance id + */ +SDL_Joystick * +SDL_JoystickFromInstanceID(SDL_JoystickID joyid) +{ + SDL_Joystick *joystick = SDL_joysticks; + while (joystick) { + if (joystick->instance_id == joyid) { + return joystick; + } + joystick = joystick->next; + } + + return NULL; +} + /* * Get the friendly name of this joystick */ @@ -412,6 +426,7 @@ SDL_JoystickClose(SDL_Joystick * joystick) } SDL_SYS_JoystickClose(joystick); + joystick->hwdata = NULL; joysticklist = SDL_joysticks; joysticklistprev = NULL; @@ -622,10 +637,10 @@ SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state) /* Make sure we're not getting garbage or duplicate events */ if (button >= joystick->nbuttons) { return 0; - } - if (state == joystick->buttons[button]) { - return 0; - } + } + if (state == joystick->buttons[button]) { + return 0; + } /* We ignore events if we don't have keyboard focus, except for button * release. */ @@ -668,20 +683,23 @@ 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... */ - for (i = 0; i < joystick->naxes; i++) + for (i = 0; i < joystick->naxes; i++) { SDL_PrivateJoystickAxis(joystick, i, 0); + } - for (i = 0; i < joystick->nbuttons; i++) + for (i = 0; i < joystick->nbuttons; i++) { SDL_PrivateJoystickButton(joystick, i, 0); + } - for (i = 0; i < joystick->nhats; i++) + 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; @@ -825,4 +843,21 @@ SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID) } +/* update the power level for this joystick */ +void SDL_PrivateJoystickBatteryLevel(SDL_Joystick * joystick, SDL_JoystickPowerLevel ePowerLevel) +{ + joystick->epowerlevel = ePowerLevel; +} + + +/* return its power level */ +SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick) +{ + if (!SDL_PrivateJoystickValid(joystick)) { + return (SDL_JOYSTICK_POWER_UNKNOWN); + } + return joystick->epowerlevel; +} + + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/joystick/SDL_joystick_c.h b/jni/SDL2-2.0.3/src/joystick/SDL_joystick_c.h index 064fb8a3..2da74bd3 100644 --- a/jni/SDL2-2.0.3/src/joystick/SDL_joystick_c.h +++ b/jni/SDL2-2.0.3/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 @@ -41,6 +41,8 @@ extern int SDL_PrivateJoystickHat(SDL_Joystick * joystick, Uint8 hat, Uint8 value); extern int SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state); +extern void SDL_PrivateJoystickBatteryLevel( SDL_Joystick * joystick, + SDL_JoystickPowerLevel ePowerLevel ); /* Internal sanity checking functions */ extern int SDL_PrivateJoystickValid(SDL_Joystick * joystick); diff --git a/jni/SDL2-2.0.3/src/joystick/SDL_sysjoystick.h b/jni/SDL2-2.0.3/src/joystick/SDL_sysjoystick.h index a3986957..f03e4042 100644 --- a/jni/SDL2-2.0.3/src/joystick/SDL_sysjoystick.h +++ b/jni/SDL2-2.0.3/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,8 @@ 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 */ + SDL_JoystickPowerLevel epowerlevel; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */ struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */ }; @@ -78,14 +78,14 @@ extern const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index); extern SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index); /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ extern int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index); /* Function to query if the joystick is currently attached - * It returns 1 if attached, 0 otherwise. + * It returns SDL_TRUE if attached, SDL_FALSE otherwise. */ extern SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick); diff --git a/jni/SDL2-2.0.3/src/joystick/android/SDL_sysjoystick.c b/jni/SDL2-2.0.3/src/joystick/android/SDL_sysjoystick.c index cce94b80..8ab682d4 100644 --- a/jni/SDL2-2.0.3/src/joystick/android/SDL_sysjoystick.c +++ b/jni/SDL2-2.0.3/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); @@ -467,7 +471,7 @@ SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) } /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -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/jni/SDL2-2.0.3/src/joystick/android/SDL_sysjoystick_c.h b/jni/SDL2-2.0.3/src/joystick/android/SDL_sysjoystick_c.h index 3d56b0b9..2137e33c 100644 --- a/jni/SDL2-2.0.3/src/joystick/android/SDL_sysjoystick_c.h +++ b/jni/SDL2-2.0.3/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 @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -#include "SDL_config.h" +#include "../../SDL_internal.h" #ifdef SDL_JOYSTICK_ANDROID #include "../SDL_sysjoystick.h" diff --git a/jni/SDL2-2.0.3/src/joystick/bsd/SDL_sysjoystick.c b/jni/SDL2-2.0.3/src/joystick/bsd/SDL_sysjoystick.c index 65a32ed2..a6fe2f73 100644 --- a/jni/SDL2-2.0.3/src/joystick/bsd/SDL_sysjoystick.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick.c b/jni/SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick.c index 0518cc75..5abb09ce 100644 --- a/jni/SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick.c +++ b/jni/SDL2-2.0.3/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 */ } @@ -218,6 +243,18 @@ AddHIDElement(const void *value, void *parameter) } } break; + case kHIDUsage_GD_DPadUp: + case kHIDUsage_GD_DPadDown: + case kHIDUsage_GD_DPadRight: + case kHIDUsage_GD_DPadLeft: + if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { + element = (recElement *) SDL_calloc(1, sizeof (recElement)); + if (element) { + pDevice->buttons++; + headElement = &(pDevice->firstButton); + } + } + break; } break; @@ -240,6 +277,7 @@ AddHIDElement(const void *value, void *parameter) break; case kHIDPage_Button: + case kHIDPage_Consumer: /* e.g. 'pause' button on Steelseries MFi gamepads. */ if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { element = (recElement *) SDL_calloc(1, sizeof (recElement)); if (element) { @@ -381,6 +419,7 @@ static void JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject) { recDevice *device; + int device_index = 0; if (res != kIOReturnSuccess) { return; @@ -410,18 +449,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 +474,28 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic curdevice = gpDeviceList; while ( curdevice->pNext ) { + ++device_index; curdevice = curdevice->pNext; } curdevice->pNext = device; + ++device_index; /* bump by one since we counted by pNext. */ } + +/* !!! 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 @@ -446,9 +507,9 @@ ConfigHIDManager(CFArrayRef matchingArray) return SDL_FALSE; } + IOHIDManagerSetDeviceMatchingMultiple(hidman, matchingArray); IOHIDManagerRegisterDeviceMatchingCallback(hidman, JoystickDeviceWasAddedCallback, NULL); IOHIDManagerScheduleWithRunLoop(hidman, runloop, SDL_JOYSTICK_RUNLOOP_MODE); - IOHIDManagerSetDeviceMatchingMultiple(hidman, matchingArray); while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { /* no-op. Callback fires once per existing device. */ @@ -560,72 +621,28 @@ SDL_SYS_NumJoysticks() void SDL_SYS_JoystickDetect() { - while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { - /* no-op. Pending callbacks will fire in CFRunLoopRunInMode(). */ - } - - 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; } } + + // run this after the checks above so we don't set device->removed and delete the device before + // SDL_SYS_JoystickUpdate can run to clean up the SDL_Joystick object that owns this device + while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { + /* no-op. Pending callbacks will fire in CFRunLoopRunInMode(). */ + } } /* Function to get the device-dependent name of a joystick */ 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 @@ -633,30 +650,19 @@ 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. - * The joystick to open is specified by the index field of the joystick. + * The joystick to open is specified by the device index. * This should fill the nbuttons and naxes fields of the joystick structure. * It returns 0, or -1 if there is an error. */ 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; @@ -670,21 +676,12 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) } /* Function to query if the joystick is currently attached - * It returns 1 if attached, 0 otherwise. + * It returns SDL_TRUE if attached, SDL_FALSE otherwise. */ 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. @@ -705,9 +702,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; } @@ -795,7 +793,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 */ @@ -812,21 +809,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/jni/SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick_c.h b/jni/SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick_c.h index 0a15ba18..0fefa265 100644 --- a/jni/SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick_c.h +++ b/jni/SDL2-2.0.3/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 @@ -21,6 +21,7 @@ #include "../../SDL_internal.h" #ifndef SDL_JOYSTICK_IOKIT_H +#define SDL_JOYSTICK_IOKIT_H #include @@ -58,12 +59,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/jni/SDL2-2.0.3/src/joystick/dummy/SDL_sysjoystick.c b/jni/SDL2-2.0.3/src/joystick/dummy/SDL_sysjoystick.c index 9baa7950..6212c0e5 100644 --- a/jni/SDL2-2.0.3/src/joystick/dummy/SDL_sysjoystick.c +++ b/jni/SDL2-2.0.3/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() @@ -61,7 +61,7 @@ SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) } /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -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/jni/SDL2-2.0.3/src/joystick/haiku/SDL_haikujoystick.cc b/jni/SDL2-2.0.3/src/joystick/haiku/SDL_haikujoystick.cc index 0caea17f..612f3849 100644 --- a/jni/SDL2-2.0.3/src/joystick/haiku/SDL_haikujoystick.cc +++ b/jni/SDL2-2.0.3/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 @@ -53,8 +53,7 @@ extern "C" static int SDL_SYS_numjoysticks = 0; /* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. + * Joystick 0 should be the system default joystick. * It should return 0, or -1 on an unrecoverable fatal error. */ int SDL_SYS_JoystickInit(void) @@ -107,7 +106,7 @@ extern "C" } /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -153,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; @@ -229,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/jni/SDL2-2.0.3/src/joystick/iphoneos/SDL_sysjoystick.m b/jni/SDL2-2.0.3/src/joystick/iphoneos/SDL_sysjoystick.m deleted file mode 100644 index a4027599..00000000 --- a/jni/SDL2-2.0.3/src/joystick/iphoneos/SDL_sysjoystick.m +++ /dev/null @@ -1,190 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2014 Sam Lantinga - - 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" - -/* This is the iOS implementation of the SDL joystick API */ - -#include "SDL_joystick.h" -#include "SDL_stdinc.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -#import - -/* needed for SDL_IPHONE_MAX_GFORCE macro */ -#import "SDL_config_iphoneos.h" - -const char *accelerometerName = "iOS accelerometer"; - -static CMMotionManager *motionManager = nil; - -/* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. - * It should return 0, or -1 on an unrecoverable fatal error. - */ -int -SDL_SYS_JoystickInit(void) -{ - return (1); -} - -int SDL_SYS_NumJoysticks() -{ - return 1; -} - -void SDL_SYS_JoystickDetect() -{ -} - -/* Function to get the device-dependent name of a joystick */ -const char * -SDL_SYS_JoystickNameForDeviceIndex(int device_index) -{ - return accelerometerName; -} - -/* Function to perform the mapping from device index to the instance id for this index */ -SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) -{ - return device_index; -} - -/* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. - This should fill the nbuttons and naxes fields of the joystick structure. - It returns 0, or -1 if there is an error. - */ -int -SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) -{ - joystick->naxes = 3; - joystick->nhats = 0; - joystick->nballs = 0; - joystick->nbuttons = 0; - - if (motionManager == nil) { - motionManager = [[CMMotionManager alloc] init]; - } - - /* 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 */ -SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) -{ - return SDL_TRUE; -} - -static void SDL_SYS_AccelerometerUpdate(SDL_Joystick * joystick) -{ - const float maxgforce = SDL_IPHONE_MAX_GFORCE; - const SInt16 maxsint16 = 0x7FFF; - CMAcceleration accel; - - if (!motionManager.accelerometerActive) { - return; - } - - accel = [[motionManager accelerometerData] acceleration]; - - /* - Convert accelerometer data from floating point to Sint16, which is what - the joystick system expects. - - To do the conversion, the data is first clamped onto the interval - [-SDL_IPHONE_MAX_G_FORCE, SDL_IPHONE_MAX_G_FORCE], then the data is multiplied - by MAX_SINT16 so that it is mapped to the full range of an Sint16. - - You can customize the clamped range of this function by modifying the - SDL_IPHONE_MAX_GFORCE macro in SDL_config_iphoneos.h. - - Once converted to Sint16, the accelerometer data no longer has coherent - units. You can convert the data back to units of g-force by multiplying - it in your application's code by SDL_IPHONE_MAX_GFORCE / 0x7FFF. - */ - - /* clamp the data */ - accel.x = SDL_min(SDL_max(accel.x, -maxgforce), maxgforce); - accel.y = SDL_min(SDL_max(accel.y, -maxgforce), maxgforce); - accel.z = SDL_min(SDL_max(accel.z, -maxgforce), maxgforce); - - /* pass in data mapped to range of SInt16 */ - SDL_PrivateJoystickAxis(joystick, 0, (accel.x / maxgforce) * maxsint16); - SDL_PrivateJoystickAxis(joystick, 1, -(accel.y / maxgforce) * maxsint16); - SDL_PrivateJoystickAxis(joystick, 2, (accel.z / maxgforce) * maxsint16); -} - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ -void -SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) -{ - SDL_SYS_AccelerometerUpdate(joystick); -} - -/* Function to close a joystick after use */ -void -SDL_SYS_JoystickClose(SDL_Joystick * joystick) -{ - [motionManager stopAccelerometerUpdates]; - joystick->closed = 1; -} - -/* Function to perform any system-specific joystick related cleanup */ -void -SDL_SYS_JoystickQuit(void) -{ - if (motionManager != nil) { - [motionManager release]; - motionManager = nil; - } -} - -SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) -{ - SDL_JoystickGUID guid; - /* the GUID is just the first 16 chars of the name for now */ - const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); - SDL_zero( guid ); - SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); - return guid; -} - -SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) -{ - SDL_JoystickGUID guid; - /* the GUID is just the first 16 chars of the name for now */ - const char *name = joystick->name; - SDL_zero( guid ); - SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); - return guid; -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/joystick/linux/SDL_sysjoystick.c b/jni/SDL2-2.0.3/src/joystick/linux/SDL_sysjoystick.c index 05bf086f..c6f7911c 100644 --- a/jni/SDL2-2.0.3/src/joystick/linux/SDL_sysjoystick.c +++ b/jni/SDL2-2.0.3/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 @@ -142,13 +142,15 @@ IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *gui #if SDL_USE_LIBUDEV void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath) { - if (devpath == NULL || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) { + if (devpath == NULL) { return; } - - switch( udev_type ) - { + + switch (udev_type) { case SDL_UDEV_DEVICEADDED: + if (!(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) { + return; + } MaybeAddDevice(devpath); break; @@ -335,13 +337,12 @@ JoystickInitWithoutUdev(void) static int JoystickInitWithUdev(void) { - if (SDL_UDEV_Init() < 0) { return SDL_SetError("Could not initialize UDEV"); } /* Set up the udev callback */ - if ( SDL_UDEV_AddCallback(joystick_udev_callback) < 0) { + if (SDL_UDEV_AddCallback(joystick_udev_callback) < 0) { SDL_UDEV_Quit(); return SDL_SetError("Could not set up joystick <-> udev callback"); } @@ -491,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; @@ -565,7 +566,7 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -620,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 @@ -752,10 +753,6 @@ HandleInputEvents(SDL_Joystick * joystick) } break; case EV_ABS: - if (code >= ABS_MISC) { - break; - } - switch (code) { case ABS_HAT0X: case ABS_HAT0Y: @@ -840,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/jni/SDL2-2.0.3/src/joystick/linux/SDL_sysjoystick_c.h b/jni/SDL2-2.0.3/src/joystick/linux/SDL_sysjoystick_c.h index 16d16e26..0d7e65d2 100644 --- a/jni/SDL2-2.0.3/src/joystick/linux/SDL_sysjoystick_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/joystick/psp/SDL_sysjoystick.c b/jni/SDL2-2.0.3/src/joystick/psp/SDL_sysjoystick.c index 9a2362e1..9d20f90d 100644 --- a/jni/SDL2-2.0.3/src/joystick/psp/SDL_sysjoystick.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,9 @@ 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_JOYSTICK_PSP /* This is the PSP implementation of the SDL joystick API */ #include @@ -97,16 +100,13 @@ int JoystickUpdate(void *data) /* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. + * Joystick 0 should be the system default joystick. * It should return number of joysticks, or -1 on an unrecoverable fatal error. */ int SDL_SYS_JoystickInit(void) { int i; -/* SDL_numjoysticks = 1; */ - /* Setup input */ sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); @@ -164,7 +164,7 @@ const char *SDL_SYS_JoystickName(int index) } /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -177,17 +177,17 @@ 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; } + /* Function to update the state of a joystick - called as a device poll. * This function shouldn't update the joystick structure directly, * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ - void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) { int i; @@ -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 */ @@ -265,5 +264,7 @@ SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) return guid; } +#endif /* SDL_JOYSTICK_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/jni/SDL2-2.0.3/src/joystick/sort_controllers.py b/jni/SDL2-2.0.3/src/joystick/sort_controllers.py index 03b857a0..af95d651 100755 --- a/jni/SDL2-2.0.3/src/joystick/sort_controllers.py +++ b/jni/SDL2-2.0.3/src/joystick/sort_controllers.py @@ -30,9 +30,9 @@ def write_controllers(): for entry in sorted(controllers, key=lambda entry: entry[2]): line = "".join(entry) + "\n" if not line.endswith(",\n") and not line.endswith("*/\n"): - print "Warning: '%s' is missing a comma at the end of the line" % (line) + print("Warning: '%s' is missing a comma at the end of the line" % (line)) if (entry[1] in controller_guids): - print "Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2]) + print("Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2])) controller_guids[entry[1]] = entry output.write(line) @@ -40,15 +40,17 @@ def write_controllers(): controller_guids = {} for line in input: - if ( parsing_controllers ): + if (parsing_controllers): if (line.startswith("{")): output.write(line) - elif (line.startswith("#endif")): + elif (line.startswith(" NULL")): parsing_controllers = False write_controllers() output.write(line) - elif (line.startswith("#")): - print "Parsing " + line.strip() + elif (line.startswith("#if")): + print("Parsing " + line.strip()) + output.write(line) + elif (line.startswith("#endif")): write_controllers() output.write(line) else: @@ -60,4 +62,4 @@ for line in input: output.write(line) output.close() -print "Finished writing %s.new" % filename +print("Finished writing %s.new" % filename) diff --git a/jni/SDL2-2.0.3/src/joystick/windows/SDL_dinputjoystick.c b/jni/SDL2-2.0.3/src/joystick/windows/SDL_dinputjoystick.c index 179f9928..61d5b386 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_dinputjoystick.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/joystick/windows/SDL_dinputjoystick_c.h b/jni/SDL2-2.0.3/src/joystick/windows/SDL_dinputjoystick_c.h index 3facf0e5..f93b1209 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_dinputjoystick_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/joystick/windows/SDL_mmjoystick.c b/jni/SDL2-2.0.3/src/joystick/windows/SDL_mmjoystick.c index 0f3b6dec..65b16ab9 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_mmjoystick.c +++ b/jni/SDL2-2.0.3/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 @@ -143,8 +143,7 @@ GetJoystickName(int index, const char *szRegKey) static int SDL_SYS_numjoysticks = 0; /* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. + * Joystick 0 should be the system default joystick. * It should return 0, or -1 on an unrecoverable fatal error. */ int @@ -211,7 +210,7 @@ SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) } /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -272,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; @@ -384,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/jni/SDL2-2.0.3/src/joystick/windows/SDL_windowsjoystick.c b/jni/SDL2-2.0.3/src/joystick/windows/SDL_windowsjoystick.c index d649edc1..c06fad0d 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_windowsjoystick.c +++ b/jni/SDL2-2.0.3/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 @@ -278,8 +278,7 @@ void SDL_SYS_AddJoystickDevice(JoyStick_DeviceData *device) } /* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. + * Joystick 0 should be the system default joystick. * It should return 0, or -1 on an unrecoverable fatal error. */ int @@ -447,7 +446,7 @@ SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) } /* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. + The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ @@ -461,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) { @@ -481,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; } @@ -498,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; } } @@ -513,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/jni/SDL2-2.0.3/src/joystick/windows/SDL_windowsjoystick_c.h b/jni/SDL2-2.0.3/src/joystick/windows/SDL_windowsjoystick_c.h index 9b09e656..5f991dc2 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_windowsjoystick_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/joystick/windows/SDL_xinputjoystick.c b/jni/SDL2-2.0.3/src/joystick/windows/SDL_xinputjoystick.c index 12bf9885..cf71f5c3 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_xinputjoystick.c +++ b/jni/SDL2-2.0.3/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. */ @@ -221,8 +221,39 @@ SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde return 0; } +static void +UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) +{ + if ( pBatteryInformation->BatteryType != BATTERY_TYPE_UNKNOWN ) + { + SDL_JoystickPowerLevel ePowerLevel = SDL_JOYSTICK_POWER_UNKNOWN; + if (pBatteryInformation->BatteryType == BATTERY_TYPE_WIRED) { + ePowerLevel = SDL_JOYSTICK_POWER_WIRED; + } else { + switch ( pBatteryInformation->BatteryLevel ) + { + case BATTERY_LEVEL_EMPTY: + ePowerLevel = SDL_JOYSTICK_POWER_EMPTY; + break; + case BATTERY_LEVEL_LOW: + ePowerLevel = SDL_JOYSTICK_POWER_LOW; + break; + case BATTERY_LEVEL_MEDIUM: + ePowerLevel = SDL_JOYSTICK_POWER_MEDIUM; + break; + default: + case BATTERY_LEVEL_FULL: + ePowerLevel = SDL_JOYSTICK_POWER_FULL; + break; + } + } + + SDL_PrivateJoystickBatteryLevel( joystick, ePowerLevel ); + } +} + static void -UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState) +UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) { static WORD s_XInputButtons[] = { XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT, @@ -244,10 +275,12 @@ UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputS for (button = 0; button < SDL_arraysize(s_XInputButtons); ++button) { SDL_PrivateJoystickButton(joystick, button, (wButtons & s_XInputButtons[button]) ? SDL_PRESSED : SDL_RELEASED); } + + UpdateXInputJoystickBatteryInformation( joystick, pBatteryInformation ); } static void -UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState) +UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) { static WORD s_XInputButtons[] = { XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y, @@ -283,6 +316,8 @@ UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState hat |= SDL_HAT_RIGHT; } SDL_PrivateJoystickHat(joystick, 0, hat); + + UpdateXInputJoystickBatteryInformation( joystick, pBatteryInformation ); } void @@ -290,6 +325,7 @@ SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick) { HRESULT result; XINPUT_STATE_EX XInputState; + XINPUT_BATTERY_INFORMATION_EX XBatteryInformation; if (!XINPUTGETSTATE) return; @@ -301,12 +337,18 @@ SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick) return; } + SDL_zero( XBatteryInformation ); + if ( XINPUTGETBATTERYINFORMATION ) + { + result = XINPUTGETBATTERYINFORMATION( joystick->hwdata->userid, BATTERY_DEVTYPE_GAMEPAD, &XBatteryInformation ); + } + /* only fire events if the data changed from last time */ if (XInputState.dwPacketNumber && XInputState.dwPacketNumber != joystick->hwdata->dwPacketNumber) { if (SDL_XInputUseOldJoystickMapping()) { - UpdateXInputJoystickState_OLD(joystick, &XInputState); + UpdateXInputJoystickState_OLD(joystick, &XInputState, &XBatteryInformation); } else { - UpdateXInputJoystickState(joystick, &XInputState); + UpdateXInputJoystickState(joystick, &XInputState, &XBatteryInformation); } joystick->hwdata->dwPacketNumber = XInputState.dwPacketNumber; } @@ -339,6 +381,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/jni/SDL2-2.0.3/src/joystick/windows/SDL_xinputjoystick_c.h b/jni/SDL2-2.0.3/src/joystick/windows/SDL_xinputjoystick_c.h index 825c2920..ed6087bc 100644 --- a/jni/SDL2-2.0.3/src/joystick/windows/SDL_xinputjoystick_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/libm/math_libm.h b/jni/SDL2-2.0.3/src/libm/math_libm.h index 6b479f44..9e91073e 100644 --- a/jni/SDL2-2.0.3/src/libm/math_libm.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/loadso/dlopen/SDL_sysloadso.c b/jni/SDL2-2.0.3/src/loadso/dlopen/SDL_sysloadso.c index db842222..f3dffefd 100644 --- a/jni/SDL2-2.0.3/src/loadso/dlopen/SDL_sysloadso.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/loadso/dummy/SDL_sysloadso.c b/jni/SDL2-2.0.3/src/loadso/dummy/SDL_sysloadso.c index 0dfb90b0..a38b5697 100644 --- a/jni/SDL2-2.0.3/src/loadso/dummy/SDL_sysloadso.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/loadso/haiku/SDL_sysloadso.c b/jni/SDL2-2.0.3/src/loadso/haiku/SDL_sysloadso.c index c8bba670..a5f12950 100644 --- a/jni/SDL2-2.0.3/src/loadso/haiku/SDL_sysloadso.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/loadso/windows/SDL_sysloadso.c b/jni/SDL2-2.0.3/src/loadso/windows/SDL_sysloadso.c index 4d32b098..1c1d8cfa 100644 --- a/jni/SDL2-2.0.3/src/loadso/windows/SDL_sysloadso.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/main/android/SDL_android_main.c b/jni/SDL2-2.0.3/src/main/android/SDL_android_main.c index 08102f8e..4173bcb1 100644 --- a/jni/SDL2-2.0.3/src/main/android/SDL_android_main.c +++ b/jni/SDL2-2.0.3/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; @@ -47,6 +47,7 @@ int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject arg = SDL_strdup(utf); (*env)->ReleaseStringUTFChars(env, string, utf); } + (*env)->DeleteLocalRef(env, string); } if (!arg) { arg = SDL_strdup(""); diff --git a/jni/SDL2-2.0.3/src/main/haiku/SDL_BApp.h b/jni/SDL2-2.0.3/src/main/haiku/SDL_BApp.h index 1e4a0f55..1c5dbb84 100644 --- a/jni/SDL2-2.0.3/src/main/haiku/SDL_BApp.h +++ b/jni/SDL2-2.0.3/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 @@ -254,7 +254,7 @@ private: return; } win = GetSDLWindow(winID); - SDL_SendMouseWheel(win, 0, xTicks, yTicks); + SDL_SendMouseWheel(win, 0, xTicks, yTicks, SDL_MOUSEWHEEL_NORMAL); } void _HandleKey(BMessage *msg) { diff --git a/jni/SDL2-2.0.3/src/main/haiku/SDL_BeApp.cc b/jni/SDL2-2.0.3/src/main/haiku/SDL_BeApp.cc index d471887f..f09afb2e 100644 --- a/jni/SDL2-2.0.3/src/main/haiku/SDL_BeApp.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/main/haiku/SDL_BeApp.h b/jni/SDL2-2.0.3/src/main/haiku/SDL_BeApp.h index f4399c81..b1cb9501 100644 --- a/jni/SDL2-2.0.3/src/main/haiku/SDL_BeApp.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/main/nacl/SDL_nacl_main.c b/jni/SDL2-2.0.3/src/main/nacl/SDL_nacl_main.c index 40a29ddf..378db7af 100644 --- a/jni/SDL2-2.0.3/src/main/nacl/SDL_nacl_main.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/main/psp/SDL_psp_main.c b/jni/SDL2-2.0.3/src/main/psp/SDL_psp_main.c index d79135db..2ca8e446 100644 --- a/jni/SDL2-2.0.3/src/main/psp/SDL_psp_main.c +++ b/jni/SDL2-2.0.3/src/main/psp/SDL_psp_main.c @@ -1,6 +1,9 @@ /* SDL_psp_main.c, placed in the public domain by Sam Lantinga 3/13/14 */ +#include "SDL_config.h" + +#ifdef __PSP__ #include "SDL_main.h" #include @@ -61,3 +64,7 @@ int main(int argc, char *argv[]) (void)SDL_main(argc, argv); return 0; } + +#endif /* __PSP__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/main/windows/SDL_windows_main.c b/jni/SDL2-2.0.3/src/main/windows/SDL_windows_main.c index f7cdbdbc..e6378081 100644 --- a/jni/SDL2-2.0.3/src/main/windows/SDL_windows_main.c +++ b/jni/SDL2-2.0.3/src/main/windows/SDL_windows_main.c @@ -109,13 +109,16 @@ OutOfMemory(void) } #if defined(_MSC_VER) -/* The VC++ compiler needs main defined */ -#define console_main main +/* The VC++ compiler needs main/wmain defined */ +# define console_ansi_main main +# if UNICODE +# define console_wmain wmain +# endif #endif -/* This is where execution begins [console apps] */ -int -console_main(int argc, char *argv[]) +/* WinMain, main, and wmain eventually call into here. */ +static int +main_utf8(int argc, char *argv[]) { SDL_SetMainReady(); @@ -123,6 +126,37 @@ console_main(int argc, char *argv[]) return SDL_main(argc, argv); } +/* This is where execution begins [console apps, ansi] */ +int +console_ansi_main(int argc, char *argv[]) +{ + /* !!! FIXME: are these in the system codepage? We need to convert to UTF-8. */ + return main_utf8(argc, argv); +} + + +#if UNICODE +/* This is where execution begins [console apps, unicode] */ +int +console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp) +{ + int retval = 0; + char **argv = SDL_stack_alloc(char*, argc); + int i; + + for (i = 0; i < argc; ++i) { + argv[i] = WIN_StringToUTF8(wargv[i]); + } + + retval = main_utf8(argc, argv); + + /* !!! FIXME: we are leaking all the elements of argv we allocated. */ + SDL_stack_free(argv); + + return retval; +} +#endif + /* This is where execution begins [windowed apps] */ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) @@ -134,8 +168,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) /* Grab the command line */ TCHAR *text = GetCommandLine(); #if UNICODE - cmdline = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(text), (SDL_wcslen(text)+1)*sizeof(WCHAR)); + cmdline = WIN_StringToUTF8(text); #else + /* !!! FIXME: are these in the system codepage? We need to convert to UTF-8. */ cmdline = SDL_strdup(text); #endif if (cmdline == NULL) { @@ -151,7 +186,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) ParseCommandLine(cmdline, argv); /* Run the main program */ - console_main(argc, argv); + main_utf8(argc, argv); SDL_stack_free(argv); diff --git a/jni/SDL2-2.0.3/src/main/windows/version.rc b/jni/SDL2-2.0.3/src/main/windows/version.rc index 3a461276..d9fbffc7 100644 --- a/jni/SDL2-2.0.3/src/main/windows/version.rc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/SDL_power.c b/jni/SDL2-2.0.3/src/power/SDL_power.c index cc9ba396..8f919f2e 100644 --- a/jni/SDL2-2.0.3/src/power/SDL_power.c +++ b/jni/SDL2-2.0.3/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 *); @@ -38,6 +39,7 @@ SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *); SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *); SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *); SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *, int *, int *); #ifndef SDL_POWER_DISABLED #ifdef SDL_POWER_HARDWIRED @@ -57,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 @@ -81,6 +84,9 @@ static SDL_GetPowerInfo_Impl implementations[] = { #ifdef SDL_POWER_WINRT /* handles WinRT */ SDL_GetPowerInfo_WinRT, #endif +#ifdef SDL_POWER_EMSCRIPTEN /* handles Emscripten */ + SDL_GetPowerInfo_Emscripten, +#endif #ifdef SDL_POWER_HARDWIRED SDL_GetPowerInfo_Hardwired, diff --git a/jni/SDL2-2.0.3/src/power/android/SDL_syspower.c b/jni/SDL2-2.0.3/src/power/android/SDL_syspower.c index e363731d..94a4ff4c 100644 --- a/jni/SDL2-2.0.3/src/power/android/SDL_syspower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/haiku/SDL_syspower.c b/jni/SDL2-2.0.3/src/power/haiku/SDL_syspower.c index aaf61e8b..2d87806a 100644 --- a/jni/SDL2-2.0.3/src/power/haiku/SDL_syspower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/linux/SDL_syspower.c b/jni/SDL2-2.0.3/src/power/linux/SDL_syspower.c index 05eb200b..3986489f 100644 --- a/jni/SDL2-2.0.3/src/power/linux/SDL_syspower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/macosx/SDL_syspower.c b/jni/SDL2-2.0.3/src/power/macosx/SDL_syspower.c index 9bcacafd..d029de5d 100644 --- a/jni/SDL2-2.0.3/src/power/macosx/SDL_syspower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/psp/SDL_syspower.c b/jni/SDL2-2.0.3/src/power/psp/SDL_syspower.c index b28a68cf..55011080 100644 --- a/jni/SDL2-2.0.3/src/power/psp/SDL_syspower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/uikit/SDL_syspower.h b/jni/SDL2-2.0.3/src/power/uikit/SDL_syspower.h index 581c358d..7b0e5242 100644 --- a/jni/SDL2-2.0.3/src/power/uikit/SDL_syspower.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/uikit/SDL_syspower.m b/jni/SDL2-2.0.3/src/power/uikit/SDL_syspower.m index 60c42745..2851c109 100644 --- a/jni/SDL2-2.0.3/src/power/uikit/SDL_syspower.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/windows/SDL_syspower.c b/jni/SDL2-2.0.3/src/power/windows/SDL_syspower.c index 0a247ba0..5c9e0240 100644 --- a/jni/SDL2-2.0.3/src/power/windows/SDL_syspower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/power/winrt/SDL_syspower.cpp b/jni/SDL2-2.0.3/src/power/winrt/SDL_syspower.cpp index 8804aec7..cce6bede 100644 --- a/jni/SDL2-2.0.3/src/power/winrt/SDL_syspower.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_d3dmath.c b/jni/SDL2-2.0.3/src/render/SDL_d3dmath.c index 7c358a1e..058b3af2 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_d3dmath.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_d3dmath.h b/jni/SDL2-2.0.3/src/render/SDL_d3dmath.h index aa6c3fff..34a226d5 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_d3dmath.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_render.c b/jni/SDL2-2.0.3/src/render/SDL_render.c index 4480d715..f00688b0 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_render.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_sysrender.h b/jni/SDL2-2.0.3/src/render/SDL_sysrender.h index aba4bbb4..9c74ebbe 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_sysrender.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_yuv_mmx.c b/jni/SDL2-2.0.3/src/render/SDL_yuv_mmx.c index e4ae4acb..f9320bfb 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_yuv_mmx.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_yuv_sw.c b/jni/SDL2-2.0.3/src/render/SDL_yuv_sw.c index 4bd1856f..a9ad87aa 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_yuv_sw.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/SDL_yuv_sw_c.h b/jni/SDL2-2.0.3/src/render/SDL_yuv_sw_c.h index 6b4044b6..3b3a266f 100644 --- a/jni/SDL2-2.0.3/src/render/SDL_yuv_sw_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/direct3d/SDL_render_d3d.c b/jni/SDL2-2.0.3/src/render/direct3d/SDL_render_d3d.c index d96522e7..910ceb37 100644 --- a/jni/SDL2-2.0.3/src/render/direct3d/SDL_render_d3d.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_d3d11.c b/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_d3d11.c index f99fdb1d..941c3d79 100644 --- a/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_d3d11.c +++ b/jni/SDL2-2.0.3/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 @@ -760,8 +760,8 @@ SDL_RenderDriver D3D11_RenderDriver = { }; -static Uint32 -DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) { +Uint32 +D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) { switch (dxgiFormat) { case DXGI_FORMAT_B8G8R8A8_UNORM: return SDL_PIXELFORMAT_ARGB8888; @@ -829,9 +829,24 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); renderer->driverdata = data; +#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP + /* VSync is required in Windows Phone, at least for Win Phone 8.0 and 8.1. + * Failure to use it seems to either result in: + * + * - with the D3D11 debug runtime turned OFF, vsync seemingly gets turned + * off (framerate doesn't get capped), but nothing appears on-screen + * + * - with the D3D11 debug runtime turned ON, vsync gets automatically + * turned back on, and the following gets output to the debug console: + * + * DXGI ERROR: IDXGISwapChain::Present: Interval 0 is not supported, changed to Interval 1. [ UNKNOWN ERROR #1024: ] + */ + renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; +#else if ((flags & SDL_RENDERER_PRESENTVSYNC)) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } +#endif /* HACK: make sure the SDL_Renderer references the SDL_Window data now, in * order to give init functions access to the underlying window handle: @@ -1341,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); @@ -1351,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; @@ -2265,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; } @@ -2346,7 +2367,7 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, } else { SAFE_RELEASE(rendererData->vertexBuffer); - vertexBufferDesc.ByteWidth = dataSizeInBytes; + vertexBufferDesc.ByteWidth = (UINT) dataSizeInBytes; vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC; vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; @@ -2483,7 +2504,7 @@ D3D11_RenderDrawPoints(SDL_Renderer * renderer, a = (float)(renderer->a / 255.0f); vertices = SDL_stack_alloc(VertexPositionColor, count); - for (i = 0; i < min(count, 128); ++i) { + for (i = 0; i < count; ++i) { const VertexPositionColor v = { { points[i].x, points[i].y, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } }; vertices[i] = v; } @@ -2854,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; } @@ -2890,7 +2911,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, */ if (SDL_ConvertPixels( rect->w, rect->h, - DXGIFormatToSDLPixelFormat(stagingTextureDesc.Format), + D3D11_DXGIFormatToSDLPixelFormat(stagingTextureDesc.Format), textureMemory.pData, textureMemory.RowPitch, format, @@ -2901,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/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_winrt.cpp b/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_winrt.cpp index 19c060f1..99136662 100644 --- a/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_winrt.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_winrt.h b/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_winrt.h index 66a3220d..5c76b70f 100644 --- a/jni/SDL2-2.0.3/src/render/direct3d11/SDL_render_winrt.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengl/SDL_glfuncs.h b/jni/SDL2-2.0.3/src/render/opengl/SDL_glfuncs.h index fefbdd26..a9f38c43 100644 --- a/jni/SDL2-2.0.3/src/render/opengl/SDL_glfuncs.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengl/SDL_render_gl.c b/jni/SDL2-2.0.3/src/render/opengl/SDL_render_gl.c index ecd0d531..f5ac96d0 100644 --- a/jni/SDL2-2.0.3/src/render/opengl/SDL_render_gl.c +++ b/jni/SDL2-2.0.3/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 @@ -342,9 +342,11 @@ GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GL if (type == GL_DEBUG_TYPE_ERROR_ARB) { /* Record this error */ - ++data->errors; - data->error_messages = SDL_realloc(data->error_messages, data->errors * sizeof(*data->error_messages)); - if (data->error_messages) { + int errors = data->errors + 1; + char **error_messages = SDL_realloc(data->error_messages, errors * sizeof(*data->error_messages)); + if (error_messages) { + data->errors = errors; + data->error_messages = error_messages; data->error_messages[data->errors-1] = SDL_strdup(message); } } @@ -1044,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/jni/SDL2-2.0.3/src/render/opengl/SDL_shaders_gl.c b/jni/SDL2-2.0.3/src/render/opengl/SDL_shaders_gl.c index a831890c..f0885523 100644 --- a/jni/SDL2-2.0.3/src/render/opengl/SDL_shaders_gl.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengl/SDL_shaders_gl.h b/jni/SDL2-2.0.3/src/render/opengl/SDL_shaders_gl.h index 4604f05f..1b2e4a5a 100644 --- a/jni/SDL2-2.0.3/src/render/opengl/SDL_shaders_gl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengles/SDL_glesfuncs.h b/jni/SDL2-2.0.3/src/render/opengles/SDL_glesfuncs.h index 6dc197a6..4eb72d6b 100644 --- a/jni/SDL2-2.0.3/src/render/opengles/SDL_glesfuncs.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengles/SDL_render_gles.c b/jni/SDL2-2.0.3/src/render/opengles/SDL_render_gles.c index 72cce305..21c22bfd 100644 --- a/jni/SDL2-2.0.3/src/render/opengles/SDL_render_gles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengles2/SDL_gles2funcs.h b/jni/SDL2-2.0.3/src/render/opengles2/SDL_gles2funcs.h index 2c02cdd1..36dcf742 100644 --- a/jni/SDL2-2.0.3/src/render/opengles2/SDL_gles2funcs.h +++ b/jni/SDL2-2.0.3/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 @@ -69,3 +69,7 @@ SDL_PROC(GLenum, glCheckFramebufferStatus, (GLenum)) SDL_PROC(void, glDeleteFramebuffers, (GLsizei, const GLuint *)) SDL_PROC(GLint, glGetAttribLocation, (GLuint, const GLchar *)) SDL_PROC(void, glGetProgramInfoLog, (GLuint, GLsizei, GLsizei*, GLchar*)) +SDL_PROC(void, glGenBuffers, (GLsizei, GLuint *)) +SDL_PROC(void, glBindBuffer, (GLenum, GLuint)) +SDL_PROC(void, glBufferData, (GLenum, GLsizeiptr, const GLvoid *, GLenum)) +SDL_PROC(void, glBufferSubData, (GLenum, GLintptr, GLsizeiptr, const GLvoid *)) diff --git a/jni/SDL2-2.0.3/src/render/opengles2/SDL_render_gles2.c b/jni/SDL2-2.0.3/src/render/opengles2/SDL_render_gles2.c index fd7f1b37..7254cb7a 100644 --- a/jni/SDL2-2.0.3/src/render/opengles2/SDL_render_gles2.c +++ b/jni/SDL2-2.0.3/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 @@ -28,7 +28,20 @@ #include "../../video/SDL_blit.h" #include "SDL_shaders_gles2.h" -/* To prevent unnecessary window recreation, +/* !!! FIXME: Emscripten makes these into WebGL calls, and WebGL doesn't offer + !!! FIXME: client-side arrays (without an Emscripten compatibility hack, + !!! FIXME: at least), but the current VBO code here is dramatically + !!! FIXME: slower on actual iOS devices, even though the iOS Simulator + !!! FIXME: is okay. Some time after 2.0.4 ships, we should revisit this, + !!! FIXME: fix the performance bottleneck, and make everything use VBOs. +*/ +#ifdef __EMSCRIPTEN__ +#define SDL_GLES2_USE_VBOS 1 +#else +#define SDL_GLES2_USE_VBOS 0 +#endif + +/* To prevent unnecessary window recreation, * these should match the defaults selected in SDL_GL_ResetAttributes */ #define RENDERER_CONTEXT_MAJOR 2 @@ -180,6 +193,11 @@ typedef struct GLES2_DriverContext GLES2_ProgramCache program_cache; GLES2_ProgramCacheEntry *current_program; Uint8 clear_r, clear_g, clear_b, clear_a; + +#if SDL_GLES2_USE_VBOS + GLuint vertex_buffers[4]; + GLsizeiptr vertex_buffer_size[4]; +#endif } GLES2_DriverContext; #define GLES2_MAX_CACHED_PROGRAMS 8 @@ -206,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) { @@ -221,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) */ @@ -284,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 @@ -295,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; @@ -351,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) { @@ -361,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); @@ -383,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); } @@ -403,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); @@ -652,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); @@ -730,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, @@ -827,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); @@ -867,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; @@ -891,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; } @@ -910,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"); @@ -944,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; @@ -961,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); @@ -990,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; } @@ -1039,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; @@ -1074,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; } @@ -1090,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 */ @@ -1114,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; @@ -1146,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); @@ -1170,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; } @@ -1385,6 +1417,34 @@ GLES2_SetDrawingState(SDL_Renderer * renderer) return 0; } +static int +GLES2_UpdateVertexBuffer(SDL_Renderer *renderer, GLES2_Attribute attr, + const void *vertexData, size_t dataSizeInBytes) +{ + GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata; + +#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]) { + data->glGenBuffers(1, &data->vertex_buffers[attr]); + } + + data->glBindBuffer(GL_ARRAY_BUFFER, data->vertex_buffers[attr]); + + if (data->vertex_buffer_size[attr] < dataSizeInBytes) { + data->glBufferData(GL_ARRAY_BUFFER, dataSizeInBytes, vertexData, GL_STREAM_DRAW); + data->vertex_buffer_size[attr] = dataSizeInBytes; + } else { + data->glBufferSubData(GL_ARRAY_BUFFER, 0, dataSizeInBytes, vertexData); + } + + data->glVertexAttribPointer(attr, attr == GLES2_ATTRIBUTE_ANGLE ? 1 : 2, GL_FLOAT, GL_FALSE, 0, 0); +#endif + + return 0; +} + static int GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count) { @@ -1405,7 +1465,8 @@ GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int cou vertices[idx * 2] = x; vertices[(idx * 2) + 1] = y; } - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);*/ + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_POSITION, vertices, count * 2 * sizeof(GLfloat)); data->glDrawArrays(GL_POINTS, 0, count); SDL_stack_free(vertices); return 0; @@ -1431,7 +1492,8 @@ GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, int coun vertices[idx * 2] = x; vertices[(idx * 2) + 1] = y; } - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);*/ + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_POSITION, vertices, count * 2 * sizeof(GLfloat)); data->glDrawArrays(GL_LINE_STRIP, 0, count); /* We need to close the endpoint of the line */ @@ -1472,7 +1534,8 @@ GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) vertices[5] = yMax; vertices[6] = xMax; vertices[7] = yMax; - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);*/ + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_POSITION, vertices, 8 * sizeof(GLfloat)); data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } return GL_CheckError("", renderer); @@ -1493,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: @@ -1560,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; @@ -1668,7 +1726,8 @@ GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *s vertices[5] = (dstrect->y + dstrect->h); vertices[6] = (dstrect->x + dstrect->w); vertices[7] = (dstrect->y + dstrect->h); - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);*/ + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_POSITION, vertices, 8 * sizeof(GLfloat)); texCoords[0] = srcrect->x / (GLfloat)texture->w; texCoords[1] = srcrect->y / (GLfloat)texture->h; texCoords[2] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; @@ -1677,7 +1736,8 @@ GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *s texCoords[5] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; texCoords[6] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; - data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords);*/ + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_TEXCOORD, texCoords, 8 * sizeof(GLfloat)); data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); return GL_CheckError("", renderer); @@ -1727,9 +1787,13 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect vertices[5] = vertices[7] = tmp; } - data->glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 1, GL_FLOAT, GL_FALSE, 0, &fAngle); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 1, GL_FLOAT, GL_FALSE, 0, &fAngle); data->glVertexAttribPointer(GLES2_ATTRIBUTE_CENTER, 2, GL_FLOAT, GL_FALSE, 0, translate); - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);*/ + + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_ANGLE, fAngle, 4 * sizeof(GLfloat)); + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_CENTER, translate, 8 * sizeof(GLfloat)); + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_POSITION, vertices, 8 * sizeof(GLfloat)); texCoords[0] = srcrect->x / (GLfloat)texture->w; texCoords[1] = srcrect->y / (GLfloat)texture->h; @@ -1739,7 +1803,8 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect texCoords[5] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; texCoords[6] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; - data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords); + /*data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords);*/ + GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_TEXCOORD, texCoords, 8 * sizeof(GLfloat)); data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); data->glDisableVertexAttribArray(GLES2_ATTRIBUTE_CENTER); data->glDisableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE); @@ -1822,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; } @@ -1979,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; @@ -1994,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; @@ -2004,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/jni/SDL2-2.0.3/src/render/opengles2/SDL_shaders_gles2.c b/jni/SDL2-2.0.3/src/render/opengles2/SDL_shaders_gles2.c index 48040f96..6f650811 100644 --- a/jni/SDL2-2.0.3/src/render/opengles2/SDL_shaders_gles2.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/opengles2/SDL_shaders_gles2.h b/jni/SDL2-2.0.3/src/render/opengles2/SDL_shaders_gles2.h index d68f7d05..f22c8f56 100644 --- a/jni/SDL2-2.0.3/src/render/opengles2/SDL_shaders_gles2.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/psp/SDL_render_psp.c b/jni/SDL2-2.0.3/src/render/psp/SDL_render_psp.c index cdd13e82..39a2eab6 100644 --- a/jni/SDL2-2.0.3/src/render/psp/SDL_render_psp.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_blendfillrect.c b/jni/SDL2-2.0.3/src/render/software/SDL_blendfillrect.c index cb184d63..669422f7 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_blendfillrect.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_blendfillrect.h b/jni/SDL2-2.0.3/src/render/software/SDL_blendfillrect.h index 297c839e..b612db24 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_blendfillrect.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_blendline.c b/jni/SDL2-2.0.3/src/render/software/SDL_blendline.c index 02d748d5..b2090b13 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_blendline.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_blendline.h b/jni/SDL2-2.0.3/src/render/software/SDL_blendline.h index 14a7c18a..602cafd6 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_blendline.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_blendpoint.c b/jni/SDL2-2.0.3/src/render/software/SDL_blendpoint.c index dab13560..47243794 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_blendpoint.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_blendpoint.h b/jni/SDL2-2.0.3/src/render/software/SDL_blendpoint.h index 72eaf7b8..7045326a 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_blendpoint.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_draw.h b/jni/SDL2-2.0.3/src/render/software/SDL_draw.h index 2bd8f94c..e2822427 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_draw.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_drawline.c b/jni/SDL2-2.0.3/src/render/software/SDL_drawline.c index 1ff84a46..e76c3f40 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_drawline.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_drawline.h b/jni/SDL2-2.0.3/src/render/software/SDL_drawline.h index e3378ae8..e2dafeae 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_drawline.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_drawpoint.c b/jni/SDL2-2.0.3/src/render/software/SDL_drawpoint.c index 3f2de86c..38ea4b74 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_drawpoint.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_drawpoint.h b/jni/SDL2-2.0.3/src/render/software/SDL_drawpoint.h index 96933d61..d26c2b58 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_drawpoint.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_render_sw.c b/jni/SDL2-2.0.3/src/render/software/SDL_render_sw.c index 37f42f07..119b2001 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_render_sw.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_render_sw_c.h b/jni/SDL2-2.0.3/src/render/software/SDL_render_sw_c.h index 81cb656c..df1a6473 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_render_sw_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_rotate.c b/jni/SDL2-2.0.3/src/render/software/SDL_rotate.c index 0edf784c..8d92758f 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_rotate.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/render/software/SDL_rotate.h b/jni/SDL2-2.0.3/src/render/software/SDL_rotate.h index e92c3b77..01ceb2d8 100644 --- a/jni/SDL2-2.0.3/src/render/software/SDL_rotate.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/stdlib/SDL_getenv.c b/jni/SDL2-2.0.3/src/stdlib/SDL_getenv.c index 782b8ccb..7936498c 100644 --- a/jni/SDL2-2.0.3/src/stdlib/SDL_getenv.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,11 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_DISABLE_ANALYZE_MACROS 1 +#endif + #include "../SDL_internal.h" #if defined(__WIN32__) diff --git a/jni/SDL2-2.0.3/src/stdlib/SDL_iconv.c b/jni/SDL2-2.0.3/src/stdlib/SDL_iconv.c index 5b9c2023..31efb426 100644 --- a/jni/SDL2-2.0.3/src/stdlib/SDL_iconv.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,11 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_DISABLE_ANALYZE_MACROS 1 +#endif + #include "../SDL_internal.h" /* This file contains portable iconv functions for SDL */ diff --git a/jni/SDL2-2.0.3/src/stdlib/SDL_malloc.c b/jni/SDL2-2.0.3/src/stdlib/SDL_malloc.c index 02456224..996e5d24 100644 --- a/jni/SDL2-2.0.3/src/stdlib/SDL_malloc.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,11 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_DISABLE_ANALYZE_MACROS 1 +#endif + #include "../SDL_internal.h" /* This file contains portable memory management functions for SDL */ diff --git a/jni/SDL2-2.0.3/src/stdlib/SDL_qsort.c b/jni/SDL2-2.0.3/src/stdlib/SDL_qsort.c index 8329a35e..0d197842 100644 --- a/jni/SDL2-2.0.3/src/stdlib/SDL_qsort.c +++ b/jni/SDL2-2.0.3/src/stdlib/SDL_qsort.c @@ -41,6 +41,11 @@ * * Gareth McCaughan Peterhouse Cambridge 1998 */ + +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_DISABLE_ANALYZE_MACROS 1 +#endif + #include "../SDL_internal.h" /* diff --git a/jni/SDL2-2.0.3/src/stdlib/SDL_stdlib.c b/jni/SDL2-2.0.3/src/stdlib/SDL_stdlib.c index b1de63d2..a488af26 100644 --- a/jni/SDL2-2.0.3/src/stdlib/SDL_stdlib.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,11 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_DISABLE_ANALYZE_MACROS 1 +#endif + #include "../SDL_internal.h" /* This file contains portable stdlib functions for SDL */ @@ -273,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/jni/SDL2-2.0.3/src/stdlib/SDL_string.c b/jni/SDL2-2.0.3/src/stdlib/SDL_string.c index 84285865..68d88ece 100644 --- a/jni/SDL2-2.0.3/src/stdlib/SDL_string.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,15 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#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/jni/SDL2-2.0.3/src/test/SDL_test_assert.c b/jni/SDL2-2.0.3/src/test/SDL_test_assert.c index 691453f0..12eca146 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_assert.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_common.c b/jni/SDL2-2.0.3/src/test/SDL_test_common.c index d05dda47..2f06a794 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_common.c +++ b/jni/SDL2-2.0.3/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 @@ -1105,8 +1105,8 @@ SDLTest_PrintEvent(SDL_Event * event) event->button.windowID); break; case SDL_MOUSEWHEEL: - SDL_Log("SDL EVENT: Mouse: wheel scrolled %d in x and %d in y in window %d", - event->wheel.x, event->wheel.y, event->wheel.windowID); + SDL_Log("SDL EVENT: Mouse: wheel scrolled %d in x and %d in y (reversed: %d) in window %d", + event->wheel.x, event->wheel.y, event->wheel.direction, event->wheel.windowID); break; case SDL_JOYDEVICEADDED: SDL_Log("SDL EVENT: Joystick index %d attached", @@ -1203,6 +1203,15 @@ SDLTest_PrintEvent(SDL_Event * event) event->tfinger.x, event->tfinger.y, event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure); break; + case SDL_DOLLARGESTURE: + 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, (Sint64) event->dgesture.gestureId); + break; + case SDL_MULTIGESTURE: + SDL_Log("SDL_EVENT: Multi gesture fingers: %d", event->mgesture.numFingers); + break; case SDL_RENDER_DEVICE_RESET: SDL_Log("SDL EVENT: render device reset"); @@ -1218,7 +1227,7 @@ SDLTest_PrintEvent(SDL_Event * event) SDL_Log("SDL EVENT: User event %d", event->user.code); break; default: - SDL_Log("Unknown event %d", event->type); + SDL_Log("Unknown event %04x", event->type); break; } } diff --git a/jni/SDL2-2.0.3/src/test/SDL_test_compare.c b/jni/SDL2-2.0.3/src/test/SDL_test_compare.c index de704166..9f74c44d 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_compare.c +++ b/jni/SDL2-2.0.3/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 @@ -43,6 +43,7 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int bpp, bpp_reference; Uint8 *p, *p_reference; int dist; + int sampleErrorX, sampleErrorY, sampleDist; Uint8 R, G, B, A; Uint8 Rd, Gd, Bd, Ad; char imageFilename[128]; @@ -86,6 +87,11 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, /* Allow some difference in blending accuracy */ if (dist > allowable_error) { ret++; + if (ret == 1) { + sampleErrorX = i; + sampleErrorY = j; + sampleDist = dist; + } } } } @@ -96,6 +102,8 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, /* Save test image and reference for analysis on failures */ _CompareSurfaceCount++; if (ret != 0) { + SDLTest_LogError("Comparison of pixels with allowable error of %i failed %i times.", allowable_error, ret); + SDLTest_LogError("First detected occurrence at position %i,%i with a squared RGB-difference of %i.", sampleErrorX, sampleErrorY, sampleDist); SDL_snprintf(imageFilename, 127, "CompareSurfaces%04d_TestOutput.bmp", _CompareSurfaceCount); SDL_SaveBMP(surface, imageFilename); SDL_snprintf(referenceFilename, 127, "CompareSurfaces%04d_Reference.bmp", _CompareSurfaceCount); diff --git a/jni/SDL2-2.0.3/src/test/SDL_test_crc32.c b/jni/SDL2-2.0.3/src/test/SDL_test_crc32.c index dafe7229..7aa0a68f 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_crc32.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_font.c b/jni/SDL2-2.0.3/src/test/SDL_test_font.c index a6bc40ce..4be29f11 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_font.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_fuzzer.c b/jni/SDL2-2.0.3/src/test/SDL_test_fuzzer.c index 963fc10b..9fad1785 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_fuzzer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_harness.c b/jni/SDL2-2.0.3/src/test/SDL_test_harness.c index 9ad2697f..6dde93f8 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_harness.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_imageBlit.c b/jni/SDL2-2.0.3/src/test/SDL_test_imageBlit.c index d4c74fb4..1b9ed7bf 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_imageBlit.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_imageBlitBlend.c b/jni/SDL2-2.0.3/src/test/SDL_test_imageBlitBlend.c index f849d730..963520bd 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_imageBlitBlend.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_imageFace.c b/jni/SDL2-2.0.3/src/test/SDL_test_imageFace.c index 74fa8341..37498d87 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_imageFace.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_imagePrimitives.c b/jni/SDL2-2.0.3/src/test/SDL_test_imagePrimitives.c index d2aafcbe..5576d3d2 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_imagePrimitives.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_imagePrimitivesBlend.c b/jni/SDL2-2.0.3/src/test/SDL_test_imagePrimitivesBlend.c index cfe189a0..c8e19930 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_imagePrimitivesBlend.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_log.c b/jni/SDL2-2.0.3/src/test/SDL_test_log.c index 6c076aac..ed7139b6 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_log.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_md5.c b/jni/SDL2-2.0.3/src/test/SDL_test_md5.c index 8467ccbc..291ad6b2 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_md5.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/test/SDL_test_random.c b/jni/SDL2-2.0.3/src/test/SDL_test_random.c index bc434183..088c301a 100644 --- a/jni/SDL2-2.0.3/src/test/SDL_test_random.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/SDL_systhread.h b/jni/SDL2-2.0.3/src/thread/SDL_systhread.h index 9c9409a5..d3eab1f3 100644 --- a/jni/SDL2-2.0.3/src/thread/SDL_systhread.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/SDL_thread.c b/jni/SDL2-2.0.3/src/thread/SDL_thread.c index 3724f4f3..8bc37fac 100644 --- a/jni/SDL2-2.0.3/src/thread/SDL_thread.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/SDL_thread_c.h b/jni/SDL2-2.0.3/src/thread/SDL_thread_c.h index 85ef5cce..2df71254 100644 --- a/jni/SDL2-2.0.3/src/thread/SDL_thread_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_syscond.c b/jni/SDL2-2.0.3/src/thread/generic/SDL_syscond.c index 64cc6340..6e7f9b33 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_syscond.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_sysmutex.c b/jni/SDL2-2.0.3/src/thread/generic/SDL_sysmutex.c index ddcc8cdf..0c7a8514 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_sysmutex.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_sysmutex_c.h b/jni/SDL2-2.0.3/src/thread/generic/SDL_sysmutex_c.h index f868fade..7481b665 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_sysmutex_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_syssem.c b/jni/SDL2-2.0.3/src/thread/generic/SDL_syssem.c index c7220a2a..cae084db 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_syssem.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_systhread.c b/jni/SDL2-2.0.3/src/thread/generic/SDL_systhread.c index 6cd29f76..b248165f 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_systhread.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_systhread_c.h b/jni/SDL2-2.0.3/src/thread/generic/SDL_systhread_c.h index 38e8b208..30ba69ea 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_systhread_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/generic/SDL_systls.c b/jni/SDL2-2.0.3/src/thread/generic/SDL_systls.c index b73d901f..99bfce77 100644 --- a/jni/SDL2-2.0.3/src/thread/generic/SDL_systls.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/psp/SDL_syscond.c b/jni/SDL2-2.0.3/src/thread/psp/SDL_syscond.c index 1abd9a3d..d4ff59d5 100644 --- a/jni/SDL2-2.0.3/src/thread/psp/SDL_syscond.c +++ b/jni/SDL2-2.0.3/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 @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_THREAD_PSP + /* An implementation of condition variables using semaphores and mutexes */ /* This implementation borrows heavily from the BeOS condition variable @@ -217,4 +219,6 @@ SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); } +#endif /* SDL_THREAD_PSP */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/thread/psp/SDL_sysmutex.c b/jni/SDL2-2.0.3/src/thread/psp/SDL_sysmutex.c index 478575b3..e0f411ea 100644 --- a/jni/SDL2-2.0.3/src/thread/psp/SDL_sysmutex.c +++ b/jni/SDL2-2.0.3/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 @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_THREAD_PSP + /* An implementation of mutexes using semaphores */ #include "SDL_thread.h" @@ -129,4 +131,6 @@ SDL_mutexV(SDL_mutex * mutex) #endif /* SDL_THREADS_DISABLED */ } +#endif /* SDL_THREAD_PSP */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/thread/psp/SDL_sysmutex_c.h b/jni/SDL2-2.0.3/src/thread/psp/SDL_sysmutex_c.h index f868fade..7481b665 100644 --- a/jni/SDL2-2.0.3/src/thread/psp/SDL_sysmutex_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/psp/SDL_syssem.c b/jni/SDL2-2.0.3/src/thread/psp/SDL_syssem.c index 27d3251a..cfbbe433 100644 --- a/jni/SDL2-2.0.3/src/thread/psp/SDL_syssem.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,9 @@ 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_THREAD_PSP /* Semaphore functions for the PSP. */ @@ -76,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"); @@ -152,5 +155,7 @@ int SDL_SemPost(SDL_sem *sem) return 0; } +#endif /* SDL_THREAD_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/jni/SDL2-2.0.3/src/thread/psp/SDL_systhread.c b/jni/SDL2-2.0.3/src/thread/psp/SDL_systhread.c index d2fbeeb2..95141cc8 100644 --- a/jni/SDL2-2.0.3/src/thread/psp/SDL_systhread.c +++ b/jni/SDL2-2.0.3/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 @@ -18,7 +18,9 @@ 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_THREAD_PSP /* PSP thread management routines for SDL */ @@ -104,5 +106,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) } +#endif /* SDL_THREAD_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/jni/SDL2-2.0.3/src/thread/psp/SDL_systhread_c.h b/jni/SDL2-2.0.3/src/thread/psp/SDL_systhread_c.h index 4f9dac24..2c5de1ba 100644 --- a/jni/SDL2-2.0.3/src/thread/psp/SDL_systhread_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/pthread/SDL_syscond.c b/jni/SDL2-2.0.3/src/thread/pthread/SDL_syscond.c index c15df863..2b0e0a53 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_syscond.c +++ b/jni/SDL2-2.0.3/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 @@ -21,6 +21,7 @@ #include "../../SDL_internal.h" #include +#include #include #include #include @@ -98,17 +99,26 @@ int SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) { int retval; +#ifndef HAVE_CLOCK_GETTIME struct timeval delta; +#endif struct timespec abstime; if (!cond) { return SDL_SetError("Passed a NULL condition variable"); } +#ifdef HAVE_CLOCK_GETTIME + clock_gettime(CLOCK_REALTIME, &abstime); + + abstime.tv_nsec += (ms % 1000) * 1000000; + abstime.tv_sec += ms / 1000; +#else gettimeofday(&delta, NULL); abstime.tv_sec = delta.tv_sec + (ms / 1000); abstime.tv_nsec = (delta.tv_usec + (ms % 1000) * 1000) * 1000; +#endif if (abstime.tv_nsec > 1000000000) { abstime.tv_sec += 1; abstime.tv_nsec -= 1000000000; diff --git a/jni/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex.c b/jni/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex.c index 8303c619..d7fa982c 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex_c.h b/jni/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex_c.h index bf69bcd1..475275a2 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/pthread/SDL_syssem.c b/jni/SDL2-2.0.3/src/thread/pthread/SDL_syssem.c index 6d84e1b8..a89a262a 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_syssem.c +++ b/jni/SDL2-2.0.3/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,10 +20,14 @@ */ #include "../../SDL_internal.h" +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #include #include #include +#include #include "SDL_thread.h" #include "SDL_timer.h" @@ -102,7 +106,9 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { int retval; #ifdef HAVE_SEM_TIMEDWAIT +#ifndef HAVE_CLOCK_GETTIME struct timeval now; +#endif struct timespec ts_timeout; #else Uint32 end; @@ -125,22 +131,26 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) * a lapse of time, but until we reach a certain time. * This time is now plus the timeout. */ +#ifdef HAVE_CLOCK_GETTIME + clock_gettime(CLOCK_REALTIME, &ts_timeout); + + /* Add our timeout to current time */ + ts_timeout.tv_nsec += (timeout % 1000) * 1000000; + ts_timeout.tv_sec += timeout / 1000; +#else gettimeofday(&now, NULL); /* Add our timeout to current time */ - now.tv_usec += (timeout % 1000) * 1000; - now.tv_sec += timeout / 1000; + ts_timeout.tv_sec = now.tv_sec + (timeout / 1000); + ts_timeout.tv_nsec = (now.tv_usec + (timeout % 1000) * 1000) * 1000; +#endif /* Wrap the second if needed */ - if ( now.tv_usec >= 1000000 ) { - now.tv_usec -= 1000000; - now.tv_sec ++; + if (ts_timeout.tv_nsec > 1000000000) { + ts_timeout.tv_sec += 1; + ts_timeout.tv_nsec -= 1000000000; } - /* Convert to timespec */ - ts_timeout.tv_sec = now.tv_sec; - ts_timeout.tv_nsec = now.tv_usec * 1000; - /* Wait. */ do { retval = sem_timedwait(&sem->sem, &ts_timeout); diff --git a/jni/SDL2-2.0.3/src/thread/pthread/SDL_systhread.c b/jni/SDL2-2.0.3/src/thread/pthread/SDL_systhread.c index 6eaf20ea..14eee8de 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_systhread.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/pthread/SDL_systhread_c.h b/jni/SDL2-2.0.3/src/thread/pthread/SDL_systhread_c.h index eedb7d1f..3a25f47a 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_systhread_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/pthread/SDL_systls.c b/jni/SDL2-2.0.3/src/thread/pthread/SDL_systls.c index 09a27904..0440af57 100644 --- a/jni/SDL2-2.0.3/src/thread/pthread/SDL_systls.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_syscond.cpp b/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_syscond.cpp index e9da82a3..69e10685 100644 --- a/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_syscond.cpp +++ b/jni/SDL2-2.0.3/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 @@ -128,7 +128,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) } try { - std::unique_lock cpp_lock(mutex->cpp_mutex, std::defer_lock_t()); + std::unique_lock cpp_lock(mutex->cpp_mutex, std::adopt_lock_t()); if (ms == SDL_MUTEX_MAXWAIT) { cond->cpp_cond.wait( cpp_lock diff --git a/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_sysmutex.cpp b/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_sysmutex.cpp index 4b60fb1d..da411612 100644 --- a/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_sysmutex.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_sysmutex_c.h b/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_sysmutex_c.h index 6bbd9dcd..d7b5b218 100644 --- a/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_sysmutex_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_systhread.cpp b/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_systhread.cpp index 5de700ab..ab8e1505 100644 --- a/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_systhread.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_systhread_c.h b/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_systhread_c.h index a0a338f5..d3affedc 100644 --- a/jni/SDL2-2.0.3/src/thread/stdcpp/SDL_systhread_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/windows/SDL_sysmutex.c b/jni/SDL2-2.0.3/src/thread/windows/SDL_sysmutex.c index 8333e11b..3b75ded8 100644 --- a/jni/SDL2-2.0.3/src/thread/windows/SDL_sysmutex.c +++ b/jni/SDL2-2.0.3/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 @@ -45,7 +45,11 @@ SDL_CreateMutex(void) if (mutex) { /* Initialize */ /* On SMP systems, a non-zero spin count generally helps performance */ +#if __WINRT__ + InitializeCriticalSectionEx(&mutex->cs, 2000, 0); +#else InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); +#endif } else { SDL_OutOfMemory(); } diff --git a/jni/SDL2-2.0.3/src/thread/windows/SDL_syssem.c b/jni/SDL2-2.0.3/src/thread/windows/SDL_syssem.c index a4f75f5c..1f0a8dfc 100644 --- a/jni/SDL2-2.0.3/src/thread/windows/SDL_syssem.c +++ b/jni/SDL2-2.0.3/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 @@ -45,7 +45,11 @@ SDL_CreateSemaphore(Uint32 initial_value) sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); if (sem) { /* Create the semaphore, with max value 32K */ +#if __WINRT__ + sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS); +#else sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL); +#endif sem->count = initial_value; if (!sem->id) { SDL_SetError("Couldn't create semaphore"); @@ -86,7 +90,11 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) } else { dwMilliseconds = (DWORD) timeout; } +#if __WINRT__ + switch (WaitForSingleObjectEx(sem->id, dwMilliseconds, FALSE)) { +#else switch (WaitForSingleObject(sem->id, dwMilliseconds)) { +#endif case WAIT_OBJECT_0: InterlockedDecrement(&sem->count); retval = 0; diff --git a/jni/SDL2-2.0.3/src/thread/windows/SDL_systhread.c b/jni/SDL2-2.0.3/src/thread/windows/SDL_systhread.c index 79c40b16..9217ebc3 100644 --- a/jni/SDL2-2.0.3/src/thread/windows/SDL_systhread.c +++ b/jni/SDL2-2.0.3/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 @@ -106,7 +106,7 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) { -#elif defined(__CYGWIN__) +#elif defined(__CYGWIN__) || defined(__WINRT__) int SDL_SYS_CreateThread(SDL_Thread * thread, void *args) { @@ -230,7 +230,11 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) void SDL_SYS_WaitThread(SDL_Thread * thread) { +#if __WINRT__ + WaitForSingleObjectEx(thread->handle, INFINITE, FALSE); +#else WaitForSingleObject(thread->handle, INFINITE); +#endif CloseHandle(thread->handle); } diff --git a/jni/SDL2-2.0.3/src/thread/windows/SDL_systhread_c.h b/jni/SDL2-2.0.3/src/thread/windows/SDL_systhread_c.h index f3c78e99..0beafe88 100644 --- a/jni/SDL2-2.0.3/src/thread/windows/SDL_systhread_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/thread/windows/SDL_systls.c b/jni/SDL2-2.0.3/src/thread/windows/SDL_systls.c index 6ceadaa1..67c84741 100644 --- a/jni/SDL2-2.0.3/src/thread/windows/SDL_systls.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/timer/SDL_timer.c b/jni/SDL2-2.0.3/src/timer/SDL_timer.c index 3ec1291b..2e5e544c 100644 --- a/jni/SDL2-2.0.3/src/timer/SDL_timer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/timer/SDL_timer_c.h b/jni/SDL2-2.0.3/src/timer/SDL_timer_c.h index 8d563cff..ab1e16ac 100644 --- a/jni/SDL2-2.0.3/src/timer/SDL_timer_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/timer/dummy/SDL_systimer.c b/jni/SDL2-2.0.3/src/timer/dummy/SDL_systimer.c index 57899ae9..0a63bfab 100644 --- a/jni/SDL2-2.0.3/src/timer/dummy/SDL_systimer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/timer/haiku/SDL_systimer.c b/jni/SDL2-2.0.3/src/timer/haiku/SDL_systimer.c index 685f72a8..ea736ba7 100644 --- a/jni/SDL2-2.0.3/src/timer/haiku/SDL_systimer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/timer/psp/SDL_systimer.c b/jni/SDL2-2.0.3/src/timer/psp/SDL_systimer.c index b706f449..ece71d37 100644 --- a/jni/SDL2-2.0.3/src/timer/psp/SDL_systimer.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,9 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "../../SDL_internal.h" + +#ifdef SDL_TIMERS_PSP #include "SDL_thread.h" #include "SDL_timer.h" @@ -82,5 +85,7 @@ void SDL_Delay(Uint32 ms) sceKernelDelayThreadCB(ms * 1000); } +#endif /* SDL_TIMERS_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/jni/SDL2-2.0.3/src/timer/unix/SDL_systimer.c b/jni/SDL2-2.0.3/src/timer/unix/SDL_systimer.c index cace8661..98917214 100644 --- a/jni/SDL2-2.0.3/src/timer/unix/SDL_systimer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/timer/windows/SDL_systimer.c b/jni/SDL2-2.0.3/src/timer/windows/SDL_systimer.c index 07561636..a213be00 100644 --- a/jni/SDL2-2.0.3/src/timer/windows/SDL_systimer.c +++ b/jni/SDL2-2.0.3/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,23 +167,30 @@ SDL_GetPerformanceFrequency(void) return frequency.QuadPart; } -#ifdef __WINRT__ -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/jni/SDL2-2.0.3/src/video/SDL_RLEaccel.c b/jni/SDL2-2.0.3/src/video/SDL_RLEaccel.c index 1f0f7507..b9f1426d 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_RLEaccel.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_RLEaccel_c.h b/jni/SDL2-2.0.3/src/video/SDL_RLEaccel_c.h index 271faa0b..ed980f98 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_RLEaccel_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit.c b/jni/SDL2-2.0.3/src/video/SDL_blit.c index fe30923b..1c8b0735 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit.h b/jni/SDL2-2.0.3/src/video/SDL_blit.h index f12018d8..6b8effff 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_0.c b/jni/SDL2-2.0.3/src/video/SDL_blit_0.c index a820fb37..64e20f8e 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_0.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_1.c b/jni/SDL2-2.0.3/src/video/SDL_blit_1.c index 4dfcabda..53f486b9 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_1.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_A.c b/jni/SDL2-2.0.3/src/video/SDL_blit_A.c index d3a9e814..4ba7c82c 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_A.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_N.c b/jni/SDL2-2.0.3/src/video/SDL_blit_N.c index 41615be5..c0c7fbfb 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_N.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_auto.c b/jni/SDL2-2.0.3/src/video/SDL_blit_auto.c index 8b7c8e9b..987d12d8 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_auto.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_auto.h b/jni/SDL2-2.0.3/src/video/SDL_blit_auto.h index 369e12fc..7ba689c7 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_auto.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_copy.c b/jni/SDL2-2.0.3/src/video/SDL_blit_copy.c index 5c62d633..3ec2e7eb 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_copy.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_copy.h b/jni/SDL2-2.0.3/src/video/SDL_blit_copy.h index 8b6950ce..73defa2f 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_copy.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_slow.c b/jni/SDL2-2.0.3/src/video/SDL_blit_slow.c index ca644adc..9082f7a6 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_slow.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_blit_slow.h b/jni/SDL2-2.0.3/src/video/SDL_blit_slow.h index c1786e0b..5bd0598a 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_blit_slow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_bmp.c b/jni/SDL2-2.0.3/src/video/SDL_bmp.c index fcc48c6d..3ea2dd54 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_bmp.c +++ b/jni/SDL2-2.0.3/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 @@ -306,16 +306,19 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) biClrUsed = 1 << biBitCount; } if ((int) biClrUsed > palette->ncolors) { - palette->ncolors = biClrUsed; - palette->colors = + SDL_Color *colors; + int ncolors = biClrUsed; + colors = (SDL_Color *) SDL_realloc(palette->colors, - palette->ncolors * + ncolors * sizeof(*palette->colors)); - if (!palette->colors) { + if (!colors) { SDL_OutOfMemory(); was_error = SDL_TRUE; goto done; } + palette->ncolors = ncolors; + palette->colors = colors; } else if ((int) biClrUsed < palette->ncolors) { palette->ncolors = biClrUsed; } @@ -528,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/jni/SDL2-2.0.3/src/video/SDL_clipboard.c b/jni/SDL2-2.0.3/src/video/SDL_clipboard.c index a3b38e04..feff8eb3 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_clipboard.c +++ b/jni/SDL2-2.0.3/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 @@ -29,6 +29,10 @@ SDL_SetClipboardText(const char *text) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); + if (!_this) { + return SDL_SetError("Video subsystem must be initialized to set clipboard text"); + } + if (!text) { text = ""; } @@ -46,6 +50,11 @@ SDL_GetClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); + if (!_this) { + SDL_SetError("Video subsystem must be initialized to get clipboard text"); + return SDL_strdup(""); + } + if (_this->GetClipboardText) { return _this->GetClipboardText(_this); } else { @@ -62,6 +71,11 @@ SDL_HasClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); + if (!_this) { + SDL_SetError("Video subsystem must be initialized to check clipboard text"); + return SDL_FALSE; + } + if (_this->HasClipboardText) { return _this->HasClipboardText(_this); } else { diff --git a/jni/SDL2-2.0.3/src/video/SDL_egl.c b/jni/SDL2-2.0.3/src/video/SDL_egl.c index a93b7b71..7b1c690e 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_egl.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_egl_c.h b/jni/SDL2-2.0.3/src/video/SDL_egl_c.h index ef58b18e..b46cfca6 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_egl_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_fillrect.c b/jni/SDL2-2.0.3/src/video/SDL_fillrect.c index 5f343eaf..2282d2b1 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_fillrect.c +++ b/jni/SDL2-2.0.3/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; } @@ -251,6 +257,10 @@ SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color) rect = &clipped; } else { rect = &dst->clip_rect; + /* Don't attempt to fill if the surface's clip_rect is empty */ + if (SDL_RectEmpty(rect)) { + return 0; + } } /* Perform software fill */ diff --git a/jni/SDL2-2.0.3/src/video/SDL_pixels.c b/jni/SDL2-2.0.3/src/video/SDL_pixels.c index 0858daad..6b96125b 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_pixels.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_pixels_c.h b/jni/SDL2-2.0.3/src/video/SDL_pixels_c.h index de2916ff..3d2deb1a 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_pixels_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_rect.c b/jni/SDL2-2.0.3/src/video/SDL_rect.c index a0456bd6..b2295195 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_rect.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_rect_c.h b/jni/SDL2-2.0.3/src/video/SDL_rect_c.h index e6be3292..bc639ae2 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_rect_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_shape.c b/jni/SDL2-2.0.3/src/video/SDL_shape.c index 147c60a5..3309f6db 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_shape.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_shape_internals.h b/jni/SDL2-2.0.3/src/video/SDL_shape_internals.h index b5413e1e..4eda9dd1 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_shape_internals.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_stretch.c b/jni/SDL2-2.0.3/src/video/SDL_stretch.c index a4faacaf..d3abaed5 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_stretch.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/SDL_surface.c b/jni/SDL2-2.0.3/src/video/SDL_surface.c index fcd78870..ef581fa9 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_surface.c +++ b/jni/SDL2-2.0.3/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 @@ -741,15 +741,15 @@ SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, dst_y0 += dst->clip_rect.y; dst_y1 += dst->clip_rect.y; - final_src.x = SDL_floor(src_x0 + 0.5); - final_src.y = SDL_floor(src_y0 + 0.5); - final_src.w = SDL_floor(src_x1 - src_x0 + 1.5); - final_src.h = SDL_floor(src_y1 - src_y0 + 1.5); + final_src.x = (int)SDL_floor(src_x0 + 0.5); + final_src.y = (int)SDL_floor(src_y0 + 0.5); + final_src.w = (int)SDL_floor(src_x1 - src_x0 + 1.5); + final_src.h = (int)SDL_floor(src_y1 - src_y0 + 1.5); - final_dst.x = SDL_floor(dst_x0 + 0.5); - final_dst.y = SDL_floor(dst_y0 + 0.5); - final_dst.w = SDL_floor(dst_x1 - dst_x0 + 1.5); - final_dst.h = SDL_floor(dst_y1 - dst_y0 + 1.5); + final_dst.x = (int)SDL_floor(dst_x0 + 0.5); + final_dst.y = (int)SDL_floor(dst_y0 + 0.5); + final_dst.w = (int)SDL_floor(dst_x1 - dst_x0 + 1.5); + final_dst.h = (int)SDL_floor(dst_y1 - dst_y0 + 1.5); if (final_dst.w < 0) final_dst.w = 0; diff --git a/jni/SDL2-2.0.3/src/video/SDL_sysvideo.h b/jni/SDL2-2.0.3/src/video/SDL_sysvideo.h index cdb21b5e..5e3e1526 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_sysvideo.h +++ b/jni/SDL2-2.0.3/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; @@ -394,6 +401,9 @@ extern VideoBootStrap NACL_bootstrap; #if SDL_VIDEO_DRIVER_VIVANTE extern VideoBootStrap VIVANTE_bootstrap; #endif +#if SDL_VIDEO_DRIVER_EMSCRIPTEN +extern VideoBootStrap Emscripten_bootstrap; +#endif extern SDL_VideoDevice *SDL_GetVideoDevice(void); extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); @@ -418,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/jni/SDL2-2.0.3/src/video/SDL_video.c b/jni/SDL2-2.0.3/src/video/SDL_video.c index 43d674fe..753eac98 100644 --- a/jni/SDL2-2.0.3/src/video/SDL_video.c +++ b/jni/SDL2-2.0.3/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 @@ -98,6 +102,9 @@ static VideoBootStrap *bootstrap[] = { #if SDL_VIDEO_DRIVER_NACL &NACL_bootstrap, #endif +#if SDL_VIDEO_DRIVER_EMSCRIPTEN + &Emscripten_bootstrap, +#endif #if SDL_VIDEO_DRIVER_DUMMY &DUMMY_bootstrap, #endif @@ -680,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) { @@ -1100,22 +1125,72 @@ SDL_RestoreMousePosition(SDL_Window *window) } } -static void +#if __WINRT__ +extern Uint32 WINRT_DetectWindowFlags(SDL_Window * window); +#endif + +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 the window is going away and no resolution change is necessary, + do nothing, or else we may trigger an ugly double-transition + */ + if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) + return 0; + + /* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */ + if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) { + if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) { + return -1; + } + } else if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)) { + display = SDL_GetDisplayForWindow(window); + SDL_SetDisplayModeForDisplay(display, NULL); + if (_this->SetWindowFullscreen) { + _this->SetWindowFullscreen(_this, window, display, SDL_FALSE); + } + } + if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) { + if (Cocoa_IsWindowInFullscreenSpace(window) != fullscreen) { + return -1; + } window->last_fullscreen_flags = window->flags; - return; + return 0; + } +#elif __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10) + /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen + or not. The user can choose this, via OS-provided UI, but this can't + be set programmatically. + + Just look at what SDL's WinRT video backend code detected with regards + to fullscreen (being active, or not), and figure out a return/error code + from that. + */ + if (fullscreen == !(WINRT_DetectWindowFlags(window) & FULLSCREEN_MASK)) { + /* Uh oh, either: + 1. fullscreen was requested, and we're already windowed + 2. windowed-mode was requested, and we're already fullscreen + + WinRT 8.x can't resolve either programmatically, so we're + giving up. + */ + return -1; + } else { + /* Whatever was requested, fullscreen or windowed mode, is already + in-place. + */ + return 0; } #endif @@ -1132,7 +1207,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; } } @@ -1161,9 +1236,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) { @@ -1182,7 +1261,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) SDL_RestoreMousePosition(other); window->last_fullscreen_flags = window->flags; - return; + return 0; } } } @@ -1202,6 +1281,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) SDL_RestoreMousePosition(window); window->last_fullscreen_flags = window->flags; + return 0; } #define CREATE_FLAGS \ @@ -1253,6 +1333,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; @@ -1319,6 +1405,18 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) return NULL; } +#if __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10) + /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen + or not. The user can choose this, via OS-provided UI, but this can't + be set programmatically. + + Just look at what SDL's WinRT video backend code detected with regards + to fullscreen (being active, or not), and figure out a return/error code + from that. + */ + flags = window->flags; +#endif + if (title) { SDL_SetWindowTitle(window, title); } @@ -1370,8 +1468,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) { @@ -1411,8 +1507,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; @@ -1426,17 +1520,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) { @@ -1489,11 +1583,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); @@ -1604,13 +1695,14 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y) CHECK_WINDOW_MAGIC(window,); if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) { - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - int displayIndex; + int displayIndex = (x & 0xFFFF); SDL_Rect bounds; + if (displayIndex > _this->num_displays) { + displayIndex = 0; + } SDL_zero(bounds); - displayIndex = SDL_GetIndexOfDisplay(display); SDL_GetDisplayBounds(displayIndex, &bounds); if (SDL_WINDOWPOS_ISCENTERED(x)) { x = bounds.x + (bounds.w - window->w) / 2; @@ -1649,12 +1741,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; @@ -1915,6 +2026,7 @@ SDL_RestoreWindow(SDL_Window * window) int SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) { + Uint32 oldflags; CHECK_WINDOW_MAGIC(window, -1); flags &= FULLSCREEN_MASK; @@ -1924,12 +2036,17 @@ SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) } /* clear the previous flags and OR in the new ones */ + oldflags = window->flags & FULLSCREEN_MASK; window->flags &= ~FULLSCREEN_MASK; window->flags |= flags; - SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)); - - return 0; + if (SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)) == 0) { + return 0; + } + + window->flags &= ~FULLSCREEN_MASK; + window->flags |= oldflags; + return -1; } static SDL_Surface * @@ -2041,6 +2158,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) { @@ -2107,14 +2225,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); } } @@ -2139,8 +2273,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 @@ -2633,6 +2774,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; } @@ -2739,6 +2881,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; @@ -2753,19 +2898,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 */ @@ -2773,15 +2930,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: @@ -2796,9 +2965,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 @@ -2828,38 +3005,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: @@ -2918,7 +3094,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) { @@ -3327,6 +3523,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; @@ -3448,4 +3645,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/jni/SDL2-2.0.3/src/video/android/SDL_androidclipboard.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidclipboard.c index dcac2e70..6a456472 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidclipboard.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidclipboard.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidclipboard.h index c1ab140c..600771b9 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidclipboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidevents.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidevents.c index 2662d1b3..f15180a9 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidevents.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidevents.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidevents.h index 547338d7..888a593c 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidevents.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidgl.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidgl.c index b452b5c7..5bf8d1a1 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidgl.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidkeyboard.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidkeyboard.c index 5008cfde..a6123517 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidkeyboard.c +++ b/jni/SDL2-2.0.3/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 */ @@ -263,6 +263,59 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_BRIGHTNESSDOWN, /* AKEYCODE_BRIGHTNESS_DOWN */ SDL_SCANCODE_BRIGHTNESSUP, /* AKEYCODE_BRIGHTNESS_UP */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_AUDIO_TRACK */ + SDL_SCANCODE_SLEEP, /* AKEYCODE_SLEEP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WAKEUP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PAIRING */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_TOP_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_11 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_12 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LAST_CHANNEL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_DATA_SERVICE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOICE_ASSIST */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_RADIO_SERVICE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TELETEXT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_NUMBER_ENTRY */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TERRESTRIAL_ANALOG */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TERRESTRIAL_DIGITAL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_BS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_CS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_SERVICE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_NETWORK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_ANTENNA_CABLE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_3 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_4 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPOSITE_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPOSITE_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPONENT_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPONENT_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_VGA_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_ZOOM_MODE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_CONTENTS_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_MEDIA_CONTEXT_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TIMER_PROGRAMMING */ + SDL_SCANCODE_HELP, /* AKEYCODE_HELP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_PREVIOUS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_NEXT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_IN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_OUT */ + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_SKIP_FORWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_SKIP_BACKWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_STEP_FORWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_STEP_BACKWARD */ }; static SDL_Scancode diff --git a/jni/SDL2-2.0.3/src/video/android/SDL_androidkeyboard.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidkeyboard.h index 041987ac..3f643c30 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidkeyboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidmessagebox.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidmessagebox.c index a55afb37..1783b9cd 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidmessagebox.c +++ b/jni/SDL2-2.0.3/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 @@ -18,7 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ -#include "SDL_config.h" +#include "../../SDL_internal.h" #if SDL_VIDEO_DRIVER_ANDROID diff --git a/jni/SDL2-2.0.3/src/video/android/SDL_androidmessagebox.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidmessagebox.h index bc439cbe..b732a2a0 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidmessagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidmouse.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidmouse.c new file mode 100644 index 00000000..795b2aab --- /dev/null +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidmouse.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidmouse.h new file mode 100644 index 00000000..72b3deb3 --- /dev/null +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidtouch.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidtouch.c index 5f33429b..b7ba3860 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidtouch.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidtouch.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidtouch.h index 81a0cb50..73a934fe 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidtouch.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidvideo.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidvideo.c index 05c07537..983f3aa3 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidvideo.c +++ b/jni/SDL2-2.0.3/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 @@ -64,6 +64,8 @@ extern int Android_GLES_LoadLibrary(_THIS, const char *path); int Android_ScreenWidth = 0; int Android_ScreenHeight = 0; Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; +int Android_ScreenRate = 0; + SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL; /* Currently only one window */ @@ -84,6 +86,7 @@ Android_SuspendScreenSaver(_THIS) static void Android_DeleteDevice(SDL_VideoDevice * device) { + SDL_free(device->driverdata); SDL_free(device); } @@ -166,7 +169,7 @@ Android_VideoInit(_THIS) mode.format = Android_ScreenFormat; mode.w = Android_ScreenWidth; mode.h = Android_ScreenHeight; - mode.refresh_rate = 0; + mode.refresh_rate = Android_ScreenRate; mode.driverdata = NULL; if (SDL_AddBasicVideoDisplay(&mode) < 0) { return -1; @@ -185,15 +188,17 @@ Android_VideoInit(_THIS) void Android_VideoQuit(_THIS) { + Android_QuitTouch(); } /* This function gets called before VideoInit() */ void -Android_SetScreenResolution(int width, int height, Uint32 format) +Android_SetScreenResolution(int width, int height, Uint32 format, float rate) { Android_ScreenWidth = width; Android_ScreenHeight = height; Android_ScreenFormat = format; + Android_ScreenRate = rate; if (Android_Window) { SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height); diff --git a/jni/SDL2-2.0.3/src/video/android/SDL_androidvideo.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidvideo.h index ccd5d7a1..fc6e60e8 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidvideo.h +++ b/jni/SDL2-2.0.3/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 @@ -28,7 +28,7 @@ #include "../SDL_sysvideo.h" /* Called by the JNI layer when the screen changes size or format */ -extern void Android_SetScreenResolution(int width, int height, Uint32 format); +extern void Android_SetScreenResolution(int width, int height, Uint32 format, float rate); /* Private display data */ diff --git a/jni/SDL2-2.0.3/src/video/android/SDL_androidwindow.c b/jni/SDL2-2.0.3/src/video/android/SDL_androidwindow.c index 32446dd3..46eaeb2a 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidwindow.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/android/SDL_androidwindow.h b/jni/SDL2-2.0.3/src/video/android/SDL_androidwindow.h index 9228b0f5..aa9283bc 100644 --- a/jni/SDL2-2.0.3/src/video/android/SDL_androidwindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.h index 0a5e0dc0..d86a75ef 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.m index bf3b9095..73307445 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaevents.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaevents.h index 687cf647..f92a4a94 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaevents.h +++ b/jni/SDL2-2.0.3/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 @@ -25,6 +25,7 @@ extern void Cocoa_RegisterApp(void); extern void Cocoa_PumpEvents(_THIS); +extern void Cocoa_SuspendScreenSaver(_THIS); #endif /* _SDL_cocoaevents_h */ diff --git a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaevents.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaevents.m index 13aeb450..994da182 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaevents.m +++ b/jni/SDL2-2.0.3/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,12 @@ #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 +#define kIOPMAssertPreventUserIdleDisplaySleep kIOPMAssertionTypePreventUserIdleDisplaySleep +#endif @interface SDLApplication : NSApplication @@ -61,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; @@ -73,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; @@ -251,17 +314,26 @@ Cocoa_RegisterApp(void) { @autoreleasepool { /* This can get called more than once! Be careful what you initialize! */ - ProcessSerialNumber psn; - - if (!GetCurrentProcess(&psn)) { - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - SetFrontProcess(&psn); - } if (NSApp == nil) { [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:)]) { +#endif + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 + } else { + ProcessSerialNumber psn = {0, kCurrentProcess}; + TransformProcessType(&psn, kProcessTransformToForegroundApplication); + } +#endif + [NSApp activateIgnoringOtherApps:YES]; + } + if ([NSApp mainMenu] == nil) { CreateApplicationMenus(); } @@ -293,8 +365,8 @@ Cocoa_PumpEvents(_THIS) { @autoreleasepool { /* Update activity every 30 seconds to prevent screensaver */ - if (_this->suspend_screensaver) { - SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + if (_this->suspend_screensaver && !data->screensaver_use_iopm) { Uint32 now = SDL_GetTicks(); if (!data->screensaver_activity || SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) { @@ -336,6 +408,35 @@ Cocoa_PumpEvents(_THIS) } }} +void +Cocoa_SuspendScreenSaver(_THIS) +{ @autoreleasepool +{ + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + + if (!data->screensaver_use_iopm) { + return; + } + + if (data->screensaver_assertion) { + IOPMAssertionRelease(data->screensaver_assertion); + data->screensaver_assertion = 0; + } + + if (_this->suspend_screensaver) { + /* FIXME: this should ideally describe the real reason why the game + * called SDL_DisableScreenSaver. Note that the name is only meant to be + * seen by OS X power users. there's an additional optional human-readable + * (localized) reason parameter which we don't set. + */ + NSString *name = [GetApplicationName() stringByAppendingString:@" using SDL_DisableScreenSaver"]; + IOPMAssertionCreateWithDescription(kIOPMAssertPreventUserIdleDisplaySleep, + (CFStringRef) name, + NULL, NULL, NULL, 0, NULL, + &data->screensaver_assertion); + } +}} + #endif /* SDL_VIDEO_DRIVER_COCOA */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.h index a85f9b7b..e206bd3a 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.m index c621182b..39431876 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.m +++ b/jni/SDL2-2.0.3/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 @@ -24,6 +24,7 @@ #include "SDL_cocoavideo.h" +#include "../../events/SDL_events_c.h" #include "../../events/SDL_keyboard_c.h" #include "../../events/scancodes_darwin.h" @@ -398,7 +399,7 @@ HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags) } static void -UpdateKeymap(SDL_VideoData *data) +UpdateKeymap(SDL_VideoData *data, SDL_bool send_event) { TISInputSourceRef key_layout; const void *chr_data; @@ -454,6 +455,9 @@ UpdateKeymap(SDL_VideoData *data) } } SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); + if (send_event) { + SDL_SendKeymapChangedEvent(); + } return; } @@ -466,7 +470,7 @@ Cocoa_InitKeyboard(_THIS) { SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; - UpdateKeymap(data); + UpdateKeymap(data, SDL_FALSE); /* Set our own names for the platform-dependent but layout-independent keys */ /* This key is NumLock on the MacBook keyboard. :) */ @@ -564,7 +568,7 @@ Cocoa_HandleKeyEvent(_THIS, NSEvent *event) case NSKeyDown: if (![event isARepeat]) { /* See if we need to rebuild the keyboard layout */ - UpdateKeymap(data); + UpdateKeymap(data, SDL_TRUE); } SDL_SendKeyboardKey(SDL_PRESSED, code); diff --git a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamessagebox.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamessagebox.h index ff468a88..f9ac0c45 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamessagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamessagebox.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamessagebox.m index 5a8f7805..0998f792 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamessagebox.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.h index 4f8e8632..57c22ebd 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.m index b3025c4f..73b14ed7 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.h index 336b8404..89e68caa 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.m index 8b933c27..625d8f40 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.m +++ b/jni/SDL2-2.0.3/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 @@ -399,6 +421,13 @@ Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event) float x = -[event deltaX]; float y = [event deltaY]; + SDL_MouseWheelDirection direction = SDL_MOUSEWHEEL_NORMAL; + + if ([event respondsToSelector:@selector(isDirectionInvertedFromDevice)]) { + if ([event isDirectionInvertedFromDevice] == YES) { + direction = SDL_MOUSEWHEEL_FLIPPED; + } + } if (x > 0) { x += 0.9f; @@ -410,7 +439,7 @@ Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event) } else if (y < 0) { y -= 0.9f; } - SDL_SendMouseWheel(window, mouse->mouseID, (int)x, (int)y); + SDL_SendMouseWheel(window, mouse->mouseID, (int)x, (int)y, direction); } void diff --git a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamousetap.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamousetap.h index bf3e7383..f1041b18 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamousetap.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamousetap.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamousetap.m index c2742895..ca50ff96 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoamousetap.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.h index 14fd3ab4..6b18af1e 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.m index 0bbbbcb7..d8e9c901 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoashape.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoashape.h index 0ab9980e..e7fd185d 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoashape.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoashape.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoashape.m index 61d800b6..1dce5679 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoashape.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.h index 288c41fc..873f2573 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.h +++ b/jni/SDL2-2.0.3/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 @@ -26,6 +26,7 @@ #include "SDL_opengl.h" #include +#include #include #include "SDL_keycode.h" @@ -51,6 +52,9 @@ typedef struct SDL_VideoData SDLTranslatorResponder *fieldEdit; NSInteger clipboard_count; Uint32 screensaver_activity; + BOOL screensaver_use_iopm; + IOPMAssertionID screensaver_assertion; + } SDL_VideoData; /* Utility functions */ diff --git a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.m index ad4f14c2..c6b01296 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.m +++ b/jni/SDL2-2.0.3/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 @@ -76,6 +76,7 @@ Cocoa_CreateDevice(int devindex) device->GetDisplayModes = Cocoa_GetDisplayModes; device->SetDisplayMode = Cocoa_SetDisplayMode; device->PumpEvents = Cocoa_PumpEvents; + device->SuspendScreenSaver = Cocoa_SuspendScreenSaver; device->CreateWindow = Cocoa_CreateWindow; device->CreateWindowFrom = Cocoa_CreateWindowFrom; @@ -148,6 +149,9 @@ Cocoa_VideoInit(_THIS) const char *hint = SDL_GetHint(SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES); data->allow_spaces = ( (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) && (!hint || (*hint != '0')) ); + /* The IOPM assertion API can disable the screensaver as of 10.7. */ + data->screensaver_use_iopm = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6; + return 0; } diff --git a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.h b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.h index 65a2c2fc..ed56600f 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.m b/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.m index 29bba457..c815db54 100644 --- a/jni/SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.m +++ b/jni/SDL2-2.0.3/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 @@ -34,6 +34,7 @@ #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" #include "../../events/SDL_windowevents_c.h" +#include "../../events/SDL_dropevents_c.h" #include "SDL_cocoavideo.h" #include "SDL_cocoashape.h" #include "SDL_cocoamouse.h" @@ -52,15 +53,21 @@ #define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN) -@interface SDLWindow : NSWindow +@interface SDLWindow : NSWindow /* These are needed for borderless/fullscreen windows */ - (BOOL)canBecomeKeyWindow; - (BOOL)canBecomeMainWindow; - (void)sendEvent:(NSEvent *)event; - (void)doCommandBySelector:(SEL)aSelector; + +/* Handle drag-and-drop of files onto the SDL window. */ +- (NSDragOperation)draggingEntered:(id )sender; +- (BOOL)performDragOperation:(id )sender; +- (BOOL)wantsPeriodicDraggingUpdates; @end @implementation SDLWindow + - (BOOL)canBecomeKeyWindow { return YES; @@ -96,6 +103,73 @@ { /*NSLog(@"doCommandBySelector: %@\n", NSStringFromSelector(aSelector));*/ } + +- (NSDragOperation)draggingEntered:(id )sender +{ + if (([sender draggingSourceOperationMask] & NSDragOperationGeneric) == NSDragOperationGeneric) { + return NSDragOperationGeneric; + } + + return NSDragOperationNone; /* no idea what to do with this, reject it. */ +} + +- (BOOL)performDragOperation:(id )sender +{ @autoreleasepool +{ + 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. */ + } + + NSData *data = [pasteboard dataForType:desiredType]; + if (data == nil) { + return NO; + } + + SDL_assert([desiredType isEqualToString:NSFilenamesPboardType]); + NSArray *array = [pasteboard propertyListForType:@"NSFilenamesPboardType"]; + + for (NSString *path in array) { + NSURL *fileURL = [[NSURL fileURLWithPath:path] autorelease]; + NSNumber *isAlias = nil; + + /* 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 YES; +}} + +- (BOOL)wantsPeriodicDraggingUpdates +{ + return NO; +} + @end @@ -203,10 +277,13 @@ 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]; [center addObserver:self selector:@selector(windowDidExitFullScreen:) name:NSWindowDidExitFullScreenNotification object:window]; + [center addObserver:self selector:@selector(windowDidFailToEnterFullScreen:) name:@"NSWindowDidFailToEnterFullScreenNotification" object:window]; + [center addObserver:self selector:@selector(windowDidFailToExitFullScreen:) name:@"NSWindowDidFailToExitFullScreenNotification" object:window]; } else { [window setDelegate:self]; } @@ -322,7 +399,6 @@ SetWindowStyle(SDL_Window * window, unsigned int style) NSNotificationCenter *center; NSWindow *window = _data->nswindow; NSView *view = [window contentView]; - NSArray *windows = nil; center = [NSNotificationCenter defaultCenter]; @@ -334,10 +410,13 @@ 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]; [center removeObserver:self name:NSWindowDidExitFullScreenNotification object:window]; + [center removeObserver:self name:@"NSWindowDidFailToEnterFullScreenNotification" object:window]; + [center removeObserver:self name:@"NSWindowDidFailToExitFullScreenNotification" object:window]; } else { [window setDelegate:nil]; } @@ -350,25 +429,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 @@ -499,13 +559,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; @@ -550,6 +612,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; @@ -560,6 +638,22 @@ SetWindowStyle(SDL_Window * window, unsigned int style) inFullscreenTransition = YES; } +- (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification +{ + SDL_Window *window = _data->window; + + if (window->is_destroying) { + return; + } + + SetWindowStyle(window, GetWindowStyle(window)); + + isFullscreenSpace = NO; + inFullscreenTransition = NO; + + [self windowDidExitFullScreen:nil]; +} + - (void)windowDidEnterFullScreen:(NSNotification *)aNotification { SDL_Window *window = _data->window; @@ -588,12 +682,31 @@ SetWindowStyle(SDL_Window * window, unsigned int style) { SDL_Window *window = _data->window; - SetWindowStyle(window, GetWindowStyle(window)); + /* As of OS X 10.11, the window seems to need to be resizable when exiting + a Space, in order for it to resize back to its windowed-mode size. + */ + SetWindowStyle(window, GetWindowStyle(window) | NSResizableWindowMask); isFullscreenSpace = NO; inFullscreenTransition = YES; } +- (void)windowDidFailToExitFullScreen:(NSNotification *)aNotification +{ + SDL_Window *window = _data->window; + + if (window->is_destroying) { + return; + } + + SetWindowStyle(window, (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask)); + + isFullscreenSpace = YES; + inFullscreenTransition = NO; + + [self windowDidEnterFullScreen:nil]; +} + - (void)windowDidExitFullScreen:(NSNotification *)aNotification { SDL_Window *window = _data->window; @@ -601,6 +714,8 @@ SetWindowStyle(SDL_Window * window, unsigned int style) inFullscreenTransition = NO; + SetWindowStyle(window, GetWindowStyle(window)); + [nswindow setLevel:kCGNormalWindowLevel]; if (pendingWindowOperation == PENDING_OPERATION_ENTER_FULLSCREEN) { @@ -699,6 +814,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. */ } @@ -856,6 +979,25 @@ SetWindowStyle(SDL_Window * window, unsigned int style) - (void)touchesBeganWithEvent:(NSEvent *) theEvent { + NSSet *touches = [theEvent touchesMatchingPhase:NSTouchPhaseAny inView:nil]; + int existingTouchCount = 0; + + for (NSTouch* touch in touches) { + if ([touch phase] != NSTouchPhaseBegan) { + existingTouchCount++; + } + } + if (existingTouchCount == 0) { + SDL_TouchID touchID = (SDL_TouchID)(intptr_t)[[touches anyObject] device]; + int numFingers = SDL_GetNumTouchFingers(touchID); + DLog("Reset Lost Fingers: %d", numFingers); + for (--numFingers; numFingers >= 0; --numFingers) { + SDL_Finger* finger = SDL_GetTouchFinger(touchID, numFingers); + SDL_SendTouch(touchID, finger->id, SDL_FALSE, 0, 0, 0); + } + } + + DLog("Began Fingers: %lu .. existing: %d", (unsigned long)[touches count], existingTouchCount); [self handleTouches:NSTouchPhaseBegan withEvent:theEvent]; } @@ -880,10 +1022,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]; @@ -911,14 +1051,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]; @@ -949,8 +1104,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; @@ -965,8 +1120,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]; @@ -1028,16 +1181,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; @@ -1072,9 +1224,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]]; @@ -1090,7 +1240,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:)]) { @@ -1101,70 +1252,58 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window) [nswindow setContentView: contentView]; [contentView release]; - [pool release]; + /* Allow files and folders to be dragged onto the window by users */ + [nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]]; 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; @@ -1182,31 +1321,39 @@ 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; + NSRect rect; + Uint32 moveHack; - size.width = window->w; - size.height = window->h; - [nswindow setContentSize:size]; + /* Cocoa will resize the window from the bottom-left rather than the + * top-left when -[nswindow setContentSize:] is used, so we must set the + * entire frame based on the new size, in order to preserve the position. + */ + rect.origin.x = window->x; + rect.origin.y = window->y; + rect.size.width = window->w; + rect.size.height = window->h; + ConvertNSRect([nswindow screen], (window->flags & FULLSCREEN_MASK), &rect); + + moveHack = s_moveHack; + s_moveHack = 0; + [nswindow setFrame:[nswindow frameRectForContentRect:rect] display:YES]; + s_moveHack = moveHack; 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; @@ -1214,14 +1361,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; @@ -1229,14 +1374,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; @@ -1245,23 +1388,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; @@ -1274,28 +1415,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; @@ -1304,13 +1441,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]) { @@ -1318,8 +1454,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) @@ -1332,6 +1467,7 @@ Cocoa_RebuildWindow(SDL_WindowData * data, NSWindow * nswindow, unsigned style) [data->listener close]; data->nswindow = [[SDLWindow alloc] initWithContentRect:[[nswindow contentView] frame] styleMask:style backing:NSBackingStoreBuffered defer:NO screen:[nswindow screen]]; [data->nswindow setContentView:[nswindow contentView]]; + [data->nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]]; /* See comment in SetupWindowData. */ [data->nswindow setOneShot:NO]; [data->listener listen:data]; @@ -1343,21 +1479,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; @@ -1397,6 +1532,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)); } @@ -1431,9 +1571,7 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display } ScheduleContextUpdates(data); - - [pool release]; -} +}} int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) @@ -1505,8 +1643,10 @@ Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) } if ( data && (window->flags & SDL_WINDOW_FULLSCREEN) ) { - if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { + if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS) + && ![data->listener isInFullscreenSpace]) { /* OpenGL is rendering to the window, so make it visible! */ + /* Doing this in 10.11 while in a Space breaks things (bug #3152) */ [data->nswindow setLevel:CGShieldingWindowLevel()]; } else { [data->nswindow setLevel:kCGNormalWindowLevel]; @@ -1516,11 +1656,14 @@ 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) { + if ([data->listener isInFullscreenSpace]) { + [NSMenu setMenuBarVisible:YES]; + } [data->listener close]; [data->listener release]; if (data->created) { @@ -1537,9 +1680,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) @@ -1571,33 +1712,40 @@ 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)]) { - succeeded = SDL_TRUE; - - /* Wait for the transition to complete, so application changes - take effect properly (e.g. setting the window size, etc.) - */ - const int limit = 10000; - int count = 0; - while ([data->listener isInFullscreenSpaceTransition]) { - if ( ++count == limit ) { - /* Uh oh, transition isn't completing. Should we assert? */ - break; + const int maxattempts = 3; + int attempt = 0; + while (++attempt <= maxattempts) { + /* Wait for the transition to complete, so application changes + take effect properly (e.g. setting the window size, etc.) + */ + const int limit = 10000; + int count = 0; + while ([data->listener isInFullscreenSpaceTransition]) { + if ( ++count == limit ) { + /* Uh oh, transition isn't completing. Should we assert? */ + break; + } + SDL_Delay(1); + SDL_PumpEvents(); } - SDL_Delay(1); - SDL_PumpEvents(); + if ([data->listener isInFullscreenSpace] == (state ? YES : NO)) + break; + /* Try again, the last attempt was interrupted by user gestures */ + if (![data->listener setFullscreenSpace:(state ? YES : NO)]) + break; /* ??? */ } + /* Return TRUE to prevent non-space fullscreen logic from running */ + succeeded = SDL_TRUE; } - [pool release]; - return succeeded; -} +}} int Cocoa_SetWindowHitTest(SDL_Window * window, SDL_bool enabled) diff --git a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_WM.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_WM.c index b48a1069..f6e1dea4 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_WM.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_WM.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_WM.h index 0bfe07e0..828bd952 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_WM.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_dyn.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_dyn.c index 49c737b0..4dfd08c1 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_dyn.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_dyn.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_dyn.h index ba57f453..81d2b163 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_dyn.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_events.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_events.c index 9c6c7940..8508f2a9 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_events.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_events.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_events.h index db5c7f0f..fe205d1d 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_events.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_modes.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_modes.c index 73de1fc0..ab13b7ee 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_modes.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_modes.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_modes.h index 7999f606..c847f182 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_modes.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_mouse.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_mouse.c index 93798f8e..caa9eeec 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_mouse.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_mouse.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_mouse.h index 7ac48682..3f62c01b 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_mouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_opengl.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_opengl.c index 1a378792..edddd32c 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_opengl.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_opengl.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_opengl.h index ecd5bbaf..454aa249 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_opengl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_render.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_render.c index 3a0220ea..003e4a77 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_render.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_render.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_render.h index 5405a5e5..0cd4bd32 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_render.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_shape.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_shape.c index 64e91f61..4c571572 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_shape.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_shape.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_shape.h index 99bff800..27304712 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_shape.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_video.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_video.c index 0d107dc9..dbf890be 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_video.c +++ b/jni/SDL2-2.0.3/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 @@ -156,7 +156,7 @@ DirectFB_CreateDevice(int devindex) return device; error: if (device) - free(device); + SDL_free(device); return (0); } diff --git a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_video.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_video.h index 82250b63..b722bbd9 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_video.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_window.c b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_window.c index 42064be4..b8a94b45 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_window.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_window.h b/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_window.h index a16d1609..9290abcd 100644 --- a/jni/SDL2-2.0.3/src/video/directfb/SDL_DirectFB_window.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/dummy/SDL_nullevents.c b/jni/SDL2-2.0.3/src/video/dummy/SDL_nullevents.c index 22a34bba..d7df0dcb 100644 --- a/jni/SDL2-2.0.3/src/video/dummy/SDL_nullevents.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/dummy/SDL_nullevents_c.h b/jni/SDL2-2.0.3/src/video/dummy/SDL_nullevents_c.h index 41e28caa..21168464 100644 --- a/jni/SDL2-2.0.3/src/video/dummy/SDL_nullevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/dummy/SDL_nullframebuffer.c b/jni/SDL2-2.0.3/src/video/dummy/SDL_nullframebuffer.c index 2f1bcab7..74eeb310 100644 --- a/jni/SDL2-2.0.3/src/video/dummy/SDL_nullframebuffer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/dummy/SDL_nullframebuffer_c.h b/jni/SDL2-2.0.3/src/video/dummy/SDL_nullframebuffer_c.h index 4c582d7d..f75c70e8 100644 --- a/jni/SDL2-2.0.3/src/video/dummy/SDL_nullframebuffer_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/dummy/SDL_nullvideo.c b/jni/SDL2-2.0.3/src/video/dummy/SDL_nullvideo.c index 28147bd1..96cee921 100644 --- a/jni/SDL2-2.0.3/src/video/dummy/SDL_nullvideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/dummy/SDL_nullvideo.h b/jni/SDL2-2.0.3/src/video/dummy/SDL_nullvideo.h index b0a76c06..90ed3bc8 100644 --- a/jni/SDL2-2.0.3/src/video/dummy/SDL_nullvideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_BWin.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_BWin.h index e6de5b0d..b4e347d0 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_BWin.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bclipboard.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bclipboard.cc index 9760d0fb..1a10b6bf 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bclipboard.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bclipboard.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bclipboard.h index 418ba90b..654c6c59 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bclipboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bevents.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bevents.cc index 2ffc4713..ec7d0125 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bevents.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bevents.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bevents.h index 9b53f39a..ffb9ba5e 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bevents.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bframebuffer.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bframebuffer.cc index 0c563960..3eb835b2 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bframebuffer.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bframebuffer.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bframebuffer.h index b0b73d3c..f3fbd96f 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bframebuffer.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bkeyboard.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bkeyboard.cc index 97f34b23..e12d30ba 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bkeyboard.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bkeyboard.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bkeyboard.h index 0acb42c9..edf7643d 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bkeyboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bmodes.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bmodes.cc index b56442b0..c5da410f 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bmodes.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bmodes.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bmodes.h index 3df862d3..e73c090e 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bmodes.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bopengl.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bopengl.cc index 245cec12..25869992 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bopengl.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bopengl.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bopengl.h index b046de4e..e325687f 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bopengl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bvideo.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bvideo.cc index a526893f..9fe24d34 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bvideo.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bvideo.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bvideo.h index 925c8b5b..72292d00 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bvideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bwindow.cc b/jni/SDL2-2.0.3/src/video/haiku/SDL_bwindow.cc index c0a3cee0..dc3ddb5d 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bwindow.cc +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/haiku/SDL_bwindow.h b/jni/SDL2-2.0.3/src/video/haiku/SDL_bwindow.h index 5a393497..e1c59134 100644 --- a/jni/SDL2-2.0.3/src/video/haiku/SDL_bwindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirdyn.c b/jni/SDL2-2.0.3/src/video/mir/SDL_mirdyn.c index f544d06e..ffb1e9e2 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirdyn.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirdyn.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirdyn.h index 3bd62e14..1dadfc6d 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirdyn.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirevents.c b/jni/SDL2-2.0.3/src/video/mir/SDL_mirevents.c index b5829c7c..8ff2cb3a 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirevents.c +++ b/jni/SDL2-2.0.3/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 @@ -137,7 +137,7 @@ HandleTouchMotion(int device_id, int source_id, float x, float y, float pressure static void HandleMouseScroll(SDL_Window* sdl_window, int hscroll, int vscroll) { - SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll); + SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll, SDL_MOUSEWHEEL_NORMAL); } static void diff --git a/jni/SDL2-2.0.3/src/video/mir/SDL_mirevents.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirevents.h index 9219eed1..8caabc8a 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirevents.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirframebuffer.c b/jni/SDL2-2.0.3/src/video/mir/SDL_mirframebuffer.c index 212c4a78..d1821cc4 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirframebuffer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirframebuffer.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirframebuffer.h index b4860fe1..328fb23d 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirframebuffer.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirmouse.c b/jni/SDL2-2.0.3/src/video/mir/SDL_mirmouse.c index 72f4b6a3..740ac20e 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirmouse.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirmouse.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirmouse.h index fd4e4762..700cc699 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirmouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_miropengl.c b/jni/SDL2-2.0.3/src/video/mir/SDL_miropengl.c index 976b7727..b7c7ae80 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_miropengl.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_miropengl.h b/jni/SDL2-2.0.3/src/video/mir/SDL_miropengl.h index 0f4c9731..5a04ac8a 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_miropengl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirsym.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirsym.h index fe495e3e..415df0c9 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirsym.h +++ b/jni/SDL2-2.0.3/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 @@ -26,7 +26,7 @@ SDL_MIR_SYM(MirDisplayConfiguration*,mir_connection_create_display_config,(MirCo SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params)) SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats)) SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection)) -SDL_MIR_SYM(int,mir_connection_is_valid,(MirConnection *connection)) +SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection)) SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection)) SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name)) SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration)) @@ -34,10 +34,11 @@ SDL_MIR_SYM(MirEGLNativeWindowType,mir_surface_get_egl_native_window,(MirSurface SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface)) SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region)) SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters)) -SDL_MIR_SYM(int,mir_surface_is_valid,(MirSurface *surface)) +SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface)) SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface)) SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler)) SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type)) +SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state)) SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface)) SDL_MIR_MODULE(XKBCOMMON) diff --git a/jni/SDL2-2.0.3/src/video/mir/SDL_mirvideo.c b/jni/SDL2-2.0.3/src/video/mir/SDL_mirvideo.c index 490e0571..176e9a12 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirvideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirvideo.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirvideo.h index 5a46d09c..8db90b52 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirvideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/mir/SDL_mirwindow.c b/jni/SDL2-2.0.3/src/video/mir/SDL_mirwindow.c index cb8f1cb5..513dbe24 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirwindow.c +++ b/jni/SDL2-2.0.3/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 @@ -186,9 +186,9 @@ MIR_SetWindowFullscreen(_THIS, SDL_Window* window, return; if (fullscreen) { - MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_fullscreen); + MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen); } else { - MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored); + MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored); } } @@ -200,7 +200,7 @@ MIR_MaximizeWindow(_THIS, SDL_Window* window) if (IsSurfaceValid(mir_window) < 0) return; - MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_maximized); + MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized); } void @@ -211,7 +211,7 @@ MIR_MinimizeWindow(_THIS, SDL_Window* window) if (IsSurfaceValid(mir_window) < 0) return; - MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_minimized); + MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized); } void @@ -222,7 +222,7 @@ MIR_RestoreWindow(_THIS, SDL_Window * window) if (IsSurfaceValid(mir_window) < 0) return; - MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored); + MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored); } #endif /* SDL_VIDEO_DRIVER_MIR */ diff --git a/jni/SDL2-2.0.3/src/video/mir/SDL_mirwindow.h b/jni/SDL2-2.0.3/src/video/mir/SDL_mirwindow.h index 411c1485..577dfa41 100644 --- a/jni/SDL2-2.0.3/src/video/mir/SDL_mirwindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclevents.c b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclevents.c index 5a4449a4..c552abb8 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclevents.c +++ b/jni/SDL2-2.0.3/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 @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_VIDEO_DRIVER_NACL + #include "SDL.h" #include "../../events/SDL_sysevents.h" #include "../../events/SDL_events_c.h" @@ -357,7 +359,7 @@ void NACL_PumpEvents(_THIS) { case PP_INPUTEVENT_TYPE_WHEEL: /* FIXME: GetTicks provides high resolution scroll events */ fp = driverdata->ppb_wheel_input_event->GetDelta(event); - SDL_SendMouseWheel(mouse->focus, mouse->mouseID, (int) fp.x, (int) fp.y); + SDL_SendMouseWheel(mouse->focus, mouse->mouseID, (int) fp.x, (int) fp.y, SDL_MOUSEWHEEL_NORMAL); break; case PP_INPUTEVENT_TYPE_MOUSEENTER: @@ -430,3 +432,7 @@ void NACL_PumpEvents(_THIS) { } } } + +#endif /* SDL_VIDEO_DRIVER_NACL */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclevents_c.h b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclevents_c.h index 6e343683..5fa6f991 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclglue.c b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclglue.c index 722f26ef..127494e9 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclglue.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclopengles.c b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclopengles.c index 081cc8a4..349d4bbd 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclopengles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclopengles.h b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclopengles.h index d5c3e97e..bcbca7db 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclopengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclvideo.c b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclvideo.c index 90cc0f22..e9d014c8 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclvideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclvideo.h b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclvideo.h index 7e1c77fe..d9dc1630 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclvideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclwindow.c b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclwindow.c index 046331e0..73c70337 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclwindow.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/nacl/SDL_naclwindow.h b/jni/SDL2-2.0.3/src/video/nacl/SDL_naclwindow.h index ee94e60c..3d6f375b 100644 --- a/jni/SDL2-2.0.3/src/video/nacl/SDL_naclwindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora.c b/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora.c index 10ca3824..2a0f4dcc 100644 --- a/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora.h b/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora.h index 802365ee..2dbbb2a9 100644 --- a/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora_events.c b/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora_events.c index eedbc293..f42e0b71 100644 --- a/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora_events.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora_events.h b/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora_events.h index e628d14a..c4313779 100644 --- a/jni/SDL2-2.0.3/src/video/pandora/SDL_pandora_events.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/psp/SDL_pspevents.c b/jni/SDL2-2.0.3/src/video/psp/SDL_pspevents.c index d096c061..7117b50a 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspevents.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,9 @@ 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_PSP /* Being a null driver, there's no event stream. We just define stubs for most of the API. */ @@ -39,7 +42,7 @@ #define IRKBD_CONFIG_FILE NULL /* this will take ms0:/seplugins/pspirkeyb.ini */ static int irkbd_ready = 0; -static SDLKey keymap[256]; +static SDL_Keycode keymap[256]; #endif static enum PspHprmKeys hprm = 0; @@ -121,7 +124,7 @@ void PSP_PumpEvents(_THIS) /* not tested */ /* SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */ SDL_SendKeyboardKey((keys & keymap_psp[i].id) ? - SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw]); + SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw])); } } @@ -282,3 +285,6 @@ void PSP_EventQuit(_THIS) /* end of SDL_pspevents.c ... */ +#endif /* SDL_VIDEO_DRIVER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/psp/SDL_pspevents_c.h b/jni/SDL2-2.0.3/src/video/psp/SDL_pspevents_c.h index af45c4d1..9e24b6ba 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/psp/SDL_pspgl.c b/jni/SDL2-2.0.3/src/video/psp/SDL_pspgl.c index d24e7229..f0fa7c3f 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspgl.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,9 @@ 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_PSP #include #include @@ -203,3 +206,6 @@ PSP_GL_DeleteContext(_THIS, SDL_GLContext context) return; } +#endif /* SDL_VIDEO_DRIVER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/psp/SDL_pspgl_c.h b/jni/SDL2-2.0.3/src/video/psp/SDL_pspgl_c.h index c0c15d95..03b7a8c2 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspgl_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/psp/SDL_pspmouse.c b/jni/SDL2-2.0.3/src/video/psp/SDL_pspmouse.c index 8df3d614..14c69dee 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspmouse.c +++ b/jni/SDL2-2.0.3/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 @@ -18,7 +18,9 @@ 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_PSP #include @@ -33,3 +35,7 @@ struct WMcursor { int unused; }; + +#endif /* SDL_VIDEO_DRIVER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/psp/SDL_pspmouse_c.h b/jni/SDL2-2.0.3/src/video/psp/SDL_pspmouse_c.h index d14b84b9..de5ff4ef 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspmouse_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/psp/SDL_pspvideo.c b/jni/SDL2-2.0.3/src/video/psp/SDL_pspvideo.c index b3787239..cfcf0cff 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspvideo.c +++ b/jni/SDL2-2.0.3/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 @@ -66,7 +66,7 @@ PSP_Create() SDL_GLDriverData *gldata; int status; - /* Check if pandora could be initialized */ + /* Check if PSP could be initialized */ status = PSP_Available(); if (status == 0) { /* PSP could not be used */ @@ -80,7 +80,7 @@ PSP_Create() return NULL; } - /* Initialize internal Pandora specific data */ + /* Initialize internal PSP specific data */ phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); if (phdata == NULL) { SDL_OutOfMemory(); diff --git a/jni/SDL2-2.0.3/src/video/psp/SDL_pspvideo.h b/jni/SDL2-2.0.3/src/video/psp/SDL_pspvideo.h index 2e1bb241..e468c2dd 100644 --- a/jni/SDL2-2.0.3/src/video/psp/SDL_pspvideo.h +++ b/jni/SDL2-2.0.3/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 @@ -19,8 +19,8 @@ 3. This notice may not be removed or altered from any source distribution. */ -#ifndef __SDL_PANDORA_H__ -#define __SDL_PANDORA_H__ +#ifndef _SDL_pspvideo_h +#define _SDL_pspvideo_h #include @@ -97,6 +97,6 @@ void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window); void PSP_HideScreenKeyboard(_THIS, SDL_Window *window); SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window); -#endif /* __SDL_PANDORA_H__ */ +#endif /* _SDL_pspvideo_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpievents.c b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpievents.c index cdfc746a..12760a86 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpievents.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpievents_c.h b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpievents_c.h index e69c5917..adc2fdd7 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpievents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpimouse.c b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpimouse.c index b0ba88de..f8ee4ec6 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpimouse.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpimouse.h b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpimouse.h index a39e6549..db8df76f 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpimouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpiopengles.c b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpiopengles.c index c6f462b2..4809c925 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpiopengles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpiopengles.h b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpiopengles.h index 5ef8f8ff..5dda45d5 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpiopengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpivideo.c b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpivideo.c index 8391c762..fae9143b 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpivideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpivideo.h b/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpivideo.h index 4de8983c..648254c8 100644 --- a/jni/SDL2-2.0.3/src/video/raspberry/SDL_rpivideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/sdlgenblit.pl b/jni/SDL2-2.0.3/src/video/sdlgenblit.pl index db83d250..202c6c22 100755 --- a/jni/SDL2-2.0.3/src/video/sdlgenblit.pl +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitappdelegate.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitappdelegate.h index d5430beb..9f3c9854 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitappdelegate.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitappdelegate.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitappdelegate.m index a9924fbc..5d63019e 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitappdelegate.m +++ b/jni/SDL2-2.0.3/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,145 +76,291 @@ SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldVa [UIApplication sharedApplication].idleTimerDisabled = disable; } -@interface SDL_splashviewcontroller : UIViewController { - UIImageView *splash; - UIImage *splashPortrait; - UIImage *splashLandscape; +/* 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; + + 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; } -- (void)updateSplashImage:(UIInterfaceOrientation)interfaceOrientation; -@end +@implementation SDLLaunchScreenController -@implementation SDL_splashviewcontroller - -- (id)init +- (instancetype)init { - self = [super init]; - if (self == nil) { + if (!(self = [super initWithNibName:nil bundle:nil])) { return nil; } - self->splash = [[UIImageView alloc] init]; - [self setView:self->splash]; + NSBundle *bundle = [NSBundle mainBundle]; + NSString *screenname = [bundle objectForInfoDictionaryKey:@"UILaunchStoryboardName"]; + BOOL atleastiOS8 = UIKit_IsSystemVersionAtLeast(8.0); - CGSize size = [UIScreen mainScreen].bounds.size; - float height = SDL_max(size.width, size.height); - 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]; + /* 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; + } } - [self updateSplashImage:[[UIApplication sharedApplication] statusBarOrientation]]; + 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; } +- (void)loadView +{ + /* Do nothing. */ +} + +- (BOOL)shouldAutorotate +{ + /* 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]; - UIViewController *splashViewController = [[SDL_splashviewcontroller alloc] init]; - launch_window.rootViewController = splashViewController; - [launch_window addSubview:splashViewController.view]; - [launch_window makeKeyAndVisible]; +#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]; + + 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, @@ -235,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) { @@ -248,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); @@ -274,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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitevents.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitevents.h index d9fb4ab3..63eeb955 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitevents.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitevents.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitevents.m index 94fba878..d4d6fcc4 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitevents.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmessagebox.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmessagebox.h index 86af87b5..2f38ac0d 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmessagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmessagebox.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmessagebox.m index c24f3ff8..6c980d47 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmessagebox.m +++ b/jni/SDL2-2.0.3/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 @@ -24,87 +24,167 @@ #include "SDL.h" #include "SDL_uikitvideo.h" - +#include "SDL_uikitwindow.h" /* Display a UIKit message box */ static SDL_bool s_showingMessageBox = SDL_FALSE; -@interface UIKit_UIAlertViewDelegate : NSObject { -@private - int *clickedButtonIndex; -} - -- (id)initWithButtonIndex:(int *)_buttonIndex; -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; - -@end - -@implementation UIKit_UIAlertViewDelegate - -- (id)initWithButtonIndex:(int *)buttonIndex -{ - self = [self init]; - if (self == nil) { - return nil; - } - self->clickedButtonIndex = buttonIndex; - - return self; -} - -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; -{ - *clickedButtonIndex = (int)buttonIndex; -} - -@end /* UIKit_UIAlertViewDelegate */ - - SDL_bool UIKit_ShowingMessageBox() { return s_showingMessageBox; } -int -UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +static void +UIKit_WaitUntilMessageBoxClosed(const SDL_MessageBoxData *messageboxdata, int *clickedindex) { - int clicked; + *clickedindex = messageboxdata->numbuttons; - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + /* 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 ((*clickedindex) == messageboxdata->numbuttons) { + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; + } + s_showingMessageBox = SDL_FALSE; + } +} - 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; +static BOOL +UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, int *buttonid) +{ +#ifdef __IPHONE_8_0 int i; - for (i = 0; i < messageboxdata->numbuttons; ++i) { - [alert addButtonWithTitle:[[NSString alloc] initWithUTF8String:buttons[i].text]]; + int __block clickedindex = messageboxdata->numbuttons; + const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; + UIWindow *window = nil; + UIWindow *alertwindow = nil; + + if (![UIAlertController class]) { + return NO; } - /* Set up for showing the alert */ - clicked = messageboxdata->numbuttons; + UIAlertController *alert; + alert = [UIAlertController alertControllerWithTitle:@(messageboxdata->title) + message:@(messageboxdata->message) + preferredStyle:UIAlertControllerStyleAlert]; + + for (i = 0; i < messageboxdata->numbuttons; i++) { + UIAlertAction *action; + UIAlertActionStyle style = UIAlertActionStyleDefault; + + if (buttons[i].flags & SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT) { + style = UIAlertActionStyleCancel; + } + + action = [UIAlertAction actionWithTitle:@(buttons[i].text) + style:style + handler:^(UIAlertAction *action) { + clickedindex = i; + }]; + [alert addAction:action]; + } + + if (messageboxdata->window) { + SDL_WindowData *data = (__bridge SDL_WindowData *) messageboxdata->window->driverdata; + window = data.uiwindow; + } + + if (window == nil || window.rootViewController == nil) { + alertwindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + alertwindow.rootViewController = [UIViewController new]; + alertwindow.windowLevel = UIWindowLevelAlert; + + window = alertwindow; + + [alertwindow makeKeyAndVisible]; + } + + [window.rootViewController presentViewController:alert animated:YES completion:nil]; + UIKit_WaitUntilMessageBoxClosed(messageboxdata, &clickedindex); + + if (alertwindow) { + alertwindow.hidden = YES; + } + + *buttonid = messageboxdata->buttons[clickedindex].buttonid; + return YES; +#else + return NO; +#endif /* __IPHONE_8_0 */ +} + +/* UIAlertView is deprecated in iOS 8+ in favor of UIAlertController. */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 +@interface SDLAlertViewDelegate : NSObject + +@property (nonatomic, assign) int *clickedIndex; + +@end + +@implementation SDLAlertViewDelegate + +- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + if (_clickedIndex != NULL) { + *_clickedIndex = (int) buttonIndex; + } +} + +@end +#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 */ + +static BOOL +UIKit_ShowMessageBoxAlertView(const SDL_MessageBoxData *messageboxdata, int *buttonid) +{ + /* UIAlertView is deprecated in iOS 8+ in favor of UIAlertController. */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 + int i; + int clickedindex = messageboxdata->numbuttons; + const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; + 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)]; + } + + delegate.clickedIndex = &clickedindex; [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]]; + UIKit_WaitUntilMessageBoxClosed(messageboxdata, &clickedindex); + + alert.delegate = nil; + + *buttonid = messageboxdata->buttons[clickedindex].buttonid; + return YES; +#else + return NO; +#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 */ +} + +int +UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +{ + BOOL success = NO; + + @autoreleasepool { + success = UIKit_ShowMessageBoxAlertController(messageboxdata, buttonid); + if (!success) { + success = UIKit_ShowMessageBoxAlertView(messageboxdata, buttonid); + } } - s_showingMessageBox = SDL_FALSE; - *buttonid = messageboxdata->buttons[clicked].buttonid; - - [alert.delegate release]; - [alert release]; - - [pool release]; + if (!success) { + return SDL_SetError("Could not show message box."); + } return 0; } diff --git a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmodes.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmodes.h index 9f2e9dd3..86bf3b2e 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmodes.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmodes.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmodes.m index 05e33d9c..afe6a957 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitmodes.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopengles.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopengles.h index 947678ca..aa6bc75d 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopengles.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopengles.m index 8d71ee81..ef901247 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopengles.m +++ b/jni/SDL2-2.0.3/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,187 @@ #include "SDL_loadso.h" #include -static int UIKit_GL_Initialize(_THIS); +@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 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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopenglview.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopenglview.h index eed2e5b7..c710813d 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopenglview.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopenglview.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopenglview.m index 144100bf..acfdb28f 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitopenglview.m +++ b/jni/SDL2-2.0.3/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,359 @@ #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); + + /* Clamp the samples to the max supported count. */ + samples = MIN(samples, maxsamples); + } + + 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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitvideo.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitvideo.h index ef629825..5eacd807 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitvideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitvideo.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitvideo.m index 4893bc16..3847de71 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitvideo.m +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitview.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitview.h index ce616c07..00be7657 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitview.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitview.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitview.m index c51a3ba7..4372cc20 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitview.m +++ b/jni/SDL2-2.0.3/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,181 @@ #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; } +- (float)pressureForTouch:(UITouch *)touch +{ +#ifdef __IPHONE_9_0 + if ([touch respondsToSelector:@selector(force)]) { + return (float) touch.force; + } +#endif + + return 1.0f; +} + - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - NSEnumerator *enumerator = [touches objectEnumerator]; - UITouch *touch = (UITouch*)[enumerator nextObject]; + for (UITouch *touch in touches) { + float pressure = [self pressureForTouch:touch]; - while (touch) { - if (!leftFingerDown) { + 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]; + SDL_TRUE, locationInView.x, locationInView.y, pressure); } } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - NSEnumerator *enumerator = [touches objectEnumerator]; - UITouch *touch = (UITouch*)[enumerator nextObject]; + for (UITouch *touch in touches) { + float pressure = [self pressureForTouch:touch]; - while(touch) { - if (touch == leftFingerDown) { + 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_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]; + SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), + SDL_FALSE, locationInView.x, locationInView.y, pressure); } } - (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]; + for (UITouch *touch in touches) { + float pressure = [self pressureForTouch:touch]; - while (touch) { - if (touch == leftFingerDown) { + 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, - 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]; + SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch), + locationInView.x, locationInView.y, pressure); } } -/* - ---- 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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitviewcontroller.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitviewcontroller.h index e8d595d9..e8462b8e 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitviewcontroller.h +++ b/jni/SDL2-2.0.3/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,54 @@ #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; +#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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitviewcontroller.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitviewcontroller.m index 447b80b8..112638eb 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitviewcontroller.m +++ b/jni/SDL2-2.0.3/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,368 @@ #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; +} + +/* + ---- 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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.h b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.h index 494b028f..987bbe01 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.m b/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.m index 2b156777..6826f825 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.m +++ b/jni/SDL2-2.0.3/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,181 @@ 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]; + } + + /* iOS may still hold a reference to the window after we release it. + * We want to make sure the SDL view controller isn't accessed in + * that case, because it would contain an invalid pointer to the old + * SDL window. */ + data.uiwindow.rootViewController = nil; + data.uiwindow.hidden = YES; + } } window->driverdata = NULL; } @@ -301,29 +331,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/jni/SDL2-2.0.3/src/video/uikit/keyinfotable.h b/jni/SDL2-2.0.3/src/video/uikit/keyinfotable.h index 1d16868c..22a79dce 100644 --- a/jni/SDL2-2.0.3/src/video/uikit/keyinfotable.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteopengles.c b/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteopengles.c index a5499a9b..96d2f89d 100644 --- a/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteopengles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteopengles.h b/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteopengles.h index 59ce8200..b7b61803 100644 --- a/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteopengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteplatform.c b/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteplatform.c index a779d64c..40579dfa 100644 --- a/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteplatform.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteplatform.h b/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteplatform.h index 27b82afd..b8376283 100644 --- a/jni/SDL2-2.0.3/src/video/vivante/SDL_vivanteplatform.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/vivante/SDL_vivantevideo.c b/jni/SDL2-2.0.3/src/video/vivante/SDL_vivantevideo.c index 5ae3f981..8095cb58 100644 --- a/jni/SDL2-2.0.3/src/video/vivante/SDL_vivantevideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/vivante/SDL_vivantevideo.h b/jni/SDL2-2.0.3/src/video/vivante/SDL_vivantevideo.h index aab7bdf3..030516bd 100644 --- a/jni/SDL2-2.0.3/src/video/vivante/SDL_vivantevideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylanddyn.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylanddyn.c index 1ed29db5..edf6e219 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylanddyn.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylanddyn.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylanddyn.h index 8d9313a2..19fd4558 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylanddyn.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandevents.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandevents.c index cb729001..face9d64 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandevents.c +++ b/jni/SDL2-2.0.3/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; @@ -184,7 +231,7 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, return; } - SDL_SendMouseWheel(window->sdlwindow, 0, x, y); + SDL_SendMouseWheel(window->sdlwindow, 0, x, y, SDL_MOUSEWHEEL_NORMAL); } } @@ -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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandevents_c.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandevents_c.h index 8a6c3fcd..5a914e90 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandevents_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandmouse.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandmouse.c index 338f42f8..2d78ebb9 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandmouse.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandmouse.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandmouse.h index efd29d6c..3a914a28 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandmouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandopengles.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandopengles.c index 45078043..ca301e57 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandopengles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandopengles.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandopengles.h index 77081f81..42c13f84 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandopengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandsym.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandsym.h index c3b4fa50..edac091f 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandsym.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandtouch.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandtouch.c index 85f9f0ad..3aa8828d 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandtouch.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandtouch.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandtouch.h index 435fd562..8c0d2036 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandtouch.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandvideo.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandvideo.c index 43826b83..f509ddc1 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandvideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandvideo.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandvideo.h index 06bcdc48..6dc736a2 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandvideo.h +++ b/jni/SDL2-2.0.3/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,35 +40,26 @@ 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_nullvideo_h */ +#endif /* _SDL_waylandvideo_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandwindow.c b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandwindow.c index 3760c0d3..e105408a 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandwindow.c +++ b/jni/SDL2-2.0.3/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 @@ -29,6 +29,7 @@ #include "SDL_waylandwindow.h" #include "SDL_waylandvideo.h" #include "SDL_waylandtouch.h" +#include "SDL_waylanddyn.h" static void handle_ping(void *data, struct wl_shell_surface *shell_surface, @@ -108,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; @@ -115,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); @@ -131,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); @@ -146,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; @@ -178,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); @@ -196,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/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandwindow.h b/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandwindow.h index c1190d52..e2bed546 100644 --- a/jni/SDL2-2.0.3/src/video/wayland/SDL_waylandwindow.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_msctf.h b/jni/SDL2-2.0.3/src/video/windows/SDL_msctf.h index 01e732cf..c2368d7a 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_msctf.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_vkeys.h b/jni/SDL2-2.0.3/src/video/windows/SDL_vkeys.h index 1ed155a1..4c3d390d 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_vkeys.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsclipboard.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsclipboard.c index ae3a104a..d93eceed 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsclipboard.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsclipboard.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsclipboard.h index 49c36c4e..3b5e62b4 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsclipboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsevents.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsevents.c index 28801d2f..3ce8291d 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsevents.c +++ b/jni/SDL2-2.0.3/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; @@ -498,12 +521,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) s_AccumulatedMotion += GET_WHEEL_DELTA_WPARAM(wParam); if (s_AccumulatedMotion > 0) { while (s_AccumulatedMotion >= WHEEL_DELTA) { - SDL_SendMouseWheel(data->window, 0, 0, 1); + SDL_SendMouseWheel(data->window, 0, 0, 1, SDL_MOUSEWHEEL_NORMAL); s_AccumulatedMotion -= WHEEL_DELTA; } } else { while (s_AccumulatedMotion <= -WHEEL_DELTA) { - SDL_SendMouseWheel(data->window, 0, 0, -1); + SDL_SendMouseWheel(data->window, 0, 0, -1, SDL_MOUSEWHEEL_NORMAL); s_AccumulatedMotion += WHEEL_DELTA; } } @@ -517,12 +540,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) s_AccumulatedMotion += GET_WHEEL_DELTA_WPARAM(wParam); if (s_AccumulatedMotion > 0) { while (s_AccumulatedMotion >= WHEEL_DELTA) { - SDL_SendMouseWheel(data->window, 0, 1, 0); + SDL_SendMouseWheel(data->window, 0, 1, 0, SDL_MOUSEWHEEL_NORMAL); s_AccumulatedMotion -= WHEEL_DELTA; } } else { while (s_AccumulatedMotion <= -WHEEL_DELTA) { - SDL_SendMouseWheel(data->window, 0, -1, 0); + SDL_SendMouseWheel(data->window, 0, -1, 0, SDL_MOUSEWHEEL_NORMAL); s_AccumulatedMotion += WHEEL_DELTA; } } @@ -548,24 +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) { - WORD repetition; - for (repetition = lParam & 0xffff; repetition > 0; repetition--) { - WIN_ConvertUTF32toUTF8(utf32, text); - SDL_SendKeyboardText(text); - } - } - } + returnCode = 0; break; @@ -575,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) { @@ -595,8 +607,18 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_UNICHAR: + if ( wParam == UNICODE_NOCHAR ) { + returnCode = 1; + break; + } + /* otherwise fall through to below */ case WM_CHAR: - /* Ignore WM_CHAR messages that come from TranslateMessage(), since we handle WM_KEY* messages directly */ + { + char text[5]; + if ( WIN_ConvertUTF32toUTF8( (UINT32)wParam, text ) ) { + SDL_SendKeyboardText( text ); + } + } returnCode = 0; break; @@ -604,6 +626,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_INPUTLANGCHANGE: { WIN_UpdateKeymap(); + SDL_SendKeymapChangedEvent(); } returnCode = 1; break; @@ -713,7 +736,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int x, y; int w, h; - if (data->in_border_change) { + if (data->initializing || data->in_border_change) { break; } @@ -789,9 +812,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) { @@ -799,9 +826,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: { @@ -836,10 +863,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 */ @@ -924,6 +949,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) { @@ -933,6 +968,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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsevents.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsevents.h index b9944ee7..3e923aab 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsevents.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsframebuffer.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsframebuffer.c index 4292db5a..d92a5a1b 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsframebuffer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsframebuffer.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsframebuffer.h index daa42b83..ed6837ba 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsframebuffer.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowskeyboard.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowskeyboard.c index 0557b6cd..d56f4042 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowskeyboard.c +++ b/jni/SDL2-2.0.3/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); @@ -386,7 +402,7 @@ IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) INT err = 0; BOOL vertical = FALSE; UINT maxuilen = 0; - static OSVERSIONINFOA osversion; + static OSVERSIONINFOA osversion; if (videodata->ime_uiless) return; @@ -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/jni/SDL2-2.0.3/src/video/windows/SDL_windowskeyboard.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowskeyboard.h index 3eb0cbf6..5967b511 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowskeyboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmessagebox.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmessagebox.c index 6cffc8ad..ac4a3a5a 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmessagebox.c +++ b/jni/SDL2-2.0.3/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 @@ -297,9 +297,12 @@ static WIN_DialogData *CreateDialogData(int w, int h, const char *caption) /* Font size - convert to logical font size for dialog parameter. */ { - HDC ScreenDC = GetDC(0); - WordToPass = (WORD)(-72 * NCM.lfMessageFont.lfHeight / GetDeviceCaps(ScreenDC, LOGPIXELSY)); - ReleaseDC(0, ScreenDC); + HDC ScreenDC = GetDC(NULL); + int LogicalPixelsY = GetDeviceCaps(ScreenDC, LOGPIXELSY); + if (!LogicalPixelsY) /* This can happen if the application runs out of GDI handles */ + LogicalPixelsY = 72; + WordToPass = (WORD)(-72 * NCM.lfMessageFont.lfHeight / LogicalPixelsY); + ReleaseDC(NULL, ScreenDC); } if (!AddDialogData(dialog, &WordToPass, 2)) { diff --git a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmessagebox.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmessagebox.h index ea709a4a..37f9f4cb 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmessagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmodes.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmodes.c index f64a5788..7cb4ea5b 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmodes.c +++ b/jni/SDL2-2.0.3/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; @@ -50,8 +91,11 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) data->DeviceMode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY | DM_DISPLAYFLAGS); - data->ScaleX = 1.0f; - data->ScaleY = 1.0f; + 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; @@ -65,14 +109,43 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) char bmi_data[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)]; LPBITMAPINFO bmi; HBITMAP hbm; - int logical_width = GetDeviceCaps( hdc, HORZRES ); - int logical_height = GetDeviceCaps( hdc, VERTRES ); + int logical_width = GetDeviceCaps( hdc, HORZRES ); + int logical_height = GetDeviceCaps( hdc, VERTRES ); - data->ScaleX = (float)logical_width / devmode.dmPelsWidth; - data->ScaleY = (float)logical_height / devmode.dmPelsHeight; - mode->w = logical_width; - mode->h = logical_height; + data->ScaleX = (float)logical_width / devmode.dmPelsWidth; + data->ScaleY = (float)logical_height / devmode.dmPelsHeight; + 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); @@ -102,7 +175,7 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) } else if (bmi->bmiHeader.biBitCount == 4) { mode->format = SDL_PIXELFORMAT_INDEX4LSB; } - } else { + } else { /* FIXME: Can we tell what this will be? */ if ((devmode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) { switch (devmode.dmBitsPerPel) { @@ -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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmodes.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmodes.h index d16a5e7a..2bf9f4c8 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmodes.h +++ b/jni/SDL2-2.0.3/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 @@ -31,12 +31,16 @@ typedef struct typedef struct { DEVMODE DeviceMode; - float ScaleX; - float ScaleY; + 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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmouse.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmouse.c index c61076c5..69aa7771 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmouse.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmouse.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmouse.h index 665cdc57..d3d8f634 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsmouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengl.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengl.c index 71855c87..dc8cbb8a 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengl.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengl.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengl.h index b96e0ac1..71c05db0 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengl.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengles.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengles.c index 544fe525..9125da0e 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengles.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengles.h index 8e232177..f6342088 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsopengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsshape.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsshape.c index 9409e2b4..6c38ba1a 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsshape.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsshape.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsshape.h index 9405a501..568945c7 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsshape.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsvideo.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsvideo.c index d87b9cff..86c3437c 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsvideo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowsvideo.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowsvideo.h index aaedc04e..85327a7a 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowsvideo.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/windows/SDL_windowswindow.c b/jni/SDL2-2.0.3/src/video/windows/SDL_windowswindow.c index 94328339..70e80a95 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowswindow.c +++ b/jni/SDL2-2.0.3/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 @@ -109,7 +109,7 @@ WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags) y = window->y + rect.top; data->expected_resize = SDL_TRUE; - SetWindowPos( hwnd, top, x, y, w, h, flags ); + SetWindowPos(hwnd, top, x, y, w, h, flags); data->expected_resize = SDL_FALSE; } @@ -130,6 +130,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) data->created = created; data->mouse_button_flags = 0; data->videodata = videodata; + data->initializing = SDL_TRUE; window->driverdata = data; @@ -165,7 +166,26 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) int h = rect.bottom; if ((window->w && window->w != w) || (window->h && window->h != h)) { /* We tried to create a window larger than the desktop and Windows didn't allow it. Override! */ - WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); + RECT rect; + DWORD style; + BOOL menu; + int x, y; + int w, h; + + /* Figure out what the window area will be */ + style = GetWindowLong(hwnd, GWL_STYLE); + rect.left = 0; + rect.top = 0; + rect.right = window->w; + rect.bottom = window->h; + menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); + AdjustWindowRectEx(&rect, style, menu, 0); + w = (rect.right - rect.left); + h = (rect.bottom - rect.top); + x = window->x + rect.left; + y = window->y + rect.top; + + SetWindowPos(hwnd, HWND_NOTOPMOST, x, y, w, h, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); } else { window->w = w; window->h = h; @@ -236,6 +256,8 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) /* Enable dropping files */ DragAcceptFiles(hwnd, TRUE); + data->initializing = SDL_FALSE; + /* All done! */ return 0; } @@ -371,14 +393,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); } @@ -498,7 +514,7 @@ WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) } data->in_border_change = SDL_TRUE; - SetWindowLong( hwnd, GWL_STYLE, style ); + SetWindowLong(hwnd, GWL_STYLE, style); WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE); data->in_border_change = SDL_FALSE; } @@ -621,6 +637,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 +660,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/jni/SDL2-2.0.3/src/video/windows/SDL_windowswindow.h b/jni/SDL2-2.0.3/src/video/windows/SDL_windowswindow.h index 25d108bd..6b8b0c2d 100644 --- a/jni/SDL2-2.0.3/src/video/windows/SDL_windowswindow.h +++ b/jni/SDL2-2.0.3/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 @@ -37,10 +37,11 @@ typedef struct WNDPROC wndproc; SDL_bool created; WPARAM mouse_button_flags; + SDL_bool initializing; SDL_bool expected_resize; SDL_bool in_border_change; SDL_bool in_title_click; - SDL_bool focus_click_pending; + SDL_bool focus_click_pending; struct SDL_VideoData *videodata; #if SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; diff --git a/jni/SDL2-2.0.3/src/video/windows/wmmsg.h b/jni/SDL2-2.0.3/src/video/windows/wmmsg.h index cf373bc2..e8f65ac3 100644 --- a/jni/SDL2-2.0.3/src/video/windows/wmmsg.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtevents.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtevents.cpp index 7c0cf49a..5c779d3c 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtevents.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtevents_c.h b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtevents_c.h index 826cad74..047be740 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtevents_c.h +++ b/jni/SDL2-2.0.3/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 @@ -57,12 +57,15 @@ extern Uint8 WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint extern void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); extern void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); extern void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); +extern void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); +extern void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); extern void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); extern void WINRT_ProcessMouseMovedEvent(SDL_Window * window, Windows::Devices::Input::MouseEventArgs ^args); /* Keyboard */ extern void WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args); extern void WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args); +extern void WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^args); /* XAML Thread Management */ extern void WINRT_CycleXAMLThread(); diff --git a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtkeyboard.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtkeyboard.cpp index 2371d74a..f75dd5f9 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/jni/SDL2-2.0.3/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 @@ -22,10 +22,6 @@ #if SDL_VIDEO_DRIVER_WINRT -/* Standard C++11 includes */ -#include - - /* Windows-specific includes */ #include #include @@ -42,248 +38,290 @@ extern "C" { static SDL_Scancode WinRT_Official_Keycodes[] = { - SDL_SCANCODE_UNKNOWN, // VirtualKey.None -- 0 - SDL_SCANCODE_UNKNOWN, // VirtualKey.LeftButton -- 1 - SDL_SCANCODE_UNKNOWN, // VirtualKey.RightButton -- 2 - SDL_SCANCODE_CANCEL, // VirtualKey.Cancel -- 3 - SDL_SCANCODE_UNKNOWN, // VirtualKey.MiddleButton -- 4 - SDL_SCANCODE_UNKNOWN, // VirtualKey.XButton1 -- 5 - SDL_SCANCODE_UNKNOWN, // VirtualKey.XButton2 -- 6 - SDL_SCANCODE_UNKNOWN, // -- 7 - SDL_SCANCODE_BACKSPACE, // VirtualKey.Back -- 8 - SDL_SCANCODE_TAB, // VirtualKey.Tab -- 9 - SDL_SCANCODE_UNKNOWN, // -- 10 - SDL_SCANCODE_UNKNOWN, // -- 11 - SDL_SCANCODE_CLEAR, // VirtualKey.Clear -- 12 - SDL_SCANCODE_RETURN, // VirtualKey.Enter -- 13 - SDL_SCANCODE_UNKNOWN, // -- 14 - SDL_SCANCODE_UNKNOWN, // -- 15 - SDL_SCANCODE_LSHIFT, // VirtualKey.Shift -- 16 - SDL_SCANCODE_LCTRL, // VirtualKey.Control -- 17 - SDL_SCANCODE_MENU, // VirtualKey.Menu -- 18 - SDL_SCANCODE_PAUSE, // VirtualKey.Pause -- 19 - SDL_SCANCODE_CAPSLOCK, // VirtualKey.CapitalLock -- 20 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Kana or VirtualKey.Hangul -- 21 - SDL_SCANCODE_UNKNOWN, // -- 22 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Junja -- 23 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Final -- 24 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Hanja or VirtualKey.Kanji -- 25 - SDL_SCANCODE_UNKNOWN, // -- 26 - SDL_SCANCODE_ESCAPE, // VirtualKey.Escape -- 27 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Convert -- 28 - SDL_SCANCODE_UNKNOWN, // VirtualKey.NonConvert -- 29 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Accept -- 30 - SDL_SCANCODE_UNKNOWN, // VirtualKey.ModeChange -- 31 (maybe SDL_SCANCODE_MODE ?) - SDL_SCANCODE_SPACE, // VirtualKey.Space -- 32 - SDL_SCANCODE_PAGEUP, // VirtualKey.PageUp -- 33 - SDL_SCANCODE_PAGEDOWN, // VirtualKey.PageDown -- 34 - SDL_SCANCODE_END, // VirtualKey.End -- 35 - SDL_SCANCODE_HOME, // VirtualKey.Home -- 36 - SDL_SCANCODE_LEFT, // VirtualKey.Left -- 37 - SDL_SCANCODE_UP, // VirtualKey.Up -- 38 - SDL_SCANCODE_RIGHT, // VirtualKey.Right -- 39 - SDL_SCANCODE_DOWN, // VirtualKey.Down -- 40 - SDL_SCANCODE_SELECT, // VirtualKey.Select -- 41 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Print -- 42 (maybe SDL_SCANCODE_PRINTSCREEN ?) - SDL_SCANCODE_EXECUTE, // VirtualKey.Execute -- 43 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Snapshot -- 44 - SDL_SCANCODE_INSERT, // VirtualKey.Insert -- 45 - SDL_SCANCODE_DELETE, // VirtualKey.Delete -- 46 - SDL_SCANCODE_HELP, // VirtualKey.Help -- 47 - SDL_SCANCODE_0, // VirtualKey.Number0 -- 48 - SDL_SCANCODE_1, // VirtualKey.Number1 -- 49 - SDL_SCANCODE_2, // VirtualKey.Number2 -- 50 - SDL_SCANCODE_3, // VirtualKey.Number3 -- 51 - SDL_SCANCODE_4, // VirtualKey.Number4 -- 52 - SDL_SCANCODE_5, // VirtualKey.Number5 -- 53 - SDL_SCANCODE_6, // VirtualKey.Number6 -- 54 - SDL_SCANCODE_7, // VirtualKey.Number7 -- 55 - SDL_SCANCODE_8, // VirtualKey.Number8 -- 56 - SDL_SCANCODE_9, // VirtualKey.Number9 -- 57 - SDL_SCANCODE_UNKNOWN, // -- 58 - SDL_SCANCODE_UNKNOWN, // -- 59 - SDL_SCANCODE_UNKNOWN, // -- 60 - SDL_SCANCODE_UNKNOWN, // -- 61 - SDL_SCANCODE_UNKNOWN, // -- 62 - SDL_SCANCODE_UNKNOWN, // -- 63 - SDL_SCANCODE_UNKNOWN, // -- 64 - SDL_SCANCODE_A, // VirtualKey.A -- 65 - SDL_SCANCODE_B, // VirtualKey.B -- 66 - SDL_SCANCODE_C, // VirtualKey.C -- 67 - SDL_SCANCODE_D, // VirtualKey.D -- 68 - SDL_SCANCODE_E, // VirtualKey.E -- 69 - SDL_SCANCODE_F, // VirtualKey.F -- 70 - SDL_SCANCODE_G, // VirtualKey.G -- 71 - SDL_SCANCODE_H, // VirtualKey.H -- 72 - SDL_SCANCODE_I, // VirtualKey.I -- 73 - SDL_SCANCODE_J, // VirtualKey.J -- 74 - SDL_SCANCODE_K, // VirtualKey.K -- 75 - SDL_SCANCODE_L, // VirtualKey.L -- 76 - SDL_SCANCODE_M, // VirtualKey.M -- 77 - SDL_SCANCODE_N, // VirtualKey.N -- 78 - SDL_SCANCODE_O, // VirtualKey.O -- 79 - SDL_SCANCODE_P, // VirtualKey.P -- 80 - SDL_SCANCODE_Q, // VirtualKey.Q -- 81 - SDL_SCANCODE_R, // VirtualKey.R -- 82 - SDL_SCANCODE_S, // VirtualKey.S -- 83 - SDL_SCANCODE_T, // VirtualKey.T -- 84 - SDL_SCANCODE_U, // VirtualKey.U -- 85 - SDL_SCANCODE_V, // VirtualKey.V -- 86 - SDL_SCANCODE_W, // VirtualKey.W -- 87 - SDL_SCANCODE_X, // VirtualKey.X -- 88 - SDL_SCANCODE_Y, // VirtualKey.Y -- 89 - SDL_SCANCODE_Z, // VirtualKey.Z -- 90 - SDL_SCANCODE_UNKNOWN, // VirtualKey.LeftWindows -- 91 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?) - SDL_SCANCODE_UNKNOWN, // VirtualKey.RightWindows -- 92 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?) - SDL_SCANCODE_APPLICATION, // VirtualKey.Application -- 93 - SDL_SCANCODE_UNKNOWN, // -- 94 - SDL_SCANCODE_SLEEP, // VirtualKey.Sleep -- 95 - SDL_SCANCODE_KP_0, // VirtualKey.NumberPad0 -- 96 - SDL_SCANCODE_KP_1, // VirtualKey.NumberPad1 -- 97 - SDL_SCANCODE_KP_2, // VirtualKey.NumberPad2 -- 98 - SDL_SCANCODE_KP_3, // VirtualKey.NumberPad3 -- 99 - SDL_SCANCODE_KP_4, // VirtualKey.NumberPad4 -- 100 - SDL_SCANCODE_KP_5, // VirtualKey.NumberPad5 -- 101 - SDL_SCANCODE_KP_6, // VirtualKey.NumberPad6 -- 102 - SDL_SCANCODE_KP_7, // VirtualKey.NumberPad7 -- 103 - SDL_SCANCODE_KP_8, // VirtualKey.NumberPad8 -- 104 - SDL_SCANCODE_KP_9, // VirtualKey.NumberPad9 -- 105 - SDL_SCANCODE_KP_MULTIPLY, // VirtualKey.Multiply -- 106 - SDL_SCANCODE_KP_PLUS, // VirtualKey.Add -- 107 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Separator -- 108 - SDL_SCANCODE_KP_MINUS, // VirtualKey.Subtract -- 109 - SDL_SCANCODE_UNKNOWN, // VirtualKey.Decimal -- 110 (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?) - SDL_SCANCODE_KP_DIVIDE, // VirtualKey.Divide -- 111 - SDL_SCANCODE_F1, // VirtualKey.F1 -- 112 - SDL_SCANCODE_F2, // VirtualKey.F2 -- 113 - SDL_SCANCODE_F3, // VirtualKey.F3 -- 114 - SDL_SCANCODE_F4, // VirtualKey.F4 -- 115 - SDL_SCANCODE_F5, // VirtualKey.F5 -- 116 - SDL_SCANCODE_F6, // VirtualKey.F6 -- 117 - SDL_SCANCODE_F7, // VirtualKey.F7 -- 118 - SDL_SCANCODE_F8, // VirtualKey.F8 -- 119 - SDL_SCANCODE_F9, // VirtualKey.F9 -- 120 - SDL_SCANCODE_F10, // VirtualKey.F10 -- 121 - SDL_SCANCODE_F11, // VirtualKey.F11 -- 122 - SDL_SCANCODE_F12, // VirtualKey.F12 -- 123 - SDL_SCANCODE_F13, // VirtualKey.F13 -- 124 - SDL_SCANCODE_F14, // VirtualKey.F14 -- 125 - SDL_SCANCODE_F15, // VirtualKey.F15 -- 126 - SDL_SCANCODE_F16, // VirtualKey.F16 -- 127 - SDL_SCANCODE_F17, // VirtualKey.F17 -- 128 - SDL_SCANCODE_F18, // VirtualKey.F18 -- 129 - SDL_SCANCODE_F19, // VirtualKey.F19 -- 130 - SDL_SCANCODE_F20, // VirtualKey.F20 -- 131 - SDL_SCANCODE_F21, // VirtualKey.F21 -- 132 - SDL_SCANCODE_F22, // VirtualKey.F22 -- 133 - SDL_SCANCODE_F23, // VirtualKey.F23 -- 134 - SDL_SCANCODE_F24, // VirtualKey.F24 -- 135 - SDL_SCANCODE_UNKNOWN, // -- 136 - SDL_SCANCODE_UNKNOWN, // -- 137 - SDL_SCANCODE_UNKNOWN, // -- 138 - SDL_SCANCODE_UNKNOWN, // -- 139 - SDL_SCANCODE_UNKNOWN, // -- 140 - SDL_SCANCODE_UNKNOWN, // -- 141 - SDL_SCANCODE_UNKNOWN, // -- 142 - SDL_SCANCODE_UNKNOWN, // -- 143 - SDL_SCANCODE_NUMLOCKCLEAR, // VirtualKey.NumberKeyLock -- 144 - SDL_SCANCODE_SCROLLLOCK, // VirtualKey.Scroll -- 145 - SDL_SCANCODE_UNKNOWN, // -- 146 - SDL_SCANCODE_UNKNOWN, // -- 147 - SDL_SCANCODE_UNKNOWN, // -- 148 - SDL_SCANCODE_UNKNOWN, // -- 149 - SDL_SCANCODE_UNKNOWN, // -- 150 - SDL_SCANCODE_UNKNOWN, // -- 151 - SDL_SCANCODE_UNKNOWN, // -- 152 - SDL_SCANCODE_UNKNOWN, // -- 153 - SDL_SCANCODE_UNKNOWN, // -- 154 - SDL_SCANCODE_UNKNOWN, // -- 155 - SDL_SCANCODE_UNKNOWN, // -- 156 - SDL_SCANCODE_UNKNOWN, // -- 157 - SDL_SCANCODE_UNKNOWN, // -- 158 - SDL_SCANCODE_UNKNOWN, // -- 159 - SDL_SCANCODE_LSHIFT, // VirtualKey.LeftShift -- 160 - SDL_SCANCODE_RSHIFT, // VirtualKey.RightShift -- 161 - SDL_SCANCODE_LCTRL, // VirtualKey.LeftControl -- 162 - SDL_SCANCODE_RCTRL, // VirtualKey.RightControl -- 163 - SDL_SCANCODE_MENU, // VirtualKey.LeftMenu -- 164 - SDL_SCANCODE_MENU, // VirtualKey.RightMenu -- 165 - SDL_SCANCODE_AC_BACK, // VirtualKey.GoBack -- 166 : The go back key. - SDL_SCANCODE_AC_FORWARD, // VirtualKey.GoForward -- 167 : The go forward key. - SDL_SCANCODE_AC_REFRESH, // VirtualKey.Refresh -- 168 : The refresh key. - SDL_SCANCODE_AC_STOP, // VirtualKey.Stop -- 169 : The stop key. - SDL_SCANCODE_AC_SEARCH, // VirtualKey.Search -- 170 : The search key. - SDL_SCANCODE_AC_BOOKMARKS, // VirtualKey.Favorites -- 171 : The favorites key. - SDL_SCANCODE_AC_HOME // VirtualKey.GoHome -- 172 : The go home key. + SDL_SCANCODE_UNKNOWN, /* VirtualKey.None -- 0 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftButton -- 1 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightButton -- 2 */ + SDL_SCANCODE_CANCEL, /* VirtualKey.Cancel -- 3 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.MiddleButton -- 4 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton1 -- 5 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton2 -- 6 */ + SDL_SCANCODE_UNKNOWN, /* -- 7 */ + SDL_SCANCODE_BACKSPACE, /* VirtualKey.Back -- 8 */ + SDL_SCANCODE_TAB, /* VirtualKey.Tab -- 9 */ + SDL_SCANCODE_UNKNOWN, /* -- 10 */ + SDL_SCANCODE_UNKNOWN, /* -- 11 */ + SDL_SCANCODE_CLEAR, /* VirtualKey.Clear -- 12 */ + SDL_SCANCODE_RETURN, /* VirtualKey.Enter -- 13 */ + SDL_SCANCODE_UNKNOWN, /* -- 14 */ + SDL_SCANCODE_UNKNOWN, /* -- 15 */ + SDL_SCANCODE_LSHIFT, /* VirtualKey.Shift -- 16 */ + SDL_SCANCODE_LCTRL, /* VirtualKey.Control -- 17 */ + SDL_SCANCODE_MENU, /* VirtualKey.Menu -- 18 */ + SDL_SCANCODE_PAUSE, /* VirtualKey.Pause -- 19 */ + SDL_SCANCODE_CAPSLOCK, /* VirtualKey.CapitalLock -- 20 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Kana or VirtualKey.Hangul -- 21 */ + SDL_SCANCODE_UNKNOWN, /* -- 22 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Junja -- 23 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Final -- 24 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Hanja or VirtualKey.Kanji -- 25 */ + SDL_SCANCODE_UNKNOWN, /* -- 26 */ + SDL_SCANCODE_ESCAPE, /* VirtualKey.Escape -- 27 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Convert -- 28 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.NonConvert -- 29 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Accept -- 30 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.ModeChange -- 31 (maybe SDL_SCANCODE_MODE ?) */ + SDL_SCANCODE_SPACE, /* VirtualKey.Space -- 32 */ + SDL_SCANCODE_PAGEUP, /* VirtualKey.PageUp -- 33 */ + SDL_SCANCODE_PAGEDOWN, /* VirtualKey.PageDown -- 34 */ + SDL_SCANCODE_END, /* VirtualKey.End -- 35 */ + SDL_SCANCODE_HOME, /* VirtualKey.Home -- 36 */ + SDL_SCANCODE_LEFT, /* VirtualKey.Left -- 37 */ + SDL_SCANCODE_UP, /* VirtualKey.Up -- 38 */ + SDL_SCANCODE_RIGHT, /* VirtualKey.Right -- 39 */ + SDL_SCANCODE_DOWN, /* VirtualKey.Down -- 40 */ + SDL_SCANCODE_SELECT, /* VirtualKey.Select -- 41 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Print -- 42 (maybe SDL_SCANCODE_PRINTSCREEN ?) */ + SDL_SCANCODE_EXECUTE, /* VirtualKey.Execute -- 43 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Snapshot -- 44 */ + SDL_SCANCODE_INSERT, /* VirtualKey.Insert -- 45 */ + SDL_SCANCODE_DELETE, /* VirtualKey.Delete -- 46 */ + SDL_SCANCODE_HELP, /* VirtualKey.Help -- 47 */ + SDL_SCANCODE_0, /* VirtualKey.Number0 -- 48 */ + SDL_SCANCODE_1, /* VirtualKey.Number1 -- 49 */ + SDL_SCANCODE_2, /* VirtualKey.Number2 -- 50 */ + SDL_SCANCODE_3, /* VirtualKey.Number3 -- 51 */ + SDL_SCANCODE_4, /* VirtualKey.Number4 -- 52 */ + SDL_SCANCODE_5, /* VirtualKey.Number5 -- 53 */ + SDL_SCANCODE_6, /* VirtualKey.Number6 -- 54 */ + SDL_SCANCODE_7, /* VirtualKey.Number7 -- 55 */ + SDL_SCANCODE_8, /* VirtualKey.Number8 -- 56 */ + SDL_SCANCODE_9, /* VirtualKey.Number9 -- 57 */ + SDL_SCANCODE_UNKNOWN, /* -- 58 */ + SDL_SCANCODE_UNKNOWN, /* -- 59 */ + SDL_SCANCODE_UNKNOWN, /* -- 60 */ + SDL_SCANCODE_UNKNOWN, /* -- 61 */ + SDL_SCANCODE_UNKNOWN, /* -- 62 */ + SDL_SCANCODE_UNKNOWN, /* -- 63 */ + SDL_SCANCODE_UNKNOWN, /* -- 64 */ + SDL_SCANCODE_A, /* VirtualKey.A -- 65 */ + SDL_SCANCODE_B, /* VirtualKey.B -- 66 */ + SDL_SCANCODE_C, /* VirtualKey.C -- 67 */ + SDL_SCANCODE_D, /* VirtualKey.D -- 68 */ + SDL_SCANCODE_E, /* VirtualKey.E -- 69 */ + SDL_SCANCODE_F, /* VirtualKey.F -- 70 */ + SDL_SCANCODE_G, /* VirtualKey.G -- 71 */ + SDL_SCANCODE_H, /* VirtualKey.H -- 72 */ + SDL_SCANCODE_I, /* VirtualKey.I -- 73 */ + SDL_SCANCODE_J, /* VirtualKey.J -- 74 */ + SDL_SCANCODE_K, /* VirtualKey.K -- 75 */ + SDL_SCANCODE_L, /* VirtualKey.L -- 76 */ + SDL_SCANCODE_M, /* VirtualKey.M -- 77 */ + SDL_SCANCODE_N, /* VirtualKey.N -- 78 */ + SDL_SCANCODE_O, /* VirtualKey.O -- 79 */ + SDL_SCANCODE_P, /* VirtualKey.P -- 80 */ + SDL_SCANCODE_Q, /* VirtualKey.Q -- 81 */ + SDL_SCANCODE_R, /* VirtualKey.R -- 82 */ + SDL_SCANCODE_S, /* VirtualKey.S -- 83 */ + SDL_SCANCODE_T, /* VirtualKey.T -- 84 */ + SDL_SCANCODE_U, /* VirtualKey.U -- 85 */ + SDL_SCANCODE_V, /* VirtualKey.V -- 86 */ + SDL_SCANCODE_W, /* VirtualKey.W -- 87 */ + SDL_SCANCODE_X, /* VirtualKey.X -- 88 */ + SDL_SCANCODE_Y, /* VirtualKey.Y -- 89 */ + SDL_SCANCODE_Z, /* VirtualKey.Z -- 90 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftWindows -- 91 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?) */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightWindows -- 92 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?) */ + SDL_SCANCODE_APPLICATION, /* VirtualKey.Application -- 93 */ + SDL_SCANCODE_UNKNOWN, /* -- 94 */ + SDL_SCANCODE_SLEEP, /* VirtualKey.Sleep -- 95 */ + SDL_SCANCODE_KP_0, /* VirtualKey.NumberPad0 -- 96 */ + SDL_SCANCODE_KP_1, /* VirtualKey.NumberPad1 -- 97 */ + SDL_SCANCODE_KP_2, /* VirtualKey.NumberPad2 -- 98 */ + SDL_SCANCODE_KP_3, /* VirtualKey.NumberPad3 -- 99 */ + SDL_SCANCODE_KP_4, /* VirtualKey.NumberPad4 -- 100 */ + SDL_SCANCODE_KP_5, /* VirtualKey.NumberPad5 -- 101 */ + SDL_SCANCODE_KP_6, /* VirtualKey.NumberPad6 -- 102 */ + SDL_SCANCODE_KP_7, /* VirtualKey.NumberPad7 -- 103 */ + SDL_SCANCODE_KP_8, /* VirtualKey.NumberPad8 -- 104 */ + SDL_SCANCODE_KP_9, /* VirtualKey.NumberPad9 -- 105 */ + SDL_SCANCODE_KP_MULTIPLY, /* VirtualKey.Multiply -- 106 */ + SDL_SCANCODE_KP_PLUS, /* VirtualKey.Add -- 107 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Separator -- 108 */ + SDL_SCANCODE_KP_MINUS, /* VirtualKey.Subtract -- 109 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Decimal -- 110 (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?) */ + SDL_SCANCODE_KP_DIVIDE, /* VirtualKey.Divide -- 111 */ + SDL_SCANCODE_F1, /* VirtualKey.F1 -- 112 */ + SDL_SCANCODE_F2, /* VirtualKey.F2 -- 113 */ + SDL_SCANCODE_F3, /* VirtualKey.F3 -- 114 */ + SDL_SCANCODE_F4, /* VirtualKey.F4 -- 115 */ + SDL_SCANCODE_F5, /* VirtualKey.F5 -- 116 */ + SDL_SCANCODE_F6, /* VirtualKey.F6 -- 117 */ + SDL_SCANCODE_F7, /* VirtualKey.F7 -- 118 */ + SDL_SCANCODE_F8, /* VirtualKey.F8 -- 119 */ + SDL_SCANCODE_F9, /* VirtualKey.F9 -- 120 */ + SDL_SCANCODE_F10, /* VirtualKey.F10 -- 121 */ + SDL_SCANCODE_F11, /* VirtualKey.F11 -- 122 */ + SDL_SCANCODE_F12, /* VirtualKey.F12 -- 123 */ + SDL_SCANCODE_F13, /* VirtualKey.F13 -- 124 */ + SDL_SCANCODE_F14, /* VirtualKey.F14 -- 125 */ + SDL_SCANCODE_F15, /* VirtualKey.F15 -- 126 */ + SDL_SCANCODE_F16, /* VirtualKey.F16 -- 127 */ + SDL_SCANCODE_F17, /* VirtualKey.F17 -- 128 */ + SDL_SCANCODE_F18, /* VirtualKey.F18 -- 129 */ + SDL_SCANCODE_F19, /* VirtualKey.F19 -- 130 */ + SDL_SCANCODE_F20, /* VirtualKey.F20 -- 131 */ + SDL_SCANCODE_F21, /* VirtualKey.F21 -- 132 */ + SDL_SCANCODE_F22, /* VirtualKey.F22 -- 133 */ + SDL_SCANCODE_F23, /* VirtualKey.F23 -- 134 */ + SDL_SCANCODE_F24, /* VirtualKey.F24 -- 135 */ + SDL_SCANCODE_UNKNOWN, /* -- 136 */ + SDL_SCANCODE_UNKNOWN, /* -- 137 */ + SDL_SCANCODE_UNKNOWN, /* -- 138 */ + SDL_SCANCODE_UNKNOWN, /* -- 139 */ + SDL_SCANCODE_UNKNOWN, /* -- 140 */ + SDL_SCANCODE_UNKNOWN, /* -- 141 */ + SDL_SCANCODE_UNKNOWN, /* -- 142 */ + SDL_SCANCODE_UNKNOWN, /* -- 143 */ + SDL_SCANCODE_NUMLOCKCLEAR, /* VirtualKey.NumberKeyLock -- 144 */ + SDL_SCANCODE_SCROLLLOCK, /* VirtualKey.Scroll -- 145 */ + SDL_SCANCODE_UNKNOWN, /* -- 146 */ + SDL_SCANCODE_UNKNOWN, /* -- 147 */ + SDL_SCANCODE_UNKNOWN, /* -- 148 */ + SDL_SCANCODE_UNKNOWN, /* -- 149 */ + SDL_SCANCODE_UNKNOWN, /* -- 150 */ + SDL_SCANCODE_UNKNOWN, /* -- 151 */ + SDL_SCANCODE_UNKNOWN, /* -- 152 */ + SDL_SCANCODE_UNKNOWN, /* -- 153 */ + SDL_SCANCODE_UNKNOWN, /* -- 154 */ + SDL_SCANCODE_UNKNOWN, /* -- 155 */ + SDL_SCANCODE_UNKNOWN, /* -- 156 */ + SDL_SCANCODE_UNKNOWN, /* -- 157 */ + SDL_SCANCODE_UNKNOWN, /* -- 158 */ + SDL_SCANCODE_UNKNOWN, /* -- 159 */ + SDL_SCANCODE_LSHIFT, /* VirtualKey.LeftShift -- 160 */ + SDL_SCANCODE_RSHIFT, /* VirtualKey.RightShift -- 161 */ + SDL_SCANCODE_LCTRL, /* VirtualKey.LeftControl -- 162 */ + SDL_SCANCODE_RCTRL, /* VirtualKey.RightControl -- 163 */ + SDL_SCANCODE_MENU, /* VirtualKey.LeftMenu -- 164 */ + SDL_SCANCODE_MENU, /* VirtualKey.RightMenu -- 165 */ + SDL_SCANCODE_AC_BACK, /* VirtualKey.GoBack -- 166 : The go back key. */ + SDL_SCANCODE_AC_FORWARD, /* VirtualKey.GoForward -- 167 : The go forward key. */ + SDL_SCANCODE_AC_REFRESH, /* VirtualKey.Refresh -- 168 : The refresh key. */ + SDL_SCANCODE_AC_STOP, /* VirtualKey.Stop -- 169 : The stop key. */ + SDL_SCANCODE_AC_SEARCH, /* VirtualKey.Search -- 170 : The search key. */ + SDL_SCANCODE_AC_BOOKMARKS, /* VirtualKey.Favorites -- 171 : The favorites key. */ + SDL_SCANCODE_AC_HOME /* VirtualKey.GoHome -- 172 : The go home key. */ }; -static std::unordered_map WinRT_Unofficial_Keycodes; +/* Attempt to translate a keycode that isn't listed in WinRT's VirtualKey enum. + */ +static SDL_Scancode +WINRT_TranslateUnofficialKeycode(int keycode) +{ + switch (keycode) { + case 173: return SDL_SCANCODE_MUTE; /* VK_VOLUME_MUTE */ + case 174: return SDL_SCANCODE_VOLUMEDOWN; /* VK_VOLUME_DOWN */ + case 175: return SDL_SCANCODE_VOLUMEUP; /* VK_VOLUME_UP */ + case 176: return SDL_SCANCODE_AUDIONEXT; /* VK_MEDIA_NEXT_TRACK */ + case 177: return SDL_SCANCODE_AUDIOPREV; /* VK_MEDIA_PREV_TRACK */ + // case 178: return ; /* VK_MEDIA_STOP */ + case 179: return SDL_SCANCODE_AUDIOPLAY; /* VK_MEDIA_PLAY_PAUSE */ + case 180: return SDL_SCANCODE_MAIL; /* VK_LAUNCH_MAIL */ + case 181: return SDL_SCANCODE_MEDIASELECT; /* VK_LAUNCH_MEDIA_SELECT */ + // case 182: return ; /* VK_LAUNCH_APP1 */ + case 183: return SDL_SCANCODE_CALCULATOR; /* VK_LAUNCH_APP2 */ + // case 184: return ; /* ... reserved ... */ + // case 185: return ; /* ... reserved ... */ + case 186: return SDL_SCANCODE_SEMICOLON; /* VK_OEM_1, ';:' key on US standard keyboards */ + case 187: return SDL_SCANCODE_EQUALS; /* VK_OEM_PLUS */ + case 188: return SDL_SCANCODE_COMMA; /* VK_OEM_COMMA */ + case 189: return SDL_SCANCODE_MINUS; /* VK_OEM_MINUS */ + case 190: return SDL_SCANCODE_PERIOD; /* VK_OEM_PERIOD */ + case 191: return SDL_SCANCODE_SLASH; /* VK_OEM_2, '/?' key on US standard keyboards */ + case 192: return SDL_SCANCODE_GRAVE; /* VK_OEM_3, '`~' key on US standard keyboards */ + // ? + // ... reserved or unassigned ... + // ? + case 219: return SDL_SCANCODE_LEFTBRACKET; /* VK_OEM_4, '[{' key on US standard keyboards */ + case 220: return SDL_SCANCODE_BACKSLASH; /* VK_OEM_5, '\|' key on US standard keyboards */ + case 221: return SDL_SCANCODE_RIGHTBRACKET; /* VK_OEM_6, ']}' key on US standard keyboards */ + case 222: return SDL_SCANCODE_APOSTROPHE; /* VK_OEM_7, 'single/double quote' on US standard keyboards */ + default: break; + } + return SDL_SCANCODE_UNKNOWN; +} static SDL_Scancode -TranslateKeycode(int keycode) +WINRT_TranslateKeycode(int keycode, unsigned int nativeScancode) { - if (WinRT_Unofficial_Keycodes.empty()) { - /* Set up a table of keycodes that aren't listed in WinRT's - * VirtualKey enum. - */ + // TODO, WinRT: try filling out the WinRT keycode table as much as possible, using the Win32 table for interpretation hints - WinRT_Unofficial_Keycodes[173] = SDL_SCANCODE_MUTE; - WinRT_Unofficial_Keycodes[174] = SDL_SCANCODE_VOLUMEDOWN; - WinRT_Unofficial_Keycodes[175] = SDL_SCANCODE_VOLUMEUP; - WinRT_Unofficial_Keycodes[176] = SDL_SCANCODE_AUDIONEXT; - WinRT_Unofficial_Keycodes[177] = SDL_SCANCODE_AUDIOPREV; - // WinRT_Unofficial_Keycodes[178] = ; - WinRT_Unofficial_Keycodes[179] = SDL_SCANCODE_AUDIOPLAY; - WinRT_Unofficial_Keycodes[180] = SDL_SCANCODE_MAIL; - WinRT_Unofficial_Keycodes[181] = SDL_SCANCODE_MEDIASELECT; - // WinRT_Unofficial_Keycodes[182] = ; - WinRT_Unofficial_Keycodes[183] = SDL_SCANCODE_CALCULATOR; - // WinRT_Unofficial_Keycodes[184] = ; - // WinRT_Unofficial_Keycodes[185] = ; - WinRT_Unofficial_Keycodes[186] = SDL_SCANCODE_SEMICOLON; - WinRT_Unofficial_Keycodes[187] = SDL_SCANCODE_EQUALS; - WinRT_Unofficial_Keycodes[188] = SDL_SCANCODE_COMMA; - WinRT_Unofficial_Keycodes[189] = SDL_SCANCODE_MINUS; - WinRT_Unofficial_Keycodes[190] = SDL_SCANCODE_PERIOD; - WinRT_Unofficial_Keycodes[191] = SDL_SCANCODE_SLASH; - WinRT_Unofficial_Keycodes[192] = SDL_SCANCODE_GRAVE; - // ? - // ... - // ? - WinRT_Unofficial_Keycodes[219] = SDL_SCANCODE_LEFTBRACKET; - WinRT_Unofficial_Keycodes[220] = SDL_SCANCODE_BACKSLASH; - WinRT_Unofficial_Keycodes[221] = SDL_SCANCODE_RIGHTBRACKET; - WinRT_Unofficial_Keycodes[222] = SDL_SCANCODE_APOSTROPHE; + SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; + + /* HACK ALERT: At least one VirtualKey constant (Shift) with a left/right + * designation might not get reported with its correct handedness, however + * its hardware scan code can fill in the gaps. If this is detected, + * use the hardware scan code to try telling if the left, or the right + * side's key was used. + * + * If Microsoft ever allows MapVirtualKey or MapVirtualKeyEx to be used + * in WinRT apps, or something similar to these (it doesn't appear to be, + * at least not for Windows [Phone] 8/8.1, as of Oct 24, 2014), then this + * hack might become deprecated, or obsolete. + */ + if (nativeScancode < SDL_arraysize(windows_scancode_table)) { + switch (keycode) { + case 16: // VirtualKey.Shift + switch (windows_scancode_table[nativeScancode]) { + case SDL_SCANCODE_LSHIFT: + case SDL_SCANCODE_RSHIFT: + return windows_scancode_table[nativeScancode]; + } + break; + + // Add others, as necessary. + // + // Unfortunately, this hack doesn't seem to work in determining + // handedness with Control keys. + + default: + break; + } } - /* Try to get a documented, WinRT, 'VirtualKey' first (as documented at + /* Try to get a documented, WinRT, 'VirtualKey' next (as documented at http://msdn.microsoft.com/en-us/library/windows/apps/windows.system.virtualkey.aspx ). If that fails, fall back to a Win32 virtual key. + If that fails, attempt to fall back to a scancode-derived key. */ - // TODO, WinRT: try filling out the WinRT keycode table as much as possible, using the Win32 table for interpretation hints - //SDL_Log("WinRT TranslateKeycode, keycode=%d\n", (int)keycode); - SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; if (keycode < SDL_arraysize(WinRT_Official_Keycodes)) { scancode = WinRT_Official_Keycodes[keycode]; } if (scancode == SDL_SCANCODE_UNKNOWN) { - if (WinRT_Unofficial_Keycodes.find(keycode) != WinRT_Unofficial_Keycodes.end()) { - scancode = WinRT_Unofficial_Keycodes[keycode]; + scancode = WINRT_TranslateUnofficialKeycode(keycode); + } + if (scancode == SDL_SCANCODE_UNKNOWN) { + if (nativeScancode < SDL_arraysize(windows_scancode_table)) { + scancode = windows_scancode_table[nativeScancode]; } } + /* if (scancode == SDL_SCANCODE_UNKNOWN) { SDL_Log("WinRT TranslateKeycode, unknown keycode=%d\n", (int)keycode); } + */ return scancode; } void WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args) { - SDL_Scancode sdlScancode = TranslateKeycode((int)args->VirtualKey); + SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode); #if 0 SDL_Keycode keycode = SDL_GetKeyFromScancode(sdlScancode); - SDL_Log("key down, handled=%s, ext?=%s, released?=%s, menu key down?=%s, repeat count=%d, native scan code=%d, was down?=%s, vkey=%d, sdl scan code=%d (%s), sdl key code=%d (%s)\n", + SDL_Log("key down, handled=%s, ext?=%s, released?=%s, menu key down?=%s, " + "repeat count=%d, native scan code=0x%x, was down?=%s, vkey=%d, " + "sdl scan code=%d (%s), sdl key code=%d (%s)\n", (args->Handled ? "1" : "0"), (args->KeyStatus.IsExtendedKey ? "1" : "0"), (args->KeyStatus.IsKeyReleased ? "1" : "0"), @@ -297,7 +335,6 @@ WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args) keycode, SDL_GetKeyName(keycode)); //args->Handled = true; - //VirtualKey vkey = args->VirtualKey; #endif SDL_SendKeyboardKey(SDL_PRESSED, sdlScancode); } @@ -305,10 +342,12 @@ WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args) void WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args) { - SDL_Scancode sdlScancode = TranslateKeycode((int)args->VirtualKey); + SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode); #if 0 SDL_Keycode keycode = SDL_GetKeyFromScancode(sdlScancode); - SDL_Log("key up, handled=%s, ext?=%s, released?=%s, menu key down?=%s, repeat count=%d, native scan code=%d, was down?=%s, vkey=%d, sdl scan code=%d (%s), sdl key code=%d (%s)\n", + SDL_Log("key up, handled=%s, ext?=%s, released?=%s, menu key down?=%s, " + "repeat count=%d, native scan code=0x%x, was down?=%s, vkey=%d, " + "sdl scan code=%d (%s), sdl key code=%d (%s)\n", (args->Handled ? "1" : "0"), (args->KeyStatus.IsExtendedKey ? "1" : "0"), (args->KeyStatus.IsKeyReleased ? "1" : "0"), @@ -326,4 +365,22 @@ WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args) SDL_SendKeyboardKey(SDL_RELEASED, sdlScancode); } +void +WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^args) +{ + wchar_t src_ucs2[2]; + char dest_utf8[16]; + int result; + + /* Setup src */ + src_ucs2[0] = args->KeyCode; + src_ucs2[1] = L'\0'; + + /* Convert the text, then send an SDL_TEXTINPUT event. */ + result = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)&src_ucs2, -1, (LPSTR)dest_utf8, sizeof(dest_utf8), NULL, NULL); + if (result > 0) { + SDL_SendKeyboardText(dest_utf8); + } +} + #endif // SDL_VIDEO_DRIVER_WINRT diff --git a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmessagebox.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmessagebox.cpp index a2153ce0..dc38d214 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmessagebox.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmessagebox.h b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmessagebox.h index 63e23c5c..8cae479a 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmessagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmouse.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmouse.cpp index 4c04a211..cfebe9e0 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmouse.cpp +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmouse_c.h b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmouse_c.h index 676669b3..f97af04d 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtmouse_c.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtopengles.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtopengles.cpp index 4a84174d..04c61ab9 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtopengles.cpp +++ b/jni/SDL2-2.0.3/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,6 +36,16 @@ using namespace Windows::UI::Core; /* ANGLE/WinRT constants */ static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0; +#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 /* @@ -52,34 +62,114 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) } /* Load ANGLE/WinRT-specific functions */ - CreateWinrtEglWindow_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Function) SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow"); - if (!CreateWinrtEglWindow) { - return SDL_SetError("Could not retrieve ANGLE/WinRT function CreateWinrtEglWindow"); - } + CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function) SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow"); + if (CreateWinrtEglWindow) { + /* 'CreateWinrtEglWindow' was found, which means that an an older + * version of ANGLE/WinRT is being used. Continue setting up EGL, + * as appropriate to this version of ANGLE. + */ - /* Create an ANGLE/WinRT EGL-window */ - /* TODO, WinRT: check for XAML usage before accessing the CoreWindow, as not doing so could lead to a crash */ - CoreWindow ^ native_win = CoreWindow::GetForCurrentThread(); - Microsoft::WRL::ComPtr cpp_win = reinterpret_cast(native_win); - HRESULT result = CreateWinrtEglWindow(cpp_win, ANGLE_D3D_FEATURE_LEVEL_ANY, &(video_data->winrtEglWindow)); - if (FAILED(result)) { - return -1; - } + /* Create an ANGLE/WinRT EGL-window */ + /* TODO, WinRT: check for XAML usage before accessing the CoreWindow, as not doing so could lead to a crash */ + CoreWindow ^ native_win = CoreWindow::GetForCurrentThread(); + Microsoft::WRL::ComPtr cpp_win = reinterpret_cast(native_win); + HRESULT result = CreateWinrtEglWindow(cpp_win, ANGLE_D3D_FEATURE_LEVEL_ANY, &(video_data->winrtEglWindow)); + if (FAILED(result)) { + return -1; + } - /* Call eglGetDisplay and eglInitialize as appropriate. On other - * platforms, this would probably get done by SDL_EGL_LoadLibrary, - * however ANGLE/WinRT's current implementation (as of Mar 22, 2014) of - * eglGetDisplay requires that a C++ object be passed into it, so the - * call will be made in this file, a C++ file, instead. - */ - Microsoft::WRL::ComPtr cpp_display = video_data->winrtEglWindow; - _this->egl_data->egl_display = ((eglGetDisplay_Function)_this->egl_data->eglGetDisplay)(cpp_display); - if (!_this->egl_data->egl_display) { - return SDL_SetError("Could not get EGL display"); - } - - if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - return SDL_SetError("Could not initialize EGL"); + /* Call eglGetDisplay and eglInitialize as appropriate. On other + * platforms, this would probably get done by SDL_EGL_LoadLibrary, + * however ANGLE/WinRT's current implementation (as of Mar 22, 2014) of + * eglGetDisplay requires that a C++ object be passed into it, so the + * call will be made in this file, a C++ file, instead. + */ + 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 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 Windows 8.0 EGL"); + } + } else { + /* Declare some ANGLE/EGL initialization property-sets, as suggested by + * MSOpenTech's ANGLE-for-WinRT template apps: + */ + 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_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, + EGL_NONE, + }; + + const EGLint fl9_3DisplayAttributes[] = + { + 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_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_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, + }; + + /* 'CreateWinrtEglWindow' was NOT found, which either means that a + * newer version of ANGLE/WinRT is being used, or that we don't have + * a valid copy of ANGLE. + * + * Try loading ANGLE as if it were the newer version. + */ + eglGetPlatformDisplayEXT_Function eglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_Function)_this->egl_data->eglGetProcAddress("eglGetPlatformDisplayEXT"); + if (!eglGetPlatformDisplayEXT) { + return SDL_SetError("Could not retrieve ANGLE/WinRT display function(s)"); + } + +#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) + /* Try initializing EGL at D3D11 Feature Level 10_0+ (which is not + * supported on WinPhone 8.x. + */ + _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 10_0+ EGL display"); + } + + if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) +#endif + { + /* Try initializing EGL at D3D11 Feature Level 9_3, in case the + * 10_0 init fails, or we're on Windows Phone (which only supports + * 9_3). + */ + _this->egl_data->egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes); + if (!_this->egl_data->egl_display) { + return SDL_SetError("Could not get 9_3 EGL display"); + } + + if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { + /* Try initializing EGL at D3D11 Feature Level 11_0 on WARP + * (a Windows-provided, software rasterizer) if all else fails. + */ + _this->egl_data->egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes); + if (!_this->egl_data->egl_display) { + return SDL_SetError("Could not get WARP EGL display"); + } + + if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { + return SDL_SetError("Could not initialize WinRT 8.x+ EGL"); + } + } + } } return 0; diff --git a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtopengles.h b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtopengles.h index ae173917..a0fde81a 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtopengles.h +++ b/jni/SDL2-2.0.3/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 @@ -47,18 +47,22 @@ extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext cont /* Typedefs for ANGLE/WinRT's C++-based native-display and native-window types, * which are used when calling eglGetDisplay and eglCreateWindowSurface. */ -typedef Microsoft::WRL::ComPtr WINRT_EGLNativeWindowType; -typedef WINRT_EGLNativeWindowType WINRT_EGLNativeDisplayType; +typedef Microsoft::WRL::ComPtr WINRT_EGLNativeWindowType_Old; -/* Function pointer typedefs for ANGLE/WinRT's functions that require - * parameter customization [by passing in C++ objects]. +/* Function pointer typedefs for 'old' ANGLE/WinRT's functions, which may + * require that C++ objects be passed in: */ -typedef EGLDisplay (EGLAPIENTRY *eglGetDisplay_Function)(WINRT_EGLNativeWindowType); -typedef EGLSurface (EGLAPIENTRY *eglCreateWindowSurface_Function)(EGLDisplay, EGLConfig, WINRT_EGLNativeWindowType, const EGLint *); -typedef HRESULT (EGLAPIENTRY *CreateWinrtEglWindow_Function)(Microsoft::WRL::ComPtr, int, IUnknown ** result); +typedef EGLDisplay (EGLAPIENTRY *eglGetDisplay_Old_Function)(WINRT_EGLNativeWindowType_Old); +typedef EGLSurface (EGLAPIENTRY *eglCreateWindowSurface_Old_Function)(EGLDisplay, EGLConfig, WINRT_EGLNativeWindowType_Old, const EGLint *); +typedef HRESULT (EGLAPIENTRY *CreateWinrtEglWindow_Old_Function)(Microsoft::WRL::ComPtr, int, IUnknown ** result); #endif /* __cplusplus */ +/* Function pointer typedefs for 'new' ANGLE/WinRT functions, which, unlike + * the old functions, do not require C++ support and work with plain C. + */ +typedef EGLDisplay (EGLAPIENTRY *eglGetPlatformDisplayEXT_Function)(EGLenum, void *, const EGLint *); + #endif /* SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL */ #endif /* _SDL_winrtopengles_h */ diff --git a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtpointerinput.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtpointerinput.cpp index a2f7e4b5..2bd3adf2 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/jni/SDL2-2.0.3/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 @@ -233,8 +233,8 @@ void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::Po if (!WINRT_LeftFingerDown) { if (button) { - SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y); - SDL_SendMouseButton(window, 0, SDL_PRESSED, button); + SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y); + SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, button); } WINRT_LeftFingerDown = pointerPoint->PointerId; @@ -262,9 +262,9 @@ WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPo if ( ! WINRT_IsTouchEvent(pointerPoint)) { SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y); - } else if (pointerPoint->PointerId == WINRT_LeftFingerDown) { + } else { if (pointerPoint->PointerId == WINRT_LeftFingerDown) { - SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y); + SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y); } SDL_SendTouchMotion( @@ -291,7 +291,7 @@ void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::P if (WINRT_LeftFingerDown == pointerPoint->PointerId) { if (button) { - SDL_SendMouseButton(window, 0, SDL_RELEASED, button); + SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, button); } WINRT_LeftFingerDown = 0; } @@ -306,6 +306,28 @@ void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::P } } +void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +{ + if (!window) { + return; + } + + if (!WINRT_IsTouchEvent(pointerPoint)) { + SDL_SetMouseFocus(window); + } +} + +void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +{ + if (!window) { + return; + } + + if (!WINRT_IsTouchEvent(pointerPoint)) { + SDL_SetMouseFocus(NULL); + } +} + void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) { @@ -315,7 +337,7 @@ WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::Po // FIXME: This may need to accumulate deltas up to WHEEL_DELTA short motion = pointerPoint->Properties->MouseWheelDelta / WHEEL_DELTA; - SDL_SendMouseWheel(window, 0, 0, motion); + SDL_SendMouseWheel(window, 0, 0, motion, SDL_MOUSEWHEEL_NORMAL); } void diff --git a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtvideo.cpp b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtvideo.cpp index 6ec01609..726a5347 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtvideo.cpp +++ b/jni/SDL2-2.0.3/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 @@ -30,8 +30,18 @@ /* Windows includes */ #include -#include +#include +#include +#include +using namespace Windows::ApplicationModel::Core; +using namespace Windows::Foundation; +using namespace Windows::Graphics::Display; using namespace Windows::UI::Core; +using namespace Windows::UI::ViewManagement; + + +/* [re]declare Windows GUIDs locally, to limit the amount of external lib(s) SDL has to link to */ +static const GUID IID_IDXGIFactory2 = { 0x50c83a1c, 0xe072, 0x4c48,{ 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0 } }; /* SDL includes */ @@ -44,6 +54,7 @@ extern "C" { #include "../../render/SDL_sysrender.h" #include "SDL_syswm.h" #include "SDL_winrtopengles.h" +#include "../../core/windows/SDL_windows.h" } #include "../../core/winrt/SDL_winrtapp_direct3d.h" @@ -65,6 +76,8 @@ static void WINRT_VideoQuit(_THIS); /* Window functions */ static int WINRT_CreateWindow(_THIS, SDL_Window * window); +static void WINRT_SetWindowSize(_THIS, SDL_Window * window); +static void WINRT_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen); static void WINRT_DestroyWindow(_THIS, SDL_Window * window); static SDL_bool WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info); @@ -123,6 +136,8 @@ WINRT_CreateDevice(int devindex) device->VideoInit = WINRT_VideoInit; device->VideoQuit = WINRT_VideoQuit; device->CreateWindow = WINRT_CreateWindow; + device->SetWindowSize = WINRT_SetWindowSize; + device->SetWindowFullscreen = WINRT_SetWindowFullscreen; device->DestroyWindow = WINRT_DestroyWindow; device->SetDisplayMode = WINRT_SetDisplayMode; device->PumpEvents = WINRT_PumpEvents; @@ -161,110 +176,178 @@ WINRT_VideoInit(_THIS) return 0; } -int -WINRT_CalcDisplayModeUsingNativeWindow(SDL_DisplayMode * mode) +extern "C" +Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat); + +static void +WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC * dxgiMode, SDL_DisplayMode * sdlMode) { - SDL_DisplayModeData * driverdata; - - using namespace Windows::Graphics::Display; - - // Go no further if a native window cannot be accessed. This can happen, - // for example, if this function is called from certain threads, such as - // the SDL/XAML thread. - if (!CoreWindow::GetForCurrentThread()) { - return SDL_SetError("SDL/WinRT display modes cannot be calculated outside of the main thread, such as in SDL's XAML thread"); - } - - //SDL_Log("%s, size={%f,%f}, current orientation=%d, native orientation=%d, auto rot. pref=%d, DPI = %f\n", - // __FUNCTION__, - // CoreWindow::GetForCurrentThread()->Bounds.Width, CoreWindow::GetForCurrentThread()->Bounds.Height, - // WINRT_DISPLAY_PROPERTY(CurrentOrientation), - // WINRT_DISPLAY_PROPERTY(NativeOrientation), - // WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - // WINRT_DISPLAY_PROPERTY(LogicalDpi)); - - // Calculate the display size given the window size, taking into account - // the current display's DPI: - const float currentDPI = WINRT_DISPLAY_PROPERTY(LogicalDpi); - const float dipsPerInch = 96.0f; - const int w = (int) ((CoreWindow::GetForCurrentThread()->Bounds.Width * currentDPI) / dipsPerInch); - const int h = (int) ((CoreWindow::GetForCurrentThread()->Bounds.Height * currentDPI) / dipsPerInch); - if (w == 0 || w == h) { - return SDL_SetError("Unable to calculate the WinRT window/display's size"); - } - - // Create a driverdata field: - driverdata = (SDL_DisplayModeData *) SDL_malloc(sizeof(*driverdata)); - if (!driverdata) { - return SDL_OutOfMemory(); - } - SDL_zerop(driverdata); - - // Fill in most fields: - SDL_zerop(mode); - mode->format = SDL_PIXELFORMAT_RGB888; - mode->refresh_rate = 0; // TODO, WinRT: see if refresh rate data is available, or relevant (for WinRT apps) - mode->w = w; - mode->h = h; - mode->driverdata = driverdata; - driverdata->currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); - -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION == NTDDI_WIN8) - // On Windows Phone 8.0, the native window's size is always in portrait, - // regardless of the device's orientation. This is in contrast to - // Windows 8.x/RT and Windows Phone 8.1, which will resize the native window as the device's - // orientation changes. In order to compensate for this behavior, - // on Windows Phone, the mode's width and height will be swapped when - // the device is in a landscape (non-portrait) mode. - switch (driverdata->currentOrientation) { - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: - { - const int tmp = mode->h; - mode->h = mode->w; - mode->w = tmp; - break; - } - - default: - break; - } -#endif - - return 0; + SDL_zerop(sdlMode); + sdlMode->w = dxgiMode->Width; + sdlMode->h = dxgiMode->Height; + sdlMode->refresh_rate = dxgiMode->RefreshRate.Numerator / dxgiMode->RefreshRate.Denominator; + sdlMode->format = D3D11_DXGIFormatToSDLPixelFormat(dxgiMode->Format); } -int -WINRT_DuplicateDisplayMode(SDL_DisplayMode * dest, const SDL_DisplayMode * src) +static int +WINRT_AddDisplaysForOutput (_THIS, IDXGIAdapter1 * dxgiAdapter1, int outputIndex) { - SDL_DisplayModeData * driverdata; - driverdata = (SDL_DisplayModeData *) SDL_malloc(sizeof(*driverdata)); - if (!driverdata) { - return SDL_OutOfMemory(); + HRESULT hr; + IDXGIOutput * dxgiOutput = NULL; + DXGI_OUTPUT_DESC dxgiOutputDesc; + SDL_VideoDisplay display; + char * displayName = NULL; + UINT numModes; + DXGI_MODE_DESC * dxgiModes = NULL; + int functionResult = -1; /* -1 for failure, 0 for success */ + DXGI_MODE_DESC modeToMatch, closestMatch; + + SDL_zero(display); + + hr = dxgiAdapter1->EnumOutputs(outputIndex, &dxgiOutput); + if (FAILED(hr)) { + if (hr != DXGI_ERROR_NOT_FOUND) { + WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIAdapter1::EnumOutputs failed", hr); + } + goto done; } - SDL_memcpy(driverdata, src->driverdata, sizeof(SDL_DisplayModeData)); - SDL_memcpy(dest, src, sizeof(SDL_DisplayMode)); - dest->driverdata = driverdata; + + hr = dxgiOutput->GetDesc(&dxgiOutputDesc); + if (FAILED(hr)) { + WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDesc failed", hr); + goto done; + } + + SDL_zero(modeToMatch); + modeToMatch.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + modeToMatch.Width = (dxgiOutputDesc.DesktopCoordinates.right - dxgiOutputDesc.DesktopCoordinates.left); + modeToMatch.Height = (dxgiOutputDesc.DesktopCoordinates.bottom - dxgiOutputDesc.DesktopCoordinates.top); + hr = dxgiOutput->FindClosestMatchingMode(&modeToMatch, &closestMatch, NULL); + if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { + /* DXGI_ERROR_NOT_CURRENTLY_AVAILABLE gets returned by IDXGIOutput::FindClosestMatchingMode + when running under the Windows Simulator, which uses Remote Desktop (formerly known as Terminal + Services) under the hood. According to the MSDN docs for the similar function, + IDXGIOutput::GetDisplayModeList, DXGI_ERROR_NOT_CURRENTLY_AVAILABLE is returned if and + when an app is run under a Terminal Services session, hence the assumption. + + In this case, just add an SDL display mode, with approximated values. + */ + SDL_DisplayMode mode; + SDL_zero(mode); + display.name = "Windows Simulator / Terminal Services Display"; + mode.w = (dxgiOutputDesc.DesktopCoordinates.right - dxgiOutputDesc.DesktopCoordinates.left); + mode.h = (dxgiOutputDesc.DesktopCoordinates.bottom - dxgiOutputDesc.DesktopCoordinates.top); + mode.format = DXGI_FORMAT_B8G8R8A8_UNORM; + mode.refresh_rate = 0; /* Display mode is unknown, so just fill in zero, as specified by SDL's header files */ + display.desktop_mode = mode; + display.current_mode = mode; + if ( ! SDL_AddDisplayMode(&display, &mode)) { + goto done; + } + } else if (FAILED(hr)) { + WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::FindClosestMatchingMode failed", hr); + goto done; + } else { + displayName = WIN_StringToUTF8(dxgiOutputDesc.DeviceName); + display.name = displayName; + WINRT_DXGIModeToSDLDisplayMode(&closestMatch, &display.desktop_mode); + display.current_mode = display.desktop_mode; + + hr = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, NULL); + if (FAILED(hr)) { + if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { + // TODO, WinRT: make sure display mode(s) are added when using Terminal Services / Windows Simulator + } + WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDisplayModeList [get mode list size] failed", hr); + goto done; + } + + dxgiModes = (DXGI_MODE_DESC *)SDL_calloc(numModes, sizeof(DXGI_MODE_DESC)); + if ( ! dxgiModes) { + SDL_OutOfMemory(); + goto done; + } + + hr = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, dxgiModes); + if (FAILED(hr)) { + WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDisplayModeList [get mode contents] failed", hr); + goto done; + } + + for (UINT i = 0; i < numModes; ++i) { + SDL_DisplayMode sdlMode; + WINRT_DXGIModeToSDLDisplayMode(&dxgiModes[i], &sdlMode); + SDL_AddDisplayMode(&display, &sdlMode); + } + } + + if (SDL_AddVideoDisplay(&display) < 0) { + goto done; + } + + functionResult = 0; /* 0 for Success! */ +done: + if (dxgiModes) { + SDL_free(dxgiModes); + } + if (dxgiOutput) { + dxgiOutput->Release(); + } + if (displayName) { + SDL_free(displayName); + } + return functionResult; +} + +static int +WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterIndex) +{ + HRESULT hr; + IDXGIAdapter1 * dxgiAdapter1; + + hr = dxgiFactory2->EnumAdapters1(adapterIndex, &dxgiAdapter1); + if (FAILED(hr)) { + if (hr != DXGI_ERROR_NOT_FOUND) { + WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIFactory1::EnumAdapters1() failed", hr); + } + return -1; + } + + for (int outputIndex = 0; ; ++outputIndex) { + if (WINRT_AddDisplaysForOutput(_this, dxgiAdapter1, outputIndex) < 0) { + break; + } + } + + dxgiAdapter1->Release(); return 0; } int WINRT_InitModes(_THIS) { - // Retrieve the display mode: - SDL_DisplayMode mode, desktop_mode; - if (WINRT_CalcDisplayModeUsingNativeWindow(&mode) != 0) { - return -1; // If WINRT_CalcDisplayModeUsingNativeWindow fails, it'll already have set the SDL error - } + /* HACK: Initialize a single display, for whatever screen the app's + CoreApplicationView is on. + TODO, WinRT: Try initializing multiple displays, one for each monitor. + Appropriate WinRT APIs for this seem elusive, though. -- DavidL + */ - if (WINRT_DuplicateDisplayMode(&desktop_mode, &mode) != 0) { - return -1; - } - if (SDL_AddBasicVideoDisplay(&desktop_mode) < 0) { + HRESULT hr; + IDXGIFactory2 * dxgiFactory2 = NULL; + + hr = CreateDXGIFactory1(IID_IDXGIFactory2, (void **)&dxgiFactory2); + if (FAILED(hr)) { + WIN_SetErrorFromHRESULT(__FUNCTION__ ", CreateDXGIFactory1() failed", hr); return -1; } - SDL_AddDisplayMode(&_this->displays[0], &mode); + int adapterIndex = 0; + for (int adapterIndex = 0; ; ++adapterIndex) { + if (WINRT_AddDisplaysForAdapter(_this, dxgiFactory2, adapterIndex) < 0) { + break; + } + } + return 0; } @@ -280,6 +363,94 @@ WINRT_VideoQuit(_THIS) WINRT_QuitMouse(_this); } +static const Uint32 WINRT_DetectableFlags = + SDL_WINDOW_MAXIMIZED | + SDL_WINDOW_FULLSCREEN_DESKTOP | + SDL_WINDOW_SHOWN | + SDL_WINDOW_HIDDEN | + SDL_WINDOW_MOUSE_FOCUS; + +extern "C" Uint32 +WINRT_DetectWindowFlags(SDL_Window * window) +{ + Uint32 latestFlags = 0; + SDL_WindowData * data = (SDL_WindowData *) window->driverdata; + bool is_fullscreen = false; + +#if SDL_WINRT_USE_APPLICATIONVIEW + if (data->appView) { + is_fullscreen = data->appView->IsFullScreen; + } +#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION == NTDDI_WIN8) + is_fullscreen = true; +#endif + + if (data->coreWindow.Get()) { + if (is_fullscreen) { + SDL_VideoDisplay * display = SDL_GetDisplayForWindow(window); + int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); + int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); + +#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8) + // On all WinRT platforms, except for WinPhone 8.0, rotate the + // window size. This is needed to properly calculate + // fullscreen vs. maximized. + const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); + switch (currentOrientation) { +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + case DisplayOrientations::Landscape: + case DisplayOrientations::LandscapeFlipped: +#else + case DisplayOrientations::Portrait: + case DisplayOrientations::PortraitFlipped: +#endif + { + int tmp = w; + w = h; + h = tmp; + } break; + } +#endif + + if (display->desktop_mode.w != w || display->desktop_mode.h != h) { + latestFlags |= SDL_WINDOW_MAXIMIZED; + } else { + latestFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + } + } + + if (data->coreWindow->Visible) { + latestFlags |= SDL_WINDOW_SHOWN; + } else { + latestFlags |= SDL_WINDOW_HIDDEN; + } + +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION < NTDDI_WINBLUE) + // data->coreWindow->PointerPosition is not supported on WinPhone 8.0 + latestFlags |= SDL_WINDOW_MOUSE_FOCUS; +#else + if (data->coreWindow->Bounds.Contains(data->coreWindow->PointerPosition)) { + latestFlags |= SDL_WINDOW_MOUSE_FOCUS; + } +#endif + } + + return latestFlags; +} + +void +WINRT_UpdateWindowFlags(SDL_Window * window, Uint32 mask) +{ + mask &= WINRT_DetectableFlags; + if (window) { + Uint32 apply = WINRT_DetectWindowFlags(window); + if ((apply & mask) & SDL_WINDOW_FULLSCREEN) { + window->last_fullscreen_flags = window->flags; // seems necessary to programmatically un-fullscreen, via SDL APIs + } + window->flags = (window->flags & ~mask) | (apply & mask); + } +} + int WINRT_CreateWindow(_THIS, SDL_Window * window) { @@ -290,7 +461,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) return -1; } - SDL_WindowData *data = new SDL_WindowData; + SDL_WindowData *data = new SDL_WindowData; /* use 'new' here as SDL_WindowData may use WinRT/C++ types */ if (!data) { SDL_OutOfMemory(); return -1; @@ -306,8 +477,14 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) */ if (!WINRT_XAMLWasEnabled) { data->coreWindow = CoreWindow::GetForCurrentThread(); +#if SDL_WINRT_USE_APPLICATIONVIEW + data->appView = ApplicationView::GetForCurrentView(); +#endif } + /* Make note of the requested window flags, before they start getting changed. */ + const Uint32 requestedFlags = window->flags; + #if SDL_VIDEO_OPENGL_EGL /* Setup the EGL surface, but only if OpenGL ES 2 was requested. */ if (!(window->flags & SDL_WINDOW_OPENGL)) { @@ -318,38 +495,51 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) SDL_VideoData * video_data = (SDL_VideoData *)_this->driverdata; /* Call SDL_EGL_ChooseConfig and eglCreateWindowSurface directly, - * rather than via SDL_EGL_CreateSurface, as ANGLE/WinRT requires - * a C++ object, ComPtr, to be passed into - * eglCreateWindowSurface. + * rather than via SDL_EGL_CreateSurface, as older versions of + * ANGLE/WinRT may require that a C++ object, ComPtr, + * be passed into eglCreateWindowSurface. */ 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); } - Microsoft::WRL::ComPtr cpp_winrtEglWindow = video_data->winrtEglWindow; - data->egl_surface = ((eglCreateWindowSurface_Function)_this->egl_data->eglCreateWindowSurface)( - _this->egl_data->egl_display, - _this->egl_data->egl_config, - cpp_winrtEglWindow, NULL); - if (data->egl_surface == NULL) { - return SDL_SetError("eglCreateWindowSurface failed"); + if (video_data->winrtEglWindow) { /* ... is the 'old' version of ANGLE/WinRT being used? */ + /* Attempt to create a window surface using older versions of + * ANGLE/WinRT: + */ + Microsoft::WRL::ComPtr cpp_winrtEglWindow = video_data->winrtEglWindow; + data->egl_surface = ((eglCreateWindowSurface_Old_Function)_this->egl_data->eglCreateWindowSurface)( + _this->egl_data->egl_display, + _this->egl_data->egl_config, + cpp_winrtEglWindow, NULL); + if (data->egl_surface == NULL) { + return SDL_SetError("eglCreateWindowSurface failed"); + } + } else if (data->coreWindow.Get() != nullptr) { + /* Attempt to create a window surface using newer versions of + * ANGLE/WinRT: + */ + IInspectable * coreWindowAsIInspectable = reinterpret_cast(data->coreWindow.Get()); + data->egl_surface = _this->egl_data->eglCreateWindowSurface( + _this->egl_data->egl_display, + _this->egl_data->egl_config, + coreWindowAsIInspectable, + NULL); + if (data->egl_surface == NULL) { + return SDL_SetError("eglCreateWindowSurface failed"); + } + } else { + return SDL_SetError("No supported means to create an EGL window surface are available"); } } #endif - /* Make sure the window is considered to be positioned at {0,0}, - and is considered fullscreen, shown, and the like. - */ - window->x = 0; - window->y = 0; + /* Determine as many flags dynamically, as possible. */ window->flags = - SDL_WINDOW_FULLSCREEN | - SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS | - SDL_WINDOW_MAXIMIZED | - SDL_WINDOW_INPUT_GRABBED; + SDL_WINDOW_RESIZABLE; #if SDL_VIDEO_OPENGL_EGL if (data->egl_surface) { @@ -357,20 +547,60 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) } #endif - /* WinRT does not, as of this writing, appear to support app-adjustable - window sizes. Set the window size to whatever the native WinRT - CoreWindow is set at. + if (WINRT_XAMLWasEnabled) { + /* TODO, WinRT: set SDL_Window size, maybe position too, from XAML control */ + window->x = 0; + window->y = 0; + window->flags |= SDL_WINDOW_SHOWN; + SDL_SetMouseFocus(NULL); // TODO: detect this + SDL_SetKeyboardFocus(NULL); // TODO: detect this + } else { + /* WinRT 8.x apps seem to live in an environment where the OS controls the + app's window size, with some apps being fullscreen, depending on + user choice of various things. For now, just adapt the SDL_Window to + whatever Windows set-up as the native-window's geometry. + */ + window->x = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Left); + window->y = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Top); +#if NTDDI_VERSION < NTDDI_WIN10 + /* On WinRT 8.x / pre-Win10, just use the size we were given. */ + window->w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); + window->h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); +#else + /* On Windows 10, we occasionally get control over window size. For windowed + mode apps, try this. + */ + bool didSetSize = false; + if (!(requestedFlags & SDL_WINDOW_FULLSCREEN)) { + const Windows::Foundation::Size size(WINRT_PHYSICAL_PIXELS_TO_DIPS(window->w), + WINRT_PHYSICAL_PIXELS_TO_DIPS(window->h)); + didSetSize = data->appView->TryResizeView(size); + } + if (!didSetSize) { + /* We either weren't able to set the window size, or a request for + fullscreen was made. Get window-size info from the OS. + */ + window->w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); + window->h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); + } +#endif - TODO, WinRT: if and when non-fullscreen XAML control support is added to SDL, consider making those resizable via SDL_Window's interfaces. - */ - window->w = _this->displays[0].current_mode.w; - window->h = _this->displays[0].current_mode.h; + WINRT_UpdateWindowFlags( + window, + 0xffffffff /* Update any window flag(s) that WINRT_UpdateWindow can handle */ + ); - /* For now, treat WinRT apps as if they always have focus. - TODO, WinRT: try tracking keyboard and mouse focus state with respect to snapped apps - */ - SDL_SetMouseFocus(window); - SDL_SetKeyboardFocus(window); + /* Try detecting if the window is active */ + bool isWindowActive = true; /* Presume the window is active, unless we've been told otherwise */ + if (data->coreWindow->CustomProperties->HasKey("SDLHelperWindowActivationState")) { + CoreWindowActivationState activationState = \ + safe_cast(data->coreWindow->CustomProperties->Lookup("SDLHelperWindowActivationState")); + isWindowActive = (activationState != CoreWindowActivationState::Deactivated); + } + if (isWindowActive) { + SDL_SetKeyboardFocus(window); + } + } /* Make sure the WinRT app's IFramworkView can post events on behalf of SDL: @@ -381,6 +611,35 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) return 0; } +void +WINRT_SetWindowSize(_THIS, SDL_Window * window) +{ +#if NTDDI_VERSION >= NTDDI_WIN10 + SDL_WindowData * data = (SDL_WindowData *)window->driverdata; + const Windows::Foundation::Size size(WINRT_PHYSICAL_PIXELS_TO_DIPS(window->w), + WINRT_PHYSICAL_PIXELS_TO_DIPS(window->h)); + data->appView->TryResizeView(size); // TODO, WinRT: return failure (to caller?) from TryResizeView() +#endif +} + +void +WINRT_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +{ +#if NTDDI_VERSION >= NTDDI_WIN10 + SDL_WindowData * data = (SDL_WindowData *)window->driverdata; + if (fullscreen) { + if (!data->appView->IsFullScreenMode) { + data->appView->TryEnterFullScreenMode(); // TODO, WinRT: return failure (to caller?) from TryEnterFullScreenMode() + } + } else { + if (data->appView->IsFullScreenMode) { + data->appView->ExitFullScreenMode(); + } + } +#endif +} + + void WINRT_DestroyWindow(_THIS, SDL_Window * window) { @@ -394,6 +653,7 @@ WINRT_DestroyWindow(_THIS, SDL_Window * window) // Delete the internal window data: delete data; data = NULL; + window->driverdata = NULL; } } diff --git a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtvideo_cpp.h b/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtvideo_cpp.h index e327280d..84f75a6c 100644 --- a/jni/SDL2-2.0.3/src/video/winrt/SDL_winrtvideo_cpp.h +++ b/jni/SDL2-2.0.3/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 @@ -29,6 +29,12 @@ #include "SDL_video.h" #include "SDL_events.h" +#if NTDDI_VERSION >= NTDDI_WINBLUE /* ApplicationView's functionality only becomes + useful for SDL in Win[Phone] 8.1 and up. + Plus, it is not available at all in WinPhone 8.0. */ +#define SDL_WINRT_USE_APPLICATIONVIEW 1 +#endif + extern "C" { #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -48,25 +54,17 @@ typedef struct SDL_VideoData { */ extern SDL_Window * WINRT_GlobalSDLWindow; -/* Creates a display mode for Plain Direct3D (non-XAML) apps, using the lone, native window's settings. - - Pass in an allocated SDL_DisplayMode field to store the data in. - - This function will return 0 on success, -1 on failure. - - If this function succeeds, be sure to call SDL_free on the - SDL_DisplayMode's driverdata field. +/* Updates one or more SDL_Window flags, by querying the OS' native windowing APIs. + SDL_Window flags that can be updated should be specified in 'mask'. */ -extern int WINRT_CalcDisplayModeUsingNativeWindow(SDL_DisplayMode * mode); - -/* Duplicates a display mode, copying over driverdata as necessary */ -extern int WINRT_DuplicateDisplayMode(SDL_DisplayMode * dest, const SDL_DisplayMode * src); +extern void WINRT_UpdateWindowFlags(SDL_Window * window, Uint32 mask); +extern "C" Uint32 WINRT_DetectWindowFlags(SDL_Window * window); /* detects flags w/o applying them */ /* Display mode internals */ -typedef struct -{ - Windows::Graphics::Display::DisplayOrientations currentOrientation; -} SDL_DisplayModeData; +//typedef struct +//{ +// Windows::Graphics::Display::DisplayOrientations currentOrientation; +//} SDL_DisplayModeData; #ifdef __cplusplus_winrt @@ -77,6 +75,10 @@ typedef struct #define WINRT_DISPLAY_PROPERTY(NAME) (Windows::Graphics::Display::DisplayProperties::NAME) #endif +/* Converts DIPS to/from physical pixels */ +#define WINRT_DIPS_TO_PHYSICAL_PIXELS(DIPS) ((int)(0.5f + (((float)(DIPS) * (float)WINRT_DISPLAY_PROPERTY(LogicalDpi)) / 96.f))) +#define WINRT_PHYSICAL_PIXELS_TO_DIPS(PHYSPIX) (((float)(PHYSPIX) * 96.f)/WINRT_DISPLAY_PROPERTY(LogicalDpi)) + /* Internal window data */ struct SDL_WindowData { @@ -85,6 +87,9 @@ struct SDL_WindowData #ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif +#if SDL_WINRT_USE_APPLICATIONVIEW + Windows::UI::ViewManagement::ApplicationView ^ appView; +#endif }; #endif // ifdef __cplusplus_winrt diff --git a/jni/SDL2-2.0.3/src/video/x11/SDL_x11clipboard.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11clipboard.c index 2999d983..eca40f2a 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11clipboard.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11clipboard.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11clipboard.h index 46291cf6..09dcf568 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11clipboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11dyn.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11dyn.c index 97760ba3..58e97be7 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11dyn.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11dyn.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11dyn.h index 7d2e077c..2d729b70 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11dyn.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11events.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11events.c index b4b33d76..2f730c44 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11events.c +++ b/jni/SDL2-2.0.3/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,84 +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; - SDL_Window* window = data->window; - 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 @@ -607,6 +608,25 @@ 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); + SDL_SendKeymapChangedEvent(); + } return; } @@ -674,12 +694,17 @@ 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(_this, data); + } + else + { + data->pending_focus = PENDING_FOCUS_IN; + data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_TIME; } - data->pending_focus = PENDING_FOCUS_IN; - data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_IN_TIME; } break; @@ -702,28 +727,17 @@ X11_DispatchEvent(_THIS) #ifdef DEBUG_XEVENTS printf("window %p: FocusOut!\n", data); #endif - data->pending_focus = PENDING_FOCUS_OUT; - data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_OUT_TIME; - } - 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); + if (!videodata->last_mode_change_deadline) /* no recent mode changes */ + { + data->pending_focus = PENDING_FOCUS_NONE; + data->pending_focus_time = 0; + X11_DispatchFocusOut(_this, data); + } + else + { + data->pending_focus = PENDING_FOCUS_OUT; + data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_TIME; + } } break; @@ -745,7 +759,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", @@ -761,21 +775,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); + } } } @@ -867,12 +879,19 @@ X11_DispatchEvent(_THIS) /* Have we been requested to quit (or another client message?) */ case ClientMessage:{ - int xdnd_version=0; + static int xdnd_version=0; if (xevent.xclient.message_type == videodata->XdndEnter) { + 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 : %d\n", xdnd_version); + printf("More then 3 data types : %d\n", (int) use_list); +#endif + if (use_list) { /* fetch conversion targets */ SDL_x11Prop p; @@ -886,6 +905,15 @@ X11_DispatchEvent(_THIS) } } else if (xevent.xclient.message_type == videodata->XdndPosition) { + +#ifdef DEBUG_XEVENTS + Atom act= videodata->XdndActionCopy; + if(xdnd_version >= 2) { + act = xevent.xclient.data.l[4]; + } + printf("Action requested by user is : %s\n", X11_XGetAtomName(display , act)); +#endif + /* reply with status */ memset(&m, 0, sizeof(XClientMessageEvent)); @@ -973,22 +1001,37 @@ X11_DispatchEvent(_THIS) break; case ButtonPress:{ - int ticks = 0; - if (X11_IsWheelEvent(display,&xevent,&ticks)) { - SDL_SendMouseWheel(data->window, 0, 0, ticks); + 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; @@ -997,7 +1040,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) { @@ -1049,18 +1092,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); } } } @@ -1075,20 +1118,38 @@ X11_DispatchEvent(_THIS) without ever mapping / unmapping them, so we handle that here, because they use the NETWM protocol to notify us of changes. */ - Uint32 flags = X11_GetNetWMState(_this, xevent.xproperty.window); - if ((flags^data->window->flags) & SDL_WINDOW_HIDDEN || - (flags^data->window->flags) & SDL_WINDOW_FULLSCREEN ) { - if (flags & SDL_WINDOW_HIDDEN) { - X11_DispatchUnmapNotify(data); - } else { - X11_DispatchMapNotify(data); + const Uint32 flags = X11_GetNetWMState(_this, xevent.xproperty.window); + const Uint32 changed = flags ^ data->window->flags; + + if ((changed & SDL_WINDOW_HIDDEN) || (changed & SDL_WINDOW_FULLSCREEN)) { + if (flags & SDL_WINDOW_HIDDEN) { + X11_DispatchUnmapNotify(data); + } else { + X11_DispatchMapNotify(data); } } + + if (changed & SDL_WINDOW_MAXIMIZED) { + if (flags & SDL_WINDOW_MAXIMIZED) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + } 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); + SDL_SendKeymapChangedEvent(); } } 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; @@ -1110,8 +1171,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); @@ -1121,12 +1183,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); } @@ -1203,6 +1266,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); @@ -1224,10 +1297,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; } @@ -1268,9 +1341,15 @@ X11_PumpEvents(_THIS) { SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + if (data->last_mode_change_deadline) { + if (SDL_TICKS_PASSED(SDL_GetTicks(), data->last_mode_change_deadline)) { + data->last_mode_change_deadline = 0; /* assume we're done. */ + } + } + /* Update activity every 30 seconds to prevent screensaver */ if (_this->suspend_screensaver) { - Uint32 now = SDL_GetTicks(); + const Uint32 now = SDL_GetTicks(); if (!data->screensaver_activity || SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) { X11_XResetScreenSaver(data->display); @@ -1283,17 +1362,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/jni/SDL2-2.0.3/src/video/x11/SDL_x11events.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11events.h index e27d53ac..a6d434de 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11events.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11framebuffer.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11framebuffer.c index 19d9d0ba..90a4a6fc 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11framebuffer.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11framebuffer.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11framebuffer.h index c73c7487..359ee157 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11framebuffer.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11keyboard.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11keyboard.c index 53866ab5..b04830f1 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11keyboard.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11keyboard.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11keyboard.h index 6037e5c0..1e9c48ca 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11keyboard.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11messagebox.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11messagebox.c index 2a98e3c3..a52d4c9e 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11messagebox.c +++ b/jni/SDL2-2.0.3/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,6 +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, _NET_WM_NAME, UTF8_STRING; Display *display = data->display; SDL_WindowData *windowdata = NULL; const SDL_MessageBoxData *messageboxdata = data->messageboxdata; @@ -400,6 +412,18 @@ 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); + _NET_WM_WINDOW_TYPE_DIALOG = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE_DIALOG", False); + X11_XChangeProperty(display, data->window, _NET_WM_WINDOW_TYPE, XA_ATOM, 32, + PropModeReplace, + (unsigned char *)&_NET_WM_WINDOW_TYPE_DIALOG, 1); /* Allow the window to be deleted by the window manager */ data->wm_protocols = X11_XInternAtom( display, "WM_PROTOCOLS", False ); @@ -415,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 ); @@ -437,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; } @@ -445,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 ); @@ -497,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. */ @@ -531,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. */ @@ -560,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; @@ -710,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/jni/SDL2-2.0.3/src/video/x11/SDL_x11messagebox.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11messagebox.h index d2d17128..37d8312c 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11messagebox.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11modes.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11modes.c index 0fc6d238..d3f8874b 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11modes.c +++ b/jni/SDL2-2.0.3/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 @@ -24,6 +24,7 @@ #include "SDL_hints.h" #include "SDL_x11video.h" +#include "SDL_timer.h" #include "edid.h" /* #define X11MODES_DEBUG */ @@ -191,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 @@ -228,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 @@ -251,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)) { @@ -284,6 +302,206 @@ 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) +{ + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + Display *dpy = data->display; + const int screencount = ScreenCount(dpy); + const int default_screen = DefaultScreen(dpy); + RROutput primary = X11_XRRGetOutputPrimary(dpy, RootWindow(dpy, default_screen)); + Atom EDID = X11_XInternAtom(dpy, "EDID", False); + XRRScreenResources *res = NULL; + Uint32 pixelformat; + XVisualInfo vinfo; + XPixmapFormatValues *pixmapformats; + int looking_for_primary; + int scanline_pad; + int output; + int screen, i, n; + + for (looking_for_primary = 1; looking_for_primary >= 0; looking_for_primary--) { + for (screen = 0; screen < screencount; screen++) { + + /* we want the primary output first, and then skipped later. */ + if ((looking_for_primary && (screen != default_screen)) || + (!looking_for_primary && (screen == default_screen))) { + continue; + } + + if (get_visualinfo(dpy, screen, &vinfo) < 0) { + continue; /* uh, skip this screen? */ + } + + pixelformat = X11_GetPixelFormatFromVisualInfo(dpy, &vinfo); + if (SDL_ISPIXELFORMAT_INDEXED(pixelformat)) { + continue; /* 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) { + continue; + } + + 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 && ((screen != default_screen) || (res->outputs[output] != primary))) || + (!looking_for_primary && (screen == default_screen) && (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 @@ -383,21 +601,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; } @@ -409,14 +645,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; @@ -509,6 +737,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) { @@ -533,106 +773,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 @@ -712,7 +852,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) { @@ -726,7 +868,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); + } } } @@ -751,9 +895,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); } } @@ -786,9 +929,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); } } @@ -806,17 +947,22 @@ 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); + } } } int X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + Display *display = viddata->display; SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata; + viddata->last_mode_change_deadline = SDL_GetTicks() + (PENDING_FOCUS_TIME * 2); + #if SDL_VIDEO_DRIVER_X11_XRANDR if (data->use_xrandr) { XRRScreenResources *res; @@ -896,6 +1042,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/jni/SDL2-2.0.3/src/video/x11/SDL_x11modes.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11modes.h index 82af1d2d..769da5a5 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11modes.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11mouse.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11mouse.c index 02d96da7..6cef0a4e 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11mouse.c +++ b/jni/SDL2-2.0.3/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 @@ -378,12 +379,18 @@ X11_GetGlobalMouseState(int *x, int *y) int rootx, rooty, winx, winy; unsigned int mask; if (X11_XQueryPointer(display, RootWindow(display, data->screen), &root, &child, &rootx, &rooty, &winx, &winy, &mask)) { + XWindowAttributes root_attrs; Uint32 retval = 0; retval |= (mask & Button1Mask) ? SDL_BUTTON_LMASK : 0; retval |= (mask & Button2Mask) ? SDL_BUTTON_MMASK : 0; retval |= (mask & Button3Mask) ? SDL_BUTTON_RMASK : 0; - *x = data->x + rootx; - *y = data->y + rooty; + /* SDL_DisplayData->x,y point to screen origin, and adding them to mouse coordinates relative to root window doesn't do the right thing + * (observed on dual monitor setup with primary display being the rightmost one - mouse was offset to the right). + * + * Adding root position to root-relative coordinates seems to be a better way to get absolute position. */ + X11_XGetWindowAttributes(display, root, &root_attrs); + *x = root_attrs.x + rootx; + *y = root_attrs.y + rooty; return retval; } } diff --git a/jni/SDL2-2.0.3/src/video/x11/SDL_x11mouse.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11mouse.h index 8a2dac0e..7c6a5443 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11mouse.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengl.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengl.c index 1e94b041..a431ae74 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengl.c +++ b/jni/SDL2-2.0.3/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 @@ -279,14 +286,14 @@ HasExtension(const char *extension, const char *extensions) const char *start; const char *where, *terminator; + if (!extensions) + return SDL_FALSE; + /* Extension names should not have spaces. */ where = SDL_strchr(extension, ' '); if (where || *extension == '\0') return SDL_FALSE; - if (!extensions) - return SDL_FALSE; - /* It takes a bit of care to be fool-proof about parsing the * OpenGL extensions string. Don't be fooled by sub-strings, * etc. */ @@ -312,32 +319,10 @@ static void X11_GL_InitExtensions(_THIS) { Display *display = ((SDL_VideoData *) _this->driverdata)->display; - int screen = DefaultScreen(display); - XVisualInfo *vinfo; - XSetWindowAttributes xattr; - Window w; - GLXContext context; + const int screen = DefaultScreen(display); const char *(*glXQueryExtensionsStringFunc) (Display *, int); const char *extensions; - vinfo = X11_GL_GetVisual(_this, display, screen); - if (!vinfo) { - return; - } - xattr.background_pixel = 0; - xattr.border_pixel = 0; - xattr.colormap = - X11_XCreateColormap(display, RootWindow(display, screen), vinfo->visual, - AllocNone); - w = X11_XCreateWindow(display, RootWindow(display, screen), 0, 0, 32, 32, 0, - vinfo->depth, InputOutput, vinfo->visual, - (CWBackPixel | CWBorderPixel | CWColormap), &xattr); - context = _this->gl_data->glXCreateContext(display, vinfo, NULL, True); - if (context) { - _this->gl_data->glXMakeCurrent(display, w, context); - } - X11_XFree(vinfo); - glXQueryExtensionsStringFunc = (const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this, "glXQueryExtensionsString"); @@ -373,6 +358,16 @@ X11_GL_InitExtensions(_THIS) (int (*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI"); } + /* Check for GLX_ARB_create_context */ + if (HasExtension("GLX_ARB_create_context", extensions)) { + _this->gl_data->glXCreateContextAttribsARB = + (GLXContext (*)(Display*,GLXFBConfig,GLXContext,Bool,const int *)) + X11_GL_GetProcAddress(_this, "glXCreateContextAttribsARB"); + _this->gl_data->glXChooseFBConfig = + (GLXFBConfig *(*)(Display *, int, const int *, int *)) + X11_GL_GetProcAddress(_this, "glXChooseFBConfig"); + } + /* Check for GLX_EXT_visual_rating */ if (HasExtension("GLX_EXT_visual_rating", extensions)) { _this->gl_data->HAS_GLX_EXT_visual_rating = SDL_TRUE; @@ -388,18 +383,16 @@ X11_GL_InitExtensions(_THIS) _this->gl_data->HAS_GLX_EXT_create_context_es2_profile = SDL_TRUE; } - if (context) { - _this->gl_data->glXMakeCurrent(display, None, NULL); - _this->gl_data->glXDestroyContext(display, context); + /* 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; } - X11_XDestroyWindow(display, w); - X11_PumpEvents(_this); } /* 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; @@ -481,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 && @@ -538,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]; @@ -554,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); @@ -576,7 +568,6 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) XVisualInfo v, *vinfo; int n; GLXContext context = NULL, share_context; - PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribs = NULL; if (_this->gl_config.share_with_current_context) { share_context = (GLXContext)SDL_GL_GetCurrentContext(); @@ -586,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); @@ -601,78 +593,61 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) context = _this->gl_data->glXCreateContext(display, vinfo, share_context, True); } else { - /* If we want a GL 3.0 context or later we need to get a temporary - context to grab the new context creation function */ - GLXContext temp_context = - _this->gl_data->glXCreateContext(display, vinfo, NULL, True); - if (temp_context) { - /* max 8 attributes plus terminator */ - int attribs[9] = { - GLX_CONTEXT_MAJOR_VERSION_ARB, - _this->gl_config.major_version, - GLX_CONTEXT_MINOR_VERSION_ARB, - _this->gl_config.minor_version, - 0 - }; - int iattr = 4; + /* max 10 attributes plus terminator */ + int attribs[11] = { + GLX_CONTEXT_MAJOR_VERSION_ARB, + _this->gl_config.major_version, + GLX_CONTEXT_MINOR_VERSION_ARB, + _this->gl_config.minor_version, + 0 + }; + int iattr = 4; - /* SDL profile bits match GLX profile bits */ - if( _this->gl_config.profile_mask != 0 ) { - attribs[iattr++] = GLX_CONTEXT_PROFILE_MASK_ARB; - attribs[iattr++] = _this->gl_config.profile_mask; - } + /* SDL profile bits match GLX profile bits */ + if( _this->gl_config.profile_mask != 0 ) { + attribs[iattr++] = GLX_CONTEXT_PROFILE_MASK_ARB; + attribs[iattr++] = _this->gl_config.profile_mask; + } - /* SDL flags match GLX flags */ - if( _this->gl_config.flags != 0 ) { - attribs[iattr++] = GLX_CONTEXT_FLAGS_ARB; - attribs[iattr++] = _this->gl_config.flags; - } + /* SDL flags match GLX flags */ + if( _this->gl_config.flags != 0 ) { + attribs[iattr++] = GLX_CONTEXT_FLAGS_ARB; + attribs[iattr++] = _this->gl_config.flags; + } - attribs[iattr++] = 0; + /* 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; + } - /* Get a pointer to the context creation function for GL 3.0 */ - glXCreateContextAttribs = - (PFNGLXCREATECONTEXTATTRIBSARBPROC) _this->gl_data-> - glXGetProcAddress((GLubyte *) - "glXCreateContextAttribsARB"); - if (!glXCreateContextAttribs) { - SDL_SetError("GL 3.x is not supported"); - context = temp_context; + attribs[iattr++] = 0; + + /* Get a pointer to the context creation function for GL 3.0 */ + if (!_this->gl_data->glXCreateContextAttribsARB) { + SDL_SetError("OpenGL 3.0 and later are not supported by this system"); + } else { + int glxAttribs[64]; + + /* Create a GL 3.x context */ + GLXFBConfig *framebuffer_config = NULL; + int fbcount = 0; + + X11_GL_GetAttributes(_this,display,screen,glxAttribs,64,SDL_TRUE); + + if (!_this->gl_data->glXChooseFBConfig + || !(framebuffer_config = + _this->gl_data->glXChooseFBConfig(display, + DefaultScreen(display), glxAttribs, + &fbcount))) { + SDL_SetError("No good framebuffers found. OpenGL 3.0 and later unavailable"); } else { - int glxAttribs[64]; - - /* Create a GL 3.x context */ - GLXFBConfig *framebuffer_config = NULL; - int fbcount = 0; - GLXFBConfig *(*glXChooseFBConfig) (Display * disp, - int screen, - const int *attrib_list, - int *nelements); - - glXChooseFBConfig = - (GLXFBConfig * - (*)(Display *, int, const int *, - int *)) _this->gl_data-> - glXGetProcAddress((GLubyte *) "glXChooseFBConfig"); - - X11_GL_GetAttributes(_this,display,screen,glxAttribs,64,SDL_TRUE); - - if (!glXChooseFBConfig - || !(framebuffer_config = - glXChooseFBConfig(display, - DefaultScreen(display), glxAttribs, - &fbcount))) { - SDL_SetError - ("No good framebuffers found. GL 3.x disabled"); - context = temp_context; - } else { - context = - glXCreateContextAttribs(display, + context = _this->gl_data->glXCreateContextAttribsARB(display, framebuffer_config[0], share_context, True, attribs); - _this->gl_data->glXDestroyContext(display, - temp_context); - } } } } @@ -703,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/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengl.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengl.h index ed7f292d..de229735 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengl.h +++ b/jni/SDL2-2.0.3/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,11 +35,14 @@ 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*); XVisualInfo *(*glXChooseVisual) (Display*,int,int*); GLXContext (*glXCreateContext) (Display*,XVisualInfo*,GLXContext,Bool); + GLXContext (*glXCreateContextAttribsARB) (Display*,GLXFBConfig,GLXContext,Bool,const int *); + GLXFBConfig *(*glXChooseFBConfig) (Display*,int,const int *,int *); void (*glXDestroyContext) (Display*, GLXContext); Bool(*glXMakeCurrent) (Display*,GLXDrawable,GLXContext); void (*glXSwapBuffers) (Display*, GLXDrawable); diff --git a/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengles.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengles.c index 5310420c..ca57af38 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengles.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengles.h index f6ea71eb..e39e3c01 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11opengles.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11shape.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11shape.c index 51520946..19c7942d 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11shape.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11shape.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11shape.h index 68118cfe..0d3c2107 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11shape.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11sym.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11sym.h index 9678bac5..4a926a34 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11sym.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11touch.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11touch.c index a6da0463..2b24027a 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11touch.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11touch.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11touch.h index 84de8d63..47645e8f 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11touch.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11video.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11video.c index 4ede655e..9d07438e 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11video.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11video.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11video.h index f076ccec..a544113e 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11video.h +++ b/jni/SDL2-2.0.3/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,10 +111,12 @@ typedef struct SDL_VideoData Atom XdndDrop; Atom XdndFinished; Atom XdndSelection; + Atom XKLAVIER_STATE; SDL_Scancode key_layout[256]; SDL_bool selection_waiting; + Uint32 last_mode_change_deadline; } SDL_VideoData; extern SDL_bool X11_UseDirectColorVisuals(void); diff --git a/jni/SDL2-2.0.3/src/video/x11/SDL_x11window.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11window.c index 05621e0c..b9505611 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11window.c +++ b/jni/SDL2-2.0.3/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)); } @@ -542,11 +542,23 @@ X11_CreateWindow(_THIS, SDL_Window * window) (unsigned char *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1); { - Atom protocols[] = { - data->WM_DELETE_WINDOW, /* Allow window to be deleted by the WM */ - data->_NET_WM_PING, /* Respond so WM knows we're alive */ - }; - X11_XSetWMProtocols(display, w, protocols, sizeof (protocols) / sizeof (protocols[0])); + Atom protocols[2]; + int proto_count = 0; + const char *ping_hint; + + protocols[proto_count] = data->WM_DELETE_WINDOW; /* Allow window to be deleted by the WM */ + proto_count++; + + ping_hint = SDL_GetHint(SDL_HINT_VIDEO_X11_NET_WM_PING); + /* Default to using ping if there is no hint */ + if (!ping_hint || SDL_atoi(ping_hint)) { + protocols[proto_count] = data->_NET_WM_PING; /* Respond so WM knows we're alive */ + proto_count++; + } + + SDL_assert(proto_count <= sizeof(protocols) / sizeof(protocols[0])); + + X11_XSetWMProtocols(display, w, protocols, proto_count); } if (SetupWindowData(_this, window, w, SDL_TRUE) < 0) { @@ -656,67 +668,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 +876,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 +910,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/jni/SDL2-2.0.3/src/video/x11/SDL_x11window.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11window.h index 789d2f7c..a3424ff6 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11window.h +++ b/jni/SDL2-2.0.3/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 @@ -27,8 +27,7 @@ video mode changes and we can respond to them by triggering more mode changes. */ -#define PENDING_FOCUS_IN_TIME 200 -#define PENDING_FOCUS_OUT_TIME 200 +#define PENDING_FOCUS_TIME 200 #if SDL_VIDEO_OPENGL_EGL #include diff --git a/jni/SDL2-2.0.3/src/video/x11/SDL_x11xinput2.c b/jni/SDL2-2.0.3/src/video/x11/SDL_x11xinput2.c index 7c149922..c74e027c 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11xinput2.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/src/video/x11/SDL_x11xinput2.h b/jni/SDL2-2.0.3/src/video/x11/SDL_x11xinput2.h index 3e7178cb..06d3c990 100644 --- a/jni/SDL2-2.0.3/src/video/x11/SDL_x11xinput2.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/Makefile.in b/jni/SDL2-2.0.3/test/Makefile.in index 79edbc31..9a1df774 100644 --- a/jni/SDL2-2.0.3/test/Makefile.in +++ b/jni/SDL2-2.0.3/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) @@ -196,6 +201,15 @@ testnative$(EXE): $(srcdir)/testnative.c \ $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @XLIB@ endif +#there's probably a better way of doing this +ifeq (@ISMACOSX@,false) +ifeq (@ISWINDOWS@,false) +ifeq (@ISUNIX@,false) +testnative$(EXE): ; +endif +endif +endif + testoverlay2$(EXE): $(srcdir)/testoverlay2.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @@ -253,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/jni/SDL2-2.0.3/test/README b/jni/SDL2-2.0.3/test/README index 6ce36167..179b28a4 100644 --- a/jni/SDL2-2.0.3/test/README +++ b/jni/SDL2-2.0.3/test/README @@ -29,3 +29,21 @@ These are test programs for the SDL library: controllermap Useful to generate Game Controller API compatible maps + +This directory contains sample.wav, which is a sample from Will Provost's +song, The Living Proof: + + From the album The Living Proof + Publisher: 5 Guys Named Will + Copyright 1996 Will Provost + +You can get a copy of the full song (and album!) from iTunes... + + https://itunes.apple.com/us/album/the-living-proof/id4153978 + +or Amazon... + + http://www.amazon.com/The-Living-Proof-Will-Provost/dp/B00004R8RH + +Thanks to Will for permitting us to distribute this sample with SDL! + diff --git a/jni/SDL2-2.0.3/test/checkkeys.c b/jni/SDL2-2.0.3/test/checkkeys.c index e157b289..0b51f388 100644 --- a/jni/SDL2-2.0.3/test/checkkeys.c +++ b/jni/SDL2-2.0.3/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 @@ -19,8 +19,14 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -82,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) { @@ -115,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]; @@ -125,22 +145,55 @@ 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 +loop() +{ + SDL_Event event; + /* Check for events */ + /*SDL_WaitEvent(&event); emscripten does not like waiting*/ + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: + 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("INPUT", event.text.text); + break; + case SDL_MOUSEBUTTONDOWN: + /* Any button press quits the app... */ + case SDL_QUIT: + done = 1; + break; + default: + break; + } + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif } int main(int argc, char *argv[]) { SDL_Window *window; - SDL_Event event; - int done; - - /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return (1); } @@ -161,28 +214,20 @@ main(int argc, char *argv[]) SDL_StartTextInput(); + /* Print initial modifier state */ + SDL_PumpEvents(); + PrintModifierState(); + /* Watch keystrokes */ done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ - SDL_WaitEvent(&event); - switch (event.type) { - case SDL_KEYDOWN: - 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_TEXTINPUT: - PrintText(event.text.text); - break; - case SDL_MOUSEBUTTONDOWN: - /* Any button press quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } + loop(); } +#endif SDL_Quit(); return (0); diff --git a/jni/SDL2-2.0.3/test/configure b/jni/SDL2-2.0.3/test/configure index c4545ecb..61c32fba 100755 --- a/jni/SDL2-2.0.3/test/configure +++ b/jni/SDL2-2.0.3/test/configure @@ -2980,6 +2980,11 @@ fi MATHLIB="" SYS_GL_LIBS="-lGLES_CM" ;; + *-*-emscripten* ) + EXE=".bc" + MATHLIB="" + SYS_GL_LIBS="" + ;; *) ISUNIX="true" EXE="" diff --git a/jni/SDL2-2.0.3/test/configure.in b/jni/SDL2-2.0.3/test/configure.in index a55e63df..fd3f3022 100644 --- a/jni/SDL2-2.0.3/test/configure.in +++ b/jni/SDL2-2.0.3/test/configure.in @@ -65,6 +65,12 @@ case "$host" in MATHLIB="" SYS_GL_LIBS="-lGLES_CM" ;; + *-*-emscripten* ) + dnl This should really be .js, but we need to specify extra flags when compiling to js + EXE=".bc" + MATHLIB="" + SYS_GL_LIBS="" + ;; *) dnl Oh well, call it Unix... ISUNIX="true" diff --git a/jni/SDL2-2.0.3/test/controllermap.c b/jni/SDL2-2.0.3/test/controllermap.c index fd7b1444..eca82c37 100644 --- a/jni/SDL2-2.0.3/test/controllermap.c +++ b/jni/SDL2-2.0.3/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 @@ -191,7 +191,6 @@ WatchJoystick(SDL_Joystick * joystick) step->button = -1; step->hat = -1; step->hat_value = -1; - SDL_SetClipboardText("TESTING TESTING 123"); switch(step->marker) { case MARKER_AXIS: @@ -345,7 +344,7 @@ main(int argc, char *argv[]) SDL_Joystick *joystick; /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL (Note: video is required to start event loop) */ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { diff --git a/jni/SDL2-2.0.3/test/loopwave.c b/jni/SDL2-2.0.3/test/loopwave.c index 288cea4a..1e98f4ba 100644 --- a/jni/SDL2-2.0.3/test/loopwave.c +++ b/jni/SDL2-2.0.3/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 @@ -24,8 +24,11 @@ #include #endif +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" -#include "SDL_audio.h" struct { @@ -75,14 +78,23 @@ poked(int sig) done = 1; } +#ifdef __EMSCRIPTEN__ +void +loop() +{ + if(done || (SDL_GetAudioStatus() != SDL_AUDIO_PLAYING)) + emscripten_cancel_main_loop(); +} +#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); + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ if (SDL_Init(SDL_INIT_AUDIO) < 0) { @@ -117,7 +129,7 @@ main(int argc, char *argv[]) /* 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("%i: %s", i, SDL_GetAudioDriver(i)); } /* Initialize fillerup() variables */ @@ -131,8 +143,13 @@ main(int argc, char *argv[]) /* Let the audio run */ SDL_PauseAudio(0); + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING)) SDL_Delay(1000); +#endif /* Clean up on signal */ SDL_CloseAudio(); diff --git a/jni/SDL2-2.0.3/test/loopwavequeue.c b/jni/SDL2-2.0.3/test/loopwavequeue.c index 8ca31dd0..2794c723 100644 --- a/jni/SDL2-2.0.3/test/loopwavequeue.c +++ b/jni/SDL2-2.0.3/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,14 +49,36 @@ 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[]) { - int i; char filename[4096]; - /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ if (SDL_Init(SDL_INIT_AUDIO) < 0) { @@ -97,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/jni/SDL2-2.0.3/test/relative_mode.markdown b/jni/SDL2-2.0.3/test/relative_mode.markdown index 9ae88aa1..5b2ed618 100644 --- a/jni/SDL2-2.0.3/test/relative_mode.markdown +++ b/jni/SDL2-2.0.3/test/relative_mode.markdown @@ -37,9 +37,11 @@ Code int main(int argc, char *argv[]) { + SDL_Window *win; + SDL_Init(SDL_INIT_VIDEO); - SDL_Window *win = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0); + win = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0); SDL_SetRelativeMouseMode(SDL_TRUE); while (1) diff --git a/jni/SDL2-2.0.3/test/testatomic.c b/jni/SDL2-2.0.3/test/testatomic.c index 662a017c..430213bb 100644 --- a/jni/SDL2-2.0.3/test/testatomic.c +++ b/jni/SDL2-2.0.3/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 @@ -12,9 +12,6 @@ #include #include "SDL.h" -#include "SDL_atomic.h" -#include "SDL_assert.h" -#include "SDL_cpuinfo.h" /* Absolutely basic tests just to see if we get the expected value @@ -599,8 +596,8 @@ static void RunFIFOTest(SDL_bool lock_free) Uint32 start, end; int i, j; int grand_total; - char textBuffer[1024]; - int len; + char textBuffer[1024]; + int len; SDL_Log("\nFIFO test---------------------------------------\n\n"); SDL_Log("Mode: %s\n", lock_free ? "LockFree" : "Mutex"); @@ -689,10 +686,10 @@ static void RunFIFOTest(SDL_bool lock_free) } grand_total += total; SDL_Log("Reader %d read %d events, had %d waits\n", i, total, readerData[i].waits); - SDL_snprintf(textBuffer, sizeof(textBuffer), " { "); + SDL_snprintf(textBuffer, sizeof(textBuffer), " { "); for (j = 0; j < NUM_WRITERS; ++j) { if (j > 0) { - len = SDL_strlen(textBuffer); + len = SDL_strlen(textBuffer); SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", "); } len = SDL_strlen(textBuffer); @@ -700,7 +697,7 @@ static void RunFIFOTest(SDL_bool lock_free) } len = SDL_strlen(textBuffer); SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n"); - SDL_Log("%s", textBuffer); + SDL_Log("%s", textBuffer); } SDL_Log("Readers read %d total events\n", grand_total); } @@ -711,8 +708,8 @@ static void RunFIFOTest(SDL_bool lock_free) int main(int argc, char *argv[]) { - /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); RunBasicTest(); RunEpicTest(); diff --git a/jni/SDL2-2.0.3/test/testaudioinfo.c b/jni/SDL2-2.0.3/test/testaudioinfo.c index 76ac9428..cd95dc95 100644 --- a/jni/SDL2-2.0.3/test/testaudioinfo.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testautomation.c b/jni/SDL2-2.0.3/test/testautomation.c index 8eab76e9..34478a18 100644 --- a/jni/SDL2-2.0.3/test/testautomation.c +++ b/jni/SDL2-2.0.3/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 @@ -62,7 +62,7 @@ main(int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i], "--execKey") == 0) { if (argv[i + 1]) { - SDL_sscanf(argv[i + 1], "%llu", (long long unsigned int *)&userExecKey); + SDL_sscanf(argv[i + 1], "%"SDL_PRIu64, (long long unsigned int *)&userExecKey); consumed = 2; } } diff --git a/jni/SDL2-2.0.3/test/testautomation_audio.c b/jni/SDL2-2.0.3/test/testautomation_audio.c index 06071566..bef838dd 100644 --- a/jni/SDL2-2.0.3/test/testautomation_audio.c +++ b/jni/SDL2-2.0.3/test/testautomation_audio.c @@ -92,7 +92,7 @@ int audio_initQuitAudio() /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { audioDriver = SDL_GetAudioDriver(i); @@ -149,7 +149,7 @@ int audio_initOpenCloseQuitAudio() /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { audioDriver = SDL_GetAudioDriver(i); @@ -238,7 +238,7 @@ int audio_pauseUnpauseAudio() /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { audioDriver = SDL_GetAudioDriver(i); diff --git a/jni/SDL2-2.0.3/test/testautomation_clipboard.c b/jni/SDL2-2.0.3/test/testautomation_clipboard.c index 9ce4f514..f943ffee 100644 --- a/jni/SDL2-2.0.3/test/testautomation_clipboard.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testautomation_platform.c b/jni/SDL2-2.0.3/test/testautomation_platform.c index 849d4e38..5211a4a7 100644 --- a/jni/SDL2-2.0.3/test/testautomation_platform.c +++ b/jni/SDL2-2.0.3/test/testautomation_platform.c @@ -34,16 +34,16 @@ int platform_testTypes(void *arg) int ret; ret = _compareSizeOfType( sizeof(Uint8), 1 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint8) = %lu, expected 1", sizeof(Uint8) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint8) = %lu, expected 1", (unsigned long)sizeof(Uint8) ); ret = _compareSizeOfType( sizeof(Uint16), 2 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint16) = %lu, expected 2", sizeof(Uint16) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint16) = %lu, expected 2", (unsigned long)sizeof(Uint16) ); ret = _compareSizeOfType( sizeof(Uint32), 4 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint32) = %lu, expected 4", sizeof(Uint32) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint32) = %lu, expected 4", (unsigned long)sizeof(Uint32) ); ret = _compareSizeOfType( sizeof(Uint64), 8 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint64) = %lu, expected 8", sizeof(Uint64) ); + SDLTest_AssertCheck( ret == 0, "sizeof(Uint64) = %lu, expected 8", (unsigned long)sizeof(Uint64) ); return TEST_COMPLETED; } @@ -92,11 +92,7 @@ int platform_testEndianessAndSwap(void *arg) /* Test 64 swap. */ SDLTest_AssertCheck( SDL_Swap64(value64) == swapped64, -#ifdef _MSC_VER - "SDL_Swap64(): 64 bit swapped: 0x%I64X => 0x%I64X", -#else - "SDL_Swap64(): 64 bit swapped: 0x%llX => 0x%llX", -#endif + "SDL_Swap64(): 64 bit swapped: 0x%"SDL_PRIX64" => 0x%"SDL_PRIX64, value64, SDL_Swap64(value64) ); return TEST_COMPLETED; @@ -395,21 +391,17 @@ int platform_testSetErrorInvalidInput(void *arg) len = SDL_strlen(lastError); SDLTest_AssertCheck(len == 0, "SDL_GetError(): expected message len 0, was len: %i", - 0, len); - SDLTest_AssertCheck(SDL_strcmp(lastError, "") == 0, - "SDL_GetError(): expected message '', was message: '%s'", - lastError); } /* Set */ result = SDL_SetError(probeError); - SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertPass("SDL_SetError('%s')", probeError); SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); /* Check for no-op */ result = SDL_SetError(invalidError); - SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertPass("SDL_SetError(NULL)"); SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); lastError = (char *)SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, @@ -417,14 +409,9 @@ int platform_testSetErrorInvalidInput(void *arg) if (lastError != NULL) { len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == SDL_strlen(probeError), - "SDL_GetError(): expected message len %i, was len: %i", - SDL_strlen(probeError), + SDLTest_AssertCheck(len == 0, + "SDL_GetError(): expected message len 0, was len: %i", len); - SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - probeError, - lastError); } /* Reset */ diff --git a/jni/SDL2-2.0.3/test/testautomation_render.c b/jni/SDL2-2.0.3/test/testautomation_render.c index e380181f..5a1bc9b8 100644 --- a/jni/SDL2-2.0.3/test/testautomation_render.c +++ b/jni/SDL2-2.0.3/test/testautomation_render.c @@ -113,6 +113,9 @@ int render_testPrimitives (void *arg) int checkFailCount1; int checkFailCount2; + /* Clear surface. */ + _clearScreen(); + /* Need drawcolor or just skip test. */ SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor"); @@ -184,7 +187,10 @@ int render_testPrimitives (void *arg) ret = SDL_RenderDrawLine(renderer, 79, 59, 50, 30 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret); - + + /* Make current */ + SDL_RenderPresent(renderer); + /* See if it's the same. */ referenceSurface = SDLTest_ImagePrimitives(); _compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE ); @@ -214,6 +220,9 @@ int render_testPrimitivesBlend (void *arg) int checkFailCount2; int checkFailCount3; + /* Clear surface. */ + _clearScreen(); + /* Need drawcolor and blendmode or just skip test. */ SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor"); SDLTest_AssertCheck(_hasBlendModes(), "_hasBlendModes"); @@ -326,6 +335,9 @@ int render_testPrimitivesBlend (void *arg) SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2); SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawPoint, expected: 0, got: %i", checkFailCount3); + /* Make current */ + SDL_RenderPresent(renderer); + /* See if it's the same. */ referenceSurface = SDLTest_ImagePrimitivesBlend(); _compare(referenceSurface, ALLOWABLE_ERROR_BLENDED ); @@ -358,6 +370,8 @@ render_testBlit(void *arg) int i, j, ni, nj; int checkFailCount1; + /* Clear surface. */ + _clearScreen(); /* Need drawcolor or just skip test. */ SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor)"); @@ -390,6 +404,9 @@ render_testBlit(void *arg) } SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount1); + /* Make current */ + SDL_RenderPresent(renderer); + /* See if it's the same */ referenceSurface = SDLTest_ImageBlit(); _compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE ); @@ -424,6 +441,9 @@ render_testBlitColor (void *arg) int checkFailCount1; int checkFailCount2; + /* Clear surface. */ + _clearScreen(); + /* Create face surface. */ tface = _loadTestFace(); SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result"); @@ -458,6 +478,9 @@ render_testBlitColor (void *arg) SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2); + /* Make current */ + SDL_RenderPresent(renderer); + /* See if it's the same. */ referenceSurface = SDLTest_ImageBlitColor(); _compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE ); @@ -492,6 +515,9 @@ render_testBlitAlpha (void *arg) int checkFailCount1; int checkFailCount2; + /* Clear surface. */ + _clearScreen(); + /* Need alpha or just skip test. */ SDLTest_AssertCheck(_hasTexAlpha(), "_hasTexAlpha"); @@ -529,6 +555,9 @@ render_testBlitAlpha (void *arg) SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2); + /* Make current */ + SDL_RenderPresent(renderer); + /* See if it's the same. */ referenceSurface = SDLTest_ImageBlitAlpha(); _compare(referenceSurface, ALLOWABLE_ERROR_BLENDED ); @@ -644,6 +673,9 @@ render_testBlitBlend (void *arg) /* Test None. */ _testBlitBlendMode( tface, SDL_BLENDMODE_NONE ); referenceSurface = SDLTest_ImageBlitBlendNone(); + + /* Make current and compare */ + SDL_RenderPresent(renderer); _compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE ); SDL_FreeSurface(referenceSurface); referenceSurface = NULL; @@ -651,6 +683,9 @@ render_testBlitBlend (void *arg) /* Test Blend. */ _testBlitBlendMode( tface, SDL_BLENDMODE_BLEND ); referenceSurface = SDLTest_ImageBlitBlend(); + + /* Make current and compare */ + SDL_RenderPresent(renderer); _compare(referenceSurface, ALLOWABLE_ERROR_BLENDED ); SDL_FreeSurface(referenceSurface); referenceSurface = NULL; @@ -658,6 +693,9 @@ render_testBlitBlend (void *arg) /* Test Add. */ _testBlitBlendMode( tface, SDL_BLENDMODE_ADD ); referenceSurface = SDLTest_ImageBlitBlendAdd(); + + /* Make current and compare */ + SDL_RenderPresent(renderer); _compare(referenceSurface, ALLOWABLE_ERROR_BLENDED ); SDL_FreeSurface(referenceSurface); referenceSurface = NULL; @@ -665,6 +703,9 @@ render_testBlitBlend (void *arg) /* Test Mod. */ _testBlitBlendMode( tface, SDL_BLENDMODE_MOD); referenceSurface = SDLTest_ImageBlitBlendMod(); + + /* Make current and compare */ + SDL_RenderPresent(renderer); _compare(referenceSurface, ALLOWABLE_ERROR_BLENDED ); SDL_FreeSurface(referenceSurface); referenceSurface = NULL; @@ -712,6 +753,9 @@ render_testBlitBlend (void *arg) /* Clean up. */ SDL_DestroyTexture( tface ); + /* Make current */ + SDL_RenderPresent(renderer); + /* Check to see if final image matches. */ referenceSurface = SDLTest_ImageBlitBlendAll(); _compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); @@ -984,7 +1028,8 @@ _compare(SDL_Surface *referenceSurface, int allowable_error) * * \sa * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor - * http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect + * http://wiki.libsdl.org/moin.cgi/SDL_RenderClear + * http://wiki.libsdl.org/moin.cgi/SDL_RenderPresent * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode */ static int @@ -997,8 +1042,11 @@ _clearScreen(void) SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); /* Clear screen. */ - ret = SDL_RenderFillRect(renderer, NULL ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret); + ret = SDL_RenderClear(renderer); + SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderClear, expected: 0, got: %i", ret); + + /* Make current */ + SDL_RenderPresent(renderer); /* Set defaults. */ ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); diff --git a/jni/SDL2-2.0.3/test/testautomation_rwops.c b/jni/SDL2-2.0.3/test/testautomation_rwops.c index 32aa7f60..16f2161f 100644 --- a/jni/SDL2-2.0.3/test/testautomation_rwops.c +++ b/jni/SDL2-2.0.3/test/testautomation_rwops.c @@ -105,7 +105,7 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) /* Set to start. */ i = SDL_RWseek(rw, 0, RW_SEEK_SET ); SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i); + SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %"SDL_PRIs64, i); /* Test write. */ s = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1); @@ -120,12 +120,12 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) /* Test seek to random position */ i = SDL_RWseek( rw, seekPos, RW_SEEK_SET ); SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(i == (Sint64)seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %i", seekPos, seekPos, i); + SDLTest_AssertCheck(i == (Sint64)seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %"SDL_PRIs64, seekPos, seekPos, i); /* Test seek back to start */ i = SDL_RWseek(rw, 0, RW_SEEK_SET ); SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i); + SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %"SDL_PRIs64, i); /* Test read */ s = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 ); @@ -144,7 +144,7 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) SDLTest_AssertPass("Call to SDL_RWseek(...,-4,RW_SEEK_CUR) succeeded"); SDLTest_AssertCheck( i == (Sint64)(sizeof(RWopsHelloWorldTestString)-5), - "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i", + "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %"SDL_PRIs64, sizeof(RWopsHelloWorldTestString)-5, i); @@ -152,7 +152,7 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) SDLTest_AssertPass("Call to SDL_RWseek(...,-1,RW_SEEK_END) succeeded"); SDLTest_AssertCheck( i == (Sint64)(sizeof(RWopsHelloWorldTestString)-2), - "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i", + "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %"SDL_PRIs64, sizeof(RWopsHelloWorldTestString)-2, i); @@ -161,7 +161,7 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) SDLTest_AssertPass("Call to SDL_RWseek(...,0,invalid_whence) succeeded"); SDLTest_AssertCheck( i == (Sint64)(-1), - "Verify seek with SDL_RWseek (invalid_whence); expected: -1, got %i", + "Verify seek with SDL_RWseek (invalid_whence); expected: -1, got %"SDL_PRIs64, i); } @@ -560,7 +560,7 @@ rwops_testCompareRWFromMemWithRWFromFile(void) /* Compare */ SDLTest_AssertCheck(rv_mem == rv_file, "Verify returned read blocks matches for mem and file reads; got: rv_mem=%d rv_file=%d", rv_mem, rv_file); - SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%llu sv_file=%llu", sv_mem, sv_file); + SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%"SDL_PRIu64" sv_file=%"SDL_PRIu64, sv_mem, sv_file); SDLTest_AssertCheck(buffer_mem[slen] == 0, "Verify mem buffer termination; expected: 0, got: %d", buffer_mem[slen]); SDLTest_AssertCheck(buffer_file[slen] == 0, "Verify file buffer termination; expected: 0, got: %d", buffer_file[slen]); SDLTest_AssertCheck( @@ -647,48 +647,48 @@ rwops_testFileWriteReadEndian(void) /* Write test data */ objectsWritten = SDL_WriteBE16(rw, BE16value); - SDLTest_AssertPass("Call to SDL_WriteBE16"); + SDLTest_AssertPass("Call to SDL_WriteBE16()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteBE32(rw, BE32value); - SDLTest_AssertPass("Call to SDL_WriteBE32"); + SDLTest_AssertPass("Call to SDL_WriteBE32()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteBE64(rw, BE64value); - SDLTest_AssertPass("Call to SDL_WriteBE64"); + SDLTest_AssertPass("Call to SDL_WriteBE64()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE16(rw, LE16value); - SDLTest_AssertPass("Call to SDL_WriteLE16"); + SDLTest_AssertPass("Call to SDL_WriteLE16()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE32(rw, LE32value); - SDLTest_AssertPass("Call to SDL_WriteLE32"); + SDLTest_AssertPass("Call to SDL_WriteLE32()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE64(rw, LE64value); - SDLTest_AssertPass("Call to SDL_WriteLE64"); + SDLTest_AssertPass("Call to SDL_WriteLE64()"); SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); /* Test seek to start */ result = SDL_RWseek( rw, 0, RW_SEEK_SET ); SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result from position 0 with SDL_RWseek, expected 0, got %i", result); + SDLTest_AssertCheck(result == 0, "Verify result from position 0 with SDL_RWseek, expected 0, got %"SDL_PRIs64, result); /* Read test data */ BE16test = SDL_ReadBE16(rw); - SDLTest_AssertPass("Call to SDL_ReadBE16"); + SDLTest_AssertPass("Call to SDL_ReadBE16()"); SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test); BE32test = SDL_ReadBE32(rw); - SDLTest_AssertPass("Call to SDL_ReadBE32"); + SDLTest_AssertPass("Call to SDL_ReadBE32()"); SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test); BE64test = SDL_ReadBE64(rw); - SDLTest_AssertPass("Call to SDL_ReadBE64"); - SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %llu, got: %llu", BE64value, BE64test); + SDLTest_AssertPass("Call to SDL_ReadBE64()"); + SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, BE64value, BE64test); LE16test = SDL_ReadLE16(rw); - SDLTest_AssertPass("Call to SDL_ReadLE16"); + SDLTest_AssertPass("Call to SDL_ReadLE16()"); SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test); LE32test = SDL_ReadLE32(rw); - SDLTest_AssertPass("Call to SDL_ReadLE32"); + SDLTest_AssertPass("Call to SDL_ReadLE32()"); SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test); LE64test = SDL_ReadLE64(rw); - SDLTest_AssertPass("Call to SDL_ReadLE64"); - SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %llu, got: %llu", LE64value, LE64test); + SDLTest_AssertPass("Call to SDL_ReadLE64()"); + SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, LE64value, LE64test); /* Close handle */ cresult = SDL_RWclose(rw); diff --git a/jni/SDL2-2.0.3/test/testautomation_sdltest.c b/jni/SDL2-2.0.3/test/testautomation_sdltest.c index 646027a6..ec1da8a5 100644 --- a/jni/SDL2-2.0.3/test/testautomation_sdltest.c +++ b/jni/SDL2-2.0.3/test/testautomation_sdltest.c @@ -93,35 +93,35 @@ sdltest_randomNumber(void *arg) result = (Sint64)SDLTest_RandomUint8(); umax = (1 << 8) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint8"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); result = (Sint64)SDLTest_RandomSint8(); min = 0 - (1 << 7); max = (1 << 7) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint8"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); result = (Sint64)SDLTest_RandomUint16(); umax = (1 << 16) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint16"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); result = (Sint64)SDLTest_RandomSint16(); min = 0 - (1 << 15); max = (1 << 15) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint16"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); result = (Sint64)SDLTest_RandomUint32(); umax = ((Uint64)1 << 32) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint32"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); result = (Sint64)SDLTest_RandomSint32(); min = 0 - ((Sint64)1 << 31); max = ((Sint64)1 << 31) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint32"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); uresult = SDLTest_RandomUint64(); SDLTest_AssertPass("Call to SDLTest_RandomUint64"); @@ -166,63 +166,63 @@ sdltest_randomBoundaryNumberUint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -232,7 +232,7 @@ sdltest_randomBoundaryNumberUint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0xff, - "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %lld", uresult); + "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -242,7 +242,7 @@ sdltest_randomBoundaryNumberUint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -276,63 +276,63 @@ sdltest_randomBoundaryNumberUint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -342,7 +342,7 @@ sdltest_randomBoundaryNumberUint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffff, - "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %lld", uresult); + "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -352,7 +352,7 @@ sdltest_randomBoundaryNumberUint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -386,63 +386,63 @@ sdltest_randomBoundaryNumberUint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -452,7 +452,7 @@ sdltest_randomBoundaryNumberUint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffffffff, - "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %lld", uresult); + "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -462,7 +462,7 @@ sdltest_randomBoundaryNumberUint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -496,63 +496,63 @@ sdltest_randomBoundaryNumberUint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, (Uint64)0xffffffffffffffffULL, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -562,7 +562,7 @@ sdltest_randomBoundaryNumberUint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == (Uint64)0xffffffffffffffffULL, - "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %lld", uresult); + "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -572,7 +572,7 @@ sdltest_randomBoundaryNumberUint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %lld", uresult); + "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -606,63 +606,63 @@ sdltest_randomBoundaryNumberSint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MIN, - "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %lld", SCHAR_MIN, sresult); + "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -672,7 +672,7 @@ sdltest_randomBoundaryNumberSint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MAX, - "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %lld", SCHAR_MAX, sresult); + "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MAX, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -682,7 +682,7 @@ sdltest_randomBoundaryNumberSint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MIN, - "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %lld", SCHAR_MIN, sresult); + "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -716,63 +716,63 @@ sdltest_randomBoundaryNumberSint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MIN, - "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %lld", SHRT_MIN, sresult); + "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -782,7 +782,7 @@ sdltest_randomBoundaryNumberSint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MAX, - "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %lld", SHRT_MAX, sresult); + "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MAX, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -792,7 +792,7 @@ sdltest_randomBoundaryNumberSint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MIN, - "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %lld", SHRT_MIN, sresult); + "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -833,63 +833,63 @@ sdltest_randomBoundaryNumberSint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_min, - "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult); + "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -899,7 +899,7 @@ sdltest_randomBoundaryNumberSint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_max, - "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %lld", long_max, sresult); + "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_max, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -909,7 +909,7 @@ sdltest_randomBoundaryNumberSint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_min, - "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult); + "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -943,63 +943,63 @@ sdltest_randomBoundaryNumberSint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == LLONG_MIN, - "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %lld, got: %lld", LLONG_MIN, sresult); + "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -1009,7 +1009,7 @@ sdltest_randomBoundaryNumberSint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == LLONG_MAX, - "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %lld, got: %lld", LLONG_MAX, sresult); + "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MAX, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); @@ -1019,7 +1019,7 @@ sdltest_randomBoundaryNumberSint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == LLONG_MIN, - "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %lld, got: %lld", LLONG_MIN, sresult); + "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -1076,7 +1076,7 @@ sdltest_randomIntegerInRange(void *arg) max = 0; result = SDLTest_RandomIntegerInRange(min, max); SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)"); - SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %d", min, max, result); + SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %d", result); /* Swapped min-max */ min = (Sint32)SDLTest_RandomSint16(); diff --git a/jni/SDL2-2.0.3/test/testautomation_surface.c b/jni/SDL2-2.0.3/test/testautomation_surface.c index b517c773..ca41d4a0 100644 --- a/jni/SDL2-2.0.3/test/testautomation_surface.c +++ b/jni/SDL2-2.0.3/test/testautomation_surface.c @@ -8,6 +8,9 @@ #define _CRT_NONSTDC_NO_DEPRECATE #include +#ifndef _MSC_VER +#include +#endif #include #include "SDL.h" @@ -614,7 +617,7 @@ static const SDLTest_TestCaseReference surfaceTest8 = /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest9 = - { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blittin routines with verious blending modes", TEST_DISABLED}; + { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blitting routines with various blending modes", TEST_DISABLED}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest10 = diff --git a/jni/SDL2-2.0.3/test/testautomation_syswm.c b/jni/SDL2-2.0.3/test/testautomation_syswm.c index 3e368f63..d9fd982b 100644 --- a/jni/SDL2-2.0.3/test/testautomation_syswm.c +++ b/jni/SDL2-2.0.3/test/testautomation_syswm.c @@ -32,7 +32,7 @@ syswm_getWindowWMInfo(void *arg) /* Make call */ result = SDL_GetWindowWMInfo(window, &info); - SDLTest_AssertPass("Call to SDL_GetWindowWMInfo"); + SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()"); SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information"); SDL_DestroyWindow(window); diff --git a/jni/SDL2-2.0.3/test/testautomation_timer.c b/jni/SDL2-2.0.3/test/testautomation_timer.c index ddf6a5f2..6d73856e 100644 --- a/jni/SDL2-2.0.3/test/testautomation_timer.c +++ b/jni/SDL2-2.0.3/test/testautomation_timer.c @@ -42,7 +42,7 @@ timer_getPerformanceCounter(void *arg) result = SDL_GetPerformanceCounter(); SDLTest_AssertPass("Call to SDL_GetPerformanceCounter()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %lu", result); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %"SDL_PRIu64, result); return TEST_COMPLETED; } @@ -57,7 +57,7 @@ timer_getPerformanceFrequency(void *arg) result = SDL_GetPerformanceFrequency(); SDLTest_AssertPass("Call to SDL_GetPerformanceFrequency()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %lu", result); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %"SDL_PRIu64, result); return TEST_COMPLETED; } diff --git a/jni/SDL2-2.0.3/test/testautomation_video.c b/jni/SDL2-2.0.3/test/testautomation_video.c index 3a7bfca0..7b86cfba 100644 --- a/jni/SDL2-2.0.3/test/testautomation_video.c +++ b/jni/SDL2-2.0.3/test/testautomation_video.c @@ -51,7 +51,7 @@ void _destroyVideoSuiteTestWindow(SDL_Window *window) if (window != NULL) { SDL_DestroyWindow(window); window = NULL; - SDLTest_AssertPass("Call to SDL_DestroyWindow"); + SDLTest_AssertPass("Call to SDL_DestroyWindow()"); } } @@ -342,7 +342,7 @@ video_getWindowFlags(void *arg) window = _createVideoSuiteTestWindow(title); if (window != NULL) { actualFlags = SDL_GetWindowFlags(window); - SDLTest_AssertPass("Call to SDL_GetWindowFlags"); + SDLTest_AssertPass("Call to SDL_GetWindowFlags()"); SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %d", flags, actualFlags); } @@ -364,7 +364,7 @@ video_getNumDisplayModes(void *arg) /* Get number of displays */ displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays"); + SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); /* Make call for each display */ for (i=0; i= 0.0 && result <= 1.0, "Validate range of result value; expected: [0.0, 1.0], got: %f", result); } @@ -541,7 +541,6 @@ video_getWindowBrightnessNegative(void *arg) { const char *invalidWindowError = "Invalid window"; char *lastError; - const char* title = "video_getWindowBrightnessNegative Test Window"; float result; /* Call against invalid window */ @@ -583,7 +582,7 @@ video_getWindowDisplayMode(void *arg) window = _createVideoSuiteTestWindow(title); if (window != NULL) { result = SDL_GetWindowDisplayMode(window, &mode); - SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode"); + SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode()"); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result); SDLTest_AssertCheck(mode.w > 0, "Validate mode.w content; expected: >0, got: %d", mode.w); SDLTest_AssertCheck(mode.h > 0, "Validate mode.h content; expected: >0, got: %d", mode.h); @@ -728,7 +727,6 @@ video_getWindowGammaRamp(void *arg) int video_getWindowGammaRampNegative(void *arg) { - const char* title = "video_getWindowGammaRampNegative Test Window"; Uint16 red[256]; Uint16 green[256]; Uint16 blue[256]; @@ -740,7 +738,7 @@ video_getWindowGammaRampNegative(void *arg) /* Call against invalid window */ result = SDL_GetWindowGammaRamp(NULL, red, green, blue); SDLTest_AssertPass("Call to SDL_GetWindowGammaRamp(window=NULL,r,g,b)"); - SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %f", result); + SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %i", result); _checkInvalidWindowError(); return TEST_COMPLETED; @@ -1524,10 +1522,10 @@ video_getSetWindowData(void *arg) const char *referenceName2 = "TestName2"; const char *name2 = "TestName2"; int datasize; - char *referenceUserdata; - char *userdata; - char *referenceUserdata2; - char *userdata2; + char *referenceUserdata = NULL; + char *userdata = NULL; + char *referenceUserdata2 = NULL; + char *userdata2 = NULL; char *result; int iteration; @@ -1619,7 +1617,7 @@ video_getSetWindowData(void *arg) /* Set data with NULL to clear */ result = (char *)SDL_SetWindowData(window, name, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); @@ -1627,7 +1625,7 @@ video_getSetWindowData(void *arg) /* Set data with NULL to clear again */ result = (char *)SDL_SetWindowData(window, name, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); diff --git a/jni/SDL2-2.0.3/test/testdraw2.c b/jni/SDL2-2.0.3/test/testdraw2.c index 8c14185c..c3914260 100644 --- a/jni/SDL2-2.0.3/test/testdraw2.c +++ b/jni/SDL2-2.0.3/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 @@ -16,6 +16,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" #define NUM_OBJECTS 100 @@ -29,6 +33,8 @@ static int current_alpha = 255; static int current_color = 255; static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; +int done; + void DrawPoints(SDL_Renderer * renderer) { @@ -169,15 +175,44 @@ DrawRects(SDL_Renderer * renderer) } } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + + DrawRects(renderer); + DrawLines(renderer); + DrawPoints(renderer); + + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int i, done; - SDL_Event event; + int i; Uint32 then, now, frames; - /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize parameters */ num_objects = NUM_OBJECTS; @@ -245,26 +280,16 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); + loop(); } - for (i = 0; i < state->num_windows; ++i) { - SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) - continue; - SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); - SDL_RenderClear(renderer); +#endif - DrawRects(renderer); - DrawLines(renderer); - DrawPoints(renderer); - - SDL_RenderPresent(renderer); - } - } SDLTest_CommonQuit(state); diff --git a/jni/SDL2-2.0.3/test/testdrawchessboard.c b/jni/SDL2-2.0.3/test/testdrawchessboard.c index 2456b690..b34fc715 100644 --- a/jni/SDL2-2.0.3/test/testdrawchessboard.c +++ b/jni/SDL2-2.0.3/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 @@ -14,94 +14,122 @@ /* Sample program: Draw a Chess Board by using SDL_CreateSoftwareRenderer API */ +#include +#include + +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" +SDL_Window *window; +SDL_Renderer *renderer; +int done; + void DrawChessBoard(SDL_Renderer * renderer) { - int row = 0,column = 0,x = 0; - SDL_Rect rect, darea; + int row = 0,column = 0,x = 0; + SDL_Rect rect, darea; - /* Get the Size of drawing surface */ - SDL_RenderGetViewport(renderer, &darea); + /* Get the Size of drawing surface */ + SDL_RenderGetViewport(renderer, &darea); - for( ; row < 8; row++) - { - column = row%2; - x = x + column; - for( ; column < 4+(row%2); column++) - { - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF); + for( ; row < 8; row++) + { + column = row%2; + x = column; + for( ; column < 4+(row%2); column++) + { + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF); - rect.w = darea.w/8; - rect.h = darea.h/8; - rect.x = x * rect.w; - rect.y = row * rect.h; - x = x + 2; - SDL_RenderFillRect(renderer, &rect); - } - x=0; - } + rect.w = darea.w/8; + rect.h = darea.h/8; + rect.x = x * rect.w; + rect.y = row * rect.h; + x = x + 2; + SDL_RenderFillRect(renderer, &rect); + } + } +} + +void +loop() +{ + SDL_Event e; + while (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) { + done = 1; +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif + return; + } + + if ((e.type == SDL_KEYDOWN) && (e.key.keysym.sym == SDLK_ESCAPE)) { + done = 1; +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif + return; + } + } + + DrawChessBoard(renderer); + + /* Got everything on rendering surface, + now Update the drawing image on window screen */ + SDL_UpdateWindowSurface(window); } int main(int argc, char *argv[]) { - SDL_Window *window; - SDL_Surface *surface; - SDL_Renderer *renderer; + SDL_Surface *surface; /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - /* Initialize SDL */ - if(SDL_Init(SDL_INIT_VIDEO) != 0) - { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init fail : %s\n", SDL_GetError()); - return 1; - } + /* Initialize SDL */ + if(SDL_Init(SDL_INIT_VIDEO) != 0) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init fail : %s\n", SDL_GetError()); + return 1; + } - /* Create window and renderer for given surface */ - window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); - if(!window) - { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n",SDL_GetError()); - return 1; - } - surface = SDL_GetWindowSurface(window); - renderer = SDL_CreateSoftwareRenderer(surface); - if(!renderer) - { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n",SDL_GetError()); - return 1; - } + /* Create window and renderer for given surface */ + window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); + if(!window) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n",SDL_GetError()); + return 1; + } + surface = SDL_GetWindowSurface(window); + renderer = SDL_CreateSoftwareRenderer(surface); + if(!renderer) + { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n",SDL_GetError()); + return 1; + } - /* Clear the rendering surface with the specified color */ - SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); - SDL_RenderClear(renderer); + /* Clear the rendering surface with the specified color */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); + SDL_RenderClear(renderer); - /* Draw the Image on rendering surface */ - while(1) - { - SDL_Event e; - if (SDL_PollEvent(&e)) { - if (e.type == SDL_QUIT) - break; + /* Draw the Image on rendering surface */ + done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif - if(e.key.keysym.sym == SDLK_ESCAPE) - break; - } - - DrawChessBoard(renderer); - - /* Got everything on rendering surface, - now Update the drawing image on window screen */ - SDL_UpdateWindowSurface(window); - - } - - return 0; + SDL_Quit(); + return 0; } diff --git a/jni/SDL2-2.0.3/test/testdropfile.c b/jni/SDL2-2.0.3/test/testdropfile.c index 53821ed8..550e58e3 100644 --- a/jni/SDL2-2.0.3/test/testdropfile.c +++ b/jni/SDL2-2.0.3/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 @@ -31,7 +31,7 @@ main(int argc, char *argv[]) int i, done; SDL_Event event; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize test framework */ diff --git a/jni/SDL2-2.0.3/test/testerror.c b/jni/SDL2-2.0.3/test/testerror.c index 1fa60885..181ee11e 100644 --- a/jni/SDL2-2.0.3/test/testerror.c +++ b/jni/SDL2-2.0.3/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 @@ -17,7 +17,6 @@ #include #include "SDL.h" -#include "SDL_thread.h" static int alive = 0; diff --git a/jni/SDL2-2.0.3/test/testfile.c b/jni/SDL2-2.0.3/test/testfile.c index 172da865..e07b2fab 100644 --- a/jni/SDL2-2.0.3/test/testfile.c +++ b/jni/SDL2-2.0.3/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 @@ -22,7 +22,6 @@ #endif #include "SDL.h" -#include "SDL_endian.h" #include @@ -70,7 +69,7 @@ main(int argc, char *argv[]) char test_buf[30]; /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); cleanup(); diff --git a/jni/SDL2-2.0.3/test/testfilesystem.c b/jni/SDL2-2.0.3/test/testfilesystem.c index 701b98ad..e1660c8d 100644 --- a/jni/SDL2-2.0.3/test/testfilesystem.c +++ b/jni/SDL2-2.0.3/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 @@ -25,8 +25,24 @@ main(int argc, char *argv[]) return 1; } - SDL_Log("base path: '%s'\n", SDL_GetBasePath()); - SDL_Log("pref path: '%s'\n", SDL_GetPrefPath("libsdl", "testfilesystem")); + char *base_path = SDL_GetBasePath(); + if(base_path == NULL){ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n", + SDL_GetError()); + return 0; + } + + SDL_Log("base path: '%s'\n", base_path); + SDL_free(base_path); + + char *pref_path = SDL_GetPrefPath("libsdl", "testfilesystem"); + if(pref_path == NULL){ + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n", + SDL_GetError()); + return 0; + } + SDL_Log("pref path: '%s'\n", pref_path); + SDL_free(pref_path); SDL_Quit(); return 0; diff --git a/jni/SDL2-2.0.3/test/testgamecontroller.c b/jni/SDL2-2.0.3/test/testgamecontroller.c index 10046bd3..688544ec 100644 --- a/jni/SDL2-2.0.3/test/testgamecontroller.c +++ b/jni/SDL2-2.0.3/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 @@ -18,16 +18,54 @@ #include "SDL.h" +#ifdef __EMSCRIPTEN__ +#include +#endif + #ifndef SDL_JOYSTICK_DISABLED #ifdef __IPHONEOS__ -#define SCREEN_WIDTH 320 -#define SCREEN_HEIGHT 480 +#define SCREEN_WIDTH 480 +#define SCREEN_HEIGHT 320 #else #define SCREEN_WIDTH 512 #define SCREEN_HEIGHT 317 #endif +/* This is indexed by SDL_GameControllerButton. */ +static const struct { int x; int y; } button_positions[] = { + {387, 167}, /* A */ + {431, 132}, /* B */ + {342, 132}, /* X */ + {389, 101}, /* Y */ + {174, 132}, /* BACK */ + {233, 132}, /* GUIDE */ + {289, 132}, /* START */ + {75, 154}, /* LEFTSTICK */ + {305, 230}, /* RIGHTSTICK */ + {77, 40}, /* LEFTSHOULDER */ + {396, 36}, /* RIGHTSHOULDER */ + {154, 188}, /* DPAD_UP */ + {154, 249}, /* DPAD_DOWN */ + {116, 217}, /* DPAD_LEFT */ + {186, 217}, /* DPAD_RIGHT */ +}; + +/* This is indexed by SDL_GameControllerAxis. */ +static const struct { int x; int y; double angle; } axis_positions[] = { + {75, 154, 0.0}, /* LEFTX */ + {75, 154, 90.0}, /* LEFTY */ + {305, 230, 0.0}, /* RIGHTX */ + {305, 230, 90.0}, /* RIGHTY */ + {91, 0, 90.0}, /* TRIGGERLEFT */ + {375, 0, 90.0}, /* TRIGGERRIGHT */ +}; + +SDL_Renderer *screen = NULL; +SDL_bool retval = SDL_FALSE; +SDL_bool done = SDL_FALSE; +SDL_Texture *background, *button, *axis; + static SDL_Texture * LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) { @@ -60,49 +98,80 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) return texture; } +void +loop(void *arg) +{ + SDL_Event event; + int i; + SDL_GameController *gamecontroller = (SDL_GameController *)arg; + + /* blank screen, set up for drawing this frame. */ + SDL_SetRenderDrawColor(screen, 0xFF, 0xFF, 0xFF, SDL_ALPHA_OPAQUE); + SDL_RenderClear(screen); + SDL_RenderCopy(screen, background, NULL, NULL); + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: + if (event.key.keysym.sym != SDLK_ESCAPE) { + break; + } + /* Fall through to signal quit */ + case SDL_QUIT: + done = SDL_TRUE; + break; + default: + break; + } + } + + /* Update visual controller state */ + for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) { + if (SDL_GameControllerGetButton(gamecontroller, (SDL_GameControllerButton)i) == SDL_PRESSED) { + const SDL_Rect dst = { button_positions[i].x, button_positions[i].y, 50, 50 }; + SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, 0); + } + } + + for (i = 0; i < SDL_CONTROLLER_AXIS_MAX; ++i) { + const Sint16 deadzone = 8000; /* !!! FIXME: real deadzone */ + const Sint16 value = SDL_GameControllerGetAxis(gamecontroller, (SDL_GameControllerAxis)(i)); + if (value < -deadzone) { + const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; + const double angle = axis_positions[i].angle; + SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); + } else if (value > deadzone) { + const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; + const double angle = axis_positions[i].angle + 180.0; + SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); + } + } + + SDL_RenderPresent(screen); + + if (!SDL_GameControllerGetAttached(gamecontroller)) { + done = SDL_TRUE; + retval = SDL_TRUE; /* keep going, wait for reattach. */ + } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + SDL_bool WatchGameController(SDL_GameController * gamecontroller) { - /* This is indexed by SDL_GameControllerButton. */ - static const struct { int x; int y; } button_positions[] = { - {387, 167}, /* A */ - {431, 132}, /* B */ - {342, 132}, /* X */ - {389, 101}, /* Y */ - {174, 132}, /* BACK */ - {233, 132}, /* GUIDE */ - {289, 132}, /* START */ - {75, 154}, /* LEFTSTICK */ - {305, 230}, /* RIGHTSTICK */ - {77, 40}, /* LEFTSHOULDER */ - {396, 36}, /* RIGHTSHOULDER */ - {154, 188}, /* DPAD_UP */ - {154, 249}, /* DPAD_DOWN */ - {116, 217}, /* DPAD_LEFT */ - {186, 217}, /* DPAD_RIGHT */ - }; - - /* This is indexed by SDL_GameControllerAxis. */ - static const struct { int x; int y; double angle; } axis_positions[] = { - {75, 154, 0.0}, /* LEFTX */ - {75, 154, 90.0}, /* LEFTY */ - {305, 230, 0.0}, /* RIGHTX */ - {305, 230, 90.0}, /* RIGHTY */ - {91, 0, 90.0}, /* TRIGGERLEFT */ - {375, 0, 90.0}, /* TRIGGERRIGHT */ - }; - const char *name = SDL_GameControllerName(gamecontroller); const char *basetitle = "Game Controller Test: "; const size_t titlelen = SDL_strlen(basetitle) + SDL_strlen(name) + 1; char *title = (char *)SDL_malloc(titlelen); - SDL_Texture *background, *button, *axis; SDL_Window *window = NULL; - SDL_Renderer *screen = NULL; - SDL_bool retval = SDL_FALSE; - SDL_bool done = SDL_FALSE; - SDL_Event event; - int i; + + retval = SDL_FALSE; + done = SDL_FALSE; if (title) { SDL_snprintf(title, titlelen, "%s%s", basetitle, name); @@ -151,58 +220,19 @@ WatchGameController(SDL_GameController * gamecontroller) SDL_Log("Watching controller %s\n", name ? name : "Unknown Controller"); /* Loop, getting controller events! */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop_arg(loop, gamecontroller, 0, 1); +#else while (!done) { - /* blank screen, set up for drawing this frame. */ - SDL_SetRenderDrawColor(screen, 0xFF, 0xFF, 0xFF, SDL_ALPHA_OPAQUE); - SDL_RenderClear(screen); - SDL_RenderCopy(screen, background, NULL, NULL); - - while (SDL_PollEvent(&event)) { - switch (event.type) { - case SDL_KEYDOWN: - if (event.key.keysym.sym != SDLK_ESCAPE) { - break; - } - /* Fall through to signal quit */ - case SDL_QUIT: - done = SDL_TRUE; - break; - default: - break; - } - } - - /* Update visual controller state */ - for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) { - if (SDL_GameControllerGetButton(gamecontroller, (SDL_GameControllerButton)i) == SDL_PRESSED) { - const SDL_Rect dst = { button_positions[i].x, button_positions[i].y, 50, 50 }; - SDL_RenderCopyEx(screen, button, NULL, &dst, 0, NULL, 0); - } - } - - for (i = 0; i < SDL_CONTROLLER_AXIS_MAX; ++i) { - const Sint16 deadzone = 8000; /* !!! FIXME: real deadzone */ - const Sint16 value = SDL_GameControllerGetAxis(gamecontroller, (SDL_GameControllerAxis)(i)); - if (value < -deadzone) { - const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; - const double angle = axis_positions[i].angle; - SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); - } else if (value > deadzone) { - const SDL_Rect dst = { axis_positions[i].x, axis_positions[i].y, 50, 50 }; - const double angle = axis_positions[i].angle + 180.0; - SDL_RenderCopyEx(screen, axis, NULL, &dst, angle, NULL, 0); - } - } - - SDL_RenderPresent(screen); - - if (!SDL_GameControllerGetAttached(gamecontroller)) { - done = SDL_TRUE; - retval = SDL_TRUE; /* keep going, wait for reattach. */ - } + loop(gamecontroller); } +#endif SDL_DestroyRenderer(screen); + screen = NULL; + background = NULL; + button = NULL; + axis = NULL; SDL_DestroyWindow(window); return retval; } @@ -217,7 +247,7 @@ main(int argc, char *argv[]) SDL_GameController *gamecontroller; /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL (Note: video is required to start event loop) */ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER ) < 0) { @@ -254,20 +284,23 @@ main(int argc, char *argv[]) SDL_Event event; int device = atoi(argv[1]); if (device >= SDL_NumJoysticks()) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%i is an invalid joystick index.\n", device); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%i is an invalid joystick index.\n", device); retcode = 1; } else { SDL_JoystickGetGUIDString(SDL_JoystickGetDeviceGUID(device), guid, sizeof (guid)); SDL_Log("Attempting to open device %i, guid %s\n", device, guid); gamecontroller = SDL_GameControllerOpen(device); + + if (gamecontroller != NULL) { + SDL_assert(SDL_GameControllerFromInstanceID(SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(gamecontroller))) == gamecontroller); + } + 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; } @@ -288,6 +321,9 @@ main(int argc, char *argv[]) keepGoing = SDL_FALSE; } else if (event.type == SDL_CONTROLLERDEVICEADDED) { gamecontroller = SDL_GameControllerOpen(event.cdevice.which); + if (gamecontroller != NULL) { + SDL_assert(SDL_GameControllerFromInstanceID(SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(gamecontroller))) == gamecontroller); + } break; } } diff --git a/jni/SDL2-2.0.3/test/testgesture.c b/jni/SDL2-2.0.3/test/testgesture.c index f6658dbb..5437c6c4 100644 --- a/jni/SDL2-2.0.3/test/testgesture.c +++ b/jni/SDL2-2.0.3/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 @@ -15,12 +15,12 @@ * l to load all touches from "./gestureSave" */ -#include -#include - #include "SDL.h" -#include "SDL_touch.h" -#include "SDL_gesture.h" +#include /* for exit() */ + +#ifdef __EMSCRIPTEN__ +#include +#endif #define WIDTH 640 #define HEIGHT 480 @@ -33,13 +33,16 @@ #define VERBOSE 0 -static SDL_Window *window; static SDL_Event events[EVENT_BUF_SIZE]; static int eventWrite; static int colors[7] = {0xFF,0xFF00,0xFF0000,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF}; +SDL_Surface *screen; +SDL_Window *window; +SDL_bool quitting = SDL_FALSE; + typedef struct { float x,y; } Point; @@ -51,18 +54,6 @@ typedef struct { static Knob knob; -void handler (int sig) -{ - SDL_Log ("exiting...(%d)", sig); - exit (0); -} - -void perror_exit (char *error) -{ - perror (error); - handler (9); -} - void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) { Uint32 *pixmem32; @@ -104,7 +95,7 @@ void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c) float tx,ty; float xr; for(ty = (float)-SDL_fabs(r);ty <= (float)SDL_fabs((int)r);ty++) { - xr = (float)sqrt(r*r - ty*ty); + xr = (float)SDL_sqrt(r*r - ty*ty); if(r > 0) { /* r > 0 ==> filled circle */ for(tx=-xr+.5f;tx<=xr-.5;tx++) { setpix(screen,x+tx,y+ty,c); @@ -123,7 +114,7 @@ void drawKnob(SDL_Surface* screen,Knob k) { (k.p.y+k.r/2*SDL_sinf(k.ang))*screen->h,k.r/4*screen->w,0); } -void DrawScreen(SDL_Surface* screen) +void DrawScreen(SDL_Surface* screen, SDL_Window* window) { int i; #if 1 @@ -165,44 +156,24 @@ void DrawScreen(SDL_Surface* screen) SDL_UpdateWindowSurface(window); } -SDL_Surface* initScreen(int width,int height) +/* Returns a new SDL_Window if window is NULL or window if not. */ +SDL_Window* initWindow(SDL_Window *window, int width,int height) { if (!window) { window = SDL_CreateWindow("Gesture Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_RESIZABLE); } - if (!window) { - return NULL; - } - return SDL_GetWindowSurface(window); + return window; } -int main(int argc, char* argv[]) +void loop() { - SDL_Surface *screen; - SDL_Event event; - SDL_bool quitting = SDL_FALSE; - SDL_RWops *stream; + SDL_Event event; + SDL_RWops *stream; - /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - - /* gesture variables */ - knob.r = .1f; - knob.ang = 0; - - if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1; - - if (!(screen = initScreen(WIDTH,HEIGHT))) - { - SDL_Quit(); - return 1; - } - - while(!quitting) { while(SDL_PollEvent(&event)) - { + { /* Record _all_ events */ events[eventWrite & (EVENT_BUF_SIZE-1)] = event; eventWrite++; @@ -215,6 +186,15 @@ int main(int argc, char* argv[]) case SDL_KEYDOWN: switch (event.key.keysym.sym) { + case SDLK_i: + { + int i; + for (i = 0; i < SDL_GetNumTouchDevices(); ++i) { + SDL_TouchID id = SDL_GetTouchDevice(i); + SDL_Log("Fingers Down on device %"SDL_PRIs64": %d", id, SDL_GetNumTouchFingers(id)); + } + break; + } case SDLK_SPACE: SDL_RecordGesture(-1); break; @@ -235,10 +215,11 @@ int main(int argc, char* argv[]) break; case SDL_WINDOWEVENT: if (event.window.event == SDL_WINDOWEVENT_RESIZED) { - if (!(screen = initScreen(event.window.data1, event.window.data2))) + if (!(window = initWindow(window, event.window.data1, event.window.data2)) || + !(screen = SDL_GetWindowSurface(window))) { SDL_Quit(); - return 1; + exit(1); } } break; @@ -283,9 +264,46 @@ int main(int argc, char* argv[]) SDL_Log("Recorded gesture: %"SDL_PRIs64"",event.dgesture.gestureId); break; } - } - DrawScreen(screen); + } + DrawScreen(screen, window); + +#ifdef __EMSCRIPTEN__ + if (quitting) { + emscripten_cancel_main_loop(); + } +#endif +} + +int main(int argc, char* argv[]) +{ + window = NULL; + screen = NULL; + quitting = SDL_FALSE; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* gesture variables */ + knob.r = .1f; + knob.ang = 0; + + if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1; + + if (!(window = initWindow(window, WIDTH, HEIGHT)) || + !(screen = SDL_GetWindowSurface(window))) + { + SDL_Quit(); + return 1; } + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while(!quitting) { + loop(); + } +#endif + SDL_Quit(); return 0; } diff --git a/jni/SDL2-2.0.3/test/testgl2.c b/jni/SDL2-2.0.3/test/testgl2.c index 85148515..449e02e4 100644 --- a/jni/SDL2-2.0.3/test/testgl2.c +++ b/jni/SDL2-2.0.3/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 @@ -357,7 +357,7 @@ main(int argc, char *argv[]) SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", accel, value); } else { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", SDL_GetError()); } } diff --git a/jni/SDL2-2.0.3/test/testgles.c b/jni/SDL2-2.0.3/test/testgles.c index 588cbfb3..b0b47c96 100644 --- a/jni/SDL2-2.0.3/test/testgles.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testgles2.c b/jni/SDL2-2.0.3/test/testgles2.c index fcbdbf03..f75bc157 100644 --- a/jni/SDL2-2.0.3/test/testgles2.c +++ b/jni/SDL2-2.0.3/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 @@ -14,9 +14,13 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #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 @@ -165,7 +169,7 @@ perspective_matrix(float fovy, float aspect, float znear, float zfar, float *r) static void multiply_matrix(float *lhs, float *rhs, float *r) { - int i, j, k; + int i, j, k; float tmp[16]; for (i = 0; i < 4; i++) { @@ -408,17 +412,77 @@ Render(unsigned int width, unsigned int height, shader_data* data) GL_CHECK(ctx.glDrawArrays(GL_TRIANGLES, 0, 36)); } +int done; +Uint32 frames; +shader_data *datas; + +void loop() +{ + SDL_Event event; + int i; + int status; + + /* Check for events */ + ++frames; + while (SDL_PollEvent(&event) && !done) { + switch (event.type) { + case SDL_WINDOWEVENT: + switch (event.window.event) { + case SDL_WINDOWEVENT_RESIZED: + for (i = 0; i < state->num_windows; ++i) { + if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { + int w, h; + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + break; + } + /* Change view port to the new window dimensions */ + SDL_GL_GetDrawableSize(state->windows[i], &w, &h); + ctx.glViewport(0, 0, w, h); + state->window_w = event.window.data1; + state->window_h = event.window.data2; + /* Update window content */ + Render(event.window.data1, event.window.data2, &datas[i]); + SDL_GL_SwapWindow(state->windows[i]); + break; + } + } + break; + } + } + SDLTest_CommonEvent(state, &event, &done); + } + if (!done) { + for (i = 0; i < state->num_windows; ++i) { + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + + /* Continue for next window */ + continue; + } + Render(state->window_w, state->window_h, &datas[i]); + SDL_GL_SwapWindow(state->windows[i]); + } + } +#ifdef __EMSCRIPTEN__ + else { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { int fsaa, accel; int value; - int i, done; + int i; SDL_DisplayMode mode; - SDL_Event event; - Uint32 then, now, frames; + Uint32 then, now; int status; - shader_data *datas, *data; + shader_data *data; /* Initialize parameters */ fsaa = 0; @@ -581,6 +645,7 @@ main(int argc, char *argv[]) /* Set rendering settings for each context */ for (i = 0; i < state->num_windows; ++i) { + int w, h; status = SDL_GL_MakeCurrent(state->windows[i], context[i]); if (status) { SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); @@ -588,7 +653,8 @@ main(int argc, char *argv[]) /* Continue for next window */ continue; } - ctx.glViewport(0, 0, state->window_w, state->window_h); + SDL_GL_GetDrawableSize(state->windows[i], &w, &h); + ctx.glViewport(0, 0, w, h); data = &datas[i]; data->angle_x = 0; data->angle_y = 0; data->angle_z = 0; @@ -630,48 +696,14 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; - while (!done) { - /* Check for events */ - ++frames; - while (SDL_PollEvent(&event) && !done) { - switch (event.type) { - case SDL_WINDOWEVENT: - switch (event.window.event) { - case SDL_WINDOWEVENT_RESIZED: - for (i = 0; i < state->num_windows; ++i) { - if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { - status = SDL_GL_MakeCurrent(state->windows[i], context[i]); - if (status) { - SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); - break; - } - /* Change view port to the new window dimensions */ - ctx.glViewport(0, 0, event.window.data1, event.window.data2); - /* Update window content */ - Render(event.window.data1, event.window.data2, &datas[i]); - SDL_GL_SwapWindow(state->windows[i]); - break; - } - } - break; - } - } - SDLTest_CommonEvent(state, &event, &done); - } - if (!done) { - for (i = 0; i < state->num_windows; ++i) { - status = SDL_GL_MakeCurrent(state->windows[i], context[i]); - if (status) { - SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); - /* Continue for next window */ - continue; - } - Render(state->window_w, state->window_h, &datas[i]); - SDL_GL_SwapWindow(state->windows[i]); - } - } +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); diff --git a/jni/SDL2-2.0.3/test/testhaptic.c b/jni/SDL2-2.0.3/test/testhaptic.c index ac8ab415..bffe4467 100644 --- a/jni/SDL2-2.0.3/test/testhaptic.c +++ b/jni/SDL2-2.0.3/test/testhaptic.c @@ -22,8 +22,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #ifndef SDL_HAPTIC_DISABLED -#include "SDL_haptic.h" - static SDL_Haptic *haptic; diff --git a/jni/SDL2-2.0.3/test/testhotplug.c b/jni/SDL2-2.0.3/test/testhotplug.c index ba06dea0..1de96f6d 100644 --- a/jni/SDL2-2.0.3/test/testhotplug.c +++ b/jni/SDL2-2.0.3/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 @@ -17,7 +17,6 @@ #include #include "SDL.h" -#include "SDL_haptic.h" #if !defined SDL_JOYSTICK_DISABLED && !defined SDL_HAPTIC_DISABLED @@ -43,7 +42,7 @@ main(int argc, char *argv[]) } /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); @@ -135,10 +134,10 @@ main(int argc, char *argv[]) { SDL_HapticRumblePlay(haptic, 0.25, 250); } - if (event.jbutton.button == 0) { - SDL_Log("Exiting due to button press of button 0\n"); - keepGoing = SDL_FALSE; - } + if (event.jbutton.button == 0) { + SDL_Log("Exiting due to button press of button 0\n"); + keepGoing = SDL_FALSE; + } break; case SDL_JOYBUTTONUP: SDL_Log("Button Release: %d\n", event.jbutton.button); diff --git a/jni/SDL2-2.0.3/test/testiconv.c b/jni/SDL2-2.0.3/test/testiconv.c index 1ab4c036..6576a87d 100644 --- a/jni/SDL2-2.0.3/test/testiconv.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testime.c b/jni/SDL2-2.0.3/test/testime.c index 6f7b6a54..4bddee17 100644 --- a/jni/SDL2-2.0.3/test/testime.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testintersections.c b/jni/SDL2-2.0.3/test/testintersections.c index 7ea3b555..d67b15e6 100644 --- a/jni/SDL2-2.0.3/test/testintersections.c +++ b/jni/SDL2-2.0.3/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 @@ -16,6 +16,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" #define SWAP(typ,a,b) do{typ t=a;a=b;b=t;}while(0) @@ -30,6 +34,9 @@ static int current_alpha = 255; static int current_color = 255; static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; +int mouse_begin_x = -1, mouse_begin_y = -1; +int done; + void DrawPoints(SDL_Renderer * renderer) { @@ -191,12 +198,76 @@ DrawRectRectIntersections(SDL_Renderer * renderer) } } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + switch (event.type) { + case SDL_MOUSEBUTTONDOWN: + mouse_begin_x = event.button.x; + mouse_begin_y = event.button.y; + break; + case SDL_MOUSEBUTTONUP: + if (event.button.button == 3) + add_line(mouse_begin_x, mouse_begin_y, event.button.x, + event.button.y); + if (event.button.button == 1) + add_rect(mouse_begin_x, mouse_begin_y, event.button.x, + event.button.y); + break; + case SDL_KEYDOWN: + switch (event.key.keysym.sym) { + case 'l': + if (event.key.keysym.mod & KMOD_SHIFT) + num_lines = 0; + else + add_line(rand() % 640, rand() % 480, rand() % 640, + rand() % 480); + break; + case 'r': + if (event.key.keysym.mod & KMOD_SHIFT) + num_rects = 0; + else + add_rect(rand() % 640, rand() % 480, rand() % 640, + rand() % 480); + break; + } + break; + default: + break; + } + } + for (i = 0; i < state->num_windows; ++i) { + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; + SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); + SDL_RenderClear(renderer); + + DrawRects(renderer); + DrawPoints(renderer); + DrawRectRectIntersections(renderer); + DrawLines(renderer); + DrawRectLineIntersections(renderer); + + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int mouse_begin_x = -1, mouse_begin_y = -1; - int i, done; - SDL_Event event; + int i; Uint32 then, now, frames; /* Enable standard application logging */ @@ -268,62 +339,15 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - switch (event.type) { - case SDL_MOUSEBUTTONDOWN: - mouse_begin_x = event.button.x; - mouse_begin_y = event.button.y; - break; - case SDL_MOUSEBUTTONUP: - if (event.button.button == 3) - add_line(mouse_begin_x, mouse_begin_y, event.button.x, - event.button.y); - if (event.button.button == 1) - add_rect(mouse_begin_x, mouse_begin_y, event.button.x, - event.button.y); - break; - case SDL_KEYDOWN: - switch (event.key.keysym.sym) { - case 'l': - if (event.key.keysym.mod & KMOD_SHIFT) - num_lines = 0; - else - add_line(rand() % 640, rand() % 480, rand() % 640, - rand() % 480); - break; - case 'r': - if (event.key.keysym.mod & KMOD_SHIFT) - num_rects = 0; - else - add_rect(rand() % 640, rand() % 480, rand() % 640, - rand() % 480); - break; - } - break; - default: - break; - } - } - for (i = 0; i < state->num_windows; ++i) { - SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) - continue; - SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); - SDL_RenderClear(renderer); - - DrawRects(renderer); - DrawPoints(renderer); - DrawRectRectIntersections(renderer); - DrawLines(renderer); - DrawRectLineIntersections(renderer); - - SDL_RenderPresent(renderer); - } + loop(); } +#endif SDLTest_CommonQuit(state); diff --git a/jni/SDL2-2.0.3/test/testjoystick.c b/jni/SDL2-2.0.3/test/testjoystick.c index 2dc965da..259b5a85 100644 --- a/jni/SDL2-2.0.3/test/testjoystick.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,10 @@ #include "SDL.h" +#ifdef __EMSCRIPTEN__ +#include +#endif + #ifndef SDL_JOYSTICK_DISABLED #ifdef __IPHONEOS__ @@ -28,6 +32,9 @@ #define SCREEN_HEIGHT 480 #endif +SDL_Renderer *screen = NULL; +SDL_bool retval = SDL_FALSE; +SDL_bool done = SDL_FALSE; static void DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h) @@ -36,54 +43,25 @@ DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h) SDL_RenderFillRect(r, &area); } -static SDL_bool -WatchJoystick(SDL_Joystick * joystick) +void +loop(void *arg) { - SDL_Window *window = NULL; - SDL_Renderer *screen = NULL; - const char *name = NULL; - SDL_bool retval = SDL_FALSE; - SDL_bool done = SDL_FALSE; SDL_Event event; int i; + SDL_Joystick *joystick = (SDL_Joystick *)arg; - /* Create a window to display joystick axis position */ - window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED, - SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, - SCREEN_HEIGHT, 0); - if (window == NULL) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); - return SDL_FALSE; - } - - screen = SDL_CreateRenderer(window, -1, 0); - if (screen == NULL) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); - SDL_DestroyWindow(window); - return SDL_FALSE; - } - - SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE); - SDL_RenderClear(screen); - SDL_RenderPresent(screen); - SDL_RaiseWindow(window); - - /* Print info about the joystick we are watching */ - name = SDL_JoystickName(joystick); - SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick), - name ? name : "Unknown Joystick"); - SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n", - SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick), - SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick)); - - /* Loop, getting joystick events! */ - while (!done) { /* blank screen, set up for drawing this frame. */ - SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE); + SDL_SetRenderDrawColor(screen, 0x0, 0x0, 0x0, SDL_ALPHA_OPAQUE); SDL_RenderClear(screen); 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, @@ -197,9 +175,63 @@ WatchJoystick(SDL_Joystick * joystick) done = SDL_TRUE; retval = SDL_TRUE; /* keep going, wait for reattach. */ } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +static SDL_bool +WatchJoystick(SDL_Joystick * joystick) +{ + SDL_Window *window = NULL; + const char *name = NULL; + + retval = SDL_FALSE; + done = SDL_FALSE; + + /* Create a window to display joystick axis position */ + window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED, + SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, + SCREEN_HEIGHT, 0); + if (window == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); + return SDL_FALSE; } + screen = SDL_CreateRenderer(window, -1, 0); + if (screen == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); + SDL_DestroyWindow(window); + return SDL_FALSE; + } + + SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE); + SDL_RenderClear(screen); + SDL_RenderPresent(screen); + SDL_RaiseWindow(window); + + /* Print info about the joystick we are watching */ + name = SDL_JoystickName(joystick); + SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick), + name ? name : "Unknown Joystick"); + SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n", + SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick), + SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick)); + + /* Loop, getting joystick events! */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop_arg(loop, joystick, 0, 1); +#else + while (!done) { + loop(joystick); + } +#endif + SDL_DestroyRenderer(screen); + screen = NULL; SDL_DestroyWindow(window); return retval; } @@ -211,8 +243,10 @@ main(int argc, char *argv[]) int i; SDL_Joystick *joystick; + SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); + /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL (Note: video is required to start event loop) */ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { @@ -231,6 +265,7 @@ main(int argc, char *argv[]) SDL_GetError()); } else { char guid[64]; + SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick); SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), guid, sizeof (guid)); SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick)); @@ -243,7 +278,7 @@ main(int argc, char *argv[]) } } -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__IPHONEOS__) if (SDL_NumJoysticks() > 0) { #else if (argv[1]) { @@ -252,12 +287,15 @@ main(int argc, char *argv[]) SDL_bool keepGoing = SDL_TRUE; SDL_Event event; int device; -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__IPHONEOS__) device = 0; #else device = atoi(argv[1]); #endif joystick = SDL_JoystickOpen(device); + if (joystick != NULL) { + SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick); + } while ( keepGoing ) { if (joystick == NULL) { @@ -283,6 +321,9 @@ main(int argc, char *argv[]) keepGoing = SDL_FALSE; } else if (event.type == SDL_JOYDEVICEADDED) { joystick = SDL_JoystickOpen(device); + if (joystick != NULL) { + SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick); + } break; } } diff --git a/jni/SDL2-2.0.3/test/testkeys.c b/jni/SDL2-2.0.3/test/testkeys.c index 97f52a44..1c73df91 100644 --- a/jni/SDL2-2.0.3/test/testkeys.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testloadso.c b/jni/SDL2-2.0.3/test/testloadso.c index da7bab98..8b4e4180 100644 --- a/jni/SDL2-2.0.3/test/testloadso.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testlock.c b/jni/SDL2-2.0.3/test/testlock.c index 9ca3ca19..1293f958 100644 --- a/jni/SDL2-2.0.3/test/testlock.c +++ b/jni/SDL2-2.0.3/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 @@ -19,8 +19,6 @@ #include /* for atexit() */ #include "SDL.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" static SDL_mutex *mutex = NULL; static SDL_threadID mainthread; @@ -97,7 +95,7 @@ main(int argc, char *argv[]) int i; int maxproc = 6; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ diff --git a/jni/SDL2-2.0.3/test/testmessage.c b/jni/SDL2-2.0.3/test/testmessage.c index f44880c3..2040e554 100644 --- a/jni/SDL2-2.0.3/test/testmessage.c +++ b/jni/SDL2-2.0.3/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 @@ -17,7 +17,6 @@ #include #include "SDL.h" -#include "SDL_thread.h" /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void @@ -70,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; @@ -86,7 +85,7 @@ main(int argc, char *argv[]) { int success; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, @@ -127,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/jni/SDL2-2.0.3/test/testmultiaudio.c b/jni/SDL2-2.0.3/test/testmultiaudio.c index cc3cdcb6..d98ac945 100644 --- a/jni/SDL2-2.0.3/test/testmultiaudio.c +++ b/jni/SDL2-2.0.3/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 @@ -13,6 +13,10 @@ #include /* for fflush() and stdout */ +#ifdef __EMSCRIPTEN__ +#include +#endif + static SDL_AudioSpec spec; static Uint8 *sound = NULL; /* Pointer to wave data */ static Uint32 soundlen = 0; /* Length of wave data */ @@ -24,6 +28,8 @@ typedef struct volatile int done; } callback_data; +callback_data cbd[64]; + void SDLCALL play_through_once(void *arg, Uint8 * stream, int len) { @@ -44,16 +50,30 @@ play_through_once(void *arg, Uint8 * stream, int len) } } +void +loop() +{ + if(cbd[0].done) { +#ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); +#endif + SDL_PauseAudioDevice(cbd[0].dev, 1); + SDL_CloseAudioDevice(cbd[0].dev); + SDL_FreeWAV(sound); + SDL_Quit(); + } +} + static void test_multi_audio(int devcount) { - callback_data cbd[64]; int keep_going = 1; int i; #ifdef __ANDROID__ SDL_Event event; + /* Create a Window to get fully initialized event processing for testing pause on Android. */ SDL_CreateWindow("testmultiaudio", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0); #endif @@ -77,13 +97,19 @@ test_multi_audio(int devcount) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Open device failed: %s\n", SDL_GetError()); } else { SDL_PauseAudioDevice(cbd[0].dev, 0); - while (!cbd[0].done) { -#ifdef __ANDROID__ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!cbd[0].done) + { + #ifdef __ANDROID__ + /* Empty queue, some application events would prevent pause. */ while (SDL_PollEvent(&event)){} -#endif + #endif SDL_Delay(100); } SDL_PauseAudioDevice(cbd[0].dev, 1); +#endif SDL_Log("done.\n"); SDL_CloseAudioDevice(cbd[0].dev); } @@ -114,12 +140,15 @@ test_multi_audio(int devcount) keep_going = 1; } } -#ifdef __ANDROID__ + #ifdef __ANDROID__ + /* Empty queue, some application events would prevent pause. */ while (SDL_PollEvent(&event)){} -#endif + #endif + SDL_Delay(100); } +#ifndef __EMSCRIPTEN__ for (i = 0; i < devcount; i++) { if (cbd[i].dev) { SDL_PauseAudioDevice(cbd[i].dev, 1); @@ -128,6 +157,7 @@ test_multi_audio(int devcount) } SDL_Log("All done!\n"); +#endif } @@ -136,7 +166,7 @@ main(int argc, char **argv) { int devcount = 0; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ diff --git a/jni/SDL2-2.0.3/test/testnative.c b/jni/SDL2-2.0.3/test/testnative.c index c010445f..0861bc98 100644 --- a/jni/SDL2-2.0.3/test/testnative.c +++ b/jni/SDL2-2.0.3/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 @@ -131,7 +131,7 @@ main(int argc, char *argv[]) int sprite_w, sprite_h; SDL_Event event; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (SDL_VideoInit(NULL) < 0) { diff --git a/jni/SDL2-2.0.3/test/testnative.h b/jni/SDL2-2.0.3/test/testnative.h index fa0bffc3..a373fa98 100644 --- a/jni/SDL2-2.0.3/test/testnative.h +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testnativew32.c b/jni/SDL2-2.0.3/test/testnativew32.c index f43c2209..7ca41500 100644 --- a/jni/SDL2-2.0.3/test/testnativew32.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testnativex11.c b/jni/SDL2-2.0.3/test/testnativex11.c index b60c999e..fc6fd9ab 100644 --- a/jni/SDL2-2.0.3/test/testnativex11.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testoverlay2.c b/jni/SDL2-2.0.3/test/testoverlay2.c index d9bd8273..47a633a2 100644 --- a/jni/SDL2-2.0.3/test/testoverlay2.c +++ b/jni/SDL2-2.0.3/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 @@ -20,6 +20,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" #define MOOSEPIC_W 64 @@ -135,6 +139,18 @@ SDL_Color MooseColors[84] = { , {239, 206, 173} }; +Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE*2]; +SDL_Texture *MooseTexture; +SDL_Rect displayrect; +int window_w; +int window_h; +SDL_Window *window; +SDL_Renderer *renderer; +int paused = 0; +int i; +SDL_bool done = SDL_FALSE; +Uint32 pixel_format = SDL_PIXELFORMAT_YV12; +int fpsdelay; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void @@ -246,21 +262,71 @@ PrintUsage(char *argv0) SDL_Log("\n"); } +void +loop() +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_WINDOWEVENT: + if (event.window.event == SDL_WINDOWEVENT_RESIZED) { + SDL_RenderSetViewport(renderer, NULL); + displayrect.w = window_w = event.window.data1; + displayrect.h = window_h = event.window.data2; + } + break; + case SDL_MOUSEBUTTONDOWN: + displayrect.x = event.button.x - window_w / 2; + displayrect.y = event.button.y - window_h / 2; + break; + case SDL_MOUSEMOTION: + if (event.motion.state) { + displayrect.x = event.motion.x - window_w / 2; + displayrect.y = event.motion.y - window_h / 2; + } + break; + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_SPACE) { + paused = !paused; + break; + } + if (event.key.keysym.sym != SDLK_ESCAPE) { + break; + } + case SDL_QUIT: + done = SDL_TRUE; + break; + } + } + +#ifndef __EMSCRIPTEN__ + SDL_Delay(fpsdelay); +#endif + + if (!paused) { + i = (i + 1) % MOOSEFRAMES_COUNT; + + SDL_UpdateTexture(MooseTexture, NULL, MooseFrame[i], MOOSEPIC_W*SDL_BYTESPERPIXEL(pixel_format)); + } + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, MooseTexture, NULL, &displayrect); + SDL_RenderPresent(renderer); + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char **argv) { Uint8 *RawMooseData; SDL_RWops *handle; - int window_w; - int window_h; SDL_Window *window; - SDL_Renderer *renderer; - Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE*2]; - SDL_Texture *MooseTexture; - SDL_Rect displayrect; - SDL_Event event; - int paused = 0; - int i, j; + int j; int fps = 12; int fpsdelay; int nodelay = 0; @@ -270,7 +336,6 @@ main(int argc, char **argv) Uint32 pixel_format = SDL_PIXELFORMAT_YV12; #endif int scale = 5; - SDL_bool done = SDL_FALSE; /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -430,50 +495,14 @@ main(int argc, char **argv) SDL_EventState(SDL_KEYUP, SDL_IGNORE); /* Loop, waiting for QUIT or RESIZE */ +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, nodelay ? 0 : fps, 1); +#else while (!done) { - while (SDL_PollEvent(&event)) { - switch (event.type) { - case SDL_WINDOWEVENT: - if (event.window.event == SDL_WINDOWEVENT_RESIZED) { - SDL_RenderSetViewport(renderer, NULL); - displayrect.w = window_w = event.window.data1; - displayrect.h = window_h = event.window.data2; - } - break; - case SDL_MOUSEBUTTONDOWN: - displayrect.x = event.button.x - window_w / 2; - displayrect.y = event.button.y - window_h / 2; - break; - case SDL_MOUSEMOTION: - if (event.motion.state) { - displayrect.x = event.motion.x - window_w / 2; - displayrect.y = event.motion.y - window_h / 2; - } - break; - case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_SPACE) { - paused = !paused; - break; - } - if (event.key.keysym.sym != SDLK_ESCAPE) { - break; - } - case SDL_QUIT: - done = SDL_TRUE; - break; + loop(); } - } - SDL_Delay(fpsdelay); +#endif - if (!paused) { - i = (i + 1) % MOOSEFRAMES_COUNT; - - SDL_UpdateTexture(MooseTexture, NULL, MooseFrame[i], MOOSEPIC_W*SDL_BYTESPERPIXEL(pixel_format)); - } - SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, MooseTexture, NULL, &displayrect); - SDL_RenderPresent(renderer); - } SDL_DestroyRenderer(renderer); quit(0); return 0; diff --git a/jni/SDL2-2.0.3/test/testplatform.c b/jni/SDL2-2.0.3/test/testplatform.c index ae367ff4..51b0f178 100644 --- a/jni/SDL2-2.0.3/test/testplatform.c +++ b/jni/SDL2-2.0.3/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 @@ -13,9 +13,6 @@ #include #include "SDL.h" -#include "SDL_endian.h" -#include "SDL_cpuinfo.h" -#include "SDL_assert.h" /* * Watcom C flags these as Warning 201: "Unreachable code" if you just @@ -119,14 +116,8 @@ TestEndian(SDL_bool verbose) ++error; } if (verbose) { -#ifdef _MSC_VER - SDL_Log("Value 64 = 0x%I64X, swapped = 0x%I64X\n", value64, + SDL_Log("Value 64 = 0x%"SDL_PRIX64", swapped = 0x%"SDL_PRIX64"\n", value64, SDL_Swap64(value64)); -#else - SDL_Log("Value 64 = 0x%llX, swapped = 0x%llX\n", - (unsigned long long) value64, - (unsigned long long) SDL_Swap64(value64)); -#endif } if (SDL_Swap64(value64) != swapped64) { if (verbose) { @@ -176,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/jni/SDL2-2.0.3/test/testpower.c b/jni/SDL2-2.0.3/test/testpower.c index 058a53fc..b400f33b 100644 --- a/jni/SDL2-2.0.3/test/testpower.c +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/test/testrelative.c b/jni/SDL2-2.0.3/test/testrelative.c index 2c87ba1d..a8c57444 100644 --- a/jni/SDL2-2.0.3/test/testrelative.c +++ b/jni/SDL2-2.0.3/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 @@ -18,22 +18,65 @@ #include "SDL_test_common.h" +#ifdef __EMSCRIPTEN__ +#include +#endif static SDLTest_CommonState *state; +int i, done; +SDL_Rect rect; +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); } +static void +loop(){ + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + switch(event.type) { + case SDL_MOUSEMOTION: + { + rect.x += event.motion.xrel; + rect.y += event.motion.yrel; + } + break; + } + } + for (i = 0; i < state->num_windows; ++i) { + SDL_Rect viewport; + SDL_Renderer *renderer = state->renderers[i]; + if (state->windows[i] == NULL) + continue; + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); + SDL_RenderClear(renderer); + + /* Wrap the cursor rectangle at the screen edges to keep it visible */ + SDL_RenderGetViewport(renderer, &viewport); + if (rect.x < viewport.x) rect.x += viewport.w; + if (rect.y < viewport.y) rect.y += viewport.h; + if (rect.x > viewport.x + viewport.w) rect.x -= viewport.w; + if (rect.y > viewport.y + viewport.h) rect.y -= viewport.h; + + DrawRects(renderer, &rect); + + SDL_RenderPresent(renderer); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int i, done; - SDL_Rect rect; - SDL_Event event; /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -69,32 +112,13 @@ main(int argc, char *argv[]) rect.h = 10; /* Main render loop */ done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - switch(event.type) { - case SDL_MOUSEMOTION: - { - rect.x += event.motion.xrel; - rect.y += event.motion.yrel; - } - break; - } + loop(); } - for (i = 0; i < state->num_windows; ++i) { - SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) - continue; - SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); - SDL_RenderClear(renderer); - - DrawRects(renderer, &rect); - - SDL_RenderPresent(renderer); - } - } - +#endif SDLTest_CommonQuit(state); return 0; } diff --git a/jni/SDL2-2.0.3/test/testrendercopyex.c b/jni/SDL2-2.0.3/test/testrendercopyex.c index 95a77a17..8c5e5192 100644 --- a/jni/SDL2-2.0.3/test/testrendercopyex.c +++ b/jni/SDL2-2.0.3/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 @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" @@ -29,6 +33,9 @@ typedef struct { int scale_direction; } DrawState; +DrawState *drawstates; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -130,16 +137,36 @@ Draw(DrawState *s) /* SDL_Delay(10); */ } +void loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + Draw(&drawstates[i]); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - DrawState *drawstates; - int i, done; - SDL_Event event; + int i; int frames; Uint32 then, now; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize test framework */ @@ -181,19 +208,15 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; - while (!done) { - /* Check for events */ - ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) - continue; - Draw(&drawstates[i]); - } - } +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + ++frames; + loop(); + } +#endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { diff --git a/jni/SDL2-2.0.3/test/testrendertarget.c b/jni/SDL2-2.0.3/test/testrendertarget.c index 61a3a5fd..0ae0a824 100644 --- a/jni/SDL2-2.0.3/test/testrendertarget.c +++ b/jni/SDL2-2.0.3/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 @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" @@ -29,6 +33,10 @@ typedef struct { int scale_direction; } DrawState; +DrawState *drawstates; +int done; +SDL_bool test_composite = SDL_FALSE; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -214,15 +222,38 @@ Draw(DrawState *s) return SDL_TRUE; } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + if (test_composite) { + if (!DrawComposite(&drawstates[i])) done = 1; + } else { + if (!Draw(&drawstates[i])) done = 1; + } + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - DrawState *drawstates; - int i, done; - SDL_Event event; + int i; int frames; Uint32 then, now; - SDL_bool test_composite = SDL_FALSE; /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -278,22 +309,15 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) - continue; - if (test_composite) { - if (!DrawComposite(&drawstates[i])) done = 1; - } else { - if (!Draw(&drawstates[i])) done = 1; - } - } + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); diff --git a/jni/SDL2-2.0.3/test/testresample.c b/jni/SDL2-2.0.3/test/testresample.c index 78335052..1c1333d0 100644 --- a/jni/SDL2-2.0.3/test/testresample.c +++ b/jni/SDL2-2.0.3/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 @@ -25,7 +25,7 @@ main(int argc, char **argv) int avgbytes = 0; SDL_RWops *io = NULL; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (argc != 4) { @@ -115,4 +115,4 @@ main(int argc, char **argv) return 0; } /* main */ -/* end of resample_test.c ... */ +/* end of testresample.c ... */ diff --git a/jni/SDL2-2.0.3/test/testrumble.c b/jni/SDL2-2.0.3/test/testrumble.c index 74a7e98f..27c1937e 100644 --- a/jni/SDL2-2.0.3/test/testrumble.c +++ b/jni/SDL2-2.0.3/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 @@ -33,8 +33,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #ifndef SDL_HAPTIC_DISABLED -#include "SDL_haptic.h" - static SDL_Haptic *haptic; @@ -50,7 +48,7 @@ main(int argc, char **argv) char *name; int index; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); name = NULL; diff --git a/jni/SDL2-2.0.3/test/testscale.c b/jni/SDL2-2.0.3/test/testscale.c index edd2c2fd..d3edf676 100644 --- a/jni/SDL2-2.0.3/test/testscale.c +++ b/jni/SDL2-2.0.3/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 @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" #define WINDOW_WIDTH 640 @@ -31,6 +35,9 @@ typedef struct { int scale_direction; } DrawState; +DrawState *drawstates; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -120,12 +127,32 @@ Draw(DrawState *s) SDL_RenderPresent(s->renderer); } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + Draw(&drawstates[i]); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - DrawState *drawstates; - int i, done; - SDL_Event event; + int i; int frames; Uint32 then, now; @@ -171,18 +198,15 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) - continue; - Draw(&drawstates[i]); - } + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); diff --git a/jni/SDL2-2.0.3/test/testsem.c b/jni/SDL2-2.0.3/test/testsem.c index ca71ec2e..456c4f06 100644 --- a/jni/SDL2-2.0.3/test/testsem.c +++ b/jni/SDL2-2.0.3/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 @@ -17,7 +17,6 @@ #include #include "SDL.h" -#include "SDL_thread.h" #define NUM_THREADS 10 @@ -83,7 +82,7 @@ main(int argc, char **argv) uintptr_t i; int init_sem; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (argc < 2) { diff --git a/jni/SDL2-2.0.3/test/testshader.c b/jni/SDL2-2.0.3/test/testshader.c index 91ce3313..9a29c6cb 100644 --- a/jni/SDL2-2.0.3/test/testshader.c +++ b/jni/SDL2-2.0.3/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 @@ -421,7 +421,7 @@ int main(int argc, char **argv) GLuint texture; GLfloat texcoords[4]; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL for video output */ diff --git a/jni/SDL2-2.0.3/test/testshape.c b/jni/SDL2-2.0.3/test/testshape.c index 5538515a..845dd59e 100644 --- a/jni/SDL2-2.0.3/test/testshape.c +++ b/jni/SDL2-2.0.3/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 @@ -60,7 +60,7 @@ int main(int argc,char** argv) SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if(argc < 2) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Shape requires at least one bitmap file as argument."); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Shape requires at least one bitmap file as argument."); exit(-1); } diff --git a/jni/SDL2-2.0.3/test/testsprite2.c b/jni/SDL2-2.0.3/test/testsprite2.c index 945280f9..aa5c930e 100644 --- a/jni/SDL2-2.0.3/test/testsprite2.c +++ b/jni/SDL2-2.0.3/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 @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test.h" #include "SDL_test_common.h" @@ -38,6 +42,8 @@ static SDL_BlendMode blendMode = SDL_BLENDMODE_BLEND; /* -1: infinite random moves (default); >=0: enables N deterministic moves */ static int iterations = -1; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -197,13 +203,13 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) velocity = &velocities[i]; position->x += velocity->x; if ((position->x < 0) || (position->x >= (viewport.w - sprite_w))) { - velocity->x = -velocity->x; - position->x += velocity->x; + velocity->x = -velocity->x; + position->x += velocity->x; } position->y += velocity->y; if ((position->y < 0) || (position->y >= (viewport.h - sprite_h))) { - velocity->y = -velocity->y; - position->y += velocity->y; + velocity->y = -velocity->y; + position->y += velocity->y; } } @@ -221,7 +227,7 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) /* Draw sprites */ for (i = 0; i < num_sprites; ++i) { position = &positions[i]; - + /* Blit the sprite onto the screen */ SDL_RenderCopy(renderer, sprite, NULL, position); } @@ -230,13 +236,34 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderPresent(renderer); } +void +loop() +{ + int i; + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + MoveSprites(state->renderers[i], sprites[i]); + } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int i, done; - SDL_Event event; + int i; Uint32 then, now, frames; - Uint64 seed; + Uint64 seed; const char *icon = "icon.bmp"; /* Initialize parameters */ @@ -351,18 +378,15 @@ main(int argc, char *argv[]) frames = 0; then = SDL_GetTicks(); done = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - /* Check for events */ ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) - continue; - MoveSprites(state->renderers[i], sprites[i]); - } + loop(); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); diff --git a/jni/SDL2-2.0.3/test/testspriteminimal.c b/jni/SDL2-2.0.3/test/testspriteminimal.c index bdcb8b38..0e3e9a27 100644 --- a/jni/SDL2-2.0.3/test/testspriteminimal.c +++ b/jni/SDL2-2.0.3/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 @@ -15,6 +15,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" #define WINDOW_WIDTH 640 @@ -27,6 +31,9 @@ static SDL_Rect positions[NUM_SPRITES]; static SDL_Rect velocities[NUM_SPRITES]; static int sprite_w, sprite_h; +SDL_Renderer *renderer; +int done; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -118,15 +125,32 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderPresent(renderer); } +void loop() +{ + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT || event.type == SDL_KEYDOWN) { + done = 1; + } + } + MoveSprites(renderer, sprite); +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { SDL_Window *window; - SDL_Renderer *renderer; - int i, done; - SDL_Event event; + int i; - /* Enable standard application logging */ + + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (SDL_CreateWindowAndRenderer(WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer) < 0) { @@ -154,16 +178,14 @@ main(int argc, char *argv[]) /* Main render loop */ done = 0; - while (!done) { - /* Check for events */ - while (SDL_PollEvent(&event)) { - if (event.type == SDL_QUIT || event.type == SDL_KEYDOWN) { - done = 1; - } - } - MoveSprites(renderer, sprite); - } +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif quit(0); return 0; /* to prevent compiler warning */ diff --git a/jni/SDL2-2.0.3/test/teststreaming.c b/jni/SDL2-2.0.3/test/teststreaming.c index e8bb1f21..623d5879 100644 --- a/jni/SDL2-2.0.3/test/teststreaming.c +++ b/jni/SDL2-2.0.3/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 @@ -18,6 +18,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL.h" #define MOOSEPIC_W 64 @@ -52,6 +56,11 @@ SDL_Color MooseColors[84] = { Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE]; +SDL_Renderer *renderer; +int frame; +SDL_Texture *MooseTexture; +SDL_bool done = SDL_FALSE; + void quit(int rc) { SDL_Quit(); @@ -82,18 +91,45 @@ void UpdateTexture(SDL_Texture *texture, int frame) SDL_UnlockTexture(texture); } +void +loop() +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_ESCAPE) { + done = SDL_TRUE; + } + break; + case SDL_QUIT: + done = SDL_TRUE; + break; + } + } + + frame = (frame + 1) % MOOSEFRAMES_COUNT; + UpdateTexture(MooseTexture, frame); + + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, MooseTexture, NULL, NULL); + SDL_RenderPresent(renderer); + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char **argv) { SDL_Window *window; - SDL_Renderer *renderer; SDL_RWops *handle; - SDL_Texture *MooseTexture; - SDL_Event event; - SDL_bool done = SDL_FALSE; - int frame; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (SDL_Init(SDL_INIT_VIDEO) < 0) { @@ -136,27 +172,15 @@ main(int argc, char **argv) /* Loop, waiting for QUIT or the escape key */ frame = 0; + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else while (!done) { - while (SDL_PollEvent(&event)) { - switch (event.type) { - case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_ESCAPE) { - done = SDL_TRUE; - } - break; - case SDL_QUIT: - done = SDL_TRUE; - break; - } + loop(); } +#endif - frame = (frame + 1) % MOOSEFRAMES_COUNT; - UpdateTexture(MooseTexture, frame); - - SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, MooseTexture, NULL, NULL); - SDL_RenderPresent(renderer); - } SDL_DestroyRenderer(renderer); quit(0); diff --git a/jni/SDL2-2.0.3/test/testthread.c b/jni/SDL2-2.0.3/test/testthread.c index d732320a..45077d90 100644 --- a/jni/SDL2-2.0.3/test/testthread.c +++ b/jni/SDL2-2.0.3/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 @@ -17,7 +17,6 @@ #include #include "SDL.h" -#include "SDL_thread.h" static SDL_TLSID tls; static int alive = 0; @@ -58,7 +57,7 @@ main(int argc, char *argv[]) { SDL_Thread *thread; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ diff --git a/jni/SDL2-2.0.3/test/testtimer.c b/jni/SDL2-2.0.3/test/testtimer.c index ef6bcb6a..5d8d8c7f 100644 --- a/jni/SDL2-2.0.3/test/testtimer.c +++ b/jni/SDL2-2.0.3/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 @@ -45,7 +45,7 @@ main(int argc, char *argv[]) Uint32 start32, now32; Uint64 start, now; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); if (SDL_Init(SDL_INIT_TIMER) < 0) { @@ -107,7 +107,7 @@ main(int argc, char *argv[]) now = SDL_GetPerformanceCounter(); SDL_Log("1 million iterations of ticktock took %f ms\n", (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); - SDL_Log("Performance counter frequency: %llu\n", (unsigned long long) SDL_GetPerformanceFrequency()); + SDL_Log("Performance counter frequency: %"PRIu64"\n", (unsigned long long) SDL_GetPerformanceFrequency()); start32 = SDL_GetTicks(); start = SDL_GetPerformanceCounter(); SDL_Delay(1000); diff --git a/jni/SDL2-2.0.3/test/testver.c b/jni/SDL2-2.0.3/test/testver.c index e59381f4..0f934989 100644 --- a/jni/SDL2-2.0.3/test/testver.c +++ b/jni/SDL2-2.0.3/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 @@ -26,7 +26,7 @@ main(int argc, char *argv[]) SDL_version compiled; SDL_version linked; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); #if SDL_VERSION_ATLEAST(2, 0, 0) diff --git a/jni/SDL2-2.0.3/test/testviewport.c b/jni/SDL2-2.0.3/test/testviewport.c index c9d32340..957498a6 100644 --- a/jni/SDL2-2.0.3/test/testviewport.c +++ b/jni/SDL2-2.0.3/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 @@ -15,12 +15,23 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test.h" #include "SDL_test_common.h" static SDLTest_CommonState *state; +SDL_Rect viewport; +int done, j; +SDL_bool use_target = SDL_FALSE; +#ifdef __EMSCRIPTEN__ +Uint32 wait_start; +#endif + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -77,14 +88,60 @@ DrawOnViewport(SDL_Renderer * renderer, SDL_Rect viewport) SDL_RenderFillRect(renderer, &rect); } +void +loop() +{ +#ifdef __EMSCRIPTEN__ + /* Avoid using delays */ + if(SDL_GetTicks() - wait_start < 1000) + return; + wait_start = SDL_GetTicks(); +#endif + SDL_Event event; + int i; + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + + /* Move a viewport box in steps around the screen */ + viewport.x = j * 100; + viewport.y = viewport.x; + viewport.w = 100 + j * 50; + viewport.h = 100 + j * 50; + j = (j + 1) % 4; + SDL_Log("Current Viewport x=%i y=%i w=%i h=%i", viewport.x, viewport.y, viewport.w, viewport.h); + + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) + continue; + + /* Draw using viewport */ + DrawOnViewport(state->renderers[i], viewport); + + /* Update the screen! */ + if (use_target) { + SDL_SetRenderTarget(state->renderers[i], NULL); + SDL_RenderCopy(state->renderers[i], state->targets[i], NULL, NULL); + SDL_RenderPresent(state->renderers[i]); + SDL_SetRenderTarget(state->renderers[i], state->targets[i]); + } else { + SDL_RenderPresent(state->renderers[i]); + } + } + +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + int main(int argc, char *argv[]) { - int i, j, done; - SDL_Event event; + int i; Uint32 then, now, frames; - SDL_Rect viewport; - SDL_bool use_target = SDL_FALSE; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); @@ -135,41 +192,17 @@ main(int argc, char *argv[]) then = SDL_GetTicks(); done = 0; j = 0; - while (!done) { - /* Check for events */ - ++frames; - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - - /* Move a viewport box in steps around the screen */ - viewport.x = j * 100; - viewport.y = viewport.x; - viewport.w = 100 + j * 50; - viewport.h = 100 + j * 50; - j = (j + 1) % 4; - SDL_Log("Current Viewport x=%i y=%i w=%i h=%i", viewport.x, viewport.y, viewport.w, viewport.h); - - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) - continue; - - /* Draw using viewport */ - DrawOnViewport(state->renderers[i], viewport); - /* Update the screen! */ - if (use_target) { - SDL_SetRenderTarget(state->renderers[i], NULL); - SDL_RenderCopy(state->renderers[i], state->targets[i], NULL, NULL); - SDL_RenderPresent(state->renderers[i]); - SDL_SetRenderTarget(state->renderers[i], state->targets[i]); - } else { - SDL_RenderPresent(state->renderers[i]); - } - } - +#ifdef __EMSCRIPTEN__ + wait_start = SDL_GetTicks(); + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + ++frames; + loop(); SDL_Delay(1000); } +#endif /* Print out some timing information */ now = SDL_GetTicks(); diff --git a/jni/SDL2-2.0.3/test/testwm2.c b/jni/SDL2-2.0.3/test/testwm2.c index 186e0827..510e29d6 100644 --- a/jni/SDL2-2.0.3/test/testwm2.c +++ b/jni/SDL2-2.0.3/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 @@ -13,22 +13,16 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "SDL_test_common.h" static SDLTest_CommonState *state; +int done; -/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ -static void -quit(int rc) -{ - SDLTest_CommonQuit(state); - exit(rc); -} - -int -main(int argc, char *argv[]) -{ - static const char *cursorNames[] = { +static const char *cursorNames[] = { "arrow", "ibeam", "wait", @@ -41,44 +35,22 @@ main(int argc, char *argv[]) "sizeALL", "NO", "hand", - }; +}; +int system_cursor = -1; +SDL_Cursor *cursor = NULL; - int i, done; +/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ +static void +quit(int rc) +{ + SDLTest_CommonQuit(state); + exit(rc); +} + +void +loop() +{ SDL_Event event; - int system_cursor = -1; - SDL_Cursor *cursor = NULL; - - /* Enable standard application logging */ - SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - - SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS); - - /* Initialize test framework */ - state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { - return 1; - } - state->skip_renderer = SDL_TRUE; - for (i = 1; i < argc;) { - int consumed; - - consumed = SDLTest_CommonArg(state, i); - if (consumed == 0) { - consumed = -1; - } - if (consumed < 0) { - SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); - quit(1); - } - i += consumed; - } - if (!SDLTest_CommonInit(state)) { - quit(2); - } - - /* Main render loop */ - done = 0; - while (!done) { /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); @@ -128,7 +100,55 @@ main(int argc, char *argv[]) } } } +#ifdef __EMSCRIPTEN__ + if (done) { + emscripten_cancel_main_loop(); } +#endif +} + +int +main(int argc, char *argv[]) +{ + int i; + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS); + + /* Initialize test framework */ + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + return 1; + } + state->skip_renderer = SDL_TRUE; + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (consumed == 0) { + consumed = -1; + } + if (consumed < 0) { + SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); + quit(1); + } + i += consumed; + } + if (!SDLTest_CommonInit(state)) { + quit(2); + } + + /* Main render loop */ + done = 0; +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif SDL_FreeCursor(cursor); quit(0); diff --git a/jni/SDL2-2.0.3/test/torturethread.c b/jni/SDL2-2.0.3/test/torturethread.c index bc4e1132..b774cc6f 100644 --- a/jni/SDL2-2.0.3/test/torturethread.c +++ b/jni/SDL2-2.0.3/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 @@ -18,7 +18,6 @@ #include #include "SDL.h" -#include "SDL_thread.h" #define NUMTHREADS 10 @@ -80,7 +79,7 @@ main(int argc, char *argv[]) SDL_Thread *threads[NUMTHREADS]; int i; - /* Enable standard application logging */ + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ diff --git a/jni/SDL2-2.0.3/visualtest/COPYING.txt b/jni/SDL2-2.0.3/visualtest/COPYING.txt index 05460c3d..0f97d76c 100755 --- a/jni/SDL2-2.0.3/visualtest/COPYING.txt +++ b/jni/SDL2-2.0.3/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/jni/SDL2-2.0.3/visualtest/unittest/testquit.c b/jni/SDL2-2.0.3/visualtest/unittest/testquit.c index ceb83b0a..4393700f 100644 --- a/jni/SDL2-2.0.3/visualtest/unittest/testquit.c +++ b/jni/SDL2-2.0.3/visualtest/unittest/testquit.c @@ -98,4 +98,4 @@ main(int argc, char** argv) } return exit_code; -} \ No newline at end of file +} diff --git a/src/org/libsdl/app/SDLActivity.java b/src/org/libsdl/app/SDLActivity.java index 0c4fe381..e579becc 100644 --- a/src/org/libsdl/app/SDLActivity.java +++ b/src/org/libsdl/app/SDLActivity.java @@ -11,6 +11,7 @@ import java.lang.reflect.Method; import android.app.*; import android.content.*; +import android.text.InputType; import android.view.*; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.EditorInfo; @@ -27,6 +28,7 @@ import android.graphics.*; import android.graphics.drawable.Drawable; import android.media.*; import android.hardware.*; +import android.content.pm.ActivityInfo; /** SDL Activity @@ -38,6 +40,13 @@ public class SDLActivity extends Activity { public static boolean mIsPaused, mIsSurfaceReady, mHasFocus; public static boolean mExitCalledFromJava; + /** 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; @@ -47,27 +56,37 @@ 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; - // Load the .so - static { - // SDL2 is linked statically to love, so we do not need to load it - // manually - //System.loadLibrary("SDL2"); - //System.loadLibrary("SDL2_image"); - //System.loadLibrary("SDL2_mixer"); - //System.loadLibrary("SDL2_net"); - //System.loadLibrary("SDL2_ttf"); - System.loadLibrary("gnustl_shared"); - System.loadLibrary("mpg123"); - System.loadLibrary("openal"); - System.loadLibrary("love"); - } - /** - * This method is called by SDL using JNI. + * This method is called by SDL before loading the native shared libraries. + * It can be overridden to provide names of shared libraries to be loaded. + * The default implementation returns the defaults. It never returns null. + * An array returned by a new implementation must at least contain "SDL2". + * Also keep in mind that the order the libraries are loaded may matter. + * @return names of shared libraries to be loaded (e.g. "SDL2", "main"). + */ + protected String[] getLibraries() { + return new String[] { + "SDL2", + // "SDL2_image", + // "SDL2_mixer", + // "SDL2_net", + // "SDL2_ttf", + "main" + }; + } + + // Load the .so + public void loadLibraries() { + for (String lib : getLibraries()) { + 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. * The default implementation returns an empty array. It never returns null. @@ -76,7 +95,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 @@ -88,6 +107,7 @@ public class SDLActivity extends Activity { mSDLThread = null; mAudioTrack = null; mExitCalledFromJava = false; + mBrokenLibraries = false; mIsPaused = false; mIsSurfaceReady = false; mHasFocus = true; @@ -96,24 +116,83 @@ 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); - - startNative(); + + startNative(); + + // Load shared libraries + String errorMsgBrokenLib = ""; + try { + loadLibraries(); + } catch(UnsatisfiedLinkError e) { + System.err.println(e.getMessage()); + mBrokenLibraries = true; + errorMsgBrokenLib = e.getMessage(); + } catch(Exception e) { + System.err.println(e.getMessage()); + mBrokenLibraries = true; + errorMsgBrokenLib = e.getMessage(); + } + + if (mBrokenLibraries) + { + AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this); + dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall." + + System.getProperty("line.separator") + + System.getProperty("line.separator") + + "Error: " + errorMsgBrokenLib); + dlgAlert.setTitle("SDL Error"); + dlgAlert.setPositiveButton("Exit", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog,int id) { + // if this button is clicked, close current activity + SDLActivity.mSingleton.finish(); + } + }); + dlgAlert.setCancelable(false); + dlgAlert.create().show(); + + return; + } + + // 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) { + return; + } + SDLActivity.handlePause(); } @Override protected void onResume() { - Log.v("SDL", "onResume()"); + Log.v(TAG, "onResume()"); super.onResume(); + + if (SDLActivity.mBrokenLibraries) { + return; + } + SDLActivity.handleResume(); } @@ -121,7 +200,11 @@ 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; + } SDLActivity.mHasFocus = hasFocus; if (hasFocus) { @@ -131,8 +214,13 @@ public class SDLActivity extends Activity { @Override public void onLowMemory() { - Log.v("SDL", "onLowMemory()"); + Log.v(TAG, "onLowMemory()"); super.onLowMemory(); + + if (SDLActivity.mBrokenLibraries) { + return; + } + SDLActivity.nativeLowMemory(); } @@ -184,15 +272,29 @@ public class SDLActivity extends Activity { @Override protected void onDestroy() { - Log.v("SDL", "onDestroy()"); + Log.v(TAG, "onDestroy()"); + + if (SDLActivity.mBrokenLibraries) { + super.onDestroy(); + // Reset everything in case the user re opens the app + SDLActivity.initialize(); + return; + } + + resetNative(); - resetNative(); - super.onDestroy(); + // Reset everything in case the user re opens the app + SDLActivity.initialize(); } @Override public boolean dispatchKeyEvent(KeyEvent event) { + + if (SDLActivity.mBrokenLibraries) { + return false; + } + int keyCode = event.getKeyCode(); // Ignore certain special keys so they're handled by Android if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || @@ -214,7 +316,7 @@ public class SDLActivity extends Activity { if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) { SDLActivity.mIsPaused = true; SDLActivity.nativePause(); - mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false); + mSurface.handlePause(); } } @@ -229,7 +331,7 @@ public class SDLActivity extends Activity { mSurface.handleResume(); } } - + /* The native thread has finished */ public static void handleNativeExit() { SDLActivity.mSDLThread = null; @@ -323,7 +425,8 @@ public class SDLActivity extends Activity { public static native void nativeQuit(); public static native void nativePause(); public static native void nativeResume(); - public static native void onNativeResize(int x, int y, int format); + 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); public static native void onNativeJoy(int device_id, int axis, @@ -333,26 +436,19 @@ 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); - /** - * This method is called by SDL using JNI. - */ - public static void flipBuffers() { - SDLActivity.nativeFlipBuffers(); - } - /** * This method is called by SDL using JNI. */ @@ -466,33 +562,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; } @@ -511,7 +607,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; } } @@ -532,7 +628,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; } } @@ -581,7 +677,7 @@ public class SDLActivity extends Activity { } } - // APK extension files support + // APK expansion files support /** com.android.vending.expansion.zipfile.ZipResourceFile object or null. */ private Object expansionFile; @@ -590,16 +686,43 @@ public class SDLActivity extends Activity { private Method expansionFileMethod; /** - * This method is called by SDL using JNI. + * This method was called by SDL using JNI. + * @deprecated because of an incorrect name */ + @Deprecated public InputStream openAPKExtensionInputStream(String fileName) throws IOException { + return openAPKExpansionInputStream(fileName); + } + + /** + * This method is called by SDL using JNI. + * @return an InputStream on success or null if no expansion file was used. + * @throws IOException on errors. Message is set for the SDL error message. + */ + public InputStream openAPKExpansionInputStream(String fileName) throws IOException { // Get a ZipResourceFile representing a merger of both the main and patch files if (expansionFile == null) { - Integer mainVersion = Integer.valueOf(nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION")); - Integer patchVersion = Integer.valueOf(nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION")); + String mainHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"); + if (mainHint == null) { + return null; // no expansion use if no main version was set + } + String patchHint = nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"); + if (patchHint == null) { + return null; // no expansion use if no patch version was set + } + + Integer mainVersion; + Integer patchVersion; + try { + mainVersion = Integer.valueOf(mainHint); + patchVersion = Integer.valueOf(patchHint); + } catch (NumberFormatException ex) { + ex.printStackTrace(); + throw new IOException("No valid file versions set for APK expansion files", ex); + } try { - // To avoid direct dependency on Google APK extension library that is + // To avoid direct dependency on Google APK expansion library that is // not a part of Android SDK we access it using reflection expansionFile = Class.forName("com.android.vending.expansion.zipfile.APKExpansionSupport") .getMethod("getAPKExpansionZipFile", Context.class, int.class, int.class) @@ -611,6 +734,7 @@ public class SDLActivity extends Activity { ex.printStackTrace(); expansionFile = null; expansionFileMethod = null; + throw new IOException("Could not access APK expansion support library", ex); } } @@ -619,12 +743,14 @@ public class SDLActivity extends Activity { try { fileStream = (InputStream)expansionFileMethod.invoke(expansionFile, fileName); } catch (Exception ex) { + // calling "getInputStream" failed ex.printStackTrace(); - fileStream = null; + throw new IOException("Could not open stream from APK expansion file", ex); } if (fileStream == null) { - throw new IOException(); + // calling "getInputStream" was successful but null was returned + throw new IOException("Could not find path in APK expansion file"); } return fileStream; @@ -852,11 +978,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 @@ -866,20 +992,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()); } @@ -888,7 +1014,11 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mWidth = 1.0f; mHeight = 1.0f; } - + + public void handlePause() { + enableSensor(Sensor.TYPE_ACCELEROMETER, false); + } + public void handleResume() { setFocusable(true); setFocusableInTouchMode(true); @@ -897,7 +1027,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, setOnTouchListener(this); enableSensor(Sensor.TYPE_ACCELEROMETER, true); } - + public Surface getNativeSurface() { return getHolder().getSurface(); } @@ -972,8 +1102,44 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, mWidth = width; mHeight = height; - SDLActivity.onNativeResize(width, height, sdlFormat); - Log.v("SDL", "Window size:" + width + "x"+height); + SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate()); + 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; @@ -987,7 +1153,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 @@ -996,31 +1162,30 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, sdlThread.join(); } catch(Exception e){} - finally{ + finally{ // Native thread has finished if (! SDLActivity.mExitCalledFromJava) { SDLActivity.handleNativeExit(); } } } - }); + }, "SDLThreadListener"); SDLActivity.mSDLThread.start(); } + + if (SDLActivity.mHasFocus) { + SDLActivity.handleResume(); + } } - // unused - @Override - public void onDraw(Canvas canvas) {} - - // Key events @Override public boolean onKey(View v, int keyCode, KeyEvent event) { // 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) { @@ -1032,7 +1197,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); @@ -1045,7 +1210,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, return true; } } - + return false; } @@ -1057,68 +1222,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 @@ -1150,7 +1345,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 @@ -1192,7 +1387,7 @@ class DummyEdit extends View implements View.OnKeyListener { return false; } - + // @Override public boolean onKeyPreIme (int keyCode, KeyEvent event) { @@ -1214,6 +1409,7 @@ class DummyEdit extends View implements View.OnKeyListener { public InputConnection onCreateInputConnection(EditorInfo outAttrs) { ic = new SDLInputConnection(this, true); + outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI | 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */; @@ -1271,7 +1467,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 @@ -1285,7 +1481,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. @@ -1317,11 +1513,11 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler { return arg0.getAxis() - arg1.getAxis(); } } - + private ArrayList mJoysticks; - + public SDLJoystickHandler_API12() { - + mJoysticks = new ArrayList(); } @@ -1332,18 +1528,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 ) { @@ -1357,14 +1559,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++) { @@ -1377,7 +1579,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); @@ -1387,9 +1589,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) { @@ -1397,9 +1599,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(); @@ -1413,7 +1615,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 ) ); @@ -1426,14 +1628,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 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; + } + break; + + default: + break; + } + + // Event was not managed + return false; } } diff --git a/src/org/love2d/android/GameActivity.java b/src/org/love2d/android/GameActivity.java index cd9efd48..38f9f737 100644 --- a/src/org/love2d/android/GameActivity.java +++ b/src/org/love2d/android/GameActivity.java @@ -39,6 +39,16 @@ public class GameActivity extends SDLActivity { private static Vibrator vibrator; private static boolean immersiveActive = false; + @Override + protected String[] getLibraries() { + return new String[] { + "gnustl_shared", + "mpg123", + "openal", + "love", + }; + } + @Override protected void onCreate(Bundle savedInstanceState) { Log.d("GameActivity", "started");