Commit graph

6862 commits

Author SHA1 Message Date
Gabriel Jacobo
dd726d96bf [Android] Fixes Bug 2041 - can't get SDL_QUIT event...
Thanks to Denis Bernard!

Also, changed the Android manifest so the app doesn't quit with orientation
changes, and made testgles.c exit properly on Android.
2013-11-06 11:23:24 -03:00
Gabriel Jacobo
344ed6c986 Fixes Bug 1944 - Linux events, joysticks having only hat are not read 2013-11-06 09:48:45 -03:00
Sam Lantinga
ebc3f67ea6 Fixed performance regression caused by the fix for bug 2158 2013-11-05 21:01:25 -08:00
Gabriel Jacobo
7075ece4a5 Adds Joystick support for Android
This bumps the build SDK level to 12 (up from 10). Runtime requirements remain
the same (at API level < 12 joystick support is disabled).

Also enables building SDL for armv7 and x86.
2013-11-05 20:07:39 -03:00
David Ludwig
a5069b7ae1 WinRT: added experimental OpenGL ES 2.0 support
A port of the ANGLE library (OpenGL ES 2.0 for Direct3D) to WinRT, via https://github.com/stammen/angleproject, is used as a base.

To enable, clone 'angleproject' into the directory one above where SDL/WinRT is, open the file SDL/include/SDL_config_winrt.h, and uncomment the #defines that begin with 'SDL_VIDEO_OPENGL'.  From there, apps can create an OpenGL capable SDL_Window via the flag, SDL_WINDOW_OPENGL, and an OpenGL ES 2 context via SDL_GL_CreateContext.  The Direct3D 11.1 renderer cannot be used alongside SDL_WINDOW_OPENGL.  Only Windows 8/8.1 is supported for now.  Shaders may need to be precompiled, in some (all?) cases.
2013-11-04 19:54:29 -05:00
Sam Lantinga
db8217dea5 Fixed bug 2180 - debian/rules: Makefiles should use tabs
Joseph Carter

Whitespace in a makefile is consequential.  In fact, it's part of the syntax.  And at least a few versions of make puke on Makefiles with lines indented with spaces, not tabs.  Obviously GNU make used on Debianish systems is not strictly among them, or this would fail.  Even so, I cannot resist the urge to pedantically fix this, if only to get rid of the bright syntax error red coloration in vim.  :)
2013-11-03 11:34:03 -08:00
Sam Lantinga
3d37a0f6c9 Fixed bug 2190 - test/testdrawchessboard.c line endings
Joseph Carter
test/testdrawchessboard.c checks out of hg with DOS line endings on non-dos systems.  Fixed via:

perl -pi -e 's/\r//g' test/testdrawchessboard.c
2013-11-03 11:27:06 -08:00
Sam Lantinga
2a3c7f2d72 Fixed bug 2205 - SDL_GetAudioDeviceName returns default-device name on invalid index for default-device only drivers
norfanin

The audio_enumerateAndNameAudioDevicesNegativeTests test in testautomation_audio.c reports a failure for SDL_GetAudioDeviceName when called on a driver that has only the default device. SDL_GetNumAudioDevices reports 1, but SDL_GetAudioDeviceName does not check if the index passed by the caller is in that range in this case. For positive numbers anyway.

This can be reproduced with the dummy driver on Windows and Linux.
2013-11-03 11:13:06 -08:00
Sam Lantinga
6592749e51 Fixed bug 2187 - CMake is not adding src/core/linux/*.c to the build, linking to SDL results in errors.
Daniel Ribeiro Maciel

CMake is not adding src/core/linux/*.c to the build, linking to SDL results in errors:

(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_AddCallback'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Poll'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Init'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Quit'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_DelCallback'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Scan'
collect2: error: ld returned 1 exit status
2013-11-03 11:00:28 -08:00
Sam Lantinga
572de23fec Fixed bug 1990 - focus/keyboard events not generated correctly for multiple windows
Mai Lavelle

I've recently tried to create multiple windows and process key events for them, and found that key events weren't being generated for most of the windows. After some investigating I've observed the following effects. All but the most recently created window experience these effects...

- a focus lost event is generated immediately after the focus gained event, even tho window still has focus
- key events report window id 0 rather than the id of the window which has focus, SDL thinks no window has focus?
- giving focus to a non SDL window and then selecting an SDL window causes events to be generated as expected, but only until focus changes again

Focus change events are queued and delayed (200 ticks) before they are dispatched.  The problem occurs when a focus out and focus in event are received on the same tick.  When these delayed events are dispatched they will be sent in the order determined by the window list rather than the order in which they are received.

The focus out dispatch is implemented by calling SDL_SetKeyboardFocus(NULL).  This will remove focus from any window, regardless of whether it is the one originally targeted by the X11 event.

Since SDL_SetKeyboardFocus() will always dispatch a focus lost event as needed, the easiest solution is simply to only call SDL_SetKeyboardFocus(NULL) when SDL_GetKeyboardFocus() matches the target window.
2013-11-03 09:55:27 -08:00
Sam Lantinga
0606843ed8 Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning 2013-11-03 09:42:23 -08:00
Philipp Wiesemann
0bc9aaf406 Changed parameter name for gesture template save functions from "src" to "dst". 2013-11-02 12:07:21 +01:00
Philipp Wiesemann
97dba3380d Removed unreachable return statement in gesture source. 2013-11-02 11:51:23 +01:00
Philipp Wiesemann
2c84e8979a Changed function to return -1 through SDL_Error() instead of plain -1. 2013-11-02 11:46:43 +01:00
Philipp Wiesemann
2d91a6d3e4 Corrected typo in source comment. 2013-11-02 11:42:00 +01:00
David Ludwig
23f6ff5673 WinRT: added support for SDL_HINT_RENDER_SCALE_QUALITY 2013-11-01 22:54:39 -04:00
Gabriel Jacobo
b759f643c6 Fixes Bug #2191,incorrect test for egl_context validity
Thanks David Binderman!
2013-10-31 10:02:21 -03:00
Ryan C. Gordon
d640f886b5 Fixed common test usage string (was "hidpi", should be "highdpi"). 2013-10-30 16:39:35 -04:00
Ryan C. Gordon
39f9406205 Updated GL version tests for Mac OS X 10.9 ("Mavericks").
They changed the name of their GL 3.2 enum, added the GL 4.1 core profile.
2013-10-28 22:43:39 -04:00
David Ludwig
f6e52c362a WinRT: added a comment regarding the lack of SHGetFolderPath on WinRT 2013-10-28 15:52:04 -04:00
David Ludwig
e918745db0 WinRT: implemented SDL_GetBasePath and SDL_GetPrefPath
--HG--
rename : src/core/winrt/SDL_winrtpaths.cpp => src/filesystem/winrt/SDL_sysfilesystem.cpp
2013-10-28 15:41:22 -04:00
David Ludwig
f810dc2524 WinRT: spelling fix in SDL_hints.h 2013-10-27 23:19:35 -04:00
David Ludwig
3f62c9892a WinRT: build fixes, post SDL 2.0.1 update 2013-10-27 23:03:11 -04:00
David Ludwig
59df93166d WinRT: merged with SDL 2.0.1 codebase 2013-10-27 21:26:46 -04:00
David Ludwig
b35781fdb3 WinRT: fixed two bugs regarding mouse events
The first bug had mouse motion events not getting sent out on non-touch devices, if and when a mouse button wasn't pressed.

The second bug caused virtual mouse motion events to get sent out-of-order on touch devices: the motion event would get sent after the touch occurred, rather than before.
2013-10-27 14:31:57 -04:00
David Ludwig
69cd08bc13 WinRT: made the Direct3D 11.x 'Debug Layer' be enable-able in any app via a hint
To enable the Debug Layer, set the hint, SDL_HINT_RENDER_DIRECT3D11_DEBUG to '1'.

The Debug Layer will be turned off by default, both in Release and Debug builds (of SDL).
2013-10-25 20:31:43 -04:00
Sam Lantinga
f15aed6e5f Added tag release-2.0.1 for changeset b9663c77f5c9 2013-10-23 20:58:39 -07:00
Sam Lantinga
db7c496f11 Removed tag release-2.0.1 2013-10-23 20:58:31 -07:00
Ryan C. Gordon
84929c222e Fixed buffer overflow. 2013-10-24 00:00:10 -04:00
Sam Lantinga
0d378c791a Added tag release-2.0.1 for changeset 9ec71e56071c 2013-10-23 17:46:07 -07:00
Ryan C. Gordon
c7744104c6 Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks, Justin!).
Fixes Bugzilla #2177.
2013-10-23 19:52:14 -04:00
Sam Lantinga
678e0517aa Added tag release-2.0.1 for changeset 715a01415ac9 2013-10-23 16:33:15 -07:00
Sam Lantinga
05187f9ba8 Updated Debian package version to 2.0.1 2013-10-23 16:32:56 -07:00
Sam Lantinga
c9c6126f95 Added tag release-2.0.1 for changeset a8bd63b33636 2013-10-23 16:17:08 -07:00
Pierre-Loup A. Griffais
869a803878 Fix regression causing crashes when running without a window manager. 2013-10-23 13:43:17 -07:00
Ryan C. Gordon
d89bf9b9ff Moved a SDL_SetError() call elsewhere to avoid triggering it needlessly.
Otherwise, the XInput path would always trigger it in a harmless manner.
2013-10-23 15:54:12 -04:00
Ryan C. Gordon
10fee37476 SDL_GetPrefPath() now uses the organization on all platforms.
Even if that's not the general convention for a given platform.

--HG--
extra : rebase_source : f3a8035be94bd416fca5bda09d1d93101bc4b688
2013-10-23 00:58:20 -04:00
Sam Lantinga
0fc9b5bcf7 Fixed duplicate const warning
--HG--
extra : rebase_source : 4529dd9d2bd4eb18a194d81f300cf47553ef2044
2013-10-22 21:54:52 -07:00
Sam Lantinga
274b054ac3 SDL 2.0.0 defined __inline__ and some code relies on it now.
--HG--
extra : rebase_source : b16922234216c3e66aac75ff77bcb8b041eeb729
2013-10-22 21:53:58 -07:00
Sam Lantinga
dec06dbca4 Testing fullscreen window in the accelerometer test.
--HG--
extra : rebase_source : 891b1c0b53e6a9d509c9ba86f4fc5943fafe0ec1
2013-10-22 21:53:42 -07:00
Andreas Schiffler
55dd456631 Fix error assert for negative cases of pixels_getPixelFormatName test 2013-10-21 23:17:37 -07:00
Sam Lantinga
dc404e11c9 Added patch notes for 2.0.1 2013-10-21 22:27:07 -07:00
Sam Lantinga
a161479693 Fixed whitespace
--HG--
extra : rebase_source : 0d52de2be0171755128dd1e06b4722b4bad418a1
2013-10-21 22:08:56 -07:00
Sam Lantinga
69b2958035 Revert fix for bug 1392 because it breaks linking with mingw32 2013-10-21 10:28:57 -07:00
Sam Lantinga
eb284ee46d Fixed bug 2168 - Mac: SDL_filesystem.h not exported to public header folder when building framework
Alex Szpakowski

I actually made a mistake when creating the previous patch file... I forgot to include a crucial line which changed.

I've attached a new patch which just changes the line I forgot, since the other part has already been applied to the repository.
I tested this one by doing a clean rebuild of SDL, and it works with the new patch.
2013-10-21 02:46:16 -07:00
Sam Lantinga
0c257d4b66 We don't have API changes documented yet. 2013-10-21 02:38:23 -07:00
Sam Lantinga
5544901ec1 Fixed bug 2073 - Mac: window moves unexpectedly when exiting SDL_WINDOW_FULLSCREEN_DESKTOP mode
Alex Szpakowski

In Mac OS X, when SDL_SetWindowFullscreen(window, 0) is called on a window which was in SDL_WINDOW_FULLSCREEN_DESKTOP mode, its original size is restored but its position is moved to the bottom of the screen.

I tracked down the issue to these two lines: http://hg.libsdl.org/SDL/file/66b5b8446275/src/video/cocoa/SDL_cocoawindow.m#l1034

I believe [nswindow setFrameOrigin:rect.origin] implicitly calls [nswindow constrainFrameRect:rect toScreen:screen], which will attempt to constrain the window to the screen, but at that point the window size is still full-screen rather than the restored window size, so the constrainFrameRect function operates on the wrong window size.

https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/constrainFrameRect:toScreen:

I resolved the issue by swapping the order of the function calls, like so:
[nswindow setContentSize:rect.size];
[nswindow setFrameOrigin:rect.origin];
2013-10-21 02:37:03 -07:00
Sam Lantinga
a68bc09ed9 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Jānis Rūcis

Reopening as compilation with ANSI C throws lots of unnecessary warnings, both using MinGW and using Linux GCC. (BTW, what happened? MinGW is broken to all hell. sdl2-config does not even link SDLMain anymore?)

I think this may have been lost somewhere, so again: GCC supports inlining via __inline__ in all known versions of GCC, regardless of the C standard in use. Please don't assume that __STRICT_ANSI__ implies no inlining support.
2013-10-21 02:32:34 -07:00
Sam Lantinga
900cb419ce Fixed bug 2168 - Mac: SDL_filesystem.h not exported to public header folder when building framework 2013-10-21 02:20:39 -07:00
Sam Lantinga
20e65317fa Fixed some warnings building for 64-bit Windows 2013-10-21 01:16:16 -07:00