Commit graph

1072 commits

Author SHA1 Message Date
kobewi
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
MinusKube
7b05df8029 Move windows display server's 'outside' field to WindowData struct 2022-07-07 21:11:00 +02:00
bruvzg
a194043ea8
Check if GL manager exist to prevent crash when using multithreaded renderer with Vulkan. 2022-07-06 09:56:47 +03:00
Rémi Verschelde
344b42703b
Merge pull request #62212 from hansemro/eraser-detect-4
Add inversion/eraser-end property for tablet pens
2022-07-04 21:48:19 +02:00
Hansem Ro
6dcc9d1131 [macOS, Windows, X11] Add stylus inverted/eraser support to
InputEventMouseMotion event
2022-07-04 10:36:53 -07:00
Jan Haller
d38d76d039 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.
2022-07-02 01:17:35 +02:00
gregcsokas
42e619c01e Adding function key support from F17 to F35
OSX supports everything by default,
Linux is also capable of supporting every function key,
Windows as I know support only up to F24
2022-06-16 19:38:21 +02:00
bruvzg
e00571b194
Add readable export errors. 2022-06-08 17:55:46 +03:00
bruvzg
40b3be7912
Remove mouse events that closed the popup from queue, to fix pop-up reopening. 2022-06-02 08:35:27 +03:00
Rémi Verschelde
9923851370 Fix typos with codespell
Using codespell 2.2-dev from current git.
2022-05-23 21:32:19 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Rémi Verschelde
ccdd85d8e7
Merge pull request #61001 from derammo/derammo_popup_conditional_hide 2022-05-17 12:56:53 +02:00
reduz
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
derammo
47d0dc8a41 popup deferred hide suppressed if reopened
popup no longer tries to close itself a second time
popup no longer closes after having been reopened
fixed bug in RenameDialog not calling base (by inspection)
fixes #59181
fixes #60921
reverts #59287
2022-05-13 09:30:00 -04:00
Rémi Verschelde
349aa9c884
Merge pull request #60894 from derammo/derammo_opengl3_windows 2022-05-13 15:07:13 +02:00
derammo
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
Haoyu Qiu
a71e808112 Try to convert OS::execute() output to Unicode on Windows 2022-05-10 20:54:48 +08:00
bruvzg
b268c4b4bc [Windows] Save and re-apply window icon when changing window style. 2022-05-10 11:12:04 +03:00
Rémi Verschelde
c366f8d2d4 Crash handler: Use print_error to include backtrace in logs 2022-05-05 12:22:56 +02:00
bruvzg
800a68837f Fix export plugins after embedded PCK loading changes. 2022-05-04 12:57:21 +03:00
mdavisprog
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
Rémi Verschelde
297241f368
Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
2022-05-03 14:28:18 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Emmanuel Leblond
80f61352fb
Add GDNativeInterface::get_library_path to GDExtension 2022-04-29 00:51:04 +02:00
bruvzg
6ab672d1ef Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
2022-04-28 14:35:41 +03:00
bruvzg
2ca91948de [Windows Export] Improve error messages for missing rcedit and signtool. 2022-04-28 10:48:30 +03:00
bruvzg
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
bruvzg
8b0761d1fd
Fix sub-menu keyboard navigation. 2022-04-13 09:58:38 +03:00
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
bruvzg
daa42e0e50
Fix a possible race condition on popup close, that might cause multiple deletions of the same list item. 2022-04-05 12:44:29 +03:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Rémi Verschelde
a647fb3e62 Fix typos with codespell
Using codespell 2.2-dev from current git.

Fix a couple incorrect uses of gendered pronouns.
2022-03-31 14:07:29 +02:00
Lyuma
ee02a7f785 Keep editor at normal priority on windows.
The multithreaded importer often causes system-wide hangs when importing more than 20 files at a time.
Running the editor at normal priority allows other applications on the system to be responsive during long imports.
2022-03-29 00:01:31 -07:00
Markus Sauermann
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
Aaron Franke
13392a96e9
Generate export template file names instead of having a fixed set 2022-03-22 10:16:03 -05:00
Aaron Franke
f301451fa3
Move extension logic to EditorExportPlatformLinuxBSD 2022-03-21 12:50:31 -05:00
Aaron Franke
e5e697564d
Move fixup_embedded_pck to EditorExportPlatform classes 2022-03-20 21:04:22 -05:00
Rémi Verschelde
02f61d9fb3
Merge pull request #59287 from Vitika9/59181
Right-clicking will not close popup in windows
2022-03-18 19:45:30 +01:00
Vitika9
8bbc7614f6 Right-clicking will not close popup 2022-03-18 22:13:54 +05:30
Rémi Verschelde
cc1bc09090
Merge pull request #58455 from bruvzg/export_script 2022-03-18 14:34:42 +01:00
Rémi Verschelde
70eb95c30c
Merge pull request #57850 from pkowal1982/icon
Change godot.ico to uncompressed/fixed size
2022-03-18 07:41:30 +01:00
ztco224
4802f15231 Fix DST Error on Windows 2022-03-17 06:28:08 -04:00
Rémi Verschelde
fa37f17029 Windows: Properly set mouse_monitor instead of shadowing it
GCC was raising a warning about unused variable, but it's actually meant
to be used in the destructor for deinit.
2022-03-16 15:48:56 +01:00
bruvzg
f0315c28a8
[Export] Add "export console script" option for Linux, macOS, and Windows exports. 2022-03-14 17:19:18 +02:00
Hendrik Brucker
fba80dbd63 Reenable window_set_vsync_mode on Windows 2022-03-13 15:04:59 +01:00
bruvzg
3cc37342c4
[X11] Do not try to focus unmapped window. 2022-03-08 11:46:44 +02:00
bruvzg
74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02:00
bruvzg
d39ec5b9ed [Windows] Fix borderless window flag toggle and restoring minimized borderless window. 2022-02-22 10:56:58 +02:00
bruvzg
0c27667124 [Windows] Fix Vulkan driver crash on sub-window minimization. 2022-02-17 13:34:08 +02:00
Rémi Verschelde
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
Hugo Locurcio
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
Fabio Alessandrelli
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
Rémi Verschelde
d3a6b6daaa
Merge pull request #56953 from bruvzg/ex_wnd 2022-02-12 16:46:55 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
bruvzg
7d59b81d79
Add exclusive window handling to DisplayServer (on macOS and Windows). 2022-02-12 00:14:09 +02:00
bruvzg
65426f831f [Windows] Fix drag-and-drop. 2022-02-11 09:34:55 +02:00
pkowal
d469cfb2ab Change godot.ico to uncompressed/fixed size 2022-02-09 11:20:49 +01:00
Rémi Verschelde
90162851a7
Core: Move generated VERSION_HASH to a .cpp file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +01:00
bruvzg
8bc837453b [Windows] Fix fullscreen mode detection on window move/resize. 2022-02-08 10:36:57 +02:00
TechnicalSoup
20fb34927d Fix icons for sub windows
Modify the create_sub_window method to set an icon for all sub windows, setting the icon to the same icon as the main window.

Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
2022-02-07 23:03:10 +11:00
Rémi Verschelde
225a3b2545
Merge pull request #57341 from bruvzg/win_multiwin_fs 2022-02-04 13:28:56 +01:00
Rémi Verschelde
d235c1bb19
Merge pull request #57335 from jordigcs/display-refresh-rate 2022-02-04 11:51:07 +01:00
Rémi Verschelde
85f6151e9d
Merge pull request #54645 from rxlecky/editor-window-offset-bug-45740 2022-02-04 11:48:57 +01:00
bruvzg
f4ea9cd9f3
[Windows] Add WS_BORDER flag to windows in WINDOW_MODE_FULLSCREEN mode to allow multi-window interface in full-screen.
[Windows] Add WINDOW_MODE_EXCLUSIVE_FULLSCREEN without WS_BORDER flag enabled (no multi-window support).
2022-02-04 12:08:46 +02:00
jordi
54dec44dba Add screen_get_refresh_rate to DisplayServer 2022-02-03 21:50:32 -06:00
Rémi Verschelde
e165f18ae5
Merge pull request #57350 from NeilKleistGao/master 2022-02-03 12:36:23 +01:00
NeilKleistGao
1cf2b9a44b Add warning for Windows export when rcedit is not configured 2022-02-03 16:25:00 +08:00
Rémi Verschelde
ea12094f19
Merge pull request #57497 from Geometror/fix-mouse-mode 2022-02-01 14:46:30 +01:00
Rémi Verschelde
5a1f42b322
Windows: Fix GCC -fpermissive error with 'pck' section workaround
Follow-up to #57450.
2022-02-01 11:33:41 +01:00
Hendrik Brucker
c058361a23 Fix captured mouse mode 2022-02-01 03:49:51 +01:00
SeleckyErik
d14165dae9 Simplify DisplayServerWindows pos/size message handling
Replace WM_MOVE and WM_SIZE message handling with WM_POSCHANGED instead.
This is for multiple reasons:
1) Microsoft suggest using WM_POSCHANGED is more efficient
2) RectChanged callback is only called once for most window operations
3) Simplifies message handling code
2022-01-31 18:28:48 +01:00
Bartłomiej T. Listwon
e4bde938a1 Prevent LTCG (MSVC LTO) from removing "pck" section 2022-01-30 16:45:28 +01:00
Rémi Verschelde
83c7bf6d94
Merge pull request #57336 from bruvzg/win_con_redir 2022-01-28 15:04:09 +01:00
bruvzg
2c8511579f Fix MOUSE_MODE_CONFINED not updating area when full-screen is toggled or current screen is changed. 2022-01-28 10:15:08 +02:00
bruvzg
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
Rémi Verschelde
4b36b6e92a
Merge pull request #56785 from bruvzg/nat_handles_4 2022-01-27 12:12:34 +01:00
Max Hilbrunner
9590eeebb5 Minor typo fixups to Windows console changes 2022-01-27 03:11:00 +01:00
Rémi Verschelde
57a057f7ff
Merge pull request #56754 from madmiraal/fix-45592 2022-01-24 10:05:42 +01:00
bruvzg
3bf05c9018
[Export] Instead of removing unsupported options, hide it. 2022-01-22 22:56:58 +02:00
bruvzg
d62ca0c9c0 Window management improvements.
[macOS] Fix transient windows not working in the full-screen mode.
[macOS] Fix moving transient windows to the other screen than parent window.
[macOS] Fix popup menu switch on hover.
[macOS] Use content origin rect for windows position (to ensure `DS.mouse_get_position` is equal to `DS.window_get_position` + mouse position from the input events).
[macOS] Fix incorrect input coordinates, when external display with different scaling in connected/disconnected.
[macOS/Windows] Fix moving fullscreen windows between the screens.
Add auto refocusing of the parent window, when the focused transient window is closed.
Remove redundant `DS.mouse_get_absolute_position` function (returns mouse position in the screen coordinates, same as `DS.mouse_get_position`).
2022-01-18 11:47:03 +02:00
Rémi Verschelde
8bdef23f7f
Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
Rémi Verschelde
5f4e90d602
Merge pull request #56238 from madmiraal/fix-44178
Fix Actions mapped to triggers not using the full range
2022-01-14 19:59:29 +01:00
Marcel Admiraal
f41c72c538 Fix Actions mapped to triggers not using the full range 2022-01-14 15:36:20 +00:00
Yuri Roubinsky
9418a2a599 Flush input events before destroying the window 2022-01-14 17:43:31 +03:00
bruvzg
89f37d4105
Add support for getting native display, window, and view handles. 2022-01-14 13:36:32 +02:00
Marcel Admiraal
5250cdd150 Use mouse event relative motion to calculate mouse velocity 2022-01-13 15:23:21 +00:00
Rémi Verschelde
46624388d4
Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
Rémi Verschelde
277a159c48
Merge pull request #56497 from Pineapple/qpc-tweaks
Windows: Simplify QueryPerformanceCounter usage
2022-01-08 23:40:01 +01:00
Max Hilbrunner
6a6c4f2197 Windows input: Fix wrong OEM key, add missing keys 2022-01-05 12:20:47 +01:00
Bartłomiej T. Listwon
5ba38fb208 Windows: Simplify QueryPerformanceCounter usage 2022-01-05 07:40:46 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Marcel Admiraal
3105d9b1f3 Rename speed to velocity when it's a directional Vector 2021-12-29 15:35:26 +00:00
Yuri Roubinsky
0f83d7272c Fix cursor stucking in resize shape 2021-12-28 13:35:07 +03:00
bruvzg
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
Bastiaan Olij
d08b28aeb0 Fix initialising of gl_manager and checking gl_manager and context_vulkan preventing crash issues. 2021-12-18 12:21:16 +11:00
Rémi Verschelde
33e03386b3
Merge pull request #55966 from bruvzg/wt💩4 2021-12-16 23:05:24 +01:00
Sam Lantinga
8df0baf6f5 Fixed detecting the Valve Streaming Gamepad
Fixed the GUID, and compare the contents of the GUID, not just the pointers
2021-12-16 08:52:47 -08:00
bruvzg
1fdb6a99c8
[Windows] Detect new Windows Terminal and disable unsupported set_console_visible code. 2021-12-15 20:00:57 +02:00
bruvzg
6ee48afb4e
[Windows] Open a new console window for the editor instances. 2021-12-14 14:49:58 +02:00