src/video/emscripten


Log

Author Commit Date CI Message
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Johannes Bader 17243133 2017-11-04T11:16:49 Emscripten: use cursor hotspot the cursor's hotspot simply wasn't translated to it's CSS equivalent, yet see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor?v=example#Syntax. no explicit hotspot if (0|0) for compatibility with Edge and IE, which indeed don't support custom hot spots
Sam Lantinga 50efbda7 2017-08-28T00:43:14 Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h
Sam Lantinga 0d011ec6 2017-08-28T00:22:23 Renaming of guard header names to quiet -Wreserved-id-macro
Sam Lantinga a4cfa936 2017-08-14T21:28:04 Fixed bug 2293 - Precise scrolling events Martijn Courteaux I implemented precise scrolling events. I have been through all the folders in /src/video/[platform] to implement where possible. This works on OS X, but I can't speak for others. Build farm will figure that out, I guess. I think this patch should introduce precise scrolling on OS X, Wayland, Mir, Windows, Android, Nacl, Windows RT. The way I provide precise scrolling events is by adding two float fields to the SDL_MouseWheelScrollEvent datastructure, called "preciseX" and "preciseY". The old integer fields "x" and "y" are still present. The idea is that every platform specific code normalises the scroll amounts and forwards them to the SDL_SendMouseWheel function. It is this function that will now accumulate these (using a static variable, as I have seen how it was implemented in the Windows specific code) and once we hit a unit size, set the traditional integer "x" and "y" fields. I believe this is pretty solid way of doing it, although I'm not the expert here. There is also a fix in the patch for a typo recently introduced, that might need to be taken away by the time anybody merges this in. There is also a file in Nacl which I have stripped a horrible amount of trailing whitespaces. (Leave that part out if you want).
Philipp Wiesemann 711df8a9 2017-08-05T22:10:48 emscripten: Fixed compiling without OpenGL support.
Ryan C. Gordon 599d9ba1 2017-06-05T21:30:25 emscripten: listen for pointerlockchange events on the #document specifically.
Philipp Wiesemann 75931972 2017-05-26T22:45:40 emscripten: Fixed compiling on C89 compilers.
Charlie Birks 126e5a1d 2017-05-24T14:04:39 Emscripten: Prevent default on arrow keys
Patrick Monaghan f839b209 2017-05-24T14:04:25 Emscripten: fixed incorrect conversion of touch motion events to mouse motion events
Philipp Wiesemann bf8ccf08 2017-05-19T23:30:59 Removed redundant mouse clean up on quit for some platforms. SDL_MouseQuit() already frees cursors and sets fields to NULL.
Philipp Wiesemann 29222db7 2017-05-13T23:00:35 emscripten: Fixed not removing pointer lock event callback.
Philipp Wiesemann cc5b4f45 2017-05-12T23:01:17 emscripten: Changed internal functions to be static.
Philipp Wiesemann 34d9c521 2017-05-06T21:45:43 emscripten: Fixed return type in event callback declaration.
Ryan C. Gordon 93a6191c 2017-04-20T13:00:54 emscripten: keep track of pointer lock losses and maybe regrab pointer later. If an Emscripten app is in relative mouse mode and the user presses Escape (or whatever is appropriate), then the pointer lock is broken by the browser. This keeps track of those losses, and next time the user presses a mouse button down on the canvas, if the app is still meant to be in relative mouse mode, we will attempt to regrab the pointer. This makes it much more seamless for things like first-person shooters, and the app doesn't need any manual intervention.
Charlie Birks 0d647d35 2017-02-17T10:13:17 Emscripten: implement custom cursors
Charlie Birks 33bddcfd 2017-02-17T10:13:12 Emscripten: refactor cursor handling
Charlie Birks 613955b4 2017-02-17T10:13:07 Emscripten: only update pixel ratio if HiDPI is enabled
Sam Lantinga 67ed8943 2017-01-01T19:10:36 Fixed bug 3529 - SDL_EGL_UnloadLibrary is not called at all on SDL_Quit kaisyu In case of OpenGLES, the sequences of loading and unloading driver library should be like that: SDL_Init ... SDL_GL_LoadLibrary SDL_EGL_LoadLibrary ... SDL_Quit ... SDL_GL_UnloadLibrary SDL_EGL_UnloadLibrary ... However, according to my test results, the varible '_this->gl_config.driver_loaded' does not allow 'SDL_GL_UnloadLibrary' to call 'SDL_EGL_UnloadLibrary'.
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga 97d05b0d 2016-12-09T05:12:27 Fixed a bunch of SwapWindow calls that needed their return value updated
Ryan C. Gordon 232ae688 2016-11-23T17:20:28 Still more compiler warning fixes for various platforms.
Philipp Wiesemann c3451262 2016-11-18T00:05:28 Emscripten: Fixed handling of deactivated mouse events. SDL_GetEventState() was called with a button state instead of an event type.
Csongor Szabo 01f62736 2016-10-14T17:06:28 emscripten: check if device pixel ratio has changed
Sam Lantinga 00791f3a 2016-09-13T00:09:21 Only prevent the default browser event handling when the specific event types aren't disabled by the user, patch contributed by Jonas Platte
Charlie Birks 993dd835 2016-09-13T00:04:00 Add mapping for media keys
Alon Zakai 1b6565fc 2016-09-13T00:03:59 use Module.createContext for 2D rendering in emscripten
Alon Zakai bec55734 2016-09-13T00:03:58 add some detail to fullscreen workaround comment; version 6 Conflicts: version.txt
Charlie Birks 405d64b2 2016-09-13T00:03:56 only unset fullscreen flags if fullscreen failed
Charlie Birks c68cac89 2016-09-13T00:03:55 use screen resolution instead of canvas size
Boris Gjenero 791b946a 2016-09-13T00:03:54 Fix full screen mode in Firefox, which was broken by 9d4beb2
Boris Gjenero b71208d4 2016-09-13T00:03:53 Support SDL_SetWindowTitle() via Module['setWindowTitle']()
Jukka Jyl?nki 7cf44f1b 2016-09-13T00:03:51 Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange().
Boris Gjenero b54eb82c 2016-09-13T00:03:49 Unpress all keys on blur to avoid stuck keys
Boris Gjenero a0a75f38 2016-09-13T00:03:48 Listen for blur and focus events on window instead of canvas Blur and focus events were not arriving for the canvas in Firefox 35 and Chrome 40.
Boris Gjenero 3e5c4cec 2016-09-13T00:03:46 Mouse events use CSS coordinates, so don't scale by pixel_ratio
Boris Gjenero a20c40c4 2016-09-13T00:03:45 Accumulate subpixel mouse motion so motion is not lost. Previously when the canvas was scaled up and the pointer was locked, motion corresponding to less than one pixel was lost. Therefore, slow mouse motion resulted in no motion. This fixes that.
TelpeNight 443998ff 2016-09-13T00:03:44 Fix of mouse events in browser without pointer locks
Alon Zakai 2b367cb6 2016-09-13T00:03:43 optimize Emscripten_UpdateWindowFramebuffer - avoid creating contexts and images all the time - use set and then fix alpha directly
Charlie Birks 98ec8443 2016-09-13T00:03:39 send mouse move on enter/leave
Charlie Birks a2ef0db8 2016-09-13T00:03:37 listen for mouse up on document (fixes mouseup outside canvas)
Charlie Birks cd05184f 2016-09-13T00:03:36 use SDL_SetMouseFocus
Sam Lantinga bdca510f 2016-09-13T00:03:28 simplify fullscreen handling using new fullscreen_strategy api, patch contributed by Charlie Birks
Charlie Birks be08cc61 2016-09-12T23:58:08 use css size for touch normalisation
Ryan C. Gordon d05ae194 2016-08-12T19:59:00 emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Philipp Wiesemann 19f18558 2016-03-11T22:10:35 Emscripten: Deactivated custom cursor support because it created system cursors.
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
Philipp Wiesemann 5d6aa08b 2015-06-09T21:06:29 Emscripten: Fixed SDL_GetTouchDevice() returning 0 for the valid device index. The single touch device gets SDL_TouchID 1 (like on iOS and WinRT).
Philipp Wiesemann fd8b7c1c 2015-06-05T19:41:18 Fixed comments at conditional compilation macros.
Sam Lantinga 6e67c949 2015-05-28T12:55:01 Fixed bug 2054 - SDL_GetError: "Unknown touch device" Volumetric The "Unknown touch device" message appears because the initial touch device setup loop uses SDL_GetTouch() as a guard for calling SDL_AddTouch(). SDL_GetTouch() will always report "Unknown touch device" since the device hasn't been added yet. The SDL_GetTouch() call is unnecessary since SDL_AddTouch() calls SDL_GetTouchIndex() to verify that the device hasn't been added yet, and SDL_GetTouchIndex() has the benefit of not reporting an error for a device it can't find.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Philipp Wiesemann a54d038b 2015-05-16T21:15:27 Emscripten: Fixed wrong source comment and updated web link.
Philipp Wiesemann 3f51758e 2015-05-06T21:10:48 Emscripten: Fixed touch coordinates not being normalized.
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Philipp Wiesemann 8f4c2a8f 2015-03-06T21:29:25 Emscripten: Fixed ignoring return value of internal function. If the function Emscripten_ConvertUTF32toUTF8() failed (should currently not be possible) a not terminated string would have been sent as text input event.
Philipp Wiesemann 1686af72 2015-03-06T21:26:37 Emscripten: Partially fixed not removing key event callbacks if hint was used. The key event callbacks were always removed from the same target although it is possible to set them to different targets using the hint. This is only a partial fix because it assumes that the hint is not changed to a different value later.
Philipp Wiesemann bd2d0146 2015-02-15T21:44:36 Emscripten: Changed return type of callback implementations from int to EM_BOOL. The prototypes are declared with EM_BOOL (which is currently an int) in html5.h.
Philipp Wiesemann 697c5c57 2015-02-14T00:10:58 Emscripten: Fixed framebuffer error message.
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem 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.
Ryan C. Gordon 16f3cbfc 2014-12-26T23:16:54 Cleaned up some compiler warnings.
Philipp Wiesemann d8c60342 2014-12-26T20:11:28 Added three missing checks for return values of SDL_calloc().
Philipp Wiesemann 22855927 2014-12-25T22:08:48 Removed unnecessary call to SDL_free().
Ryan C. Gordon fe40a172 2014-12-18T00:19:52 Initial merge of Emscripten port! With this commit, you can compile SDL2 with Emscripten ( http://emscripten.org/ ), and make your SDL-based C/C++ program into a web app. This port was due to the efforts of several people, including: Charlie Birks, Sathyanarayanan Gunasekaran, Jukka Jyl?nki, Alon Zakai, Edward Rudd, Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)