Commit Graph

3747 Commits

Author SHA1 Message Date
Philipp Wiesemann
49b3851430 Fixed SDL_RenderSetClipRect() returning undefined instead of -1 on error. 2013-05-04 22:44:03 +02:00
Andreas Schiffler
511dc6b8f0 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
7253832be1 First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Kevin Shanahan
80d6f659b2 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
908e617900 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
Edward Rudd
79ed7900ca add in OS X Monotonic clock as well as handling fall-back incase the OSX/Linux system doesn't have a monotonic clock.
Code curtesy of Thomas Habets ( https://github.com/ThomasHabets/monotonic_clock )
2013-05-02 21:17:59 -04:00
Sam Lantinga
570f6639eb QueryPerformanceCounter() is reliable these days, and setting the timer frequency higher can have adverse power consequences.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624%28v=vs.85%29.aspx
2013-05-02 16:54:03 -07:00
Philipp Wiesemann
70f0f362c8 Removed SDL prefix from internal function pointers for screen keyboard access. 2013-05-02 23:12:03 +02:00
Philipp Wiesemann
14b55479a2 Corrected spelling in C source files. 2013-05-01 11:59:54 +02:00
Philipp Wiesemann
85c137379b Corrected spelling in C source files. 2013-05-01 11:42:29 +02:00
Philipp Wiesemann
0be9414926 Fixed SDL_HapticQuery() returning -1 as unsigned int if device is not valid.
The function now returns 0 which is the same as if no effects were supported.
This may be confusing in rare situations but will not matter most of the time.
2013-05-01 11:32:05 +02:00
Philipp Wiesemann
f307a3299f Removed unused variables from C source files. 2013-04-29 23:54:22 +02:00
Philipp Wiesemann
b9dcadd158 Corrected confusing indentation in C source file. 2013-04-29 23:50:27 +02:00
Philipp Wiesemann
30f31e94b1 Corrected spelling in C source file. 2013-04-29 23:45:40 +02:00
Philipp Wiesemann
575d241367 Replaces tabs with four spaces in C source file. 2013-04-27 13:55:47 +02:00
Jørgen P. Tjernø
87f24bf111 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.
2013-04-25 18:40:29 -07:00
Jørgen P. Tjernø
7ae2238b0e Mac: Don't supress mousemoves after warp.
By default, synthesizing events supresses real events for a quarter
second. This makes for some wonky behavior.
2013-04-25 18:40:22 -07:00
Jørgen P. Tjernø
85b5d58990 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.
2013-04-25 18:40:31 -07:00
Edward Rudd
b64d74e6b6 Allow disabling SDL_IPHONE_KEYBOARD in iOS builds 2013-04-25 18:05:08 -04:00
Sam Lantinga
f8677d5c8d Fixed bug 1582 - Allow disabling SDL_VIDEO_DRIVER_WINDOWS
Marcus von Appen

Trying to build SDL 2.x (HG) on Win32 platforms with either VS.NET or MinGW requires one to have the video subsystem and SDL_VIDEO_DRIVER_WINDOWS flag enabled due to the helper window creation routines.

The attached patch changes the helper window creation behaviour, so that one can build SDL2 without the video subsystem or Windows video drivers on Win32 platforms.
2013-04-25 00:26:17 -07:00
Sam Lantinga
c1bfee0f2d Fixed bug 1583 - Fix build for disabled SDL render subsystem
Marcus von Appen

If one wants to disable the SDL render subsystem, the build breaks on several platforms due to an empty render_drivers array in SDL_render.c.
2013-04-25 00:15:09 -07:00
Ryan C. Gordon
811286bf4b Removed Cocoa OpenGL optimization that was probably good advice 10 years ago. 2013-04-24 23:11:48 -04:00
Jørgen P. Tjernø
a792805ab4 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ø
e60980d899 Mac: Update mouse position on warp. 2013-04-24 12:20:48 -07:00
Jørgen P. Tjernø
01c74a11b7 Add SDL_GetDefaultCursor.
This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1798
Thanks to Alex Szpakowski for suggestion & patch.
2013-04-24 10:42:44 -07:00
Gabriel Jacobo
4d4ca3186f Bug 1787 - memory leak in WIN_InitMouse() by Marcel Bakker 2013-04-24 12:22:08 -03:00
Gabriel Jacobo
debca5dd7d Bug 1786 - memory leak in WIN_GetDisplayModes by Marcel Bakker 2013-04-24 11:49:52 -03:00
Jørgen P. Tjernø
d35ddf266b 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
2013-04-23 18:47:44 -07:00
Jørgen P. Tjernø
c62b60671d 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.
2013-04-23 18:47:41 -07:00
Jørgen P. Tjernø
733eb53c6f 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.
2013-04-23 18:47:38 -07:00
Jørgen P. Tjernø
f23a05cdee 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
2013-04-23 18:47:32 -07:00
Gabriel Jacobo
de33c6164e Fixes PSP_DestroyTexture release of data (don't release the SDL_Texture pointer) 2013-04-23 16:54:52 -03:00
Gabriel Jacobo
d1ec7f2e3c Moved warning about SDL_AndroidGetActivity to SDL_system.h 2013-04-23 16:44:54 -03:00
Jørgen P. Tjernø
abb960c20a Add multimon & mouse tracking info to SDL_test_common. 2013-04-22 18:15:10 -07:00
Jørgen P. Tjernø
a228e5242a 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ø
cc1860f252 Forgot to add this file to Mac crash fix. 2013-04-22 18:15:00 -07:00
Jørgen P. Tjernø
119316f54a 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ø
f448a8ba7c Make Cocoa_ShowMessageBox work in background threads. 2013-04-22 18:14:32 -07:00
Jørgen P. Tjernø
80ce87f3a1 Fix Mac crash when creating fullscreen window introduced in 9d43403e9fc5.
makeKeyAndOrderFront: was sending three KVO transitions for isVisible,
for false -> true, true -> false, and then false -> true. This was
causing an infinite recursion.

We now suspend monitoring of the KVO before makeKeyAndOrderFront, then
resume afterwards and send any changes in isVisible's state.
2013-04-22 18:14:26 -07:00
VALVE\alfred@alfredlinux.valvesoftware.com
f8eb6524ec - make sure to send a joy removed event even if the joystick wasn't opened under OSX 2013-04-22 15:24:35 -07:00
Jørgen P. Tjernø
32c9eef670 Mac no longer loses OpenGL context when window is hidden.
This fixes an issue that would arise when you minimize / order out an
OpenGL window on Mac, where the window would lose it's window device.
Without a window device, you cannot render to the window.

It does so by making two changes:
  - Windows are no longer "oneShot" (which caused their window device to
    get destroyed when they're minified or ordered out)
  - Windows are no longer "deferred" (which caused the OS to defer
    window device creation until the window is shown, which meant that
    we couldn't properly makeCurrent to it)

Thanks to http://www.mikeash.com/pyblog/nsopenglcontext-and-one-shot.html
2013-04-22 12:07:16 -07:00
Jørgen P. Tjernø
0a2d80b427 Properly reflect hidden/shown windows on OSX.
This fixes a bug where windows would always be considered to be in the
shown/hidden state they were originally created in.
2013-04-22 12:07:13 -07:00
Gabriel Jacobo
188bcf698a Fixes #1815, don't release the LocalRef returned by SDL_AndroidGetActivity 2013-04-22 11:18:45 -03:00
David Ludwig
95a3bba282 future-proofing for Microsoft's C++/CX extensions, whereby "generic" is a reserved keyword 2013-04-20 23:05:08 -04:00
Jørgen P. Tjernø
84b7ed93dc Fix overflow in recent gamecontroller trigger change. 2013-04-19 16:02:16 -07:00
Jørgen P. Tjernø
2a4188c11f Make gamecontroller triggers have values in 0 - 32767.
This changes the old behavior of having values in the -32768 - 32767
range, like regular joystick axis. Now "button as axis" triggers (like
on Logitech controllers) and regular axis triggers (like on Xbox
controllers) have the same resting value, 0.
2013-04-19 10:51:21 -07:00
Ryan C. Gordon
8cc072db1b Fixed using the event queue lock before the mutex was created.
This has the benefit of ending the otherwise-bogus complaints that
 SDL_GetError() reports "Passed a NULL mutex" if you call it instead of
 checking if SDL_CreateWindow() actually succeeded.  :)
2013-04-19 11:58:38 -04:00
Ryan C. Gordon
295c17e99b Don't use glDisable(GL_TEXTURE_2D) in GLES2 renderer.
Fixes Bugzilla #1799.
2013-04-17 11:45:50 -04:00
Andreas Schiffler
4e8c854aab Fix bug 1789: SDL_IntersectRect intersection with empty rect does not set result to empty; add test coverage to Rect suite 2013-04-17 08:09:11 -07:00
Andreas Schiffler
fc589bd617 Fix bug 1764: incorrect variable assignment in RenderDrawLinesWithRects 2013-04-17 07:35:30 -07:00