Commit Graph

4902 Commits

Author SHA1 Message Date
Wim Looman
bf836266b7 Make mouse relative mode save the original co-ordinates to restore them
properly.
2012-02-04 00:13:21 +13:00
Wim Looman
fde369d185 Change SDL_SetCursor to set the cursor back to the default cursor when the
window is unfocused.
2012-02-03 23:53:51 +13:00
Wim Looman
82dd1b8f35 Fix null reference exception.
Occurred when using relative mouse mode without a focused window.
2012-02-03 23:08:48 +13:00
Sam Lantinga
2f440f0b3b Fixed bug 1423 - Finger touch events don't report pressure
Philip Taylor 2012-02-19 08:34:52 PST

SDL_touch.c never actually uses the 'pressurein' arguments to
SDL_SendFingerDown/SDL_SendTouchMotion, so it doesn't report the real pressure.
Also it uses touch->pressureres which is never initialised. Also it fails to
initialise some fields of event.tfinger for certain events, so applications
might try to use bogus data.

The attached patch seems to be enough to produce generally sensible output on
Android.
2012-02-20 23:54:33 -05:00
Sam Lantinga
6ff55c1ca2 Fixed bug 1426 - SDL_SemWaitTimeout returns -1 and sets error instead of SDL_MUTEX_TIMEDOUT on time out
deraj 2012-02-19 19:01:08 PST

Fix to treat ETIMEDOUT as a time out instead of an error (and update the test)
2012-02-20 23:51:53 -05:00
Sam Lantinga
c24538ae24 Add OpenGL 3.X context creation support
Matthias Bentrup 2011-10-30 03:58:24 PDT

I've updated the context creation patch to include the bugfixes by Martin
Schreiber and also included a profile bit to request a ES2 compatible profile.

The wgl context creation may use 2 call to wglChoosePixelFormat if no
acceleration attribute is selected, this should work around a bug with buggy
AMD drivers (see #1254).
2012-02-20 23:37:57 -05:00
Sam Lantinga
2a31fa7716 Fixed bug 1424 - Handling of alpha channel in Altivec accelerated blit functions
evilbite 2012-02-19 09:38:21 PST

There is only one Altivec accelerated blit function
(ConvertAltivec32to32_prefetch() or ConvertAltivec32to32_noprefetch(),
depending on the CPU used) that is supposed to handle all alpha combinations.
This works as follows for every pixel line:
1. Blit single pixels until an aligned address is reached
2. Accelerated blit as far as possible
3. Blit single remaining pixels
Part 2. is set up correctly to handle different combinations of the alpha
channels of the participating surfaces. Parts 1. and 3. only do a simple copy
of all the pixel's components from souce to destination. But when the source
surface has no alpha channel (Amask is 0, e.g. the video surface) the surface's
alpha value must be used instead. Otherwise crap (uninitialized data) is being
copied to the destiniation's alpha channel.

The attached patch is a quick'n'dirty solution to the problem. A more
sophisticated solution might require separate functions for different
combinations of the alpha channels of the participating surfaces.
2012-02-20 20:56:52 -05:00
Sam Lantinga
d2a506d0d6 Fix for double free when quitting on iOS
Tim Angus 2012-02-20 09:40:35 PST

As alluded to in the email thread "SDL2 error on iOS (doublefree)", I believe
the original cause of this bug is confusion over the purpose of
SDL_VideoDisplay::current_mode. It looks as though it is a weak reference to
another mode, albeit with value semantics. The iOS port treated it as a strong
reference however and claimed ownership, which is why things blew up. All the
patch really does it to stop treating current_mode as a strong reference.

To prevent this happening again it might be an idea to change current_mode to
be a pointer type rather than a value. This would certainly make its semantics
much more obvious. Failing that, a comment in the struct indicating its weak
reference properties might be wise.
2012-02-20 20:46:30 -05:00
Sam Lantinga
f7b34c87f6 Fixed bug 1419 - SDL_libgl2D.c breaks ndk-build
Philip Taylor 2012-02-15 10:43:47 PST

render/nds/SDL_libgl2D.c unconditionally includes NDS-only code. SDL's
Android.mk compiles source files matching

  $(wildcard $(LOCAL_PATH)/src/render/*/*.c)

which includes that file, causing build errors when running ndk-build.
2012-02-15 21:11:21 -05:00
Sam Lantinga
67d39f0198 FreeBSD compile fix
Robert Millan

src/joystick/bsd/SDL_sysjoystick.c makes the invalid assumption that
__FreeBSD_kernel__ implies presence of "ucr_data" struct member.  This
breaks recent versions of FreeBSD 10-CURRENT, FreeBSD 9-STABLE and
Debian GNU/kFreeBSD "wheezy/sid".
2012-02-15 21:06:45 -05:00
Sam Lantinga
608641e290 Quick android Makefile fix from Gabriel Jacobo 2012-02-14 20:54:44 -05:00
Sam Lantinga
95748ef40d Missed a file in Frank's patch 2012-02-12 23:22:44 -05:00
Sam Lantinga
1cbd3b1798 Updated the .hgignore for the current set of test programs 2012-02-12 21:05:24 -05:00
Sam Lantinga
41dcf2a16e Updated Nintendo DS support
Frank Zago

This patch updates the DS port:
- do not use the now removed compat layer.
- integrate parts of libgl2D since I got permission from the author, and thus
removed an external dependancy,
- a few bugs fixes.

Now, the textures should be completely supported, except reading from them
which doesn't makes sense to have on the DS. Sound is still not supported.

If someone else wants to work on the missing pieces, feel free.
2012-02-12 21:04:01 -05:00
Sam Lantinga
030c7f17b7 Fixed bug 1417 - Android_JNI_FileClose local reference bug
A better solution for automatic local reference management.
2012-02-12 20:57:32 -05:00
Sam Lantinga
333943e556 Fixed bug 1412 - Patch - Software renderer crash
Dimitris Zenios Date: 2012-02-06 15:12:37 GMT

Hi gus there is a bug when using software renderer and the window
surface gets destroyed (Fullscreen and back).The solution is easy
2012-02-07 19:34:24 -05:00
Ryan C. Gordon
a887ff0bac Removed GLX_BUFFER_SIZE attribute; it doesn't do anything with GLX_RGBA. 2012-02-07 02:11:42 -05:00
Ryan C. Gordon
d2093e13ed Replaced some assert macros with SDL_assert. 2012-02-07 02:11:15 -05:00
Ryan C. Gordon
a6a93eaeae Check for _STDINT_H in SDL_config_minimal.h 2012-02-07 01:26:00 -05:00
Sam Lantinga
4f291e8eae Updated the Android Java activity for SDL2 2012-02-04 16:39:52 -05:00
Sam Lantinga
7fda375925 Updated VS2010 project for the new version.rc location - thanks to Rainer Deyke 2012-02-04 10:42:12 -05:00
Sam Lantinga
96b1c69db7 Fixed bug 1410 - fatbuild.sh is broken
Martin Gerhardy 2012-02-03 23:04:45 PST

after the name change from SDL to SDL2 the fatbuild.sh got broken. The attached
patch should fix this.
2012-02-04 10:40:04 -05:00
Sam Lantinga
b42c90e65c Fixed bug 1403 - Creating a window with resizable flags may crash
jordirovira 2012-01-28 12:07:39 PST

in SDL_x11window around 520:

    /* Setup the normal size hints */
    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
        sizehints.min_width = sizehints.max_width = window->w;
        sizehints.min_height = sizehints.max_height = window->h;
        sizehints.flags = PMaxSize | PMinSize;
    }
    sizehints.x = window->x;
    sizehints.y = window->y;
    sizehints.flags |= USPosition;

the sizehints.flags member is not initizalised if it doesn't enter the
conditional. It is as easy as setting it to zero before the conditional.
2012-02-03 22:24:33 -05:00
Sam Lantinga
c7588fa928 Fixed OpenGL ES 1.1 on Android
From Gabriel Jacobo:
What I did notice is that calling
data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value); doesn't produce any
result in Android GLES1.1 if the active framebuffer is the default one, ie,
whatever is in value stays unmodified.
2012-01-31 21:03:35 -05:00
Sam Lantinga
65235aa874 Fixed bug 1405 - README.android misses build instruction: copy SDL_config_android.h -> SDL_config.h 2012-01-31 20:55:17 -05:00
Sam Lantinga
c95069ab56 Switched the SDL 2 autoconf macro to AM_PATH_SDL2 2012-01-30 21:39:26 -05:00
Sam Lantinga
9470893698 Fixed magenta texture on iOS with OpenGL ES 2.0 2012-01-30 20:56:25 -05:00
Sam Lantinga
5277741dcd Updated Android Makefile for SDL2 2012-01-30 20:09:50 -05:00
Sam Lantinga
00da0cd57c Added glGenFramebuffers() to the function pointer list 2012-01-28 14:53:23 -05:00
Sam Lantinga
55ea8bdfd4 Fixed setting the orthographic projection when the viewport changes. 2012-01-28 14:05:48 -05:00
Tim Angus
b2029b6a66 * On iOS, fix support for the case where [UIScreen scale] is not 1.0 (retina)
* Allow selection of non-retina modes on retina devices
2012-01-25 14:29:56 +00:00
Sam Lantinga
f4c0910b5b Sanity check the window width and height 2012-01-22 23:51:46 -05:00
Sam Lantinga
e2e9ecfa1f Successfully built an SDL 2.0 RPM 2012-01-22 23:36:59 -05:00
Sam Lantinga
24472a0309 Updated the README and removed the old graywin test 2012-01-22 22:30:27 -05:00
Sam Lantinga
36dbd7c7ca Removed old SDL 1.2 tests from the iOS test projects 2012-01-22 22:29:50 -05:00
Sam Lantinga
fac9ba080a Fixed setting the window visibility on iOS and Android 2012-01-22 22:19:08 -05:00
Sam Lantinga
254cf2c53c Removed old compat files from Visual Studio and Xcode projects 2012-01-22 22:09:29 -05:00
Sam Lantinga
f14f70bc64 Fixed loading textures when the window starts hidden.
The viewport automatically resets to the window size when you programmatically resize the window.
2012-01-22 21:46:06 -05:00
Sam Lantinga
3c87570c58 Have testspriteminimal use the new simple API 2012-01-22 19:47:33 -05:00
Sam Lantinga
b5844a1c07 Added a convenience function SDL_CreateWindowAndRenderer() 2012-01-22 19:22:53 -05:00
Sam Lantinga
07b8dc102e Re-added SDL_SWSURFACE, because it looks silly to always pass 0 to SDL_CreateRGBSurface() 2012-01-22 18:37:46 -05:00
Sam Lantinga
9c4c023744 Removed the SDL 1.2 compatibility API... we'll see how painful this is. 2012-01-22 18:11:41 -05:00
Sam Lantinga
0b021e1de9 Switched the RPM spec file to SDL 2.0 2012-01-22 17:50:35 -05:00
Sam Lantinga
56d871b599 Removed unsupported Watcom files 2012-01-22 17:41:33 -05:00
Sam Lantinga
aaae96a5cb BeOS is no longer a going concern. ;) 2012-01-22 17:33:44 -05:00
Sam Lantinga
115347e976 Removed unsupported Borland related files 2012-01-22 17:32:50 -05:00
Sam Lantinga
128821901c Removing some more references to SDL 1.3 2012-01-22 17:26:45 -05:00
Sam Lantinga
c484f884c5 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2 2012-01-22 17:21:00 -05:00
Sam Lantinga
c5b09f0da7 You need to create the texture with the SDL_TEXTUREACCESS_TARGET flag. 2012-01-22 01:29:26 -05:00
Sam Lantinga
b291116502 Renamed SetTargetTexture() to SetRenderTarget() 2012-01-22 01:26:28 -05:00