Commit graph

7371 commits

Author SHA1 Message Date
Jørgen P. Tjernø
3b1c45d421 SDL_opengl: Fix Mac build for SDK 10.9 too. 2014-06-04 10:33:23 -07:00
Jørgen P. Tjernø
a7333943a0 SDL_opengl: Fix Mac build with new glext.h 2014-06-04 09:59:10 -07:00
Sam Lantinga
92626ced7c 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
d961305824 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ø
226d5f634c 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.

--HG--
extra : rebase_source : 99ed4a21b67a35a11f9af80de79d844ea8ac0d80
2014-06-04 01:35:36 -07:00
Jørgen P. Tjernø
ace98412d0 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.

--HG--
extra : rebase_source : 85adb5e14c704f0202041dc0dd9ef9402508f1f6
2014-06-04 01:32:52 -07:00
Jørgen P. Tjernø
10a8560058 SDL_opengles2: Separate out GLES2 headers.
--HG--
extra : rebase_source : 67a615ceb77389a2be5ba5177966e3255bdc964b
2014-06-04 01:27:13 -07:00
Jørgen P. Tjernø
293e0c0657 SDL_opengl: Move glext.h to a separate file.
--HG--
extra : rebase_source : 36b782051e621861bfc8f47249a4e2d1ea8f4775
2014-06-04 01:21:00 -07:00
Jørgen P. Tjernø
6e7e3c9117 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
dd5e9d8941 Hopefully really fixed the Android build 2014-06-02 09:20:09 -07:00
Sam Lantinga
b14bec7a97 Fixed Android build 2014-06-02 09:12:51 -07:00
Sam Lantinga
efeb53642f 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
073850f988 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 29aac8b813d9) 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
e50052e494 Added a way to get the native Android window and EGL context 2014-06-02 09:01:26 -07:00
Sam Lantinga
f82322ac3d 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
3228a654cd 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
f4f604c8ac 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
a63394ad22 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
739c7e7b69 Fixed Direct3DCreate9Ex prototype 2014-05-31 11:53:19 -07:00
Sam Lantinga
6f697f2181 Fixed cast 2014-05-31 11:48:52 -07:00
Sam Lantinga
7ab938363f 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
932a752f54 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
Philipp Wiesemann
822b690cac Added javadoc comments to document methods used by JNI. 2014-05-29 23:05:18 +02:00
Philipp Wiesemann
272e4b090a Added javadoc comments to prevent unused parameter warning. 2014-05-29 22:58:06 +02:00
Philipp Wiesemann
4efae3ae35 Fixed implicit boxing and unboxing of Java Objects warning. 2014-05-29 22:53:53 +02:00
Philipp Wiesemann
6f8e4f99dc Added missing stdio include in test program. 2014-05-29 22:48:10 +02:00
Philipp Wiesemann
4e8cb4d7be Fixed use of uninitialized variable warning in test program. 2014-05-29 22:44:08 +02:00
Ryan C. Gordon
5b6a0bbd6d Fixed stack overflow in X11_CreateWindow() (thanks, rapha and Brad!).
This should be a "long" which on a 64-bit system is likely to be > 32-bits,
 causing XGetICValues() to write past the end of the variable (and stack).

Fixes Bugzilla #2513.
2014-05-24 21:06:40 -04:00
Ryan C. Gordon
e61835ec15 Added note about Wayland and Mir packages for Ubuntu 14.04. 2014-05-24 19:49:03 -04:00
Ryan C. Gordon
b2ff607db8 Added some FIXMEs. 2014-05-24 01:27:19 -04:00
Ryan C. Gordon
842e912664 Fixed whitespace. 2014-05-24 01:25:27 -04:00
Ryan C. Gordon
7d3359d9c4 Generated dynapi stuff for the new WinRT entry points. 2014-05-24 01:23:57 -04:00
Sam Lantinga
a9a0cf95ec Fixed crash if the OpenGL library hasn't been loaded yet 1970-01-01 04:04:21 +00:00
Yuri Kunde Schlesner
9483e21015 Align pointer in SDL_memset before doing Uint32 loop
Some more recent compilers emit SSE aligned store instructions for the loop,
causing crashes if the destination buffer isn't aligned on a 32-bit boundary.
This would also crash on platforms like ARM that require aligned stores.

This fixes a crash inside SDL_FillRect that happens with the official x64 mingw
build.

--HG--
extra : rebase_source : afd0f856fd814e7345bd0c7d20ddac3ba0422813
2014-05-10 21:48:46 -03:00
Philipp Wiesemann
ed89f98f5b Changed C++ style comments. 2014-05-18 21:11:30 +02:00
Philipp Wiesemann
8cc5275bde Fixed typo in header comment. 2014-05-18 21:05:39 +02:00
Philipp Wiesemann
423d8d1a17 Changed C++ style comments to fix pedantic warnings. 2014-05-17 22:02:25 +02:00
Philipp Wiesemann
d2d918c6b2 Removed unused standard library includes from gesture source. 2014-05-17 21:52:05 +02:00
Gabriel Jacobo
2f461036d4 Fixes #2541, build failure with Wayland enabled, OpenGL ES disabled
Also includes an attempt at fixing building SDL on Ubuntu 13.10, which hopefully
won't break 14.04
2014-05-13 19:42:40 -03:00
Sam Lantinga
506e9977d2 Added a binding for the NVIDIA Shield controller 2014-05-13 12:10:37 -07:00
Sam Lantinga
bb480c2b0a Updated coding style to match the rest of SDL 2014-05-13 11:32:36 -07:00
Philipp Wiesemann
cba5857731 Fixed typo in header comment. 2014-05-11 15:59:22 +02:00
David Ludwig
7268632f00 WinRT: fixed the max-button count for WinPhone 8.1 message boxes
Doh.

The max button count on WinPhone 8.1 was set to three, not two.  Any more than
two leads to a crash.
2014-05-10 23:39:54 -04:00
David Ludwig
15e4e3c1bd Added limited message-box support for Windows Phone 8.1
The Windows Phone 8.1 'MessageDialog' API only seems to support two buttons,
despite the documentation for such mentioning support for three.  Trying to use
three or more buttons leads to an exception being thrown.  As such, any attempt
to use more than two buttons via SDL_ShowMessageBox (on Windows Phone 8.1) will
lead to no message box getting shown, and the call returning an error.

The Win32 MessageBox and dialog APIs are not available in WinRT apps, to note.

More extensive message dialog support might be available at some point, if and
when XAML support is more fully fleshed-out.  I'm not certain of this, though.

--HG--
extra : rebase_source : 42962c17f0bc3093e67fe9e176fb7c7c4bae722c
2014-05-10 23:28:53 -04:00
Gabriel Jacobo
12f4e7625f Improve handling of focus behaviour on Android. Patch by Alexey Petruchik 2014-05-10 18:24:39 -03:00
Gabriel Jacobo
7c6e66dad9 Include gl2platform.h in SDL_opengles2.h so we play nice with GLEW.
Based on feedback from Sven Bergström
2014-05-10 17:00:37 -03:00
Gabriel Jacobo
efffa3a0c4 Fixes #2512, handle configuration change messages sent by Wayland. Patch by Bryan Cain. 2014-05-10 16:50:05 -03:00
Sam Lantinga
461ff8bf35 Updated iOS deployment target to iOS 5.1 2014-05-10 12:34:16 -07:00
Gabriel Jacobo
cdc0dfa61c Fixes #2529, guard SDL_d3math.* with the proper defines 2014-05-10 16:23:06 -03:00
Gabriel Jacobo
d00ea7e64b Fixes #2519, clear error if using the default library path for EGL succeeds. 2014-05-10 16:13:22 -03:00