Commit graph

4935 commits

Author SHA1 Message Date
Sam Lantinga
e012b4eb5d Fixed renderer flags to include support for target textures after the renderer is created. 2014-03-09 22:48:38 -07:00
Ryan C. Gordon
5b8f5159f3 Removed unused variable. 2014-03-10 00:48:41 -04:00
Ryan C. Gordon
aff242c8b6 Drop the default requested OpenGL version to 1.2.
Fixes default context creation on Mac OS X <= 10.6.

--HG--
extra : rebase_source : e8cb3a139e6af51f94929203d1046665e0d2c438
extra : histedit_source : fa77978715a878180315ea637d08d788cee94e93%2C12a503d312aeafe7669f059b1644cb04ce994b82
2014-03-10 00:01:14 -04:00
Sam Lantinga
d93a676e23 Fixed 64-bit warnings 2014-03-09 12:27:31 -07:00
Sam Lantinga
a7d2ebb8d6 Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
211b54deef Fixed line endings on WinRT source code 2014-03-09 11:06:11 -07:00
Sam Lantinga
b821f84418 Updated SDL to version 2.0.3 2014-03-09 10:38:30 -07:00
Ryan C. Gordon
e0f70ee928 Patched to compile with MingW64 on case-sensitive systems (thanks, Martin!).
Fixes Bugzilla #2440.
2014-03-09 11:52:52 -04:00
Ryan C. Gordon
08b3e512b9 Patched to compile on C89 compilers. 2014-03-08 15:34:54 -05:00
Sam Lantinga
32bf53df4e Fixed bug 2430 - Missing initialization of the variable 'centroid' inside SDL_GestureAddTouch
klose

File: SDL_gesture.c
Method: SDL_GestureAddTouch

When a new SDL_GestureTouch element is added to the global SDL_gestureTouch array the variable 'centroid' of the new element is not initialized.

The problem is that this variable is read isndie SDL_GestureProcessEvent when a SDL_FINGERDOWN event occurs.
2014-03-06 20:02:17 -08:00
David Ludwig
780830080b WinRT: emit SDL_APP_TERMINATING 2014-03-04 19:49:11 -05:00
David Ludwig
e5e0e486fe WinRT: emit SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events 2014-03-04 19:30:36 -05:00
Ryan C. Gordon
faf8781497 Mac: Added a hint to opt-out of new Spaces code. 2014-03-03 21:25:16 -05:00
Ryan C. Gordon
28ab3cb756 Removed unused variable. 2014-03-02 22:55:12 -05:00
Ryan C. Gordon
fab30f987c Mac: Don't lose the menu/dock when switching back to a resizable window Space. 2014-03-02 22:51:31 -05:00
Ryan C. Gordon
7e0a86800d Mac: only programmatically create Spaces if we're FULLSCREEN_DESKTOP.
(coming back from fullscreen in any state is okay).
2014-03-02 22:16:49 -05:00
Ryan C. Gordon
3f41dc1c92 A bunch of fixes for the new Spaces code.
--HG--
extra : rebase_source : 411c90597aaf0f5d30cb5efde652696bbb45497c
2014-03-02 16:36:40 -05:00
Sam Lantinga
1a4a891233 Fixed dictionary initialization 2014-03-02 13:06:51 -08:00
Sam Lantinga
d8a4f1ea9d Updated to build on Mac OS X 10.7 with Xcode 4.6 2014-03-02 12:58:00 -08:00
Ryan C. Gordon
abd5c75f1a Mac: Manage menubar and dock as FULLSCREEN_DESKTOP windows become/resign key. 2014-03-02 15:35:24 -05:00
Bastien Nocera
baf56fe069 Add support for the freedesktop.org Idle Inhibition specification,
as per:
http://people.freedesktop.org/~hadess/idle-inhibition-spec/

This makes screensaver inhibition work with GNOME 3 and other
desktop environments that implement the specification.

https://bugzilla.libsdl.org/show_bug.cgi?id=2169

--HG--
extra : rebase_source : b1967a91febdaa3f0fcb311ee1909a741722e9b2
2014-03-02 14:59:06 -05:00
Sam Lantinga
bb993d3a3b Backed out changeset a6493ee0c9b5 2014-03-02 11:10:00 -08:00
Sam Lantinga
5624855166 Make sure we return version 0 if XInput detection fails 2014-03-02 11:08:05 -08:00
Ryan C. Gordon
afa70ff8df Reworked fullscreen policy on Mac OS X.
- SDL_WINDOW_FULLSCREEN works as always (change resolution, lock to window).
- SDL_WINDOW_FULLSCREEN_DESKTOP now puts the window in its own Space, and
  hides the menu bar, but you can slide between Spaces and Command-Tab between
  apps without the window minimizing, etc.
- SDL_WINDOW_RESIZABLE windows will get the new 10.7+ "toggle fullscreen"
  window decoration and menubar item. As far as the app is concerned, this is
  no different than resizing a window, but it gives the end-user more power.
- The hint for putting fullscreen windows into the Spaces system is gone,
  since Spaces can't enforce the requested resolution. It's a perfect match
  for FULLSCREEN_DESKTOP, though, so this is all automated now.
2014-03-02 12:45:51 -05:00
Ryan C. Gordon
88bdcd6a28 Better attempt to detect available X11 XInput2 features.
Fixes Bugzilla #2306.
2014-03-02 02:00:40 -05:00
Ryan C. Gordon
5f11f71362 Windows: Fixed crash if quitting without closing an XInput haptic device.
--HG--
extra : histedit_source : ddde0349ad87c7b525efb7e0b01ee45fef9170af
2014-03-02 00:02:56 -05:00
Ryan C. Gordon
ae216dde6c Added a FIXME. 2014-03-01 22:27:21 -05:00
Ryan C. Gordon
8135173e3f Fixed a typo in a comment. 2014-03-01 22:27:13 -05:00
Ryan C. Gordon
f0cc3c2e56 Dynamically load glGetString(), to avoid direct dependency on OpenGL. 2014-03-01 21:33:48 -05:00
Ryan C. Gordon
81801cb940 Added some FIXMEs. 2014-03-01 20:59:43 -05:00
Ryan C. Gordon
d954bb23ac Mac OS X: Make OpenGL context selection more robust, avoid software fallback.
Fixes Bugzilla #2197.
2014-03-01 20:46:45 -05:00
Ryan C. Gordon
267f8fb155 Force Windows version of SDL_GetPrefPath() to Unicode, create missing dirs.
Fixes Bugzilla #2273.
2014-03-01 20:28:40 -05:00
David Ludwig
65f91d101f WinRT: cleaned up some hard-to-read SDL_DisplayMode management code 2014-03-01 16:37:30 -05:00
David Ludwig
582a189bc4 WinRT: fixed a crash in SDL_Quit
SDL was expected that each SDL_DisplayMode had a driverdata field that was SDL_malloc'ed, and was calling SDL_free on them.  This change moves WinRT's driverdata content into a SDL_malloc'ed field.
2014-03-01 16:08:16 -05:00
Sam Lantinga
b2c4391ab7 Changed SDL_HINT_ACCEL_AS_JOY to SDL_HINT_ACCELEROMETER_AS_JOYSTICK to be more clear. 2014-03-01 12:21:15 -08:00
Sam Lantinga
5378997447 Fixed compiler warning 2014-03-01 11:42:12 -08:00
Sam Lantinga
4835900bcd Fixed compiler warning 2014-03-01 11:40:41 -08:00
Sam Lantinga
651b638ea3 Fixed bug 2368 - Security Software is blocking RegisterRawInputDevices()
Yamagi

A customer of mine had the strange problem, that SDL_SetRelativeMouseMode() was failing for him on Windows 7. Luckily he was willing to provide some debug informations. We could track this problem down to RegisterRawInputDevices() failing due to security software running on his system (Norton Internet Security to be precise, but there are reports of similar problems with other products. For example [1]). Working around this issue with SDL_WarpMouseInWindow() is easy, and while I don't think that SDL2 can provide an internal workaround it would be really nice and helpfull if this could be documentated somewhere.

1: http://forums.codeguru.com/showthread.php?498374-How-to-run-a-very-long-SQL-statement
2014-03-01 09:59:06 -08:00
Sam Lantinga
b7435a3ad3 Fixed bug 2423 - timeBeginPeriod & timeEndPeriod mismatch
Coriiander

In src\timer\windows\SDL_systimer.c there is an error with regards to timeBeginPeriod and timeEndPeriod. These functions typically get called when no high resolution timer is available, and GetTickCount is not used.

According to MSDN (link: dd757624(v=vs.85).aspx), for every call to timeBeginPeriod a subsequent call to timeEndPeriod is required. While SDL is currently doing this, it fails to call timeEndPeriod when cleaning up/shutting down SDL. Please note that these functions affect things on a system level. Failing to call timeEndPeriod, disables applications for using WINMM-timers after usage&shutdown of SDL, as effectively they the mechanism is now broken.

Solution:
Ensure this code gets called when shutting down the timer subsystem:

#ifndef USE_GETTICKCOUNT
if (!hires_timer_available)
{
    timeSetPeriod(0);
}
#endif
2014-03-01 09:50:52 -08:00
Sam Lantinga
cff6eb5155 Null termnate the pUserMappings variable to prevent memory corruption. 2014-02-28 16:24:41 -08:00
Sam Lantinga
3dfda84048 Added a hint to enable the screensaver by default 2014-02-28 14:23:41 -08:00
Ryan C. Gordon
c5162134d2 Disable the screensaver by default.
Fixes Bugzilla #2218.

--HG--
extra : rebase_source : 839adf21025b06637f25ff2d2756c05a00d0d87a
extra : histedit_source : da99e2c6f35926cfc13b83e5557ffec57e2b1b78
2014-02-27 22:06:41 -05:00
Gabriel Jacobo
2e034c2a74 Improve window recreation logic in OpenGL* renderers 2014-02-27 20:21:46 -03:00
Jørgen P. Tjernø
28741acca1 Mac: Forgot return value in last commit. 2014-02-26 16:27:03 -08:00
Jørgen P. Tjernø
bd9b49b64c Mac: Don't disassociate cursor if window is moving / doesn't have focus.
Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396
2014-02-26 16:10:52 -08:00
Jørgen P. Tjernø
b8fae2ab0b Mac: Redo cursor warp handling.
This fixes bugs related to getting unnaturally large xrel/yrel for
SDL_MOUSEMOTION after warps and enabling / disabling relative mode.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=1836
2014-02-26 11:35:02 -08:00
Jørgen P. Tjernø
dae431ed0e Mac: Improve moving relative mode windows.
This makes it possible to move windows by their title bar, even if they're in
relative mode, if you click the title bar when the window does not have focus.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396

--HG--
extra : amend_source : 01cfe87acac88dd75b2f074d3833129605c46ed2
2014-02-25 17:27:41 -08:00
Jørgen P. Tjernø
ca29983393 Mac: Fix error message for haptic subsystem.
We were calling SDL_Error instead of SDL_SetError when the haptic subsystem
wasn't initialized.
2014-02-25 17:25:49 -08:00
Jørgen P. Tjernø
7316ed4a8f Mac: Immediately update current OpenGL context's shape.
Previously we were postponing our -[NSOpenGLContext update] call to the next
SDL_GL_SwapWindow, even if the context was current on the current thread. This
changes it so that we will do the update immediately if it's the current
context.

If you're rendering on another thread, you need to call SDL_GL_SwapWindow once
after a resize event to ensure your drawable will produce non-garbage data.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2339

--HG--
extra : rebase_source : 3316bbdbaf00cbbec9bcdcc5ef3dd11b814b1dc9
extra : amend_source : 15988f6bf499cd6d4ffa914988805ab298ee7661
2014-02-25 15:28:12 -08:00
Gabriel Jacobo
83efc7045c Fixes #2308, recreate window if GL requirements for the renderer are not met
If the window has been created with values for SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION not matching those
required by the renderer, attempt to recreate the window.
This is needed on platforms where both GL and GLES 1/2 surfaces are supported
by the video backend, requiring that the window be recreated when switching
between context types.
2014-02-25 17:42:34 -03:00