summaryrefslogtreecommitdiffstats
path: root/platform/javascript/os_javascript.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* HTML5 callbacks rework.Fabio Alessandrelli2020-01-171-31/+37
| | | | | | | | | | | | | | Fixes compatibility with emscripten 1.39.5+ . Most input callbacks now require a target and no longer support NULL defaults. This commit changes all required null targets to the expected default in the binding phase. Since for canvas-related callbacks there is no default, the "#canvas" selector is used instead. Additionally, since canvasX and canvasY event properties are no longer supported, event positions are computed from "clientX" and "clientY" and the "#canvas" bounding client rect.
* HTML5: Address removal of 'timestamp' in Emscripten 1.39.5Rémi Verschelde2020-01-171-1/+2
| | | | | | | | | | | | | | | 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.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | 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.
* iOS modular build and export implementation.bruvzg2019-12-011-3/+0
|
* Remove ECMAScript 6 "arrow operator".Fabio Alessandrelli2019-10-241-1/+1
| | | | | We don't need it, it's not well supported by compilers, and it was a mistake in the first place.
* Properly revert cursor when using set_custom_mouse_cursor with nullPouleyKetchoupp2019-10-031-0/+2
| | | | Fixes #32486
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", ↵Robin Hübner2019-08-091-18/+10
| | | | "modules/gdnative", "modules/gdscript" directories.
* Fix cursor blinking in integrated GPUsGuilherme Felipe2019-07-091-0/+17
| | | | | Optimization for Input::set_custom_mouse_cursor when used inside _process function. (Avoids cursor blinking in low end devices)
* Merge pull request #10643 from BastiaanOlij/camera_serverRémi Verschelde2019-06-161-0/+3
|\ | | | | CameraServer class
| * Adding a new Camera Server implementation to Godot.BastiaanOlij2019-06-151-0/+3
| | | | | | | | | | | | 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.
* | Fix pointer position in hidpi-corrected resolutions on webLeonardo Giovanni Scur2019-06-141-4/+18
|/
* Fix error macro calls not ending with semicolonRémi Verschelde2019-06-111-1/+1
| | | | | | | It's not necessary, but the vast majority of calls of error macros do have an ending semicolon, so it's best to be consistent. Most WARN_DEPRECATED calls did *not* have a semicolon, but there's no reason for them to be treated differently.
* Implement Clipboard API read when supported.Fabio Alessandrelli2019-05-291-0/+17
| | | | | | | 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.
* Kinda working HTML5 clipboard paste.Fabio Alessandrelli2019-05-291-0/+10
| | | | | | | | | | | | | | | | Listen to paste events to update local clipboard. CTRL+V still not working out of the box. To do that, We would need to change how we handle keypress, most likely making it worse and less safe. In the end, I'm not sure we can fix it properly for now. Maybe in the future, with the Clipboard API, support of which is still pretty limited on chrome, and only available to extensions in Firefox. For now, you can paste via: - Browser bar -> Edit -> Paste. - Middle mouse click (Linux only, copies secondary clipboard). And THEN press CTRL+V
* Add OS clipboard set support to OS JavascriptFabio Alessandrelli2019-05-281-0/+19
|
* added a const keyword for a methods that return constant literal...hbina0852019-05-211-1/+1
|
* Fix OS_Javascript execute methodFabio Alessandrelli2019-05-151-1/+1
| | | | | | Signature was changed in OS via: cd4449e7abe97b2bc883e2d182db2cc41eb35f8c
* Disable driver fallback to GLES2 by defaultRémi Verschelde2019-03-051-1/+1
| | | | | | | | | | | | | | | | | | | GLES2 is not designed to be a drop-in replacement for the GLES3 backend, so the fallback mode has to be used knowingly. It *can* make sense for simple projects which make sure to handle the differences between both rendering backends, but most users should stick to one supported backend. By making it opt-in, we can now use this parameter to define whether to export ETC textures to Android and iOS when using GLES3 + Fallback. When using GLES3 without Fallback on Android, set the proper min GLES version in the AndroidManifest. Also made the option boolean and renamed it for clarity and to avoid conflict with the previous String option (which would always evaluate as "true" otherwise). Fixes #26569.
* -Remove harcoded opengl extension testing from OS, ask rasterizer instead.Juan Linietsky2019-02-261-10/+0
| | | | -Fixed a bug where etc textures were imported broken
* Use stdout/-err for all messages in HTML5 platformLeon Krause2019-02-241-2/+2
|
* Fix pixelized previews, but also instances of breaking ImageTexture cache. ↵Juan Linietsky2019-01-271-0/+5
| | | | Closes #25378.
* Allow requesting full screen during start-up in HTML5 platformLeon Krause2019-01-231-1/+14
|
* Deal with Google's HTML5 autoplay policyLeon Krause2019-01-201-0/+6
| | | | Resume audio context after mouse, touch or key input.
* Fix HTML5 gamepad logic for Emscripten 1.38.22 compat breakageLeon Krause2019-01-201-1/+2
|
* Implements OS_JavaScript::set_custom_mouse_cursorGuilherme Felipe2019-01-031-2/+123
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Merge pull request #20385 from moiman100/unify-double-clickingRémi Verschelde2018-12-141-0/+28
|\ | | | | Added double clicking to all buttons on Linux and Javascript