Commit Graph

6311 Commits

Author SHA1 Message Date
Sam Lantinga
b93ff3b6ef Fixed the name of the environment variable to match the name of the hint. 2013-09-27 23:19:22 -07:00
Edward Rudd
fab88c0df2 add in High DPI support (aka Retina)
- based on Jørgen's patch with a few bug fixes
2013-09-20 13:43:00 -04:00
Sam Lantinga
2ce681a1a7 Default to OpenGL ES 2.0 instead of 1.0 when it's available. 2013-09-27 22:09:51 -07:00
Sam Lantinga
868e2201db Fixed syntax error in C style block comment. 2013-09-14 11:25:52 -07:00
Ryan C. Gordon
6b60bb7ad5 Don't incorrectly report success for negative swap intervals on Mac OS X. 2013-09-14 01:30:57 -04:00
Sam Lantinga
c1a125c267 Added SDL_Direct3D9GetAdapterIndex(), which returns the adapter index you would pass into CreateDevice to get your device on the right monitor in full screen mode. This fixes the default adapter in SDL_render_d3d.c, which means that tests will work fullscreen off the main monitor now.
CR: Sam
2013-09-13 17:42:46 -07:00
Sam Lantinga
a32cb2f92f Fix X11_RestoreWindow() and X11_RaiseWindow() to properly do window activation.
X11_RestoreWindow() had a call ordering problem that prevented activation, and X11_RaiseWindow() wasn't attempting activation. Windows and OS X both activate in these cases.

CR: saml
2013-09-13 17:42:38 -07:00
Sam Lantinga
c5bd664757 Mac: Translate Ctrl-Left click to right click. 2013-09-13 17:42:31 -07:00
Sam Lantinga
1763ab9b55 Mac: Turn off momentum-based scrolling. 2013-09-13 17:41:17 -07:00
Sam Lantinga
451e30f45f Mac: Fix cast warning. 2013-09-13 17:40:41 -07:00
pgriffais@spaceport
7a3c8f1213 [SDL] X11+GL: Allow Visual override for GL windows.
SDL provides an SDL_VIDEO_X11_VISUALID environment variable that lets you override
window visuals, but it wasn't being checked for OpenGL windows.

CR: Sam.
2013-09-10 18:25:13 -07:00
Ryan C. Gordon
4ec784c0d5 Workaround for compiling with /W4 warnings on Visual C++. 2013-09-07 13:57:20 -04:00
Ryan C. Gordon
19b1e1f53f Disable thread naming on Win64 for now.
We can't use _try/_except without the C runtime, and we can't use inline
 asm with the Win64 compiler. We'll need to move this to an .asm file or
 something later.
2013-09-07 13:47:14 -04:00
Sam Lantinga
fdf0494a0a Fixed bug 2090 - Some joystick inputs are delayed on FreeBSD
kikuchan

Some joysticks with high sampling rate need to be read() more fast,
otherwise it delay user inputs due to internal queue.
Especially, an app that issues SDL_PollEvent() not so frequent
2013-09-06 20:54:14 -07:00
Sam Lantinga
c7f635ec01 Fixed time comparison and explicitly delay 1 ms instead of an arbitrary scheduled time. 2013-09-06 20:45:08 -07:00
Jørgen P. Tjernø
10f5e37d2e Fix to buffer overrun in SDL_JoystickGetGUIDString(). 2013-09-05 15:49:57 -07:00
Sam Lantinga
0a093f4eea Fixed bug 2076 - OpenGL doesn't work with --disable-threads
stepik-777

Thread local storage is used to store current window and current opengl context. OpenGL worked before this changeset: 7596 (45e5c263c096)
2013-09-05 07:15:26 -07:00
Sam Lantinga
32810bdaa3 Fixed bug 2081 - Add name to SDL_Point structure
Dmitry Marakasov

Unlike SDL_Rect (typedef struct SDL_Rect {} SDL_Rect), SDL_Point (typedef struct {} SDL_Point) structure is unnamed. This feels inconsistent and makes it impossible to use forward declaration for SDL_Point, having to include whole SDL_rect.h instead.
2013-09-05 07:02:27 -07:00
Sam Lantinga
47b4f56927 Fixed bug 2082 - SDL stdlib implementation does not force upper case for %X format specifier
norfanin

When SDL_vsnprintf handles the %x format specifier, a boolean is set to signal forced lower case. It also should be able to signal forced upper case for the %X specifier. A boolean is not sufficient anymore. The attached patch adds an enum for the three cases: lower, upper and no change.
2013-09-05 06:59:34 -07:00
Sam Lantinga
d7850de4ad Fixed bug 2084 - SDL_log xxx on Android outputs to Logcat with incorrect priority.
Pallav Nawani

This effects all SDL_Logxxx functions. On android, the debug output has a priority that is 1 higher than intended, ie, if you try SDL_LogInfo, the log has the priority of Warn instead.
2013-09-05 06:43:34 -07:00
Ryan C. Gordon
4e510b3a87 The SDL_PixelFormat* passed to SDL_ConvertSurface() should be const. 2013-09-04 23:40:11 -04:00
Ryan C. Gordon
314ecabd38 Enabled thread naming on Windows.
This is now done without compiler or C runtime support for __try/__except.

(Granted, it uses Visual Studio-style inline asm, but still...)
2013-08-31 01:36:38 -04:00
Gabriel Jacobo
6b6b23633c Fixes bug #2040, prepare SDL_GL_CONTEXT_EGL for deprecation on v2.1
SDL_GL_CONTEXT_EGL = 1 is now internally treated as profile_mask = SDL_GL_CONTEXT_PROFILE_ES
2013-08-29 15:02:32 -03:00
Gabriel Jacobo
eefc8fdad1 Fixes bug #2074 - Thanks Sylvain!
SDL_syssem.c:159 comparison of unsigned expression >= 0 is always true
Solved by comparing unsigneds directly

SDL_systimer.c:164: warning: control may reach end of Compile
Solved by returning the default value if all else fails.

SDL_androidgl.c:41:1: warning: type specifier missing, defaults to 'int'
SDL_androidgl.c:47:1: warning: control reaches end of non-void function
Solved by adding void return type to the function implementation
2013-08-29 14:03:44 -03:00
Sam Lantinga
da23163fbc Christoph Mallon: Replace strlen(x) == 0 (O(n)) by x[0] == '\0' (O(1)). 2013-08-29 08:30:21 -07:00
Sam Lantinga
6d9d4b6eba Christoph Mallon: Remove pointless if (x) before SDL_FreeSurface(x) 2013-08-29 08:29:51 -07:00
Sam Lantinga
753aae78fc Christoph Mallon: Remove pointless if (x) before SDL_free(x) 2013-08-29 08:29:21 -07:00
Sam Lantinga
79bc5ff6ac Christoph Mallon: Correct indendation. 2013-08-29 08:27:25 -07:00
Sam Lantinga
e5bdcdce26 Christoph Mallon: Use SDL_arraysize() 2013-08-29 08:26:55 -07:00
Sam Lantinga
46659d953c Christoph Mallon: Simplify assignment. 2013-08-29 08:26:24 -07:00
Sam Lantinga
8f70297c38 Christoph Mallon: Report an error, if creating the directories in SDL_GetPrefPath() failed. 2013-08-29 08:25:54 -07:00
Sam Lantinga
3a2343d106 Christoph Mallon: Remove lone /* if */ comment. 2013-08-29 08:25:24 -07:00
Sam Lantinga
1f0046b99f Christoph Mallon: Simplify avoidance of duplicate / in SDL_GetPrefPath() 2013-08-29 08:24:43 -07:00
Ryan C. Gordon
1e3a064b1f Change order we enumerate Windows joysticks.
Make it so XInput devices are listed before DirectInput devices, and that the XInput
 devices are sorted by userid in ascending numeric order (so device 0 comes first).
2013-08-28 22:09:17 -04:00
Ryan C. Gordon
3d31c4ae53 Don't corrupt XInput device state during SDL_SYS_JoystickClose(). 2013-08-28 22:07:54 -04:00
Ryan C. Gordon
5c4541e9bc Fix endlines for logging via OutputDebugString(). 2013-08-28 22:05:16 -04:00
Ryan C. Gordon
39a1eb3f22 Make XInput joystick names match the numbers on the device.
(And how the Haptic code already names them.)
2013-08-28 17:17:21 -04:00
Ryan C. Gordon
efb67d6fdc Fixed comment typo. 2013-08-28 17:12:07 -04:00
Ryan C. Gordon
2291afc34f Reworked XInput and DirectInput joystick code.
Now multiple XInput controllers map correctly to device indexes instead of grabbing
the first available userid, and are completely separated out from DirectInput.

Also, the hardcoded limitation on number of DirectInput devices is gone. I don't
expect there to really ever be more than eight joysticks plugged into a machine, but
it was a leftover limitation for a static array we didn't actually use anymore.

Fixes Bugzilla #1984. (etc?)
2013-08-28 16:43:47 -04:00
Ryan C. Gordon
358ea2ddfe Better XInput detection code for DirectInput device enumeration.
This code is way faster than the Wbem code, and less ugly.
2013-08-28 16:35:32 -04:00
Ryan C. Gordon
6812b6f714 Fixed testgamecontroller output to make sense. 2013-08-28 00:07:02 -04:00
Gabriel Jacobo
5544eb2cb0 [Linux] Test config script: Add the X11 library search path if it is not empty
If ac_x_libraries is empty it means that the library's found in the default path,
so we skip adding it to the XLIB variable as it screws up the search path.
2013-08-28 12:43:29 -03:00
Gabriel Jacobo
795ba9047e Fixes test building 2013-08-28 10:41:25 -03:00
Gabriel Jacobo
bf23f88256 Fixes typo in EGL code (thanks jmcfarlane!) 2013-08-26 14:23:18 -03:00
Ryan C. Gordon
811051ecaa Removed obvious comment to trigger buildbot. 2013-08-25 21:28:03 -04:00
Edward Rudd
02e78e6604 reworked GetBasePath on OS X to use Contents/Resource by default if bundled, or exedir if not bundled.
- also adds OS X specific magic for bundled apps adding an Info.plist property of name SDL_FILESYSTEM_BASE_DIR_TYPE to the following values will change the bahaviour.
* bundle -- use the bundle directory e.g. "/Applications/MyGame/Blah.app/"
* parent -- use the bundle parent directory e.g. "/Applications/MyGame/"
* resource -- use the bundle resource directory (default) e.g. "/Applications/MyGame/Blah.app/Contents/Resources/"
2013-08-25 11:24:01 -04:00
Edward Rudd
268f60ac49 update xcode projects with filesystem API bits. (missing tests and missing from files from some targets) 2013-08-25 11:20:14 -04:00
Gabriel Jacobo
1960a11679 Fixes "error: conflicting types for 'GLintptr'" 2013-08-25 11:48:49 -03:00
Ryan C. Gordon
a9e59a9c1c Minor FreeBSD code cleanup. 2013-08-24 21:15:10 -04:00
Edward Rudd
c95bbc9ce2 make the examples in the doc comments match the actual output of the SDL_GetPrefPath function 2013-08-24 09:43:14 -04:00