summaryrefslogtreecommitdiffstats
path: root/core/os/os.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixes #65377: get_datetime_* functions can return wrong valuesJames2022-09-101-7/+3
|
* Drop obsolete resource usage debug methods from OS classRémi Verschelde2022-08-291-4/+0
| | | | | | | | | | | These methods exist since the dawn of (open source) Godot and have hardly been updated over time, so they barely work and I'm fairly sure nobody is using them. (See #46505 for details.) While some of the functionality they aimed to provide might be useful for optimization work and introspection, this should likely be redesigned from scratch with a cleaner and more modern interface (e.g. exposed via the Performance singleton, or ResourceLoader, and a better API overall).
* Merge pull request #58530 from Calinou/os-remove-dump-memory-to-fileRémi Verschelde2022-08-251-1/+0
|\ | | | | Remove unimplemented `OS.dump_memory_to_file()` method
| * Remove unimplemented `OS.dump_memory_to_file()` methodHugo Locurcio2022-08-181-1/+0
| | | | | | | | | | | | This method never did anything in Godot since 3.0, since its code was commented out. The last time the method had an implementation was in Godot 2.1.x.
* | Overhaul CLI argument forwarding to processes started by the editorPedro J. Estébanez2022-08-191-3/+0
|/
* Add support for command-line user arguments.Juan Linietsky2022-08-011-1/+3
| | | | | | | | | | Implements the standard Unix double dash (--) commandline argument: * Arguments after a double dash (--) are ignored by Godot and stored for the user. * User can access them via `OS.get_cmdline_user_args()` Example: `godot.exe scene_to_run.tscn --fullscreen -- --start-level 2`
* Implement support for loading system fonts on Linux, macOS / iOS and Windows.bruvzg2022-07-261-0/+2
|
* [macOS] Improve file association handling, and allow URL schema handling.bruvzg2022-07-071-0/+1
|
* Adding print_rich for printing with BBCodeVoylin2022-06-291-0/+1
|
* Implement Running Godot as Movie Writerreduz2022-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Allows running the game in "movie writer" mode. * It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time). * If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult. * Implements a simple, default MJPEG writer. This new features has two main use cases, which have high demand: * Saving game videos in high quality and ensuring the frame rate is *completely* stable, always. * Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this). **Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly). Usage: $ godot --write-movie movie.avi [scene_file.tscn] Missing: * Options for configuring video writing via GLOBAL_DEF * UI Menu for launching with this mode from the editor. * Add to list of command line options. * Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
* Basic 3D renderingclayjohn2022-05-121-8/+0
|
* Add OS::is_process_running function.mdavisprog2022-05-031-0/+1
| | | | | | | | 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.
* Merge pull request #60601 from touilleMan/gdextension_get_library_pathRémi Verschelde2022-05-031-1/+1
|\ | | | | Add GDNativeInterface::get_library_path to GDExtension
| * Add GDNativeInterface::get_library_path to GDExtensionEmmanuel Leblond2022-04-291-1/+1
| |
* | Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde2022-05-021-2/+1
|/ | | | | | | | | | | Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
* Improve embedded PCK loading and exporting.bruvzg2022-04-201-0/+2
| | | | | | | | | | Windows export process: Limit size of executable with embedded PCK to 4 GB. Use "rcedit" before embedding PCK. Capture and process "rcedit" errors. Windows, Linux: Add support for PCK loading from executable "pck" section.
* Zero initialize all pointer class and struct membersRémi Verschelde2022-04-041-2/+0
| | | | | This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
* Add an `OS.get_processor_name()` methodHugo Locurcio2022-02-151-0/+1
| | | | | | | | This method can be used to get the CPU model name. It can be used in conjunction with `RenderingServer.get_video_adapter_name()` and `RenderingServer.get_video_adapter_vendor()` for annotating benchmarks and automatic graphics quality configuration.
* [OS/Crypto] Add get_entropy to OS.Fabio Alessandrelli2022-02-141-0/+2
| | | | | | | | | | | | | | | Implemented via `BCryptGenRandom` on Windows. Implemented via `getentropy` syscall when available. Implemented via `/dev/urandom` device as a fallback. The `/dev/urandom` fallback can be disabled via the `NO_URANDOM` build flag. Note: The HTML5 version relies on emscripten file system urandom device which itself uses the Crypto API when available or the plain old not crypto-safe `Math.random()` otherwise. Restore get_entropy.
* Improve compilation speed (forward declarations/includes cleanup)Hendrik Brucker2022-02-121-1/+0
|
* Replace use of `OS::set_exit_code()` by `SceneTree::quit()` in `EditorNode`Emmanuel Leblond2022-01-181-0/+3
|
* 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!
* [HTML5] Add WebGL2 (GLES3) support using the OpenGL renderer.Fabio Alessandrelli2021-11-191-1/+1
| | | | | | | 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.
* [OS] Add ThreadWorkPool default size to OS.Fabio Alessandrelli2021-11-021-0/+1
| | | | | | | | | | | | | | | | | 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.
* [macOS] Add `create_instance` function to spawn editor copies.bruvzg2021-11-011-0/+1
| | | | [macOS] Modify `create_project` function to detect and run app bundles using NSWorkspace to ensure app window is registered and activated correctly.
* Add GLES2 2D renderer + Linux display managerlawnjelly2021-10-301-0/+19
| | | | | | | | | First implementation with Linux display manager. - Add single-threaded mode for EditorResourcePreview (needed for OpenGL). Co-authored-by: clayjohn <claynjohn@gmail.com> Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
* Update Time documentationAaron Franke2021-10-281-2/+2
|
* Implement toast notifications in the editorGilles Roudière2021-10-141-1/+1
|
* Merge pull request #48685 from bruvzg/bundle_icon_4Rémi Verschelde2021-09-301-0/+1
|\
| * [macOS] Prefer .app bundle icon over the default one.bruvzg2021-05-131-0/+1
| |
* | Implement `OS::get_locale_language()` helper methodRémi Verschelde2021-09-161-0/+1
| | | | | | | | | | | | | | | | | | This method extracts the 2 or 3-letter language code from `OS::get_locale()`, making it easier for users to identify the "main" language code for users that might have different OS locales due to different OS or region, but should be matched to the same translation (e.g. "generic" Spanish). Fixes #40703.
* | --single-window is passed through project manager.Jacob Edie2021-09-151-0/+3
| | | | | | | | This means you can start godot with --single-window
* | Add partial support for Android scoped storage.ne0fhyk2021-08-161-2/+1
| | | | | | | | | | This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30. In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
* | [Headless] Add --headless switch (no rendering, no audio).Fabio Alessandrelli2021-08-031-4/+0
| | | | | | | | | | Also remove now unused "--no-window" option, and relative OS getter and setter.
* | Move `alert` function from `DisplayServer` to `OS`.bruvzg2021-07-221-0/+2
| |
* | Restructure and reimplement vsync optionsHendrik Brucker2021-07-061-2/+0
| | | | | | | | | | -Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX -Removed the V-Sync via Compositor option
* | Add Time singletonAaron Franke2021-06-111-17/+16
| |
* | Add OS.get_external_data_dir() to get Android external directoryMarcel Admiraal2021-06-101-0/+1
|/
* Add flag to stop printing to stdout/stderrGeorge Marques2021-04-061-0/+7
| | | | | This allows the terminal output to be suppressed but still be captured by print/error handlers.
* Remove GDScript bindings for OS.get/set_exit_code, ↵Emmanuel Leblond2021-02-251-2/+0
| | | | SceneTree.quit(<exit_code>) should be used instead
* Fix Godot returned status code on unexpected errorEmmanuel Leblond2021-02-251-1/+4
|
* Move tablet driver API from OS to DisplayServer.bruvzg2021-02-181-5/+0
|
* Split OS::execute into two methodsMarcel Admiraal2021-01-091-1/+2
| | | | | 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 🎆
* Static analyzer fixes:bruvzg2020-12-091-2/+0
| | | | | | Removes unused code in OS. Fixes return types. Fixes few typos.
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-161-1/+0
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-5/+5
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* OS: Remove unused get_splash_tick_msecRémi Verschelde2020-09-241-2/+0
| | | | | | It was added in 3e20391bf607dc7c452b056854aed4a8c99ba0f6 but it doesn't seem particularly useful, and it was only implemented for the custom splash branch and not the default one, so it could return an uninitialized int.