Commit Graph

460 Commits

Author SHA1 Message Date
ad4cc8682b [Windows] Fix GCC MinGW warnings. 2022-10-12 20:19:17 +03:00
5aadc618b6 Merge pull request #66102 from MJacred/feature/getvideoadapterdriverinfo
Fetch video adapter driver name and version from OS
2022-10-11 13:59:53 +02:00
de768afbdc Fetch video adapter driver name and version from OS on Linux/*BSD and Windows 2022-10-11 12:39:41 +02:00
6ad1a635ee Merge pull request #67242 from akien-mga/cleanup-unused-defines
Cleanup unused defines in platform code
2022-10-11 12:34:10 +02:00
a92c564a02 Cleanup unused defines in platform code 2022-10-11 11:52:41 +02:00
e14c5186e2 Fix newlines not honored in Windows console
This is relevant when building with `windows_subsystem=console`.
2022-10-11 10:09:50 +02:00
6c58327c69 Merge pull request #66965 from bruvzg/win_llvm
[Windows] Fix LLVM MinGW build.
2022-10-06 08:57:29 +02:00
6afb2d0225 [Windows] Fix LLVM MinGW build. 2022-10-06 09:30:25 +03:00
6bf02c0162 Keep a single, portable implementation of OS::get_processor_count() 2022-10-05 20:10:47 +02:00
ac9786c525 Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP

Co-authored-by: bruvzg
2022-09-16 11:17:36 +02:00
0aecfc9254 Fixes #65377: get_datetime_* functions can return wrong values 2022-09-10 07:58:38 +08:00
d2a6a187f4 Merge pull request #44118 from Calinou/windows-enable-ansi-escape-codes
Enable ANSI escape code processing on Windows 10 and later
2022-09-08 19:53:04 +03:00
10a56981dc Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
6e647dea24 Remove unused force_quit variable from many OS abstractions 2022-08-27 13:41:53 +02:00
debfc7c38b Enable ANSI escape code processing on Windows 10 and later
This lets the engine and projects use the same color codes
in the terminal on all platforms. This includes support for
`print_rich()` (GDScript) and `print_line_rich()` (C++).
2022-08-10 00:53:11 +02:00
36ef8f29dc Implement support for loading system fonts on Linux, macOS / iOS and Windows. 2022-07-26 08:38:05 +03:00
f3979527de Fixes OS.get_unique_id() string not getting printed properly
Fixes #61023

Changing it back to how it's done on the 3.x branch fixed the text not being written properly.
2022-07-24 11:05:36 +02:00
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
349aa9c884 Merge pull request #60894 from derammo/derammo_opengl3_windows 2022-05-13 15:07:13 +02:00
96c21bc749 opengl3 driver now works on windows including multi window
fixed and simplified gl_manager_windows
swap buffers now called for all windows
fixed missing pixel format setting in additional windows
    this makes them work in OpenGL contexts
changed verbose error printing to write once
    this error message happens very frequently while opengl3 is not finished
removed dead code no longer needed after changes
fixed comments that were misinformation
window messages during window creation now handled
    these were previously discarded
    messages now tunnel the required context
changed failure to create opengl3 window on windows to be more fatal
marked a problem with pen code
conditional compilation of vulkan and opengl3 on windows fixed
windows debug builds now show messages on debug console also
rendering driver selection box now shows only compiled drivers
marked some problematic code
thanks to akien-mga for patiently rewriting my style mistakes
2022-05-11 16:12:40 -04:00
a71e808112 Try to convert OS::execute() output to Unicode on Windows 2022-05-10 20:54:48 +08:00
f3c1232c59 Add OS::is_process_running function.
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.
2022-05-03 17:27:17 -07:00
80f61352fb Add GDNativeInterface::get_library_path to GDExtension 2022-04-29 00:51:04 +02:00
c0cc41d6c1 Improve embedded PCK loading and exporting.
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.
2022-04-20 11:09:59 +03:00
4802f15231 Fix DST Error on Windows 2022-03-17 06:28:08 -04:00
b8b4580448 Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
ee7cd9a3a1 Add an OS.get_processor_name() method
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.
2022-02-15 20:55:53 +01:00
6b5634b96a [OS/Crypto] Add get_entropy to OS.
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.
2022-02-14 10:45:50 +01:00
99a1e552ac [Windows] Disable console I/O redirection, if it's already redirected to the pipe or file. 2022-01-28 08:30:01 +02:00
9590eeebb5 Minor typo fixups to Windows console changes 2022-01-27 03:11:00 +01:00
8bdef23f7f Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
5ba38fb208 Windows: Simplify QueryPerformanceCounter usage 2022-01-05 07:40:46 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
ea5bb8b47d [Windows] Improve console handling and execute/create_process.
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.
2021-12-18 10:14:07 +02:00
1fdb6a99c8 [Windows] Detect new Windows Terminal and disable unsupported set_console_visible code. 2021-12-15 20:00:57 +02:00
6ee48afb4e [Windows] Open a new console window for the editor instances. 2021-12-14 14:49:58 +02:00
49403cbfa0 Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
675111e480 Restore console window output for editor app on Windows 2021-11-25 22:06:45 +03:00
f6d16d55c6 Fix data directory of unnamed projects 2021-11-18 12:31:29 +01:00
3c9d7203ea Fix dwFlags on CreateProcessW calls 2021-11-04 09:50:45 -03:00
2dabdda36a Update Time documentation 2021-10-28 10:16:56 -05:00
007cb5ccfb Implement get_cache_path() for iOS, and improve it for Android and Windows 2021-10-09 11:13:26 +02:00
b1c6826b9f Merge pull request #52963 from Pineapple/WIN32_LEAN_AND_MEAN_master 2021-10-05 12:03:05 +02:00
b78d399f91 revert 0d7409a so additional error information prints in release builds 2021-10-04 16:55:01 -06:00
425ed0ffe0 Add missing WIN32_LEAN_AND_MEAN 2021-09-23 10:35:00 +02:00
c4787a8e6d Fix shell_open not returning errors on Windows 2021-09-19 11:29:56 +01:00
3a00ff1cce Add partial support for Android scoped storage.
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.
2021-08-16 23:11:56 -07:00
4e6efd1b07 Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
618eb27e8b Move alert function from DisplayServer to OS. 2021-07-22 21:50:35 +03:00
119a59f872 Replace backslash with forward slash in OS_Windows path methods 2021-07-04 09:04:21 +03:00