summaryrefslogtreecommitdiffstats
path: root/platform/javascript/os_javascript.cpp
Commit message (Collapse)AuthorAgeFilesLines
* HTML5: Add support for `Input.vibrate_handheld()`pattlebass2022-07-271-0/+4
|
* Add OS::is_process_running function.mdavisprog2022-05-031-0/+4
| | | | | | | | Adds the is_process_running function to the native OS class and exposes it to script. This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function. Documentation is updated to reflect new API function.
* Add GDNativeInterface::get_library_path to GDExtensionEmmanuel Leblond2022-04-291-1/+6
|
* Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde2022-02-161-1/+1
| | | | | Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
* [HTML5] Implement JavaScript PWA update callbacks.Fabio Alessandrelli2022-02-061-0/+16
| | | | | | Allows detecting when a new version of the progressive web app service worker is waiting (i.e. an update is pending), along a function to force the update and reload all clients.
* Merge pull request #56012 from bruvzg/wt🤎4Rémi Verschelde2022-01-171-2/+2
|\
| * [Windows] Improve console handling and execute/create_process.bruvzg2021-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | Always build with the GUI subsystem. Redirect stdout and stderr output to the parent process console. Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`). Add `open_console` argument to the `execute` and `create_process` to open a new console window. Remove `interface/editor/hide_console_window` editor setting. Remove `Toggle System Console` menu option. Remove `set_console_visible` and `is_console_visible` functions.
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Modules: Make sure to include modules_enabled.gen.h where neededRémi Verschelde2021-11-121-1/+1
|
* [HTML5] Refactor audio drivers. Implement AudioWorklet w/o threads.Fabio Alessandrelli2021-09-151-8/+11
| | | | | | | | | | Performances are not great in general, bad on Firefox, on Chrome, well, it could be an improvement. Leave it as a fallback for now, but can be forced via project settings if desired (or custom JavaScript logic via the "args" option). I'm actually surprised this works, it involves so many allocations, but there's no way around it when SharedArrayBuffer is not available :(.
* Make platform feature tag names lowercaseHugo Locurcio2021-08-311-2/+2
| | | | | | | | | | | | | | Feature tag names are still case-sensitive, but this makes built-in feature tags more consistent. - `Windows` -> `windows` - `OSX` -> `osx` - `LinuxBSD` -> `linuxbsd` - `Android` -> `android` - `iOS` -> `ios` - `HTML5` -> `html5` - `JavaScript` -> `javascript` - `UWP` -> `uwp`
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-2/+2
|
* Move `alert` function from `DisplayServer` to `OS`.bruvzg2021-07-221-0/+4
|
* [HTML5] Fix build (with module_webxr_enabled=no).Fabio Alessandrelli2021-07-151-2/+1
| | | | | The XR API changed a bit, and it's not just a rename, though probably an easy update for someone who is qualified :).
* Misc cleanup of header includesRémi Verschelde2021-07-151-1/+1
| | | | | Was looking for misuse of module headers without checking that the module is actually enabled and got carried away...
* [HTML5] Implement get_processor_count.Fabio Alessandrelli2021-02-171-0/+4
|
* Split OS::execute into two methodsMarcel Admiraal2021-01-091-2/+6
| | | | | 1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Merge pull request #44161 from Faless/fix/fa_buffered_removeRémi Verschelde2020-12-091-2/+0
|\ | | | | Remove unused FileAccessBuffered
| * Remove now unused FileAccessBuffered.Fabio Alessandrelli2020-12-061-1/+0
| |
| * [HTML5] Use regular unix FileAccess implementation.Fabio Alessandrelli2020-12-061-1/+0
| |
* | [HTML5] Make GDNative support feature-based.Fabio Alessandrelli2020-12-051-2/+14
| | | | | | | | | | This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work.
* | [HTML5] EditorRunNative works with GDNative.Fabio Alessandrelli2020-12-051-0/+8
|/ | | | | | This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy.
* [HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli2020-11-101-39/+13
| | | | | | | | | The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
* JS synchronous start, better persistent FS sync.Fabio Alessandrelli2020-09-231-23/+26
| | | | | | | | | | | | | | The engine now expects to emscripten FS to be setup and sync-ed before main is called. This is exposed via `Module["initFS"]` which also allows to setup multiple persistence paths (internal use only for now). Additionally, FS syncing is done **once** for every loop if at least one file in a persistent path was open for writing and closed, and if the FS is not syncing already. This should potentially fix issues reported by users where "autosave" would not work on the web (never calling `syncfs` because of too many writes).
* [HTML5] Add override keyword, cleanup methods.Fabio Alessandrelli2020-09-181-22/+0
|
* Use dummy driver when JS AudioContext is unavailable.Fabio Alessandrelli2020-07-011-3/+14
|
* Refactor canvas ID and locale handling.Fabio Alessandrelli2020-07-011-8/+0
|
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-27/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Add WebSocket debugger, use it for Javascript.Fabio Alessandrelli2020-05-121-0/+11
|
* Fix Closure compiler build, python style.Fabio Alessandrelli2020-05-101-1/+1
| | | | Move copyToFS into utils.js library included with '--pre-js'.
* DisplayServerJavaScript implementation.Fabio Alessandrelli2020-05-101-1106/+52
|
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-22/+49
| | | | Part of #33027.
* Move mouse wheel handler from window to canvas element in HTMLChristoph Schröder2020-04-281-1/+1
| | | | | | | | | | | | Similar to https://github.com/godotengine/godot/pull/36557 At least in chrome, the following error is printed for each mouse wheel rotation: [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312 This PR moves the handler to the canvas and thereby fixes the error. Tested on: Chrome and Firefox (MacOS), Firefox, Chrome(Android), Safari (IPad + MacOS)
* Replace NULL with nullptrlupoDharkael2020-04-021-13/+13
|
* Renaming of servers for coherency.Juan Linietsky2020-03-271-3/+3
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Refactored input, goes all via windows now.Juan Linietsky2020-03-261-6/+6
| | | | Also renamed Input to InputFilter because all it does is filter events.
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-2/+2
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* [HTML5] Refactor JS, threads support, closures.Fabio Alessandrelli2020-03-111-0/+1
| | | | | | | | | | - Refactored the Engine code, splitted across files. - Use MODULARIZE option to build emscripten code into it's own closure. - Enable lto support (saves ~2MiB in release). - Enable optional closure compiler pass for JS and generated code. - Enable optional pthreads support. - Can now build with tools=yes (not much to see yet). - Dropped some deprecated code for older toolchains.
* OS_Javascript temporarly uses dummy rasterizer.Fabio Alessandrelli2020-03-081-1/+5
|
* Fix Javascript platform after PoolVector removal.Fabio Alessandrelli2020-03-081-16/+8
| | | | Eval should be rechecked.
* Merge pull request #36557 from Schroedi/fix_html_touchFabio Alessandrelli2020-03-031-4/+4
|\ | | | | Fixes touch events for HTML
| * Fixes touch events for HTMLChristoph Schroeder2020-02-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | Without this patch, the following exception is thrown when the touch screen is used: TypeError: e.getBoundingClientRect is not a function. No touch events arrive in the engine. From my testing, this PR fixes the issue and behaves as expected. Tested with godot-demo-projects/misc/multitouch_view/, emscripten 1.39.8 and Firefox mobile emulator as well as FF on Android
* | Rename `scancode` to `keycode`.bruvzg2020-02-251-3/+4
|/ | | | | Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap. Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-11/+11
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Remove incomplete battery status/power APIRémi Verschelde2020-02-141-18/+0
| | | | | | | | | | | It was initially implemented in #5871 for Godot 3.0, but never really completed or thoroughly tested for most platforms. It then stayed in limbo and nobody seems really keen to finish it, so it's better to remove it in 4.0, and re-add eventually (possibly with a different API) if there's demand and an implementation confirmed working on all platforms. Closes #8770.
* Remove obsolete GLES3 backendRémi Verschelde2020-02-131-39/+8
| | | | | | | | | | | | | | Due to the port to Vulkan and complete redesign of the rendering backend, the `drivers/gles3` code is no longer usable in this state and is not planned to be ported to the new architecture. The GLES2 backend is kept (while still disabled and non-working) as it will eventually be ported to serve as the low-end renderer for Godot 4.0. Some GLES3 features might be selectively ported to the updated GLES2 backend if there's a need for them, and extensions we can use for that. So long, OpenGL driver bugs!
* Texture refactorJuan Linietsky2020-02-111-1/+1
| | | | | | | | -Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD
* Allow per pixel transparency in javascript platformmuiroc2020-02-101-1/+20
|
* Fix javascript platform buildmuiroc2020-02-071-1/+1
|