Simple DirectMedia Layer https://libsdl.org
Find a file
Sam Lantinga 0c274ee25a Fixed bug 2155 - automatically remap accelerometer coordinates according to screen orientation on Android
Denis Bernard

Background information: http://android-developers.blogspot.fr/2010/09/one-screen-turn-deserves-another.html and http://developer.android.com/reference/android/hardware/SensorEvent.html

Right now, the Android accelerometer event handler feeds raw accelerometer data  to the SDL Joystick driver. The result is that for landscape-only applications, the axis need to be swapped if running on a portrait device (like a phone), and vice-versa: running a portrait only app on a landscape device like a tablet.

The purpose of this patch is to perform coordinate remapping of the accelerometer data before feeding it to the SDL joystick driver so that the X axis of the joystick is always aligned with the X axis of the display, same for the Y axis.

This has been tested on applications that support screen orientation changes as well as applications with fixed screen orientations, both on phones and tablets.
2013-10-17 23:44:30 -07:00
acinclude Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
android-project Fixed bug 2155 - automatically remap accelerometer coordinates according to screen orientation on Android 2013-10-17 23:44:30 -07:00
build-scripts Do a full sysroot for the Raspberry Pi buildbot. 2013-10-11 10:58:05 -04:00
cmake Separate EGL / GL ES detection in CMake 2013-08-22 14:56:07 -03:00
debian Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
include Added an API to get the amount of system RAM 2013-10-17 11:32:56 -07:00
src Fixed bug 2069 - Device addition/removal queries all USB devices rather than only HID devices. 2013-10-17 23:40:13 -07:00
test Fixed building using MinGW 2013-10-17 23:02:29 -07:00
VisualC Fixed project conflict during commit 2013-10-14 09:14:09 -07:00
Xcode Updated SDL to version 2.0.1 2013-10-10 21:50:25 -07:00
Xcode-iOS OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
.hgignore Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Android.mk Fixed bug 2146 - Enable static linking of libSDL on Android 2013-10-10 21:51:39 -07:00
autogen.sh Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
BUGS.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
CMakeLists.txt Updated SDL to version 2.0.1 2013-10-10 21:50:25 -07:00
configure Fixed bug 2149 - Don't search for libusbhid except on BSD 2013-10-13 19:49:45 -07:00
configure.in Fixed bug 2149 - Don't search for libusbhid except on BSD 2013-10-13 19:49:45 -07:00
COPYING.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
CREDITS.txt Added Julian Winter to the credits for the SDL 2.0 website. 2013-08-12 08:45:37 -07:00
INSTALL.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
Makefile.in Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.minimal Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.pandora Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.psp Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.wiz Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-android.txt Fixed bug 2146 - Enable static linking of libSDL on Android 2013-10-10 21:51:39 -07:00
README-cmake.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-directfb.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-gesture.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-hg.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-ios.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-macosx.txt Mac: Better handling when someone else is the app delegate. 2013-10-07 16:01:40 -07:00
README-pandora.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-platforms.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-porting.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-psp.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-raspberrypi.txt Prevent keystrokes from leaking through to the console when using evdev. 2013-10-13 17:15:43 -03:00
README-SDL.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-touch.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README-wince.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
README.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
sdl2-config.in Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
sdl2.m4 Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
sdl2.pc.in Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
SDL2.spec.in Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
TODO.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
VisualC.html Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00
WhatsNew.txt Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() 2013-08-11 19:56:43 -07:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
Support for other platforms may be found in the source code.

SDL is written in C, works natively with C++, and there are bindings 
available for several other languages, including C# and Python.

This library is distributed under the zlib license, which can be found
in the file "COPYING.txt".

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at:
	http://wiki.libsdl.org/

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)