summaryrefslogtreecommitdiffstats
path: root/platform/javascript/javascript_main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Web] Rename JavaScript platform to Web.Fabio Alessandrelli2022-08-291-110/+0
| | | | Also rename export name from "HTML5" to "Web".
* HTML5: Fix build after #52742Rémi Verschelde2022-02-161-1/+2
| | | | Fixes #58172.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Optimize StringName usagereduz2021-07-181-1/+1
| | | | | | | | | | | * Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
* [HTML5] Fix target_fps when window loses focus.Fabio Alessandrelli2021-05-071-0/+5
| | | | | | | | We don't get updates when the window is unfocused/minimized, so we must detect the situation where the counted ticks start drifting away resulting in more frames drawn than needed. This commit adds a check to ensure that the target ticks do not drift away more than one second.
* [HTML5] Make home path persistent in editor.Fabio Alessandrelli2021-02-031-0/+7
| | | | | | | | | We used to only persist specific sub-folder of /home/web_user/ when running the Web Editor. This resulted in bad UX about default project creation path etc. This PR makes the whole folder persistent, move the zip preloading to a different folder (to avoid persisting it), and automatically prompt the user to import it if present.
* Fix JavaScript platform after MainLoop methods rename.Fabio Alessandrelli2021-01-101-1/+1
|
* 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 🎆
* [HTML5] GDNative support via SIDE_MODULE.Fabio Alessandrelli2020-12-051-1/+1
| | | | Working with emscripten >= 2.0.10
* [HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli2020-11-101-75/+8
| | | | | | | | | 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-41/+31
| | | | | | | | | | | | | | 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).
* Expose request_quit method to JS in HTML5 export.Fabio Alessandrelli2020-09-231-0/+17
|
* Merge pull request #40755 from Faless/js/fix_and_cancel_swapRémi Verschelde2020-07-271-0/+1
|\ | | | | Cancel/OK swap on HTML5 platform, small fixes.
| * Correctly include <stdlib.h> in javascript main.Fabio Alessandrelli2020-07-271-0/+1
| | | | | | | | | | Already fixed in 3.2, this header is needed since it's where setenv is declared and we should not assume it to be already included.
* | t Add unit testing to Godot using DocTest and added to GitHub Actions CIRevoluPowered2020-07-241-0/+4
|/ | | | | | | | | | Implements exit codes into the engine so tests can return their statuses. Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically. Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header. This lowers the complexity of running the unit tests and even for physics should be possible to implement such a fix.
* Use dummy driver when JS AudioContext is unavailable.Fabio Alessandrelli2020-07-011-1/+8
|
* Limit FPS in JS by skipping iterations.Fabio Alessandrelli2020-07-011-0/+10
|
* [JS] Check canvas size each loop, force redraw.Fabio Alessandrelli2020-07-011-0/+4
| | | | Fix compatibility issues, achieve smoother resizing.
* Refactor canvas ID and locale handling.Fabio Alessandrelli2020-07-011-2/+20
|
* Fix FS error on JS startup due to existing folder.Fabio Alessandrelli2020-07-011-2/+5
|
* Immediately run first iteration after JS FS sync.Fabio Alessandrelli2020-06-141-4/+8
| | | | | Which is now run inside an animation frame. This avoid a 1 frame black screen when setting up the canvas.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-3/+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 drop files functionFabio Alessandrelli2020-05-101-0/+1
|
* DisplayServerJavaScript implementation.Fabio Alessandrelli2020-05-101-6/+43
|
* 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.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+1
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Refactor OS_JavaScriptLeon Krause2018-07-101-16/+11
|
* Javascript: Remove weird logMax Hilbrunner2018-05-241-2/+0
|
* Refactor JavaScript platform build scriptLeon Krause2018-03-261-1/+1
|
* Fix internal Emscripten JS API callsLeon Krause2018-01-061-1/+1
| | | | Emscripten 1.37.24 no longer exports these by default
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | 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.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Change HTML5 start-up APILeon Krause2017-11-191-1/+0
| | | | | | | | Rename engine.start() to startGame(), new start() takes string arguments handed directly to main(). Rename Engine.loadEngine() to load(). Add setLocale(), setResizeCanvasOnStart(), setExecutableName() and preloadFile().
* Add OS::is_userfs_persistent to check user:// persistenceLeon Krause2017-10-021-9/+7
| | | | Allows starting HTML5 export when IndexedDB is not available.
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Remove GLUT usage in HTML5 platformL. Krause2017-04-281-60/+16
|
* Reimplement HTML5 mouse input without GLUTL. Krause2017-04-251-72/+0
| | | | Fixes inverted scrolling on Chromium
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* WebGL 2 export per WebAssembly or asm.jseska2017-03-291-9/+4
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-69/+56
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Fixes to webgl/opengl es 3.0 for compatibility with webgl2.0, still does not ↵Juan Linietsky2017-02-221-1/+1
| | | | work though
* -renamed globals.h to global_config.cpp (this seems to have caused a few ↵Juan Linietsky2017-02-211-3/+2
| | | | | | modified files) -.pck and .zip exporting redone, seems to be working..
* Style: Prevent clang-format on JS codeRémi Verschelde2017-01-161-0/+2
|
* Merge pull request #7519 from eska014/web-presentationRémi Verschelde2017-01-151-22/+20
|\ | | | | Improve Web export presentation
| * Improve usability and style in web export presentationeska2017-01-141-22/+20
| | | | | | | | | | | | | | | | | | | | | | | | - Check for WebGL support, don't load if unsupported - Check for IndexedDB support - Make canvas support check message visible - Colored debug output for warnings and errors - Make it obvious status can be closed by clicking - Don't use status to display non-critical errors - Limit output message count - Add clear output button - Fix setting total memory
* | Style: Fix whole-line commented codeRémi Verschelde2017-01-141-2/+2
| | | | | | | | | | They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
* | Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
|/ | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* Fix some mouse bugs in WebAssembly/asm.jseska2016-11-301-3/+8
| | | | | - Emit mouse wheel release events - Set button masks, fixes #5092
* OS additions and fixes for WebAssembly/asm.jseska2016-11-301-1/+1
| | | | | | | - Implement alert, shell_open, set_window_title - Add locale lookup, fixes #2477 - Print without color control sequences - Move get_executable_path implementation to OS_JavaScript