Commit graph

5871 commits

Author SHA1 Message Date
Philipp Wiesemann
f54e7cdaa8 Fixed Android Lint warning in AndroidManifest.xml.
If targetSdkVersion not set it becomes same as minSdkVersion and causes warning.
2013-06-09 11:51:59 +02:00
Sam Lantinga
d8de838dfe Updated configure 2013-06-07 21:50:29 -07:00
Sam Lantinga
b7c62a83d9 Improved find_lib, gets the latest version of libpng, etc. 2013-06-07 21:47:23 -07:00
Sam Lantinga
4c59063d54 Check for well known XInput device GUIDs before enumerating the device list. 2013-06-07 18:26:55 -07:00
Sam Lantinga
80917f1537 Removed redundant "Controller" names from gamepads, added mapping for Logitech F710 in DirectInput mode 2013-06-07 09:40:07 -07:00
Sam Lantinga
612ec5d29d Slightly more efficient to check the event type first 2013-06-07 09:39:10 -07:00
Sam Lantinga
7de1fa00ff It's better not to have the full range of the axis (by 1 on the negative side) than turn 0 value into -1 2013-06-07 08:48:25 -07:00
Sam Lantinga
f26e1bc175 Fixed bug 1897 - CPU spike on Windows with WM_EVENT and OpenGL
buckyballreaction

On some Windows systems, when switching from fullscreen to windowed mode in my game, the CPU will spike and the application never shows the window again.

See the part of the e-mail thread here:

http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-June/088626.html

I change the window by calling:

SDL_SetWindowFullscreen(gScreenInfo.sdlWindow, SDL_FALSE);
SDL_SetWindowSize(gScreenInfo.sdlWindow, sdlWindowWidth, sdlWindowHeight);

which you can see in our source:

https://code.google.com/p/bitfighter/source/browse/zap/VideoSystem.cpp#377

Then all of a sudden the application gets stuck in WIN_PumpEvents() in SDL_windowsevents.c.  I turned on WMMSG_DEBUG and found that there was an endless stream of WM_EVENT messages.  I also found that where WM_PAINT is being handled in the callback WIN_WindowProc(), ValidateRect is somehow not clearing, or it is persisting, the WM_EVENT message like it's supposed to (according to the docs).

This may be a hardware issue.  The issue has appeared on three different systems, one of them sporadically:
 - Windows XP SP3 running in VMware 9.0 (without VMWare 3D acceleration, but with the tools and drivers installed), Host: openSUSE 12.3 x86_64, NVidia NVS 3100M
 - Windows XP SP3 64bit running in VirtualBox, Host: Debian Wheezy (stable), Mobility Radeon HD 4100 (this was the sporadic one)
 - Windows 7 64 bit, Radeon 6770
2013-06-06 23:18:36 -07:00
Sam Lantinga
6879bf00c4 Fixed crash trying to get the GUID of an invalid joystick index 2013-06-06 18:20:06 -07:00
Sam Lantinga
0e48e3563b The triggers should be expanded out to the full range to match DirectInput behavior.
The game controller code will scale them back to 0 - 32767 when it converts the triggers axes.
2013-06-06 17:59:01 -07:00
Andreas Schiffler
a8d039c4fe Remove unnecessary debugger detection logic again from Win32 SDL_LogOutput 2013-06-06 07:25:41 -07:00
Sam Lantinga
7fe9747caf Fixed compiling iOS demos 2013-06-05 23:11:20 -07:00
Sam Lantinga
b95977a499 Removed obsolete testsdl target 2013-06-05 23:09:13 -07:00
Sam Lantinga
8e07b6b727 Fixed building tests on iOS 2013-06-05 22:56:42 -07:00
Sam Lantinga
199bed4801 Removed obsolete NoStdio configurations. 2013-06-05 22:35:13 -07:00
Sam Lantinga
b42b0c3e91 Added testautomation to the Visual Studio 2008 project. 2013-06-05 22:33:10 -07:00
Sam Lantinga
a14efd4af1 Fixed compile errors on iOS 2013-06-05 21:48:53 -07:00
Sam Lantinga
9f08f67e67 The jump hack is no longer used.
Cheers!
2013-06-05 21:47:49 -07:00
Sam Lantinga
eeffdf78ab Need to include SDL_main.h when we call SDL_main() 2013-06-05 21:38:54 -07:00
Sam Lantinga
5a85d1d29a This patch isn't needed because you have the window and can do [nswindow contentView] yourself.
I'm rolling this back so we minimize the things exposed that we have to keep consistent in the API.
2013-06-05 21:31:22 -07:00
Sam Lantinga
47f2eaf415 Added some extra protection to notify the developer if they haven't initialized the application properly.
This will help reduce issues like that reported in bug 1819:

Wouter van Oortmerssen 2013-04-23 20:12:07 EDT
#0  0x01d1e881 in __HALT ()
#1  0x01c58971 in _CFRuntimeCreateInstance ()
#2  0x02e4acc1 in GSFontCreateWithName ()
#3  0x00adc0e1 in UINewFont ()
#4  0x00adc24c in +[UIFont systemFontOfSize:traits:] ()
#5  0x00adc298 in +[UIFont systemFontOfSize:] ()
#6  0x009fb5d9 in +[UITextFieldLabel defaultFont] ()
#7  0x00a8ccd5 in -[UILabel _commonInit] ()
#8  0x00a8ce14 in -[UILabel initWithFrame:] ()
#9  0x00a052eb in -[UITextField createTextLabelWithTextColor:] ()
#10 0x009fbede in -[UITextField initWithFrame:] ()
#11 0x00152ead in -[SDL_uikitview initializeKeyboard] at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitview.m:208
#12 0x0015290c in -[SDL_uikitview initWithFrame:] at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitview.m:50
#13 0x00153b5b in -[SDL_uikitopenglview initWithFrame:scale:retainBacking:rBits:gBits:bBits:aBits:depthBits:stencilBits:majorVersion:] at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitopenglview.m:53
#14 0x001524ff in UIKit_GL_CreateContext at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitopengles.m:114
#15 0x0015078f in SDL_GL_CreateContext at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/SDL_video.c:2666
#16 0x000d8c5c in SDLInit(char const*, vec<int, 2>&) at /Users/aardappel/lobster/dev/xcode/lobster/../../src/sdlsystem.cpp:193
2013-06-05 21:23:59 -07:00
Sam Lantinga
8731286cb4 We already link SDL2_test by default now. 2013-06-05 21:14:26 -07:00
Jørgen P. Tjernø
e1e1fa3d61 Joystick: Only send joy events when focused.
This changes makes it so that you only receive joystick (and implicitly
gamecontroller) input events when your application has keyboard focus.
If you'd like to still receive events when your application is in the
background, set the SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint to "1".

This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1892
2013-06-05 15:11:38 -07:00
Philipp Wiesemann
c2d84dbad6 Fixed doxygen warnings and corrected documentation in header files. 2013-06-05 23:33:15 +02:00
Jørgen P. Tjernø
24fc22545b Mac: Fix invalid PS3 controller mapping.
PS3 controller had swapped D-Pad down & left buttons, as well as X & Y buttons.
Thanks to Alex Szpakowski for the bug report and fix.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1891
2013-06-05 12:48:44 -07:00
Jørgen P. Tjernø
df3b1a6ed1 Win32: Fix issue with SetCapture & negative values.
This fixes an issue where we were using the wrong macros to extract the position from WM_MOUSEMOVE, so negative values were behaving incorrectly.
These would be generated in multimon situations, or if you use SetCapture.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1175
2013-06-05 12:00:18 -07:00
Jørgen P. Tjernø
c6dd828f1e Win32: Ignore WM_MOUSELEAVE in relative mode.
We get an WM_MOUSELEAVE when we switch to relative mode, even though the cursor is still in the window.
Ignoring this event to not end up with a NULL mouse focus.

This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1861
2013-06-05 12:00:15 -07:00
Andreas Schiffler
6c06aefaf2 Update SDL_LogOutput for WIN32 so it writes to the console 2013-06-05 07:22:45 -07:00
Sam Lantinga
e569ac658f Updated configure with Ryan's cygwin workaround 2013-06-04 22:13:06 -07:00
Ryan C. Gordon
bc5b08c0fd Fixed build on newer Cygwin installs. 2013-06-05 00:42:39 -04:00
Jørgen P. Tjernø
f1fc414daa Mac: Fix incorrect relative jump on focus / start.
We should no longer send huge jumps on relative mode focus changes if
the cursor was moved around, or on initial start.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1836
2013-06-04 14:54:49 -07:00
Jørgen P. Tjernø
95cf57b19f Mac: Hide cursor in relative mode.
This hides the cursor when you SDL_SetRelativeMouseMode, as intended.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1860
2013-06-04 13:53:55 -07:00
Jørgen P. Tjernø
449d63452e - fix misleading hint about minimising on focus loss 2013-06-04 13:47:51 -07:00
Andreas Schiffler
5a7d3757f5 Add missing VS2012 test projects; update VS2010 and VS2012 solutions; update keybord suite for VS compiler warnings 2013-06-03 19:24:18 -07:00
Andreas Schiffler
3426ac11ad Remove deprecated/deleted VS test projects 2013-06-03 07:28:55 -07:00
Azamat H. Hackimov
1732f61b81 Fix compilation with libX11 >= 1.5.99.902.
These changes fixes bug #1769 for SDL2
(http://bugzilla.libsdl.org/show_bug.cgi?id=1769).
2013-06-02 20:20:18 +06:00
Sam Lantinga
86b3564df2 Hopefully fixed mingw32 build 2013-06-02 08:48:52 -07:00
Philipp Wiesemann
579a0da656 Changed documentation in header because LocalReferenceHolder not public API. 2013-06-02 14:27:54 +02:00
Philipp Wiesemann
5966837f4a Changed haptic test program to use announced effect type. 2013-06-02 14:18:26 +02:00
Philipp Wiesemann
663e2c37ae Fixed implicit function declaration for SDL_AndroidGetInternalStoragePath(). 2013-06-02 14:13:21 +02:00
Philipp Wiesemann
64f1ac9002 Fixed implicit function declaration and warning for SDL_Log(). 2013-06-02 14:11:04 +02:00
Sam Lantinga
cd88135edc Gyrations to get the code to compile with the latest version of mingw-w64 as well as Visual Studio.
I think in this case mingw-w64 is incorrect in defining the GUID instead of declaring it like Visual Studio and the older mingw32 compilers.
2013-06-02 01:35:38 -07:00
Sam Lantinga
d2a0d0fb58 Fixed bug 1881 - SDL will not compile with "SDL_THREADS" disabled.
MakoEnergy02

I am attempting to compile SDL on WindowsXP 32-bit, using MinGW.  The problem I am having is when I attempt to compile, when it gets to "SDL_systhread.c" it errors:

C:\Repos\Mezzanine\Mezzanine\libincludes\common\sdlsrc\SDL\src\thread\generic\SDL_systhread.c|29|error: conflicting types for 'SDL_SYS_CreateThread'
C:\Repos\Mezzanine\Mezzanine\libincludes\common\sdlsrc\SDL\src\thread\generic\..\SDL_systhread.h|35|note: previous declaration of 'SDL_SYS_CreateThread' was here

I do have SDL_THREADS disabled in my cmake configuration as I do not want or need SDL making threads for me, I have another thread provider.  It seems the generic "dummy" implementation does not account for the two extra parameters needed for the "SDL_SYS_CreateThread" method when "SDL_PASSED_BEGINTHREAD_ENDTHREAD" is defined.
2013-06-02 01:12:29 -07:00
Sam Lantinga
cb62e2540a Fixed bug 1882 - SDL_GetKeyboardState should return const.
Yuri K. Schlesner

The array returned by SDL_GetKeyboardState is also used internally by SDL to keep track of pressed/released keys and must not be modified, lest weird behaviour occurs. Because of this I believe it's return type should be changed to return a const pointer, which will provide a code indication of that fact.
2013-06-02 01:09:12 -07:00
Sam Lantinga
a54ea6ce9f Fixed testnative on Mac OS X, which no longer ships X11 by default. 2013-06-02 01:08:14 -07:00
Sam Lantinga
658c25666a Merged changes 2013-06-01 12:53:32 -07:00
Sam Lantinga
226679f4bb The standard fat gcc scripts work well with SDL 2.0 2013-06-01 12:53:06 -07: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
Philipp Wiesemann
17fab0296b Corrected indentation of license. 2013-06-01 21:09:36 +02:00