Commit Graph

1196 Commits (dfc7535ff7e4e975c41619e64ee3f75a80fe308d)

Author SHA1 Message Date
Brandon Schaefer 1f71676906 Fix warnings, only major one being an SDL_SetError not providing enough arguments. 2014-06-05 15:29:23 -07:00
Sam Lantinga 6671aa2a08 Code analysis annotations found a legitimate bug! 2014-06-05 09:49:45 -07:00
Sam Lantinga d0146cfcc0 Added missing headers that should be installed. 2014-06-05 09:27:06 -07:00
Ryan C. Gordon 4f7329a127 Don't link directly against OpenGL.framework on Mac OS X.
We dlopen() it as appropriate already.
2014-06-05 11:04:07 -04:00
Ryan C. Gordon c294130f6e Added SDL_opengl_glext.h to the list of headers to install. 2014-06-05 10:28:08 -04:00
Ryan C. Gordon 3dedcf29ff Corrected package list for Wayland/Mir support (was missing libxkbcommon-dev). 2014-06-05 01:55:52 -04:00
Ryan C. Gordon c8cf407ea3 Wired up Windows resize hit testing. 2014-06-05 00:54:43 -04:00
Ryan C. Gordon 31de8f8b99 Minor tweaks to testhittesting. 2014-06-05 00:49:25 -04:00
Ionut Leonte 2d38a71a1f Added SDL_HITTEST_RESIZE_*, and implemented for X11. 2014-06-05 00:45:16 -04:00
Ryan C. Gordon b861efde14 Implemented SDL_GetAbsoluteMouseState().
X11 only for now, but this should be doable on every platform, I think.
2014-06-05 00:03:33 -04:00
Ryan C. Gordon 264eb4bbed Added some (harmlessly) missing braces. 2014-06-05 00:02:42 -04:00
Sam Lantinga 1188c174d7 Fixed Mac OS X build 2014-06-04 16:35:07 -07:00
Brandon Schaefer d829af786e Assume all motion events are mouse events unless tool_type states otherwise. 2014-06-04 12:55:18 -07:00
Sam Lantinga 4fd03b9582 Setting the window size changes the fullscreen display mode, unless a window display mode has been set.
Testing:
* Ran testsprite2 --fullscreen, used Ctrl+ and Ctrl- to change window sizes, verified that the display mode changed as well.
2014-06-04 10:57:52 -07:00
Sam Lantinga c15e26d77d Fixed crash and lost pixel data when recovering from a lost device situation (e.g. alt-tab from fullscreen) 2014-06-04 10:57:40 -07:00
Sam Lantinga 947a0b8bae Ryan C. Gordon <icculus@icculus.org> 2014-05-24 01:23 -0400
Generated dynapi stuff for the new WinRT entry points.
http://hg.libsdl.org/SDL/rev/d54306e2b8a7
2014-06-04 10:57:12 -07:00
Sam Lantinga da6d9a9f2a Added annotations to help code analysis tools
CR: Bruce Dawson
2014-06-04 10:56:56 -07:00
Sam Lantinga 529bcf6293 Fixed bug 2526, but regressed delivering dead key presses 2014-06-04 10:56:43 -07:00
Sam Lantinga 4750fe7390 When the window fullscreen mode changes, update the display resolution 2014-06-04 10:56:37 -07:00
Sam Lantinga 707fd9f071 Fixed bug where changing the window border would change the window size on Windows. 2014-06-04 10:56:30 -07:00
Sam Lantinga 1e00c03f14 Fixed Mac OS X build 2014-06-04 10:56:17 -07:00
Sam Lantinga 45ed5ee494 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal() 2014-06-04 10:55:26 -07:00
Sam Lantinga 3e3b34adc9 Added a hint to disable windows message processing in SDL_PumpEvents()
SDL_SetHint( SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP, "0" );
2014-06-04 10:52:34 -07:00
Sam Lantinga 0d1f0fed71 Added a hint to disable window frame and title bar interaction when the cursor is hidden 2014-06-04 10:50:32 -07:00
J?rgen P. Tjern? d34184461f SDL_opengl: Fix Mac build for SDK 10.9 too. 2014-06-04 10:33:23 -07:00
J?rgen P. Tjern? d623c0b443 SDL_opengl: Fix Mac build with new glext.h 2014-06-04 09:59:10 -07:00
Sam Lantinga 65133ebc1b Wait for the fullscreen transition to complete before allowing the application to continue.
This fixes Alt-Enter in the Steam streaming client, which sets the window size and position immediately after switching out of fullscreen mode.
2014-06-04 09:39:08 -07:00
Sam Lantinga 16360b1979 Fixed escape cancelling fullscreen mode now that the SDL window is the first res
ponder.
2014-06-04 01:56:14 -07:00
J?rgen P. Tjern? a2085da216 SDL_opengles2: Update to latest Khronos headers.
This updates to the latest Khronos headers, which gives the latest
headers for MSVC.

The following files were retrieved on 2014-06-04:

http://www.khronos.org/registry/gles/api/GLES2/gl2.h
http://www.khronos.org/registry/gles/api/GLES2/gl2ext.h
http://www.khronos.org/registry/gles/api/GLES2/gl2platform.h
http://www.khronos.org/registry/egl/api/KHR/khrplatform.h

And they were modified to not include each other themselves.
2014-06-04 01:35:36 -07:00
J?rgen P. Tjern? 0887f5184c SDL_opengl: Update to glext.h from Khronos dated 2014-05-21.
This updates to the latest glext.h from Khorons that includes the OpenGL
4.4 specification. It was retrieved from
http://www.opengl.org/registry/api/GL/glext.h at 2014-06-04.
2014-06-04 01:32:52 -07:00
J?rgen P. Tjern? f45a2fd05d SDL_opengles2: Separate out GLES2 headers. 2014-06-04 01:27:13 -07:00
J?rgen P. Tjern? 8793657db7 SDL_opengl: Move glext.h to a separate file. 2014-06-04 01:21:00 -07:00
J?rgen P. Tjern? c1e11f699e X11: Provide specific X error when SDL_GL_CreateContext fails.
This makes the X error handler used for GL context creation handle *all* errors
and provide the user with specific error messages when SDL_GL_CreateContext
fails.

CR: icculus@icculus.org
2014-06-03 21:13:00 -07:00
Sam Lantinga ece2a9bf06 Hopefully really fixed the Android build 2014-06-02 09:20:09 -07:00
Sam Lantinga 5186be4a12 Fixed Android build 2014-06-02 09:12:51 -07:00
Sam Lantinga a8fcbc466a Fixed bug 2534 - Mac: black bar at top of screen in SDL_WINDOW_FULLSCREEN mode
Alex Szpakowski

Patch to fix the y component of the position of fullscreen windows in OS X.

In Mac OS X with the latest Mercurial code, when a window is in exclusive-fullscreen the y component of its position is offset by the same amount that is normally taken up by the menubar, resulting in a black bar at the top of the screen.

The recent changes to the internal ConvertNSRect function make it treat the bottom of the menubar as 0 for the y component of window positions, even when the window is fullscreen and 'above' the menubar.

I have attached a patch which fixes the issue by only making the window position relative to the menubar in windowed modes.
2014-06-02 09:09:40 -07:00
Sam Lantinga 6b90d7f58a Fixed bug 2550 - [OS X 10.9] Enabling SDL_WINDOW_FULLSCREEN after relative mouse mode leaves cursor visible
Eric Wasylishen

Steps to reproduce:

- Run testwm2 app in the SDLTest Xcode project
- Press Control+R to enable relative mouse mode. The mouse cursor should disappear.
- Press Control+Enter to enter fullscreen.
- Expected: a black screen with no cursor visible. Observed: a black screen, but the mouse cursor is visible in the middle of the screen. It doesn't move when I move the mouse.

Reproduced with latest sdl2 hg (changeset f6010ead184f) on OS X 10.9.2. Can't reproduce the problem on OS X 10.6.8 or 10.7.5.

I'm speculating that this really an Apple bug.. but anyway, the attached workaround seems to fix it for me, and I think it's fairly safe.

A more obvious idea, sticking a call SDL_SetCursor(NULL) at the end of Cocoa_SetWindowFullscreen, didn't work.
2014-06-02 09:06:38 -07:00
Sam Lantinga 32665131f6 Added a way to get the native Android window and EGL context 2014-06-02 09:01:26 -07:00
Sam Lantinga 3905b910f3 Fixed bug 2479 - [OS X] SDL_SetWindowFullscreen fails to switch to windowed
Eric Wasylishen

The problem seems to be the spaces handling code in -setFullscreenSpace: (SDL_cocoawindow.m) is incorrectly reporting that the SDL_WINDOW_FULLSCREEN -> windowed transition has already happened.

i.e. I saw this case was getting hit when trying to leave SDL_WINDOW_FULLSCREEN:

"else if (state == isFullscreenSpace) {
    return YES;  /* already there. */
}"

With the attached patch, both Control+Enter (SDL_WINDOW_FULLSCREEN toggle) and Option+Enter (SDL_WINDOW_FULLSCREEN_DESKTOP toggle) work in an sdl test app (I tried testwm2). Tested on OS X 10.9.2.
2014-06-02 09:01:10 -07:00
Sam Lantinga 75c57f8db7 Don't use D3D9Ex by default, since it can change behavior for games which rely on D3D9 classic. 2014-06-02 08:58:07 -07:00
Sam Lantinga 9d00f75a27 Fixed bug 2520 - Held double-click app startup creates a stuck MOUSEBUTTONDOWN event
snake5creator

When starting application with the usual "double click on file" method on Windows, only holding the last click, an unnecessary MOUSEBUTTONDOWN event is sent before the initial MOUSEMOTION event, and mouse button state is stuck in the sense that it takes a subsequent button release, followed by another press for the system to resume sending events (beginning with the next button release / MOUSEBUTTONUP event).

Input event log with held double-click startup: http://i.imgur.com/nypGKR2.png

Without: http://i.imgur.com/yaIqAvV.png
2014-05-31 14:03:04 -07:00
Sam Lantinga 70df9cd0cd Fullscreen to windowed mode switch
From Melesie

I noticed that when user switches from fullscreen mode to windowed mode and exits application while in windowed mode, Windows performs an additional change of display settings, even though desktop resolution is the same as current one. This causes short black screen to show up. The only way I know of avoiding this is to explicitly switch to default display settings found in registry. MSDN documentation for ChangeDisplaySettingsEx states:

Passing NULL for the lpDevMode parameter and 0 for the dwFlags parameter is the easiest way to return to the default mode after a dynamic mode change.
2014-05-31 12:21:55 -07:00
Sam Lantinga 18c31dec54 Fixed Direct3DCreate9Ex prototype 2014-05-31 11:53:19 -07:00
Sam Lantinga 0c6b99d576 Fixed cast 2014-05-31 11:48:52 -07:00
Sam Lantinga 49c53fd280 Use D3D9Ex when available
This hopefully works around crashes in Intel D3D9 support in Windows 8.1.
2014-05-31 11:37:12 -07:00
Sam Lantinga 52222db255 Fixed SDL error when filtering events after shutdown.
This can happen when restoring video modes during video system shutdown
2014-05-31 11:33:25 -07:00
Ryan C. Gordon 7153c2dad1 Fixed using SDL_PointInRect() from C++. 2014-05-30 09:50:47 -04:00
Ryan C. Gordon bb7a27fadd Fixed up SDL_CaptureMouse() on Windows to work like I expected.
This would have been a one-line patch to the documentation (specifying that
 captures only work as long as the left mouse button is pressed), but I didn't
 like that, so I got a little crazy about this instead.
2014-05-30 01:51:13 -04:00
Ryan C. Gordon bcc2cc8722 Fixed hit-testing on Windows.
Needed to convert from screen to client coords.
2014-05-30 01:49:26 -04:00
Ryan C. Gordon bf03bec120 Patched to compile on Visual Studio. 2014-05-30 01:48:26 -04:00