Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Upstream changes #14

Merged
merged 109 commits into from
Mar 29, 2015
Merged

Upstream changes #14

merged 109 commits into from
Mar 29, 2015

Conversation

Daft-Freak
Copy link
Member

Emscripten changes are mainly some joystick/gamepad fixes

philippwiesemann and others added 30 commits January 16, 2015 23:03
"MACOSX_COREAUDIO" is actually an internal #define set up elsewhere, and
this CMake var is never exported past the CMake script anyhow.

Partially fixes Bugzilla #2807.
Jonas Kulla

Display::getRefreshRate() is available on all API levels.
…tem implementation

Jonas Kulla

The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c.

I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
…odes.

Normally there's a 200 millisecond delay on all focus events in case there
was a vidmode change, now we note the last vidmode change and only impose this
delay if a change happened extremely recently.

Thanks to Epic Games for reporting this issue.

--HG--
extra : rebase_source : 9258c16df171c48e13c0df99e8d3b12e7041de63
When guessing the device class, it ends up being 0 for devices that have been removed (because the device node no longer exists)
SDL_internal.h should be included to support dynamic API.
SDL_internal.h should be included to support dynamic API and fix warnings.
Thanks to Martin Gerhardy for pointing this out.
- Don't create a temporary context first; this was probably due to Windows
needing one to get the address of wglCreateContextAttribsARB(), but that's
a unique quirk of WGL, and doesn't apply to glX. The glX spec explicitly says
you have to get a function pointer that works with any context from
glXGetProcAddress(), including when no context exists.

- Properly check for the GLX_ARB_create_context instead of just looking for a
non-NULL glXCreateContextAttribsARB()...some implementations, like Mesa,
never return NULL for function lookups (Mesa returns pointers into a jump
table that is filled out when the GL is initialized; since you can look up
functions before you have a valid context, it can't definitely say a function
isn't valid at that point).

--HG--
extra : rebase_source : 336f207a6395506e5a1402d1c25277194017db29
…ound

Eric Wasylishen

Here's a patch to make the 'testrelative' demo program more useful: it just makes the orange rectangle wrap around. Previously, the orange cursor would just disappear off screen if you move the mouse a lot in one direction, so it was hard to tell if relative mouse mode was still working.
Windows Phone does not appear to allow VSync to be turned off.  Doing so appears
to either result in content not getting drawn (when the D3D debug runtime is
turned off), or forcing VSync back on and logging an error (when the D3D debug
runtime is turned on).

VSync had been getting turned on anyways, this change just notes such:
- via the WinRT README
- by always setting the SDL_RENDERER_PRESENTVSYNC flag when creating an
  SDL_Renderer on Windows Phone

--HG--
extra : rebase_source : 504904b549f21d518919b2254319783da7c9bbdf
lectem

-plug in the joystick
-start testjoystick 0
-unplug
-replug

The joystick is detected but doesn't enter the loop anymore since done==SDL_TRUE
This helps the window manager do the right thing with these windows.
icculus and others added 23 commits March 19, 2015 13:15
…lback.

The data produced by the callback is just thrown away and the audio thread
delays as if it's waiting for the hardware to drain.

This lets apps that rely on their audio callback firing regularly continue
to make progress to function as properly as possible in the face of disaster.
Apps that want to know that the device is really gone and deal with that
scenario can use the new hotplug functionality.
This lets us reuse values between the two categories without conflicting, etc.

--HG--
extra : amend_source : a48f3e0a0274d02f31a1832fbc82d581a6fd12b9
…e sane.

Just in case we ever need those bits in the future.
--HG--
extra : amend_source : e9bf68163b3496c4fd7126a2a91cd2469579f901
Fixes not finding dlopen(), etc.
…text when GLX_ARB_context_flush_control is available.

This extension allows the user to specify whether a full flush is performed when making a context not current.
The only way to set this currently is at context creation, so this patch provides that functionality.
Defualt behaviour is set at FLUSH, as per the spec.

This patch does not contain the changes to WGL, appleGL or other platforms as I do not have access to GL 4.5 hardware on those platforms.

Full details on the use of KHR_context_flush_control can be found here:
https://www.opengl.org/registry/specs/KHR/context_flush_control.txt
Conflicts:
	cmake/sdlchecks.cmake
	src/video/emscripten/SDL_emscriptenevents.c
	test/Makefile.in
@kripken
Copy link
Member

kripken commented Mar 27, 2015

Looks good, did you verify the tests (browser and interactive) pass with this?

@Daft-Freak
Copy link
Member Author

Yes, tests still pass.

@kripken
Copy link
Member

kripken commented Mar 29, 2015

Great, thanks.

kripken added a commit that referenced this pull request Mar 29, 2015
@kripken kripken merged commit 0e4924c into master Mar 29, 2015
Daft-Freak pushed a commit that referenced this pull request Oct 20, 2016
Robert Folland

When running this little test program with SDL2 on Wayland it often crashes in SDL_Init.

From a backtrace it is apparent that there is a race condition in creating a xkb_context_ref. Sometimes it is 0x0.

By moving the relevant lines higher up in Wayland_VideoInit (in SDL2-2.0.4/src/video/wayland/SDL_waylandvideo.c:302) this seems to get fixed.

I moved the call to WAYLAND_xkb_context_new() up to before the call to WAYLAND_wl_display_connect().

Here is the test program (just a loop of init and quit), and a backtrace from gdb:

#include <cstdio>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <unistd.h>
#include <iostream>

int main(int argc, char **argv)
{
    int count = atoi(argv[1]);

    for (int i = 0; i < count; i++) {
        std::cout << "Init " << i << std::endl;
        if (SDL_Init(SDL_INIT_VIDEO) < 0) {
            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
                         "Couldn't initialize SDL: %s\n",
                         SDL_GetError());
            return 1;
        }
        std::cout << "Quit" << std::endl;
        SDL_Quit();
    }
    return 0;
}


Init 12
Quit
Init 13

Program received signal SIGSEGV, Segmentation fault.
xkb_context_ref (ctx=ctx@entry=0x0) at src/context.c:156
156         ctx->refcnt++;
(gdb) bt
#0  xkb_context_ref (ctx=ctx@entry=0x0) at src/context.c:156
#1  0x00007ffff5e1cd4c in xkb_keymap_new (ctx=0x0, format=XKB_KEYMAP_FORMAT_TEXT_V1, flags=flags@entry=XKB_KEYMAP_COMPILE_NO_FLAGS) at src/keymap-priv.c:65
#2  0x00007ffff5e1c6cc in xkb_keymap_new_from_buffer (ctx=<optimized out>,
    buffer=0x7ffff7fd5000 "xkb_keymap {\nxkb_keycodes \"(unnamed)\" {\n\tminimum = 8;\n\tmaximum = 255;\n\t<ESC>", ' ' <repeats 16 times>, "= 9;\n\t<AE01>", ' ' <re
peats 15 times>, "= 10;\n\t<AE02>", ' ' <repeats 15 times>, "= 11;\n\t<AE03>", ' ' <repeats 15 times>, "= 12;\n\t<AE04>", ' ' <repeats 12 times>..., length=48090,
    format=<optimized out>, flags=<optimized out>) at src/keymap.c:191
#3  0x00007ffff7b8ea4e in keyboard_handle_keymap (data=0x6169b0, keyboard=<optimized out>, format=<optimized out>, fd=5, size=48091)
    at /home/vlab/abs/sdl2/src/SDL2-2.0.4/src/video/wayland/SDL_waylandevents.c:269
#4  0x00007ffff64501f0 in ffi_call_unix64 () from /usr/lib/libffi.so.6
#5  0x00007ffff644fc58 in ffi_call () from /usr/lib/libffi.so.6
#6  0x00007ffff665be3e in wl_closure_invoke (closure=closure@entry=0x61f000, flags=flags@entry=1, target=<optimized out>, target@entry=0x616d20,
    opcode=opcode@entry=0, data=<optimized out>) at src/connection.c:949
#7  0x00007ffff6658be0 in dispatch_event (display=<optimized out>, queue=<optimized out>) at src/wayland-client.c:1274
#8  0x00007ffff6659db4 in dispatch_queue (queue=0x617398, display=0x6172d0) at src/wayland-client.c:1420
#9  wl_display_dispatch_queue_pending (display=0x6172d0, queue=0x617398) at src/wayland-client.c:1662
#10 0x00007ffff665a0cf in wl_display_roundtrip_queue (display=0x6172d0, queue=0x617398) at src/wayland-client.c:1085
#11 0x00007ffff7b8faa0 in Wayland_VideoInit (_this=<optimized out>) at /home/vlab/abs/sdl2/src/SDL2-2.0.4/src/video/wayland/SDL_waylandvideo.c:302
#12 0x00007ffff7b7aed6 in SDL_VideoInit_REAL (driver_name=<optimized out>, driver_name@entry=0x0) at /home/vlab/abs/sdl2/src/SDL2-2.0.4/src/video/SDL_video.c:513
#13 0x00007ffff7ae0ee7 in SDL_InitSubSystem_REAL (flags=16416) at /home/vlab/abs/sdl2/src/SDL2-2.0.4/src/SDL.c:173
#14 0x0000000000400b24 in main (argc=2, argv=0x7fffffffebb8) at vplay-init.cpp:13
(gdb)
@Daft-Freak Daft-Freak deleted the upstream_sync2 branch January 21, 2019 15:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants