Commit graph

6192 commits

Author SHA1 Message Date
Sam Lantinga
e6e79353e8 Fixed bug 2024 - Update OSX Joystick code to fully support Saitek p2500 gamepad
Patrick Maloney

Saitek p2500 (Cyborg Rumble Force Pad) has a D-pad, two analog sticks, and numerous buttons.  SDL 2.x on OSX detected everything except the right-side analog stick.  The right-side stick is considered a 'simulation device' with the axes mapped to throttle and rudder.

The patch adds support for throttle and rudder on the HID simulation page.
2013-08-10 10:55:12 -07:00
Sam Lantinga
42c560b05d Check the return value of glGenTextures()
--HG--
extra : rebase_source : e079554f253890d862bfd5d51d7b229e3fcff3d9
2013-08-10 10:49:26 -07:00
Ryan C. Gordon
d4f386f5e3 Haptic: Let XInput update effects while they're still running. 2013-08-10 13:46:19 -04:00
Ryan C. Gordon
de6d6a5554 Removed no-longer-necessary comment. 2013-08-10 13:40:08 -04:00
Ryan C. Gordon
c35c4a6f18 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Ryan C. Gordon
24097af6ac Fixed some typos in the headers. 2013-08-10 13:20:45 -04:00
Sam Lantinga
aabc0fcc3b Added the Google Summer of Code students from 2010 2013-08-09 23:58:33 -07:00
Sam Lantinga
c4a3df6938 Updated the credits for SDL 2.0. Thank you everyone! 2013-08-09 23:43:14 -07:00
Sam Lantinga
9444c11e99 Fixed bug 2007 - SDL_SetWindowMinimumSize() not implemented on X11 (thanks Rainer!) 2013-08-09 23:13:52 -07:00
Sam Lantinga
bcee442188 Better wording suggested by the community 2013-08-09 21:09:49 -07:00
Andreas Schiffler
84e0884077 Update video_getSetWindowSize for windows 2013-08-08 22:10:00 -07:00
Andreas Schiffler
7067bff470 Fix Bug 2021: Win32: Stack overflow due to recursive SDL_LogOutput on SDL_LogError without console; fix off-by-one error in SDLtest test suite 2013-08-08 21:29:30 -07:00
Sam Lantinga
58eedbb27e Removed unneeded Android audio code 2013-08-08 21:16:29 -07:00
Gabriel Jacobo
610264fb0b Start Android Audio Thread after audio buffer and AudioTrack are ready.
Also, it starts the Audio Thread from the native side, putting the code in line
with other backends.
2013-08-08 21:25:09 -03:00
Ryan C. Gordon
98a222e974 SDL_RegisterEvents() now rejects requests for numevents <= 0.
--HG--
extra : rebase_source : b45e0465ab759f92595b8cb0cbcad22d429f27f7
2013-08-08 15:04:30 -07:00
Jørgen P. Tjernø
4f1c2fd2c3 Mac: Fix mouse tap on 10.5.
There's no Block support in the runtime on 10.5, so the old code
wouldn't work.
2013-08-08 13:29:44 -07:00
Ryan C. Gordon
f43141b289 Backed out changeset 3f487d7d2d1d
This breaks applications.
2013-08-08 13:22:21 -07:00
Ryan C. Gordon
f3280d289a Send the SDL_QUIT when last window is destroyed, not during its close event.
--HG--
extra : rebase_source : 1a30ff486e98282c7d6a05d64eea0c4f3e026c41
2013-08-08 12:49:29 -07:00
Jørgen P. Tjernø
cf76f36660 Mac: Don't enable SDL_MAC_NO_SANDBOX by default.
To get this functionality, you need to use -DSDL_MAC_NO_SANDBOX=1 in
your CFLAGS.
2013-08-08 12:48:37 -07:00
Sam Lantinga
9f90ffbc9f Fixed crash if SDL_GetThreadName() is passed a NULL thread. 2013-08-08 12:21:26 -07:00
Sam Lantinga
b47f785f57 Fixed whitespace 2013-08-08 12:20:22 -07:00
Edward Rudd
396c5b8e79 use @rpath for OS X Shared Library as well 2013-08-08 11:41:35 -04:00
Gabriel Jacobo
29c4f05ed5 Add some protection against double init of the Android audio backend 2013-08-08 09:47:42 -03:00
Sam Lantinga
5a167e03cd Fixed compile error 2013-08-08 02:34:21 -07:00
Sam Lantinga
780f3a273d Fixed bug 2009 - Creating texture from 32-bit surface with colorkey and per-surface alpha ignores the colorkey
To fix this we need to ignore the alpha channel in the colorkey comparison, which is the way colorkey comparisons are defined in SDL.

We also need to reset the alpha and color modulation when converting a surface.
2013-08-08 02:30:32 -07:00
Sam Lantinga
a2e47469fc autogen.sh on development system 2013-08-08 01:59:36 -07:00
Sam Lantinga
0df5870993 Updated README to match new website description 2013-08-08 01:59:19 -07:00
Sam Lantinga
88b0f42281 Explicitly use the RTLD_LOCAL flag since that's the behavior we want.
The default on Linux is RTLD_LOCAL, the default on Mac OS X is RTLD_GLOBAL.
2013-08-07 17:26:28 -07:00
Sam Lantinga
da3326eb95 The return value of SDL_MostSignificantBitIndex32(0) is defined as -1.
--HG--
extra : rebase_source : b9f0ed0a769617991e6eadf9d6a3efa17112d1a4
2013-08-07 16:32:51 -07:00
Jørgen P. Tjernø
5d1bee0f17 Ensure that the right window is current in SDL_GL_SwapWindow. 2013-08-07 16:29:28 -07:00
Jørgen P. Tjernø
9fb9406bbc Mac: Support for multiple contexts per SDL_Window. 2013-08-07 16:29:25 -07:00
Jørgen P. Tjernø
20c8287efc Mac: Don't -[NSOpenGLContext update] on (potentially) the wrong thread.
If the user is using their context from a non-main thread, we could be
calling -[NSOpenGLContext update] on our thread, while they were
accessing it on their thread.

With this change, we schedule updates when the event comes in on the
main thread, and act on them when the user calls SDL_GL_MakeCurrent or
SDL_GL_SwapWindow.
2013-08-07 16:29:21 -07:00
Jørgen P. Tjernø
8d8238f8ae Mac: Better mouse-grab if you define SDL_MAC_NO_SANDBOX.
This uses a better mouse grab if you define SDL_MAC_NO_SANDBOX. This
mouse grab uses CGEventTapCreate, which you cannot access if you have
sandboxing enabled.
2013-08-07 16:29:15 -07:00
Sam Lantinga
b03f072d95 Updated the name of the iOS platform 2013-08-07 14:00:41 -07:00
Ryan C. Gordon
ff5cf27049 Whoops, forgot to commit this piece. 2013-08-07 12:17:33 -07:00
Ryan C. Gordon
009e12858b SDL_Init() is now just a wrapper around SDL_InitSubSystem(). 2013-08-07 11:14:16 -07:00
Ryan C. Gordon
d99a4adff9 SDL_*Parachute() are no-ops, remove them. 2013-08-07 11:12:11 -07:00
Ryan C. Gordon
8c143ffe40 Removed SDL_AssertionsInit(). It's a no-op, let's keep it that way. :) 2013-08-07 11:00:44 -07:00
Sam Lantinga
2e821930a3 Fix building the tests with Visual Studio 2012 (thanks Isaac!) 2013-08-07 09:20:41 -07:00
Sam Lantinga
89c3ac1eab Reset the viewport when we reset the other D3D state.
From Sythical:

Hello, I've created a simple SDL2 application which draws a texture on the screen. The problem I'm having is that if I launch another program which loads the UAC popup or if I lock my PC and then login again, the application stops drawing the texture. I tried adding SDL_Delay(10000) after SDL_RenderPresent(renderer). This made the texture stay on the screen for a little bit but the texture wasn't drawn again after the delay. Here's my code:

#include "SDL.h"

int main(int argc, char *argv[])
{
    SDL_Renderer *renderer;
    SDL_Window *window;
    SDL_Surface *surface;
    SDL_Texture *rect_texture;
    SDL_Event main_event;
    SDL_Rect rect_data;
    int enable_vsync = 1;

    if(SDL_Init(SDL_INIT_VIDEO) < 0) return 1;

    window = SDL_CreateWindow("SDL2 Application", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 600, SDL_WINDOW_RESIZABLE);

    renderer = SDL_CreateRenderer(window, -1, enable_vsync ? SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC : SDL_RENDERER_ACCELERATED);
    SDL_SetRenderDrawColor(renderer, 20, 20, 30, 255);

    surface = SDL_LoadBMP("icon.bmp");
    rect_texture = SDL_CreateTextureFromSurface(renderer, surface);

    rect_data.w = 32; rect_data.h = 32;
    rect_data.x = 300; rect_data.y = 300;

    while(main_event.type != SDL_QUIT)
    {
        SDL_PollEvent(&main_event);

        SDL_RenderClear(renderer);
        SDL_RenderCopy(renderer, rect_texture, NULL, &rect_data);
        SDL_RenderPresent(renderer);
    }

    SDL_DestroyTexture(rect_texture);
    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(window);
    SDL_Quit();

    return 0;
}
2013-08-07 01:14:04 -07:00
Sam Lantinga
cdcee9a581 Unify the SetWindowPos() calls so that they all set the window state based on SDL state.
This prevents a rogue call to SetWindowPos() from changing the state unexpectedly.
Also moved the size correction code above the window position query, because the initial window size can affect the positioning.
2013-08-07 00:46:42 -07:00
Sam Lantinga
40b7af6399 Fixed incorrect window state if the window is created grabbed. We don't want to activate the window if it isn't shown yet. 2013-08-07 00:10:31 -07:00
Sam Lantinga
73a2e37abb Fixed bug 1848 - SDL_SetWindowSize cannot set sizes larger than desktop resolution in Windows 2013-08-06 22:55:55 -07:00
Sam Lantinga
3f1d72a71c Fixed clobbering viewport when window is resized when using the software renderer. The viewport adjustment is already handled in the top level rendering code. 2013-08-06 22:31:11 -07:00
Ryan C. Gordon
6b504a4f01 Removed function signature that doesn't actually exist yet.
--HG--
extra : rebase_source : ffcdb6b32d54d18c3eb02f0dd46adcdac7e7bb4a
2013-08-06 18:23:46 -07:00
Sam Lantinga
330f7e1be3 Fixed a number of missing keys in the X11 keyboard mapping. 2013-08-06 18:19:34 -07:00
Sam Lantinga
8005b8d613 Added scancodes for F17, F18, F19 on a Mac keyboard 2013-08-06 12:56:47 -07:00
Sam Lantinga
a50db2d74e Added tag macosx_10_4_supported for changeset ccf5fbfa2afa 2013-08-06 01:19:23 -07:00
Ryan C. Gordon
a052fa0ae8 Removed anisotropic option from SDL_HINT_RENDER_SCALE_QUALITY.
Anisotropic filtering is meant to be used for textures at a stark
 angle, not perpendicular to the camera.

--HG--
extra : rebase_source : e01c4da3bae7f1628de7c049f31f1208dbbbb24c
2013-08-06 00:23:04 -04:00
Sam Lantinga
ecbffe9660 Added scancodes for F13-F19 from a Mac USB keyboard 2013-08-05 11:45:51 -07:00