Commit graph

6463 commits

Author SHA1 Message Date
Ryan C. Gordon
3a6e0fe33f Patched to compile in C90 mode. 2013-10-10 02:21:41 -04:00
Ryan C. Gordon
c0ea35c354 Fixed tarball name in Raspberry Pi build script. 2013-10-10 02:06:14 -04:00
Ryan C. Gordon
e1f08f5661 Added script that the buildbot will use for cross-compiling to Raspberry Pi. 2013-10-10 01:46:39 -04:00
Gabriel Jacobo
c51c4c0733 Adds gl_profile_mask to test framework, uses it in testgles 2013-10-10 00:49:57 -03:00
Gabriel Jacobo
f67950da0c Fixes Bug 2134 - [Android] Black screen after resume (sometimes) 2013-10-10 00:30:03 -03:00
Gabriel Jacobo
dca7c7b00d Fixes testgles and testgl 2013-10-09 11:30:01 -03:00
Gabriel Jacobo
3e171ab36e Adds test framework to Android.mk and a simple utility to build Android projects 2013-10-09 10:29:01 -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
6c7a589964 Only allocate a joystick instance ID once we know it's a joystick.
This fixes compatibility with code that assumes 0 based joystick instance IDs.
2013-10-06 20:39:23 -07:00
Sam Lantinga
677f017482 Removed unused variables (thanks Joseph!) 2013-10-06 13:50:36 -07:00
Sam Lantinga
ff55c5a474 Check for NULL joystick in SDL_JoystickGetGUID() 2013-10-06 13:49:23 -07:00
Sam Lantinga
5c03a1488f Fixed bug where a Logitech wireless keyboard with built-in mouse touchpad didn't get recongized as both devices. 2013-10-05 21:15:55 -07:00
Sam Lantinga
583198f72e Fixed bug 2132 - Tests may use invalid SDL_window pointers when windows are closed
norfanin

Some of the tests keep using the pointers of a destroyed SDL_Window when the common event handling handled the close event. The event handler itself does not NULL the pointer after the destruction.

The attached patch adds a loop in the handler that will assign NULL to the destroyed window. It also adds checks to some of the tests so they skip those windows by checking for NULL.
2013-10-05 19:09:03 -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
Sam Lantinga
31db3ac3c8 Do a 32-bit compare on RGBA values. Thsi should be inlined in optimized builds. 2013-10-05 12:29:05 -07:00
Ryan C. Gordon
0a999e88d1 Avoid redundant state changes in the GLES2 renderer. 2013-10-05 00:29:57 -04:00
Ryan C. Gordon
4cba5706bf Removed "u_colorTable" uniform from the GLES2 renderer. It's not used anywhere.
--HG--
extra : rebase_source : 52e7f708617733fe957c15f2ad752bf79b7c14cb
2013-10-04 11:25:14 -04:00
Gabriel Jacobo
4d80960781 Fix EGL/OpenGL ES paths 2013-10-04 08:23:37 -03:00
Sam Lantinga
75add55896 Report an error if creating a render target fails 2013-10-03 21:41:09 -07:00
Sam Lantinga
325d333774 Added optional error checking for OpenGL ES 2.0 in the same style as the OpenGL renderer.
You can enable it like this: SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
2013-10-03 20:48:52 -07:00
Sam Lantinga
d564d4ea29 Fixed a potential double-free bug if glGenTextures() failed. 2013-10-03 20:42:43 -07:00
Gabriel Jacobo
7b5e9e302b SDL_TEXTINPUT support for EVDEV 2013-10-03 10:28:10 -03:00
Sam Lantinga
201fa56aaa Fixed const/non-const warning 2013-10-03 03:31:05 -07: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
Ryan C. Gordon
715ccd02a5 Get rid of glGetError() calls in GLES2 renderer.
It's not usually useful, and it causes pipeline stalls.

--HG--
extra : rebase_source : fb1b9b3ffdee2a41fdaee5d30e7f218eacb2eaaa
2013-10-02 22:16:11 -04:00
Gabriel Jacobo
f82f0ebb6f Uses SDL_UDEV for Linux joystick hotplugging 2013-10-01 08:47:06 -03: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
Sam Lantinga
76f3df86db Fixed bug 2122 - SDL_CreateTexture allows illegal texture sizes
Lloyd Bryant

SDL_CreateTexture() is succeeding (i.e. returning a valid pointer) when the requested horizontal or vertical size of the texture exceeds the maximum allowed by the render.  This results in hard-to-understand errors showing up when later attempting to use that texture (such as with SDL_SetRenderTarget()).
2013-09-30 22:16:14 -07:00
Sam Lantinga
0a805ff137 Fixed bug 2119 - compiler warnings (-pedantic) SDL_video.h:111:42 2013-09-30 21:57:03 -07:00
Gabriel Jacobo
774637beab Removes unused property use_egl from internal structure gl_config 2013-09-28 19:23:59 -03:00
Gabriel Jacobo
b832dd0230 Fix: SDL_EVDEV_device_removed does not need UDEV 2013-09-28 19:17:27 -03:00
Sam Lantinga
06caf6a344 Call AddRef() on the device so it doesn't accidentally get released from underneath the caller. 2013-09-28 14:07:17 -07:00
Sam Lantinga
2ef24caf1d Make it clear we're just returning a D3D9 device, allowing for new functions to get other D3D versions 2013-09-28 14:07:14 -07:00
Sam Lantinga
f86e83feba Added a hint to create the D3D device in thread-safe mode: SDL_HINT_RENDER_DIRECT3D_THREADSAFE 2013-09-28 14:07:08 -07:00
Sam Lantinga
70c993af2b Added platform specific call: SDL_RenderGetD3DDevice() 2013-09-28 14:07:05 -07: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
018c78cd9f Implemented SDL_UpdateYUVTexture() for Direct3D 2013-09-28 14:06:55 -07:00
Sam Lantinga
b03fdbe67f Added missing SDL_assert.h 2013-09-28 14:06:51 -07:00
Sam Lantinga
43cc5c1cbb Added optimized YUV texture upload path with SDL_UpdateYUVTexture() 2013-09-28 14:06:47 -07:00
Sam Lantinga
45bd5e2b83 Rolled back my LoadLibrary change. The first failed call causes a dialog to pop up in Windows apps (but not console apps) and that's really bad. I'll have to deal with this in my app. 2013-09-28 14:06:39 -07:00
Sam Lantinga
f005889264 SDL_LoadObject on Windows now calls LoadLibrary a second time in its EX form whenever the first load fails. This second call uses the "altered" search path for DLL dependencies, which includes searching the directory that the DLL itself lives in. 2013-09-28 14:06:31 -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
a7429dfa22 Do not use UDEV references in EVDEV if UDEV has not been detected 2013-09-28 15:48:32 -03:00
Sam Lantinga
edf503e870 Fixed bug 1820 - building SDL as a static library with static runtime doesn't compile/link with visual studio
norfanin

Adds a condition so only the MSVC 2012 compiler defines the macros for the functions of its version.

Attaching a patch that adds a condition so that the HAVE_X supported by MSVC 2012 only get defined with that compiler. MSVC 2008 and 2010 will then build without any modification to the SDL source code.

Also moved HAVE_M_PI to a separate check. The Microsoft headers require _USE_MATH_DEFINES to be defined before they define the constants.

--HG--
extra : rebase_source : 5a348adc971f36b3e524a3f30759c6b4c04c400d
2013-09-28 10:30:51 -07:00
Gabriel Jacobo
c7f38347b7 Raspberry Pi support (also unified UDEV and EVDEV support) 2013-09-28 13:28:19 -03:00
Philipp Wiesemann
e0b5831e14 Fixed doxygen warning. 2013-09-28 12:55:32 +02: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