Commit Graph

10682 Commits

Author SHA1 Message Date
David Gow
f5777f9c53 Remove full-desktop Xinerama mode when using XRandR 2013-06-25 21:36:36 +08:00
Sam Lantinga
e6a7f560a0 Make it possible to use SDL events separately from the video subsystem. 2013-07-06 12:28:57 -07:00
Sam Lantinga
c3b234be1b Updated the README to match the new website text 2013-07-06 11:56:04 -07:00
Gabriel Jacobo
fe40941788 Fixes Bug 1896 - Android app is running while the screen is locked
Original patch by ny00@outlook.com
2013-07-06 15:22:49 -03:00
Philipp Wiesemann
1a101f252b Fixed SDL's implementation of isspace() to check form feed and vertical tab. 2013-07-06 16:05:09 +02:00
Philipp Wiesemann
6e19ab3aaf Added missing call to SDL_stack_free(). 2013-07-06 15:56:06 +02:00
Sam Lantinga
00b7934f8f Fixed potential problem with postFinishLaunch being overridden by the application.
Vittorio Giovara

I find that the calling point in SDL_uikitappdelegate.m is dangerous as the -(void) postFinishLaunch method can be overridden when subclassing.
Could this be moved in inside the init or in the didFinishLaunchingWithOptions method which are always called even when subclassed?
2013-07-06 00:32:20 -07:00
Sam Lantinga
266b3c869f Fixed bug 1936 - Broken URL in generic SDL_syscond.c
cp.ml.x.dev

A comment in 'src/thread/generic/SDL_syscond.c' references the URL 'http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html', which cannot be resolved anymore. An alternative would be 'http://web.archive.org/web/20010914175514/http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html#Workshop'.
2013-07-06 00:28:54 -07:00
Sam Lantinga
4c4dbd43a4 Fixed mingw32 build 2013-07-06 00:15:01 -07:00
Sam Lantinga
719799241f Fixed build errors on Mac OS X 2013-07-06 00:06:44 -07:00
Sam Lantinga
69bede6d35 Removed the inline functions from SDL_stdinc.h
Having the SDL functions inline is causing build issues, and in the case of malloc(), etc. causing malloc/free mismatches, if the application build environment differs from the SDL build environment.

In the interest of safety and consistency, the functions will always be in the SDL library and will only be redirected to the C library there, if they are available.

See the following threads on the SDL mailing list for the gruesome details:
* SDL_stdinc.h inlines problematic when application not compiled in exact same feature environment
* Error compiling program against SDL2 with -std=c++11 g++ flag
2013-07-05 23:57:19 -07:00
Sam Lantinga
6aada55706 No, there's no reason not to use fprintf 2013-07-05 21:37:27 -07:00
Sam Lantinga
7ab71db55c Fixed detection of overlong sequences (thanks Tommy!) 2013-07-05 21:25:32 -07:00
Ryan C. Gordon
962e55a308 Patched to compile on pre-C99 compilers. 2013-07-05 01:31:02 -04:00
Ryan C. Gordon
81c892c83b Don't set the same GL context twice on Mac OS X (thanks, Alex!).
Fixes Bugzilla #1939.
2013-07-05 01:18:18 -04:00
Ryan C. Gordon
e749bdffe7 Fixed some __BEOS__ vs __HAIKU__ preprocessor tests (thanks, Axel!).
Fixes Bugzilla #1773.
2013-07-05 01:09:27 -04:00
Ryan C. Gordon
6ca14bb9d2 Don't crash if SDL_AudioQuit() is called twice in a row.
Fixes Bugzilla #1396.
2013-07-05 00:54:00 -04:00
Ryan C. Gordon
25283c7e99 Strip newlines from messages in SDL_Log*() before calling logging function. 2013-07-05 00:41:34 -04:00
Ryan C. Gordon
c5f0419216 Added a FIXME. 2013-07-05 00:41:01 -04:00
Ryan C. Gordon
79d7ea0d5d Don't close already-closed audio devices during SDL_Quit().
Otherwise, we spam a bunch of unnecessary SDL_SetError() calls.

Fixes Bugzilla #1791.
2013-07-05 00:30:23 -04:00
Sam Lantinga
10f2d9ded3 Added SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS to the documentation for the joystick and game controller APIs 2013-07-03 12:31:40 -07:00
Edward Rudd
c4fe4c4f29 add in alt+enter keyboard shortcut to test common to toggle fullscreen desktop 2013-06-04 12:02:18 -04:00
Sam Lantinga
722a61f8df Fixed the logical size for rendering to texture, thanks to Mason Wheeler.
Mason Wheeler

The SDL_RenderGetLogicalSize function should always return the amount of pixels that are currently available for rendering to.  But after updating to the latest SDL2, I started getting crashes because it was returning (0,0) as the logical size!  After a bit of debugging, I tracked it down to the following code in SDL_SetRenderTarget:

    if (texture) {
        renderer->viewport.x = 0;
        renderer->viewport.y = 0;
        renderer->viewport.w = texture->w;
        renderer->viewport.h = texture->h;
        renderer->scale.x = 1.0f;
        renderer->scale.y = 1.0f;
        renderer->logical_w = 0;
        renderer->logical_h = 0;
    }

This is obviously wrong; 0 is never the correct value for a valid renderer.  Those last two lines should read:

        renderer->logical_w = texture->w;
        renderer->logical_h = texture->h;
2013-06-29 14:40:55 -07:00
Philipp Wiesemann
e8d807b810 Changed paths and name of header file in text of VisualC.html. 2013-06-29 22:08:38 +02:00
Sam Lantinga
95bb9a77c4 Only check for keyboard focus if the video subsystem was initialized.
Check the hint at initialization time, as an optimization.  This isn't something we expect the application to change at runtime, and if it is we should add an API for it.
2013-06-28 23:29:13 -07:00
Sam Lantinga
920ab7e6bf Removing old dangerous signal catching code.
* None of the supported platforms are hosed if the program crashes without cleaning up the graphics display connection.
* It's very likely to be unsafe to call SDL_Quit() at an arbitrary point from an arbitrary thread.
* Catching signals can prevent applications from getting correct stack traces from crashes.
2013-06-28 22:49:03 -07:00
Sam Lantinga
822fa46bfe Not using SDLmain on Windows is just fine, don't fail the initialization if the program implements WinMain() and then doesn't call SDL_SetMainReady().
This broke Steam's Big Picture game controller support.

I also added some more documentation so people know why main() is overridden on various platforms.
2013-06-28 22:44:49 -07:00
Sam Lantinga
c70478c904 Added testgamecontroller to the Visual Studio 2012 solution. 2013-06-28 22:42:10 -07:00
Sam Lantinga
cee64ab8c3 Merged 2013-06-28 20:46:11 -07:00
Sam Lantinga
d85c0e33ad Merged 2013-06-28 09:53:13 -07:00
Sam Lantinga
7e741d0e51 Updated the name of the copyright file 2013-06-28 09:52:36 -07:00
Sam Lantinga
33c5279a16 Merged 2013-06-27 17:53:05 -07:00
Sam Lantinga
53b5fbb4b3 Whoops, this controller had already been added. 2013-06-27 17:49:22 -07:00
Jørgen P. Tjernø
ac9d81df00 Remove / update references to 1.2. 2013-06-27 17:07:24 -07:00
Jørgen P. Tjernø
3a4917404d sdl - added comment with URL to windows scancode definition document 2013-06-27 17:07:18 -07:00
Sam Lantinga
d553facd78 Added game controller support for an older XBox Controller 2013-06-27 16:32:45 -07:00
Sam Lantinga
70ad624d0f We don't want to save the alpha modulation, we want to save the blend mode. 2013-06-27 11:49:19 -07:00
Sam Lantinga
7248fa2fff Updated testshader for the SDL 2.0 API 2013-06-27 11:44:07 -07:00
Sam Lantinga
f212eb00a5 Fixed bug updating the clip rect for the software renderer 2013-06-27 11:27:19 -07:00
Sam Lantinga
7a56a51b0d Fixed bug: SDL2 Xinput joystick axis jumps from positive to negative
Franz Schrober

Attached is my patch. It ensures that the values are correctly limitted between -32767 and 32767 (otherwise the negator - and the conversion to sint16 would corrupt the result)

I am using Motioninjoy (Dualshock 3 Sixaxxis controller on Windows 7)  together with a recent SDL2 (post rc1) and noticed with the testjoystick binary that the axis 3 (left analog up/down) jumps when going in down direction from 32257 to -32768. This seems obviously wrong and I have never seen this before. In my games the people are now going backwards before they start to sprint forward when the player actually wants to run as fast as possible backwards. This also happens on the axis 2 (right analog stick up/down)

This problem doesn't happen in DX mode
2013-06-27 11:21:37 -07:00
Sam Lantinga
cfcc491b45 Fixed warning about unused variable. 2013-06-27 11:17:48 -07:00
Sam Lantinga
a212744e87 Fixed initializing the haptic system from an XInput joystick
Thanks to Franz Schrober for the fix inspiration.
2013-06-27 10:59:30 -07:00
Sam Lantinga
3fdc17618c Fixed bug 1929 - SDL_Texture* from SDL_CreateTexture() causes GL_BindTexture() to segfault
Charles Huber

If SDL_CreateTexture() takes the !IsSupportedFormat() path it will return a SDL_Texture* with a NULL driverdata member.

If you then SDL_GL_BindTexture() this will cause a segfault in GL_BindTexture() when it unconditionally dereferences driverdata.
2013-06-25 20:21:31 -07:00
Sam Lantinga
5caa6632ae Better text printing for UTF-8 characters 2013-06-24 22:06:50 -07:00
Sam Lantinga
924968d2d0 Updated timer test and fixed performance counter on Mac OS X 2013-06-23 22:19:38 -07:00
Andreas Schiffler
ff47b549bd Update testsprite2 for visual testing: user fuzzer and add --iteration parameter to enable deterministic screen end-state 2013-06-23 15:00:23 -07:00
Andreas Schiffler
94cfaee9d3 Add VS Express Edition sln files (drop the unsupported solution folders for tests); update VisualC documentation 2013-06-23 14:05:27 -07:00
Sam Lantinga
d6084c5b7a Fixed bug 1913 - state->index may get negative in SDL_wave.c file.
Nitz

In function:
static Sint32
IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble)
{
 const Sint32 max_audioval = ((1 << (16 - 1)) - 1);
    const Sint32 min_audioval = -(1 << (16 - 1));
    const int index_table[16] = {
        -1, -1, -1, -1,
        2, 4, 6, 8,
        -1, -1, -1, -1,
        2, 4, 6, 8
    };
    const Sint32 step_table[89] = {
        7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31,
        34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130,
        143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408,
        449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282,
        1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327,
        3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630,
        9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350,
        22385, 24623, 27086, 29794, 32767
    };
    Sint32 delta, step;

    /* Compute difference and new sample value */
    step = step_table[state->index];
    // Some Code
}

Here step_table array have the state->index, which might be negative, so it is unsafe to assign this index to step_table array directly.
There would be a check before that to confirm its value.
2013-06-18 00:50:35 -07:00
Sam Lantinga
13787068f8 Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Philipp Wiesemann

SDL_Keysym contains a deprecated field for unicode which may be removed for SDL 2.0 release.

As far as I can tell the field is not set on all "major" platforms and therefore will not be useful for most users. Its existence in a public header therefore becomes (in my opinion) only confusing.
2013-06-18 00:39:47 -07:00
Sam Lantinga
65098c013a Improved include paths for projects using SDL on Android
Isaac Burns

I wanted to suggest a few changes I've found that help the Android build.  By adding LOCAL_EXPORT_C_INCLUDES to the Android.mk file, anything that references the SDL Android project will inherit the include paths.
2013-06-17 07:14:20 -07:00