Commit Graph

8560 Commits

Author SHA1 Message Date
Edward Rudd 7bc9815772 added simple Drag & drop test 2013-10-12 11:21:40 -04:00
Gabriel Jacobo f6fa41588c Updates the Raspberry Pi README 2013-10-12 11:35:47 -03:00
Ryan C. Gordon 9a0954c510 Do a full sysroot for the Raspberry Pi buildbot.
This gets us ALSA and X11, etc.
2013-10-11 10:58:05 -04:00
Sam Lantinga 4349cb5769 Fixed bug 2146 - Enable static linking of libSDL on Android
Denis Bernard

This patch to Android.mk adds support for static linking of libSDL for Android applications. A patched readme with static build instructions is also provided.

It does not break existing build environments setup according to the README-android.txt since the static library version will not be built in not required.

The static build uses the Android NDK module system (see docs/IMPORT-MODULE.html in the NDK folder and step 5 in the instructions below).

Instructions:
1. Copy the android-project directory wherever you want to keep your projects
   and rename it to the name of your project.
2. Create a symlink to SDL/src/main/android/SDL_android_main.c as
   <project>/jni/src/SDL_android_main.c
3. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk
   (overwrite the existing one)
4. Edit <project>/jni/src/Android.mk to include your source files
5. create and export an environment variable named NDK_MODULE_PATH that points
   to the parent directory of this SDL directory. e.g.:

   export NDK_MODULE_PATH="$PWD"/..

6. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to
   System.loadLibrary("SDL2") line 42.
7. Run 'ndk-build' (a script provided by the NDK). This compiles the C source

Although this requires an environment variable to be setup, it can be added once and for all to the main Android.mk of the project.
2013-10-10 21:51:39 -07:00
Sam Lantinga a7e1fdddea Updated SDL to version 2.0.1 2013-10-10 21:50:25 -07:00
Sam Lantinga 15682c0c5f Report joystick added/removed events even if we don't have udev.
T. Joseph Carter

As discussed (possibly to death), the Linux joystick driver does not actually report events for added or removed joysticks when you haven't got udev support.

We simply cannot know about removed joysticks without udev.  But we can (and we should) report adding them.  This brings the legacy case in line with pretty much the rest of SDL's joystick drivers.
2013-10-10 20:58:20 -07:00
J?rgen P. Tjern? 2568a367c8 Mac: Better handling when someone else is the app delegate. 2013-10-07 16:01:40 -07:00
Ryan C. Gordon 69e1e779c2 Raspberry Pi build script: let caller specify final tarball name. 2013-10-10 02:37:36 -04:00
Ryan C. Gordon f7e0a9b2b0 Patched to compile in C90 mode. 2013-10-10 02:21:41 -04:00
Ryan C. Gordon 6b2291d1cf Fixed tarball name in Raspberry Pi build script. 2013-10-10 02:06:14 -04:00
Ryan C. Gordon 4f305b85a9 Added script that the buildbot will use for cross-compiling to Raspberry Pi. 2013-10-10 01:46:39 -04:00
Gabriel Jacobo 89131435f8 Adds gl_profile_mask to test framework, uses it in testgles 2013-10-10 00:49:57 -03:00
Gabriel Jacobo d0fddfab84 Fixes Bug 2134 - [Android] Black screen after resume (sometimes) 2013-10-10 00:30:03 -03:00
Gabriel Jacobo eaa4300faf Fixes testgles and testgl 2013-10-09 11:30:01 -03:00
Gabriel Jacobo 24f237710f Adds test framework to Android.mk and a simple utility to build Android projects 2013-10-09 10:29:01 -03:00
J?rgen P. Tjern? c455f7291c Fix SDL_SetWindowPosition on fullscreen windows.
This reverts http://hg.libsdl.org/SDL/rev/7cdeb64faa72 and fixes it in
the correct way. If you call SDL_SetWindowPosition on a fullscreen
window, it would update the x & y variables for the window, but not
actually move the window (since it was fullscreen). That would make the
internal state of the SDL_Window incorrect, causing
SDL_WarpMouseInWindow to offset incorrectly.

This makes it so SDL_SetWindowPosition updates the `windowed' x & y
coordinates, which take effect when you revert from fullscreen.
2013-10-07 14:16:38 -07:00
Sam Lantinga cca094225a Only allocate a joystick instance ID once we know it's a joystick.
This fixes compatibility with code that assumes 0 based joystick instance IDs.
2013-10-06 20:39:23 -07:00
Sam Lantinga 11c45c4ede Removed unused variables (thanks Joseph!) 2013-10-06 13:50:36 -07:00
Sam Lantinga 8f46bcfd6d Check for NULL joystick in SDL_JoystickGetGUID() 2013-10-06 13:49:23 -07:00
Sam Lantinga 90a219a375 Fixed bug where a Logitech wireless keyboard with built-in mouse touchpad didn't get recongized as both devices. 2013-10-05 21:15:55 -07:00
Sam Lantinga 529664278f Fixed bug 2132 - Tests may use invalid SDL_window pointers when windows are closed
norfanin

Some of the tests keep using the pointers of a destroyed SDL_Window when the common event handling handled the close event. The event handler itself does not NULL the pointer after the destruction.

The attached patch adds a loop in the handler that will assign NULL to the destroyed window. It also adds checks to some of the tests so they skip those windows by checking for NULL.
2013-10-05 19:09:03 -07:00
Philipp Wiesemann 0db36f51aa Added detection of touch devices before first touch events happen on Android.
On Android available touch devices are now added with video initialization (like
the keyboard). This fixes SDL_GetNumTouchDevices() returning 0 before any touch
events happened although there is a touch screen available. The adding of touch
devices after a touch event was received is still active to allow connecting
devices later (if this is possible) and to provide a fallback if the new init
did not work somehow. For the implementation JNI was used and API level 9 is
required. There seems to be nothing in the Android NDK's input header (input.h)
to implement everything on C side without communication with Java side.
2013-10-05 17:08:19 +02:00
Sam Lantinga 36b759174f Do a 32-bit compare on RGBA values. Thsi should be inlined in optimized builds. 2013-10-05 12:29:05 -07:00
Ryan C. Gordon 5607cc45c5 Avoid redundant state changes in the GLES2 renderer. 2013-10-05 00:29:57 -04:00
Ryan C. Gordon 500e4f6f9a Removed "u_colorTable" uniform from the GLES2 renderer. It's not used anywhere. 2013-10-04 11:25:14 -04:00
Gabriel Jacobo 9c489c7c0d Fix EGL/OpenGL ES paths 2013-10-04 08:23:37 -03:00
Sam Lantinga 9cbd05df1e Report an error if creating a render target fails 2013-10-03 21:41:09 -07:00
Sam Lantinga 509898460c Added optional error checking for OpenGL ES 2.0 in the same style as the OpenGL renderer.
You can enable it like this: SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
2013-10-03 20:48:52 -07:00
Sam Lantinga e5ef978e13 Fixed a potential double-free bug if glGenTextures() failed. 2013-10-03 20:42:43 -07:00
Gabriel Jacobo b39a4daf04 SDL_TEXTINPUT support for EVDEV 2013-10-03 10:28:10 -03:00
Sam Lantinga 1f21484bdd Fixed const/non-const warning 2013-10-03 03:31:05 -07:00
David Ludwig 6004b764d8 WinRT: added missing files 2013-09-22 23:17:25 -04:00
David Ludwig 58dd086487 WinRT: unified the two, public, app-init functions
This function, SDL_WinRTRunApp, can be used to help launch either XAML or non-XAML/Direct3D-only based apps.
2013-09-22 12:26:53 -04:00
David Ludwig aeaa05054b WinRT: ugh, at least one file in an app's project seems to require C++/CX compilation.
Assuming this is true, that file might as well be the one that contains WinMain.
2013-09-16 22:43:12 -04:00
David Ludwig efb3cdca19 WinRT: renamed SDL_winrt_main.cpp to indicate that it should only be used in non-XAML apps
This can break builds of existing SDL/WinRT apps.  To fix, remove the reference to SDL_winrt_main.cpp, then add a reference to the renamed file, SDL_winrt_main_NonXAML.cpp.  If you get a build error about a missing .winmd file, enable the /ZW compiler flag for that one file (at minimum).
2013-09-16 22:27:30 -04:00
David Ludwig fff83d8e52 WinRT: reduced the size of SDL_winrt_main.cpp by a little bit 2013-09-16 21:09:58 -04:00
David Ludwig 0022dbf261 WinRT: made SDL_GetWindowWMInfo return window data in a slightly easier-to-use format
Having the window pointer available as a WinRT IInspectable should make it a bit easier to use in conjunction with WRL-based weak references.
2013-09-16 11:02:18 -04:00
David Ludwig fa45a9c953 WinRT: fixed a line-rendering bug in the D3D 11.1 backend 2013-09-16 00:31:01 -04:00
David Ludwig c72a4fa311 WinRT: made SDL_winrt_main.cpp not have to be compiled as C++/CX (via the /ZW compiler flag)
This file can still be compiled as C++/CX, however that is now optional/not-required.
2013-09-15 23:53:51 -04:00
David Ludwig 79e82936cd WinRT: build fix for the SDL-WinRT-only .sln 2013-09-14 23:44:50 -04:00
David Ludwig 8a16449e9b WinRT: project-naming cleanup. Projects that link to SDL will need updating. To update:
1. remove references to SDL's project files from the Visual Studio Solution.  To note, these project files have been renamed, and will show up in Visual Studio with the text, "load failed".
2. add the SDL project files back into the Visual Studio Solution
3. for each project that should link to SDL, add a reference to it.  This can be done by right-clicking on it in Visual Studio, selecting "References...", clicking "Add New Reference", checking the box next to the SDL project, then closing each dialog by clicking OK.

SDL_mixer, SDL_ttf, and SDL_image for WinRT have been updated, and will be pushed to my Bitbucket repos with these changes having been made.  If you do not pull in these changes, be sure to re-add to them the reference to the SDL project, as described above.
2013-09-14 23:34:27 -04:00
David Ludwig 34722465d1 WinRT: code cleanup: attempted to make it more clear what code is specific to what app type (plain Direct3D or XAML) 2013-09-06 21:13:15 -04:00
David Ludwig de8d9dbb93 WinRT: minor code cleanup regarding events
Some event handling functions got sorted in a somewhat consistent manner, and
in some cases, were also segregated a bit from app-lifecycle code.
2013-09-06 21:00:52 -04:00
David Ludwig 9de76eb526 WinRT: removed chunks of C++ hack code from SDL_xaudio2.c 2013-09-06 19:23:42 -04:00
David Ludwig fff780818d WinRT: made SDL_xaudio2.c compile as C code when building for WinRT
XAudio2 2.8's header file, xaudio2.h, doesn't compile in plain C code for WinRT
apps, not automatically at least.  Initially, this file was adapted to compile
as C++, however these changes are now deprecated in favor of some preprocessor
based hacks that should get xaudio2.h to compile (while making sure XAudio2
still works).
2013-09-06 19:07:15 -04:00
David Ludwig ac6e5a69ce WinRT: minor code cleanup in SDL_xaudio2.c 2013-09-04 20:20:36 -04:00
David Ludwig f3bd9175a9 WinRT: more renaming of "windowsrt" to "winrt" 2013-09-04 19:55:45 -04:00
David Ludwig 8fc04cc76e WinRT: renamed a mouse-related header file for naming-consistency's sake 2013-09-02 15:29:46 -04:00
David Ludwig 7e06b806ac WinRT: misc code cleanups regarding touch and mouse events, and also SDL-internal globals 2013-09-02 15:23:33 -04:00
David Ludwig a94e41854a WinRT: added touch input event support for Windows 8/RT devices 2013-09-01 10:20:17 -04:00