Commit graph

6228 commits

Author SHA1 Message Date
Gabriel Jacobo
25c9f2cd30 Fixes a few non C89 compliant comments 2013-08-20 19:49:24 -03:00
Edward Rudd
4aff1bfc47 add missing SDL_bits.h from OS X framework
- also add in headers to static and shared targets  (for completeness)
2013-08-20 15:56:08 -04:00
Ryan C. Gordon
824641c0cc Added some FIXMEs for later.
--HG--
extra : rebase_source : a82aef2d5065d03cb0a14f9020f9fcc82fb16f12
2013-08-20 12:43:06 -04:00
Gabriel Jacobo
ef4a588d99 Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Ryan C. Gordon
29ea6509bc Fixed leaking of pixel shader object in D3D renderer (thanks, Peter!).
Fixes Bugzilla #2047.
2013-08-19 11:02:44 -04:00
Sam Lantinga
7960e55671 Fixed warnings building with gcc 2 and gcc 4 on Haiku 2013-08-18 23:18:11 -07:00
Sam Lantinga
6af769d887 Fixed Haiku build (thanks Alexander!) 2013-08-18 22:05:53 -07:00
Philipp Wiesemann
7a4e8a1021 Replaced introduction in header file with more recent version from README.txt. 2013-08-18 11:15:30 +02:00
Philipp Wiesemann
dbd31e454a Corrected file names in header file comments. 2013-08-18 11:12:46 +02:00
Philipp Wiesemann
8900fb0a7e Changed some documentation comments in header files to be used by doxygen. 2013-08-18 11:08:52 +02:00
Ryan C. Gordon
8cd0072f2d Patched to compile with Visual Studio. 2013-08-17 20:46:34 -04:00
Sam Lantinga
f082b60d08 Fixed Windows build 2013-08-17 17:14:15 -07:00
Sam Lantinga
458f93d7cb Fixed for consistency with the other platforms 2013-08-17 17:04:14 -07:00
Edward Rudd
508d844d44 auto init the ticks if the GetTicks and the like methods are called before SDL_Init().. This prevents annoying game bugs such as caching SDL_GetPerformanceFrequency in a static initializer 2013-08-17 18:07:29 -04:00
Sam Lantinga
f2ddd7c822 Do full state initialization in D3D_Reset(), this fixes blend mode issues when resizing the window on Windows 8. 2013-08-17 09:54:30 -07:00
Sam Lantinga
814d56a9cc Fixed windows build 2013-08-16 17:50:44 -07:00
Sam Lantinga
8b93c73d0d The keyboard text events should be sent after the key down events 2013-08-16 15:38:06 -07:00
Sam Lantinga
ec992b0558 Fixed bug 1876 - SDL_TEXTINPUT only returns '?' (0x3F) in event.text.text with Khmer language input
Andreas

The issue comes down to this line on MSDN:
"TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver."

"WM_KEYDOWN and WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message. WM_SYSKEYDOWN and WM_SYSKEYUP combinations produce a WM_SYSCHAR or WM_SYSDEADCHAR message."
Except for WM_CHAR, none of these messages are used in SDL. Hence TranslateMessage should be dropped entirely and proper handling be included in the WM_KEYDOWN event.
Currently TranslateMessage is called for every message even if it must not be called in certain cases (like "An application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value.").

WM_CHAR message handling should remain for external processes posting these messages - additionally, WM_UNICHAR should be added.

I made a patch for src/video/windows/SDL_windowsevents.c that seems to work fine. It doesn't solve the "missing" composition for Khmer, but at least input for languages that cannot be mapped to ASCII characters (and for which IME is not used) will now work on Windows.

--HG--
extra : rebase_source : 7024be6c3a874d0319ea4c65b7d43f105915288f
2013-08-16 15:35:10 -07:00
Gabriel Jacobo
140002c931 Android quirk:Some devices don't report GL_OES_framebuffer_object but support it 2013-08-16 14:38:04 -03:00
Ryan C. Gordon
e5511f4ca0 Patched to compile. 2013-08-16 12:51:29 -04:00
Gabriel Jacobo
054cb84414 [Bug 2042] OpenGL ES renderer tries to load OES functions unconditionally
Also, fail more gracefully when creating texture to avoid double free errors.
2013-08-16 13:37:27 -03:00
Sam Lantinga
a460259e6b Fixed alpha composition when destination alpha is transparent.
Jianyu Guan

I found I make a big mistake that when dstA==0, I just simply let *dstp=*srcp and forgot to make dstRGB = srcRGB*srcA.

The if consition "(*dstp & amask) == 0" in BlitRGBtoRGBPixelAlphaMMX and BlitRGBtoRGBPixelAlphaMMX3dNow should be removed.
2013-08-16 09:20:33 -07:00
Sam Lantinga
1873067816 Fixed alpha blending for the MMX blit functions
I see the Remarks of function SDL_BlitSurface shows that "when SDL_BLENDMODE_BLEND, we have dstA = srcA + (dstA * (1-srcA))". however, I tested some pictures but the result implies "dstA=arcA" actually. I stepped into the source code, and found after I set SDL_BLENDMODE_BLEND for the source surface, the final blit function is BlitRGBtoRGBPixelAlphaMMX when I use SDL_BlitSurface on my computer. And I found these codes:

    else if (alpha == amask) {
    /* opaque alpha -- copy RGB, keep dst alpha */
    *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);

The same code is used in BlitRGBtoRGBPixelAlphaMMX3DNOW and BlitRGBtoRGBPixelAlpha. So I think they still keep dst alpha.

Best regards,
Jianyu Guan
2013-08-16 06:59:19 -07:00
Andreas Schiffler
16a40598f6 Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency 2013-08-14 23:30:10 -07:00
Sam Lantinga
a0bc602061 Don't print "unrecognized key" message for an X11 keycode of 0. This can happen with composed characters. 2013-08-12 22:00:21 -07:00
Sam Lantinga
24273dd369 Fixed the tag name for the SDL 2.0 release 2013-08-12 19:18:48 -07:00
Jørgen P. Tjernø
a100a39fe9 Mac: Fix restoring of Cmd-H-hidden fullscreen desktop windows.
This should fix http://bugzilla.libsdl.org/show_bug.cgi?id=1996

--HG--
extra : histedit_source : 5d56152c804e07c2750a8490d945f65f78d3cf93
2013-08-12 11:09:13 -07:00
Sam Lantinga
85492cbff9 Added Julian Winter to the credits for the SDL 2.0 website. 2013-08-12 08:45:37 -07:00
Sam Lantinga
af05051dee Added tag release_2.0.0 for changeset d6a8fa507a45
--HG--
extra : rebase_source : a735ace6526c8b4b32f704d7f0353912dff3cc18
2013-08-12 08:40:49 -07:00
Gabriel Jacobo
a3982939c5 Fixes #2022, do not resume on Android when surfaceChanged
If the app is in landscape mode and the user presses the power button, a pause
is followed immediately by a surfaceChanged event because the lock screen
is shown in portrait mode. This triggers a "false" resume.
So, we just pause and resume following the onWindowFocusChanged events.

Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before
blocking the event pump.
2013-08-12 11:13:50 -03:00
Sam Lantinga
dd7da60a4f Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow()
Rainer Deyke

I'm running Linux Mint 15 with the Cinnamon window manager.  SDL_DestroyWindow consistently locks up for me when the window if fullscreen.
2013-08-11 19:56:43 -07:00
Philipp Wiesemann
286dc2e1dc Added missing call to SDL_stack_free().
On Windows this is needed because SDL_stack_alloc() wraps SDL_malloc().
2013-08-10 23:21:06 +02:00
Philipp Wiesemann
ba31f59f54 Removed SDL_HAPTIC_SQUARE from comments in header to prevent doxygen confusion. 2013-08-10 23:14:20 +02:00
Philipp Wiesemann
0b13b79137 Corrected comment in test program. 2013-08-10 23:07:28 +02:00
Sam Lantinga
28b592cb5d Fixed bug 1925 - SDL_GetPerformanceFrequency returns incorrect value on iOS
PoopiSan

Currently on OSX and iOS simulator the values:
mach_base_info.denom = 1
mach_base_info.numer = 1

but on the real iOS device
mach_base_info.denom = 3
mach_base_info.numer = 125

The calculation is made using following formula
mach_base_info.denom / mach_base_info.numer * 1000000

but all values are int32 and the result is casted to int64.

This solves the problem:

return 1.0 * mach_base_info.denom / mach_base_info.numer * 1000000;
2013-08-10 11:19:30 -07:00
Sam Lantinga
df092588e8 Fixed whitespace 2013-08-10 10:57:54 -07:00
Sam Lantinga
e6e79353e8 Fixed bug 2024 - Update OSX Joystick code to fully support Saitek p2500 gamepad
Patrick Maloney

Saitek p2500 (Cyborg Rumble Force Pad) has a D-pad, two analog sticks, and numerous buttons.  SDL 2.x on OSX detected everything except the right-side analog stick.  The right-side stick is considered a 'simulation device' with the axes mapped to throttle and rudder.

The patch adds support for throttle and rudder on the HID simulation page.
2013-08-10 10:55:12 -07:00
Sam Lantinga
42c560b05d Check the return value of glGenTextures()
--HG--
extra : rebase_source : e079554f253890d862bfd5d51d7b229e3fcff3d9
2013-08-10 10:49:26 -07:00
Ryan C. Gordon
d4f386f5e3 Haptic: Let XInput update effects while they're still running. 2013-08-10 13:46:19 -04:00
Ryan C. Gordon
de6d6a5554 Removed no-longer-necessary comment. 2013-08-10 13:40:08 -04:00
Ryan C. Gordon
c35c4a6f18 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Ryan C. Gordon
24097af6ac Fixed some typos in the headers. 2013-08-10 13:20:45 -04:00
Sam Lantinga
aabc0fcc3b Added the Google Summer of Code students from 2010 2013-08-09 23:58:33 -07:00
Sam Lantinga
c4a3df6938 Updated the credits for SDL 2.0. Thank you everyone! 2013-08-09 23:43:14 -07:00
Sam Lantinga
9444c11e99 Fixed bug 2007 - SDL_SetWindowMinimumSize() not implemented on X11 (thanks Rainer!) 2013-08-09 23:13:52 -07:00
Sam Lantinga
bcee442188 Better wording suggested by the community 2013-08-09 21:09:49 -07:00
Andreas Schiffler
84e0884077 Update video_getSetWindowSize for windows 2013-08-08 22:10:00 -07:00
Andreas Schiffler
7067bff470 Fix Bug 2021: Win32: Stack overflow due to recursive SDL_LogOutput on SDL_LogError without console; fix off-by-one error in SDLtest test suite 2013-08-08 21:29:30 -07:00
Sam Lantinga
58eedbb27e Removed unneeded Android audio code 2013-08-08 21:16:29 -07:00
Gabriel Jacobo
610264fb0b Start Android Audio Thread after audio buffer and AudioTrack are ready.
Also, it starts the Audio Thread from the native side, putting the code in line
with other backends.
2013-08-08 21:25:09 -03:00