Commit graph

2474 commits

Author SHA1 Message Date
Philipp Wiesemann
64f1ac9002 Fixed implicit function declaration and warning for SDL_Log(). 2013-06-02 14:11:04 +02:00
Philipp Wiesemann
3472d792a9 Fixed implicit function declarations and their warnings.
For the SDL_SetMouseFocus() and SDL_SetKeyboardFocus().
2013-06-01 21:17:43 +02:00
Philipp Wiesemann
6096e60a4b Removed debug output. 2013-06-01 21:11:52 +02:00
Sam Lantinga
07424fd0ca Fixed compiler warning 2013-05-26 11:44:03 -07:00
Edward Rudd
0ce4bb89d8 Only free EventData if it's successfully retrieved.
- straight from http://who-t.blogspot.com/2009/07/xi2-and-xlib-cookies.html
- hopefully fixes random crash on some systems
2013-05-23 18:45:14 -04:00
Ryan C. Gordon
a106589b14 Patched to compile with older glext.h that don't have GL_NUM_EXTENSIONS.
--HG--
extra : rebase_source : e2ece9401f8f324875930d35c61514920732087b
2013-05-22 01:36:37 -04:00
Ryan C. Gordon
077cd8d398 Use glGetStringi() for extension lookup on OpenGL contexts >= version 3.0.
Fixes Bugzilla #1620.

--HG--
extra : rebase_source : 5fa86e8591bfea85e1adf8a495a7b32c3d5dacd5
2013-05-22 01:31:04 -04:00
Sam Lantinga
a1b0f0566b Fixed macro line endings after whitespace was fixed 2013-05-21 22:04:14 -07:00
Sam Lantinga
e2929bcb73 Fixed bug 1534 - SIGSEGV in SDL_ConvertSurface() for certain formats in SDL2
Don't assume that 8 bit formats are indexed.
Thanks to Gabriel Jacobo for research and potential patches.
2013-05-21 22:01:18 -07:00
Ryan C. Gordon
c950178124 Patched to compile on older Mac OS X devtools (thanks, D B!). 2013-05-21 23:02:16 -04:00
Sam Lantinga
44ae527164 Fixed bug 1148 - SDL window white upon first appearing
To be consistent with other platforms, we'll use black as the background color.
2013-05-20 23:30:08 -07:00
Sam Lantinga
97fba74bda Fixed bug 731 - No mechanism to extract the NSView for 3d library 2013-05-20 22:05:49 -07:00
Sam Lantinga
2f9ac5db94 Fixed losing ALT key modifiers on Unity 2013-05-20 12:25:16 -07:00
Sam Lantinga
30a001fdfa Fixed bug 1842 - [patch] SDL_SetWindowPosition sets bad position values when given SDL_WINDOWPOS_CENTERED args
Alex Szpakowski

When calling SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED), the window moves to the correct position but it seems to internally set its x/y position values to the literal value of the SDL_WINDOWPOS_CENTERED define.
This causes all sorts of problems when SDL functions which use the window position (e.g. SDL_SetWindowGrab) are called after the aforementioned SDL_SetWindowPosition call.

Looking at the SDL_SetWindowPosition code, it seems that SDL_SendWindowEvent with the SDL_WINDOWEVENT_MOVED event is called at the end of the function using the literal value of the SDL_WINDOWPOS_CENTERED define, instead of the newly set window->x and window->y values.
SDL_SendWindowEvent then sets the values of window->windowed.x and window->windowed.y to that value (0x2FFF0000, aka 805240832.)

I have attached a patch which changes SDL_SetWindowPosition to make sure SDL_SendWindowEvent is called with the correct coordinate values, if SDL_WINDOWPOS_CENTERED is used (fixes the issue for me.)

Tested with Mac OS 10.8.3.
2013-05-19 22:36:54 -07:00
Sam Lantinga
71d173a062 Fixed black screen on iOS 2013-05-18 14:51:29 -07:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
2ac8624930 Added mobile application events, with implementations for iOS and Android 2013-05-18 12:48:50 -07:00
Philipp Wiesemann
20ff4d06d8 Corrected internal function prototype. 2013-05-15 22:25:00 +02:00
Philipp Wiesemann
c5b6e3c9e1 Corrected internal function prototype. 2013-05-15 22:24:23 +02:00
Philipp Wiesemann
20a48b079c Added missing vi lines. 2013-05-10 21:14:13 +02:00
Philipp Wiesemann
cafc8e6dc1 Fixed implicit function declaration warnings. 2013-05-10 21:08:37 +02:00
Sam Lantinga
5d9de376d2 Updated version to 2.0.0 2013-05-09 16:30:44 -07:00
Jørgen P. Tjernø
7b5cb0dcbd Mac: Use cursor rects instead of NSCursor hide/unhide.
This should hopefully fix a class of problems around cursor hiding not behaving correctly on Mac.

http://bugzilla.libsdl.org/show_bug.cgi?id=1824
2013-05-07 16:52:39 -07:00
Ethan Lee
1a2ba7422c Implemented SDL_GL_SHARE_WITH_CURRENT_CONTEXT for Mac OS X. 2013-05-05 21:01:20 -04:00
Andreas Schiffler
4ec8d70ca1 Add input validation to SDL_CalculateGammaRamp; add test coverage to Pixels suite; update test cases in Pixels suite 2013-05-05 11:17:40 -07:00
Philipp Wiesemann
023c495919 Fixed SDL_HasScreenKeyboardSupport() returning SDL_TRUE for PSP.
There is currently no implementation and therefore no support.
2013-05-05 15:39:37 +02:00
Andreas Schiffler
28d45cd955 Added additional input validation to SDL_AllocPalette; added error codes; added test case to Pixels suite for coverage 2013-05-04 09:11:18 -07:00
Sam Lantinga
866f2e5f9e First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Kevin Shanahan
0a3ab9190b Fix compile on Xcode 3.1 PPC + Altivec
-faltivec is given on the command line, so #include <altivec.h> is ignored in
this case and #undef'ing vector causes compile to fail.
2013-05-03 14:11:41 +09:30
Edward Rudd
33660e58c1 move Ticks initialization tracking to separate function and ensure it's called with SDL_VideoInit is called to init SDL instead of SDL_Init
-- why do we even allow initialization w/o calling at least SDL_Init(0) ?
2013-05-02 21:40:59 -04:00
Philipp Wiesemann
0e9ba88315 Removed SDL prefix from internal function pointers for screen keyboard access. 2013-05-02 23:12:03 +02:00
Philipp Wiesemann
b23a53205a Corrected spelling in C source file. 2013-04-29 23:45:40 +02:00
Philipp Wiesemann
dc6e420626 Replaces tabs with four spaces in C source file. 2013-04-27 13:55:47 +02:00
Jørgen P. Tjernø
9e4a519493 Mac: Fix relative mode message after gaining focus.
This fixes a bug where relative mode would give a large jump if the
cursor was moved when the app doesn't have focus.

--HG--
extra : histedit_source : ff1b20a9e7f6e079c073c4ef761566b6c80b0f22%2C9879c6c838c69afea4aa2be80cbe137054600d12
2013-04-25 18:40:29 -07:00
Jørgen P. Tjernø
22358fddd1 Mac: Don't supress mousemoves after warp.
By default, synthesizing events supresses real events for a quarter
second. This makes for some wonky behavior.

--HG--
extra : histedit_source : 769156e3eba77c601de006c5aad1cdc1febe1d6c
2013-04-25 18:40:22 -07:00
Jørgen P. Tjernø
51619c5485 Don't warp mouse on focus lost.
This isn't working great, so undo it until we can fix it properly to save /
restore mouse positions.

--HG--
extra : histedit_source : d8fe81a1690bd9406df132c325c8dd7c61baec29%2C2243b548ccaec444b2e4bdab04ba67cdf236c4fb
2013-04-25 18:40:31 -07:00
Edward Rudd
42b825029c Allow disabling SDL_IPHONE_KEYBOARD in iOS builds 2013-04-25 18:05:08 -04:00
Ryan C. Gordon
83e561b48c Removed Cocoa OpenGL optimization that was probably good advice 10 years ago. 2013-04-24 23:11:48 -04:00
Jørgen P. Tjernø
d8ef30ac34 Move cursor into window when enabling relative mode or gaining focus in relative mode.
This prevents wonky behavior where the clicks won't go to the window
because the cursor was outside it when we enabled relative mode.
2013-04-24 12:20:51 -07:00
Jørgen P. Tjernø
238eacc409 Mac: Update mouse position on warp. 2013-04-24 12:20:48 -07:00
Gabriel Jacobo
8836a99081 Bug 1787 - memory leak in WIN_InitMouse() by Marcel Bakker 2013-04-24 12:22:08 -03:00
Gabriel Jacobo
742233249a Bug 1786 - memory leak in WIN_GetDisplayModes by Marcel Bakker 2013-04-24 11:49:52 -03:00
Jørgen P. Tjernø
7d048468d3 Mac: Fix cursor not updating when re-focusing the window.
This fixes a bug where [NSCursor set] doesn't take when called in
certain event handlers (like windowDidBecomeKey:).

http://bugzilla.libsdl.org/show_bug.cgi?id=1795

--HG--
extra : histedit_source : 3f150addd3b1b7bc6397aba60ccf05f9065ffb8c
2013-04-23 18:47:44 -07:00
Jørgen P. Tjernø
059ea2c1c6 Mac: Fix unmatched hide/show cursor calls.
This tracks the previous hide/unhide state of the cursor, so we don't
re-hide a hidden cursor.

--HG--
extra : histedit_source : d41e30a604fb9ff0da8fcfdd9ca926618e35c750
2013-04-23 18:47:41 -07:00
Jørgen P. Tjernø
4f88e70fe6 Mac: Make mouse movement smooth at edge of window when grabbed.
There's a limit of one update every 250ms when warping the mouse, and we
can work around that by disassociating the cursor & the mouse before
issuing our warp, then re-associating them.

--HG--
extra : histedit_source : 91ddf6078107ea9faf1c769a459e99bce6e61180
2013-04-23 18:47:38 -07:00
Jørgen P. Tjernø
694ebd59a3 Make sure to send MOUSEMOTION on window enter.
This should hopefully fix bug #1612. We now send mousemotion events when
the cursor enters the window as well as when it leaves.

Thanks to Alex Szpakowski for the fix.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1612

--HG--
extra : histedit_source : e89e8952efcc07da98a306757edeaeded31517a9
2013-04-23 18:47:32 -07:00
Jørgen P. Tjernø
187143d618 SDL_GL_DeleteContext would leave an invalid current_glctx.
Calling SDL_GL_DeleteContext wouldn't update current_glctx, so you could
end up with use-after-free and other goodies when you deleted a context.
2013-04-22 18:15:08 -07:00
Jørgen P. Tjernø
5a4c9c40f2 Forgot to add this file to Mac crash fix. 2013-04-22 18:15:00 -07:00
Jørgen P. Tjernø
f7032de060 Send mouse leave updates for Windows and X11.
We now generate a final SDL_MOUSEMOTION before the cursor leaves the
window, followed by a SDL_WINDOWEVENT_LEAVE.
2013-04-22 18:14:55 -07:00
Jørgen P. Tjernø
c7fb60a46b Make Cocoa_ShowMessageBox work in background threads. 2013-04-22 18:14:32 -07:00