Commit Graph

6794 Commits

Author SHA1 Message Date
Sam Lantinga
3a66c3ccbc Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values
Alex Szpakowski

On my Mac OS X system (10.9.1), the SDL_MOUSEWHEEL event reports negative X values when my trackpad scrolls to the right, and positive X values when my trackpad scrolls to the left. This is backwards from what I'd expect, and I don't think it matches the Windows wheel events.

The vertical scroll values are what I'd expect though, and are consistent what gets reported on Windows (positive Y for scrolling up, negative Y for scrolling down.)

This is with "scroll direction: natural" disabled in the OS X trackpad settings (i.e. my scroll direction in non-SDL OS X programs matches what happens in Windows and Linux.)

I also tested with the horizontal scroll on a real mouse (Logitech G500 without custom drivers), and the horizontal scroll values in SDL are still flipped.

I "solved" the issue for myself by changing this line in the Cocoa_HandleMouseWheel function:

    float x = [event deltaX];

to this:

    float x = -[event deltaX];

I believe it should work fine with that change - I found something similar in another codebase while looking online for my issue - but I haven't tested on anything below Mac OS 10.8.
2014-02-22 14:57:12 -08:00
Sam Lantinga
3f171c3331 Thou shalt not use more than 4k local variables in this code. 2014-02-22 10:40:12 -08:00
Ryan C. Gordon
3a6f999419 Reworked Mac OS X joystick code to use the 10.5+ HID Manager API.
Besides being a little more simple to use than the earlier IOKit HID API, and
 less likely to be deprecated, it also has the added benefit of working with
 the Sony DualShock 4 controller in Bluetooth mode out of the box, whereas
 the previous API has a bug that makes it report bad data for the
 controller.

Cleaned up several other things in this code, having gone over every line of
 it. The remaining deprecated calls are also gone.
2014-02-22 00:55:28 -05:00
Gabriel Jacobo
27d5a7e400 Fixes #2326, clean up the X11 backend a bit 2014-02-21 08:37:57 -03:00
Sam Lantinga
634b16cfd6 Fixed infinite recursion in D3D_Reset() 2014-02-20 21:07:56 -08:00
Gabriel Jacobo
e739e95fd9 Fixes #2408, VS2013: several projects of release build are not built
Patch by Hiroyuki Iwatsuki
2014-02-20 17:03:55 -03:00
Gabriel Jacobo
16abbefb81 Improve testgles2 exit behavior (useful on Android) 2014-02-20 16:12:11 -03:00
Gabriel Jacobo
770dd95100 Fixes #2403, add SDL2 dependency to testgles2 (thanks Hiroyuki Iwatsuki) 2014-02-19 11:03:03 -03:00
Sam Lantinga
67c2c9e664 Fixed resetting the current render target if the D3D device is reset while using a non-default render target. 2014-02-17 22:20:33 -08:00
Ryan C. Gordon
35563d4298 s/iPhoneOS/iOS 2014-02-17 11:47:54 -05:00
Ryan C. Gordon
6495350741 Corrected battery percentage on iOS (thanks, Felix!).
Fixes Bugzilla #2397.
2014-02-17 11:46:23 -05:00
Philipp Wiesemann
c061c5613a Fixed documentation comments in SDL_hints.h file. 2014-02-16 00:04:15 +01:00
Philipp Wiesemann
efd19efcf6 Changed text in documentation. 2014-02-15 23:57:38 +01:00
Philipp Wiesemann
2a06201c82 Corrected name of hint in README. 2014-02-15 23:52:04 +01:00
Sam Lantinga
2c962054ca Make sure we don't stay in the windows event loop forever if there are lots of events coming in quickly. 2014-02-14 11:39:58 -08:00
Sam Lantinga
7c529ab78b Fixed Mac PS4 controller entry, added Linux OUYA controller entry 2014-02-14 11:38:59 -08:00
Sam Lantinga
997f0c65d3 Added the new function at the end so we don't break the ABI 2014-02-13 11:08:12 -08:00
Sam Lantinga
adf7311ba7 Back out changelist 1951976 2014-02-13 11:05:34 -08:00
Sam Lantinga
5e96712fb1 Back out changelist 2026006 2014-02-13 11:05:32 -08:00
Sam Lantinga
38e55d5f40 Added SDL_DXGIGetOutputInfo which returns the adapter and output indices that are used to create DX10 and DX11 devices and swap chains on a particular display.
CR: SamL
2014-02-13 11:05:30 -08:00
Sam Lantinga
3adb37518a Fixed lost mouse button when in relative mouse warp mode and you click on the title bar, entering a modal move/resize loop.
Testing:
* Set the SDL_HINT_MOUSE_RELATIVE_MODE_WARP hint true, run testsprite2, press Ctrl-R to enter relative mode, alt tab away from the window, then click on the title bar of the window. Didn't get the mouse button release before, and we do now.

CR: Yahn + Alfred
2014-02-13 11:05:28 -08:00
Sam Lantinga
eb44f69490 As part of Jorgen's code review of this function I added a call to LoadLibrary so the refcounts would be consistent between Windows and Posix. Then I forgot to include the check that the thing was actually loaded and caused it to be loaded all the time. Oops.
CR: AaronL
2014-02-13 11:05:26 -08:00
Sam Lantinga
18a7c93e52 Added SDL_GetLoadedModule to do the equivalent of GetModuleHandle/dlload(NOLOAD)
CR: Jorgen
2014-02-13 11:05:24 -08:00
Gabriel Jacobo
6438cb2372 Try to work around Android's handling of static variables in terminated apps
Android, we want to love you, but you don't make it easy for us...
2014-02-12 18:12:14 -03:00
Sam Lantinga
21707536ae Fixed crash if render target textures are used while the device is lost 2014-02-10 13:40:02 -08:00
Sam Lantinga
bac409c888 Recreate render target textures when the D3D device is being reset, and notify the application using the SDL_RENDER_TARGETS_RESET event when this happens. 2014-02-10 10:02:51 -08:00
Sam Lantinga
e987abc343 Exposed the font character size and SDLTest_DrawCharacter() to make it easier to do custom debug text layout 2014-02-10 10:02:42 -08:00
Sam Lantinga
825261c067 Fixed bug where a window created fullscreen and hidden would get activated and "shown" but never actually be visible.
This is the case with the Steam In-Home Streaming client.
2014-02-10 10:02:18 -08:00
Ryan C. Gordon
12a80abc41 Fixed DualShock 4 controller config on Mac OS X. 2014-02-10 12:47:26 -05:00
Edward Rudd
b45413975a Fix Cmake so generated SOname matches autoconf's #. 2014-02-10 10:53:02 -05:00
Ryan C. Gordon
e450b2f9d9 Make controllermap, etc, work on platforms with hardcoded window sizes.
This makes sure everything renders correctly, even if, say, an Android device
gives you a certain "window" size no matter what you ask for.
2014-02-10 11:29:48 -05:00
Gabriel Jacobo
acd58f19d8 Backed out 51935d107921
The render target usage in controllermap is required if you are forced to use
the app at a different resolution than the one the art has been made for, for
example on Android, where you don't control the resolution.
(The coordinates for each button are hardcoded to the art size, and appear out
of place otherwise)
2014-02-10 09:26:22 -03:00
Ryan C. Gordon
802397a171 Removed unused function. 2014-02-10 01:43:01 -05:00
Ryan C. Gordon
c18be74a8e Replace testgamecontroller visualization mode with something more useful. 2014-02-10 01:41:58 -05:00
Ryan C. Gordon
87dd51b115 No need to use a render target here. 2014-02-09 15:20:41 -05:00
Sam Lantinga
1af9aa0b1e Updated SDL to version 2.0.2 2014-02-09 03:09:56 -08:00
Sam Lantinga
4cc159d3f4 Fixed the OUYA controller mapping on Windows 2014-02-09 03:09:04 -08:00
Sam Lantinga
45399df5d0 Added Windows entry for the bluetooth OUYA controller 2014-02-09 02:42:59 -08:00
Sam Lantinga
808c05198c Possibly fixed bug 2250 - Cmake: SDL2 Doesn't install DLLs on Windows
ernest.lee

[Exec] CMake Error at cmake_install.cmake:151 (FILE):
[13:37:43][Exec]   file INSTALL cannot find
[13:37:43][Exec]   "C:/TeamCity/buildAgent/work/2e3d17a492e75daf/Build/libSDL2.so".

The cmake INSTALL project doesn't work because it uses Linux so shared library paths. Windows uses dlls and I think cygwin also uses dlls. I've included this patch. Can you check if it works?
2014-02-09 02:04:40 -08:00
Sam Lantinga
10deb7fb9f Fixed bug 2385 - error: unknown type name 'IDirect3DDevice9'
Sandu Liviu Catalin

I'm unable to compile the latest SDL (directly from the repository) even though I disabled every DirectX option since I don't need DirectX.

I allways het these errors:
D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1897:1: error: unknown type name 'IDirect3DDevice9'
D:\DevLibs\SDL\src\render\direct3d\SDL_render_d3d.c:1898:25: error: unknown type name 'SDL_Renderer'
2014-02-09 01:56:41 -08:00
Sam Lantinga
96705398c1 Fixed bug 2354 - [ES 2.0] SDL_RenderClear clears render target with wrong color
ny00

SDL_RenderClear clears a render target with the wrong color, if the opengles2 renderer driver is used and the target texture's format is SDL_PIXELFORMAT_ARGB8888.

The bug is *not* reproduced if SDL_PIXELFORMAT_ABGR8888 is used as the texture format (the first from the renderer's list).
It is further not reproduced using any of the following renderer drivers: opengl, opengles (apparently powered by Gallium3D), software.
Finally, the correct color can be drawn using SDL_RenderFillRect (instead of SDL_RenderClear).

A few details about the current setup:
- OS: Ubuntu 12.04 for x86_64
- GPU: GeForce GTX 460
- GPU driver version: 331.20-0ubuntu1~xedgers~precise1 (from the xorg-edgers PPA)


---

Seth Williams

Sam,

It appears that the clear just needs to take the render target format into consideration.

Seth.
2014-02-09 01:49:01 -08:00
Ryan C. Gordon
aed28e46e6 Updated README-macosx.txt to note new minimum requirements, end of PowerPC. 2014-02-07 12:03:02 -05:00
Ryan C. Gordon
a18eec16cc Make non-Clang compilers happy. 2014-02-07 11:55:13 -05:00
Ryan C. Gordon
241fc337a8 Tell Clang's static analysis that SDL_assert() is an assertion handler.
This lets it know, for example, that when you do this...

    SDL_assert(ptr != NULL);

...that (ptr) is definitely not NULL at this point in the program, for the
sake of static analysis. While a buggy program could definitely trigger this
assertion, Clang assumes your assertion check is covering it and won't
report possible NULL dereferences after this point.

Since SDL_assert might continue if the user clicks "ignore", without this
change Clang would notice you checked for NULL (meaning that NULL is a real
possibility here) and still wrote code outside of that test branch that
dereferences the pointer, and thus would always trigger false positives.

Static analysis is fun!
2014-02-07 11:52:35 -05:00
Edward Rudd
ca1ebb24b6 slight adjustment to the hot plug test to allow it to be run with hap tics disabled 2014-02-07 09:35:33 -05:00
Edward Rudd
8c04aaf554 ignore hot plugs in mac haptic layer IF hap tics hasn't been initialized. 2014-02-07 09:35:13 -05:00
Ryan C. Gordon
e7c7bbcd8d Added DualShock 4 game controller config for Windows, Mac, and Linux. 2014-02-06 21:28:11 -05:00
Ryan C. Gordon
326bcf7cef Fixed crash on Windows if haptic isn't initialized when controllers are added. 2014-02-06 21:26:41 -05:00
Ryan C. Gordon
1e6f86ee52 Fixed a typo. 2014-02-06 10:00:45 -05:00
Edward Rudd
52bef1a3cf Fix device counting in HapticMouse and JoystickOpen routines. 0 is the first item in the list not the last 2014-02-06 09:35:44 -05:00