Commit graph

2756 commits

Author SHA1 Message Date
Sam Lantinga
367ffcc3af Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values.
Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
2013-10-20 20:42:55 -07:00
Ryan C. Gordon
7a0350ba09 Added SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (thanks, David!).
Fixes Bugzilla #1985.
2013-10-20 21:18:05 -04:00
Ryan C. Gordon
197b270ca8 Backed out changeset c8a0b7c05db8, done testing Buildbot changes. 2013-10-20 20:24:00 -04:00
Ryan C. Gordon
cfcf5384b7 Intentionally breaking Windows and Raspberry Pi builds to test Buildbot change. 2013-10-20 20:02:02 -04:00
Sam Lantinga
d914072403 Fixed compiling with the new X11 symbol wrapping 2013-10-20 09:58:37 -07:00
Stefanos Apostolopoulos
4d8c9bdc1f Fix bug 1300 by querying current border size in ConfigureNotify, and adjusting window coordinates accordingly. 2013-10-20 17:23:43 +02:00
Ryan C. Gordon
54a9270523 Fixed the XInput2 X11 symbols. 2013-10-18 10:56:45 -04:00
Sam Lantinga
ef02b8a4ce Fixed bug 2123 - SDL_BlitScaled crashes in src/video/SDL_blit_N.c:2145
We need to reset the blit function when switching between scaled and unscaled blits.
2013-10-18 00:47:22 -07:00
Sam Lantinga
26b26c8f01 Removed redundant #ifdef 2013-10-17 23:05:40 -07:00
Sam Lantinga
a999af88e9 Fixed building using MinGW
Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
2013-10-17 23:02:29 -07:00
Ryan C. Gordon
bf877ba691 Don't supply duplicate X11 symbols inside SDL.
Fixes static linking when something else also uses X11.

--HG--
extra : rebase_source : 8b913c842dd9793a3dbad68f070878d5931a8a94
2013-10-18 01:36:41 -04:00
Sam Lantinga
0e2c364251 Fixed compiler warning if dynamic X11 loading isn't enabled.
--HG--
extra : rebase_source : fa6d88273a5c3ab0f501f90bb98340bfedf5a086
2013-10-17 17:38:55 -07:00
Sam Lantinga
277d7b5c2c Fixed using the wrong variable when reporting a missing SDL scancode mapping.
--HG--
extra : rebase_source : addd6c5ccfe203f744ba50a120ebe5a1ca77476e
2013-10-17 17:37:23 -07:00
Sam Lantinga
23a6f738e7 Backed out revision d4a39491577f, the platform specific messagebox functions don't have the right prototype since they're designed to be used standalone. 2013-10-14 09:12:30 -07:00
Sam Lantinga
73bc021063 For some reason, trying to raise the window programmatically while it's alt-tabbed away will minimize it. Added a workaround for this. 2013-10-14 08:56:55 -07:00
Sam Lantinga
0b7df34286 Fixed the windows message debug output so it works without HAVE_LIBC 2013-10-14 08:56:50 -07:00
Sam Lantinga
097878a78e Fixed accumulating mouse wheel motion for the Microsoft Wireless Mouse 5000 2013-10-13 19:59:40 -07:00
Gabriel Jacobo
146a3bc324 Fixes X11 video backend compilation when no GL is available
For example, in our Raspberry Pi sysroot.
2013-10-12 16:29:34 -03:00
Jørgen P. Tjernø
daf4ca1ac2 Mac: Better handling when someone else is the app delegate.
--HG--
extra : rebase_source : a2d99f3c2d93c0a6adeaf04fccec23799cc52de9
2013-10-07 16:01:40 -07:00
Ryan C. Gordon
3a6e0fe33f Patched to compile in C90 mode. 2013-10-10 02:21:41 -04:00
Gabriel Jacobo
f67950da0c Fixes Bug 2134 - [Android] Black screen after resume (sometimes) 2013-10-10 00:30:03 -03:00
Jørgen P. Tjernø
f06b10a5df 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
677f017482 Removed unused variables (thanks Joseph!) 2013-10-06 13:50:36 -07:00
Philipp Wiesemann
20b394d072 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
Ryan C. Gordon
0a999e88d1 Avoid redundant state changes in the GLES2 renderer. 2013-10-05 00:29:57 -04:00
Gabriel Jacobo
4d80960781 Fix EGL/OpenGL ES paths 2013-10-04 08:23:37 -03:00
Sam Lantinga
7501cc4354 Added the platform specific messagebox function to the video function list 2013-07-14 11:28:44 -07:00
Sam Lantinga
72d2084077 Fixed bug 2130 - Two members of Windows WindowData not initialized
norfanin

SetupWindowData in SDL_windowswindow.c doesn't initialize two members of SDL_WindowData with NULL. This is an issue because other parts of the SDL code seem to make the assumption that this is the case. WIN_DestroyWindowFramebuffer for example uses data->mdc and data->hbm if they're not NULL.
2013-10-03 00:54:58 -07:00
Ryan C. Gordon
1e8c10c155 SDLK_DELETE should probably be SDLK_BACKSPACE on iOS.
The key on the software keyboard works like backspace, at least. Not sure
 what happens with a bluetooth keyboard here.

--HG--
extra : rebase_source : 9db0fb0ccf78490db0443e975a55344a39416954
2013-10-02 22:18:04 -04:00
Sam Lantinga
414ff3106c Fixed bug 2121 - GCC throws error on SDL_FORCE_INLINE when compiling with -ansi 2013-09-30 22:35:32 -07:00
Gabriel Jacobo
774637beab Removes unused property use_egl from internal structure gl_config 2013-09-28 19:23:59 -03:00
Sam Lantinga
585fd26052 Moved SDL_Direct3D9GetAdapterIndex() to SDL_windowsvideo.c since it doesn't belong in the window code. 2013-09-28 14:06:59 -07:00
Sam Lantinga
a759ac24a1 Moved D3D_LoadDLL and SDL_Direct3D9GetAdapterIndex to SDL_windowswindow.c at Jorgen's insistence. That file is wrapped in a more appropriate define check so it will work if somebody builds a binary without D3D support.
Added a reference to SDL_Direct3D9GetAdapterIndex to SDL_test_common.c so SDL will fail to compile if the new symbol isn't included properly.

CR: Jorgen
2013-09-28 14:06:20 -07:00
Gabriel Jacobo
c7f38347b7 Raspberry Pi support (also unified UDEV and EVDEV support) 2013-09-28 13:28:19 -03:00
Philipp Wiesemann
95e08da47b Corrected name of SDL_Color field from unused to a. 2013-09-28 12:48:26 +02:00
Sam Lantinga
55fe573688 Fixed bug 2101 - CWBackPixel causes weird window flickering on window resize
aBothe

I tried to experiment a bit with SDL2 and OpenGL today and noticed that something caused some weird flickering when resizing my nicely drawn SDL2/OpenGL window:
Just after resizing, the background went black and I had to let my OpenGL code redraw the contents..
However, after some hours spent with googling I found out that in OpenGL examples where this CWBackPixel flag was not used when creating X windows, there was no flickering while resizing the window.

See http://www.sbin.org/doc/Xlib/chapt_04.html @ "The Window Background" for more info.
2013-09-27 23:47:57 -07:00
Sam Lantinga
75265a79a9 # User Darren Salt <devspam@moreofthesa.me.uk>
# Date 1379621782 -3600
#      Thu Sep 19 21:16:22 2013 +0100
Work around a false-positive in the X11 mouse wheel code

This false positive occurs when one particular button on my mouse is
pressed. The kernel which I'm using is patched to cause a release event to
be synthesised immediately when the mouse says that this button is pressed
because the mouse doesn't signal release until the button is next pressed.

(Also documents a false negative, observed with the horizontal scroll wheel
on the same mouse.)
2013-09-27 23:35:17 -07:00
Sam Lantinga
64ba536a10 Fixed bug 2100 - directfb fails to build 2013-09-27 23:29:05 -07:00
Edward Rudd
3a11d95444 add in High DPI support (aka Retina)
- based on Jørgen's patch with a few bug fixes
2013-09-20 13:43:00 -04:00
Sam Lantinga
a449178caa Default to OpenGL ES 2.0 instead of 1.0 when it's available. 2013-09-27 22:09:51 -07:00
Sam Lantinga
1af00322ef Fixed syntax error in C style block comment. 2013-09-14 11:25:52 -07:00
Ryan C. Gordon
9e17cee111 Don't incorrectly report success for negative swap intervals on Mac OS X. 2013-09-14 01:30:57 -04:00
Sam Lantinga
0d7001777d Added SDL_Direct3D9GetAdapterIndex(), which returns the adapter index you would pass into CreateDevice to get your device on the right monitor in full screen mode. This fixes the default adapter in SDL_render_d3d.c, which means that tests will work fullscreen off the main monitor now.
CR: Sam
2013-09-13 17:42:46 -07:00
Sam Lantinga
8f58be5fbe Fix X11_RestoreWindow() and X11_RaiseWindow() to properly do window activation.
X11_RestoreWindow() had a call ordering problem that prevented activation, and X11_RaiseWindow() wasn't attempting activation. Windows and OS X both activate in these cases.

CR: saml
2013-09-13 17:42:38 -07:00
Sam Lantinga
c3ffb3ce88 Mac: Translate Ctrl-Left click to right click. 2013-09-13 17:42:31 -07:00
Sam Lantinga
23c6df8eae Mac: Turn off momentum-based scrolling. 2013-09-13 17:41:17 -07:00
Sam Lantinga
4e681a4151 Mac: Fix cast warning. 2013-09-13 17:40:41 -07:00
pgriffais@spaceport
905b5aa01a [SDL] X11+GL: Allow Visual override for GL windows.
SDL provides an SDL_VIDEO_X11_VISUALID environment variable that lets you override
window visuals, but it wasn't being checked for OpenGL windows.

CR: Sam.
2013-09-10 18:25:13 -07:00
Ryan C. Gordon
d7839b7827 The SDL_PixelFormat* passed to SDL_ConvertSurface() should be const. 2013-09-04 23:40:11 -04:00
Gabriel Jacobo
efb1f10b7c Fixes bug #2040, prepare SDL_GL_CONTEXT_EGL for deprecation on v2.1
SDL_GL_CONTEXT_EGL = 1 is now internally treated as profile_mask = SDL_GL_CONTEXT_PROFILE_ES
2013-08-29 15:02:32 -03:00