summaryrefslogtreecommitdiff
path: root/platform/javascript/os_javascript.h
AgeCommit message (Collapse)Author
2021-11-19[HTML5] Add WebGL2 (GLES3) support using the OpenGL renderer.Fabio Alessandrelli
Note, the editor build requires the mbedtls module to be manually enabled, as it is currently needed as a ResourceUID dependency. This will need to be addressed in a separate PR.
2021-11-02[OS] Add ThreadWorkPool default size to OS.Fabio Alessandrelli
Some platforms (*cough* web *cough*) have hard limits on the number of threads that can be spawned. Currently, ThreadPoolWork (mostly used in rendering/physics servers) will spawn as many threads as CPUs available causing exception on machines with high CPU count. This commit adds a new overridable method to OS that returns the default thread pool size (still the CPU count by default), and overrides it for the JavaScript platform so it always allocate only one thread. We can likely improve the whole ThreadPoolWork in the future to always allocate X amount of threads, and assign jobs to them on the fly, but that will require some more architectural changes.
2021-09-15[HTML5] Refactor audio drivers. Implement AudioWorklet w/o threads.Fabio Alessandrelli
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 :(.
2021-07-22Move `alert` function from `DisplayServer` to `OS`.bruvzg
2021-02-17[HTML5] Implement get_processor_count.Fabio Alessandrelli
2021-01-09Split OS::execute into two methodsMarcel Admiraal
1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-05[HTML5] EditorRunNative works with GDNative.Fabio Alessandrelli
This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy.
2020-11-10[HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli
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).
2020-09-23JS synchronous start, better persistent FS sync.Fabio Alessandrelli
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).
2020-09-18[HTML5] Add override keyword, cleanup methods.Fabio Alessandrelli
2020-07-01Use dummy driver when JS AudioContext is unavailable.Fabio Alessandrelli
2020-07-01Limit FPS in JS by skipping iterations.Fabio Alessandrelli
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-05-10DisplayServerJavaScript implementation.Fabio Alessandrelli
2020-04-28Rename InputFilter back to InputRémi Verschelde
It changed name as part of the DisplayServer and input refactoring in #37317, with the rationale that input no longer goes through the main loop, so the previous Input singleton now only does filtering. But the gains in consistency are quite limited in the renaming, and it breaks compatibility for all scripts and tutorials that access the Input singleton via the scripting language. A temporary option was suggested to keep the scripting singleton named `Input` even if its type is `InputFilter`, but that adds inconsistency and breaks C#. Fixes godotengine/godot-proposals#639. Fixes #37319. Fixes #37690.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-03-26Refactored input, goes all via windows now.Juan Linietsky
Also renamed Input to InputFilter because all it does is filter events.
2020-03-26Refactored Input, create DisplayServer and DisplayServerX11Juan Linietsky
2020-03-17Style: Set clang-format Standard to Cpp11Rémi Verschelde
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`.
2020-02-14Remove incomplete battery status/power APIRémi Verschelde
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.
2020-02-10Allow per pixel transparency in javascript platformmuiroc
2020-01-23Make `OS.execute()` blocking by default if not specifiedHugo Locurcio
This makes `OS.execute()` calls quicker to set up when calling programs in a blocking fashion.
2020-01-17HTML5: Address removal of 'timestamp' in Emscripten 1.39.5Rémi Verschelde
It was removed as noted in the changelog: https://github.com/emscripten-core/emscripten/blob/1.39.5/ChangeLog.md#v1395-12202019 > Removed `timestamp` field from mouse, wheel, devicemotion and > deviceorientation events. The presence of a `timestamp` on these > events was slightly arbitrary, and populating this field caused > a small profileable overhead that all users might not care about. > It is easy to get a timestamp of an event by calling > `emscripten_get_now()` or `emscripten_performance_now()` inside > the event handler function of any event. Fixes #34648.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-01iOS modular build and export implementation.bruvzg
2019-07-09Fix cursor blinking in integrated GPUsGuilherme Felipe
Optimization for Input::set_custom_mouse_cursor when used inside _process function. (Avoids cursor blinking in low end devices)
2019-06-15Adding a new Camera Server implementation to Godot.BastiaanOlij
This is a new singleton where camera sources such as webcams or cameras on a mobile phone can register themselves with the Server. Other parts of Godot can interact with this to obtain images from the camera as textures. This work includes additions to the Visual Server to use this functionality to present the camera image in the background. This is specifically targetted at AR applications.
2019-05-29Implement Clipboard API read when supported.Fabio Alessandrelli
Being async, the first time a value is pasted GUI elements will still return the previous one. This at least until 'clipboardchange' window event gets implemented by user agents.
2019-05-28Add OS clipboard set support to OS JavascriptFabio Alessandrelli
2019-05-21added a const keyword for a methods that return constant literal...hbina085
2019-05-15Fix OS_Javascript execute methodFabio Alessandrelli
Signature was changed in OS via: cd4449e7abe97b2bc883e2d182db2cc41eb35f8c
2019-01-20Refactor OS_JavaScript headerLeon Krause
2019-01-03Implements OS_JavaScript::set_custom_mouse_cursorGuilherme Felipe
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-14Merge pull request #20385 from moiman100/unify-double-clickingRémi Verschelde
Added double clicking to all buttons on Linux and Javascript
2018-10-29Add proper stubs for OS_JavaScript::execute(), get_process_id(), kill()Leon Krause
Avoids linker warnings and errors about undefined references.
2018-10-01Fix build for Javascript platformmuiroc
2018-09-16Implement OS::set_icon in HTML5 platformLeon Krause
2018-08-23Merge pull request #21330 from eska014/html5-canvas-resizeRémi Verschelde
Facilitate external modification of HTML5 canvas size
2018-08-23Facilitate external modification of HTML5 canvas sizeLeon Krause
2018-08-12Added double clicking to all buttonsMikko Mustonen
2018-07-19-Project/Editor settings now use new inspectorJuan Linietsky
-Project/Editor settings now show tooltips properly -Settings thar require restart now will show a restart warning -Video driver is now visible all the time, can be changed easily -Added function to request current video driver
2018-07-10Refactor OS_JavaScriptLeon Krause
2018-03-26Refactor JavaScript platform build scriptLeon Krause
2018-01-12Fix HTML5 feature tagsLeon Krause
'HTML5' is the platform tag, the 'JavaScript' tag indicates availability of the JavaScript.eval singleton. Also report texture compression support.
2018-01-05Add missing method for javascriptGuilherme Silva
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-04Change OS::initialize signature to return Error (fix segfault on x11)Emmanuel Leblond