Commit graph

108 commits

Author SHA1 Message Date
Fredia Huya-Kouadio
f3cdff46fc Add benchmark logic
Add benchmarking measuring methods to `OS` to allow for platform specific overrides (e.g: can be used to hook into platform specific benchmarking and tracing capabilities).
2023-03-20 23:29:36 -07:00
Fredia Huya-Kouadio
48a55ffad3 Provide a delegate implementation for the killProcess logic on Android
The implementation forwards the kill request to the Godot host for handling. If the Godot host is unable to handle the request, it falls back to the `OS_Unix::kill(...)` implementation.
2023-01-26 03:33:22 -08:00
Rémi Verschelde
1426cd3b3a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".

Backported from #70885.
2023-01-10 15:26:54 +01:00
Fredia Huya-Kouadio
46f091a803 Add cursor shape support for the Android platform 2022-10-05 12:08:54 -07:00
Rémi Verschelde
0bed7ea63f
Merge pull request #61316 from bruvzg/tts_3x
[3.x] Backport text-to-speech support.
2022-08-05 23:45:51 +02:00
Rémi Verschelde
26762a71b6
Merge pull request #58537 from winterpixelgames/feature/virtual-keyboard-types-3.x 2022-08-05 19:37:13 +02:00
Brian Semrau
ce24b48e50 Add support for multiple virtual keyboard types 2022-07-07 14:22:28 -04:00
Fredia Huya-Kouadio
27b63247fd Fix issue causing the Android Editor port to crash when saving a scene
In addition:
- Disable 'adb devices' query (not supported when running the editor on Android devices
- Add `move_to_trash` implementation for Android devices
2022-07-05 02:59:52 -07:00
bruvzg
6489fe890e
Backport text-to-speech support. 2022-07-01 11:04:50 +03:00
Marcel Admiraal
7a782edeaa Cleanup Android C++ code 2022-05-31 17:11:44 +01:00
Marcel Admiraal
ec2270b88f Add a method for obtaining display cutouts on Android 2022-04-26 13:52:33 +02:00
Fredia Huya-Kouadio
3ba0508f79 Update the editor display scale based on the device's scaled density 2022-04-04 04:18:56 -07:00
Fredia Huya-Kouadio
8ca32d1727 Fix flickering issues with low processor mode on Android 2022-03-29 12:17:25 -07:00
Fredy Huya-Kouadio
cb0b2aefc3 Android port of the Godot Editor
These set of changes focus primarily on getting the core logic and overall Godot Editor UI and functionality up and running natively on Android devices.
UI tweaks / cleanup / polish, as well configuration for Android specific functionality / restrictions will be addressed in follow-up PRs iteratively based on feedback.

Co-authored-by: thebestnom <shoval.arad@gmail.com>
2022-03-28 07:54:10 -07:00
Hugo Locurcio
cec7c908ca
Add get_screen_refresh_rate() to OS
This method can be used to get the refresh rate of a given screen.
It is supported on Windows, macOS, Linux, Android and iOS (but not
HTML5).
2022-03-10 22:10:48 +01:00
Haoyu Qiu
76297e744d Add OS.has_clipboard() to check clipboard content 2022-01-19 20:19:06 +08:00
Rémi Verschelde
a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
Marcel Admiraal
4d3690eba5 Remove unimplemented methods 2021-11-18 12:47:36 +00:00
Pedro J. Estébanez
abdf931832 Add off-screen GL context 2021-11-09 12:19:12 +01:00
Pedro J. Estébanez
25f01cb09d Implement get_cache_path() for iOS, and improve it for Android and Windows 2021-11-08 22:33:54 +01:00
PouleyKetchoupp
52fdb4ece9 Window transparency support on Android
Implements per-pixel transparency feature on Android.
Allows plugins to do specific rendering and render godot UI on top
(useful for camera support with drawing on top).
2021-09-15 10:41:08 -07:00
ne0fhyk
c88d1608ab 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-13 11:04:17 -07:00
Pedro J. Estébanez
45c2a7159e Switch to input buffering on Android
Key, touch and joystick events will be passed directly from the UI thread to Godot, so they can benefit from agile input flushing.

As another consequence of this new way of passing events, less Java object are created at runtime (`Runnable`), which is good since the garbage collector needs to run less.

`AndroidInputHandler` is introduced to have a smaller cross-thread surface. `main_loop_request_go_back()` is removed in favor just inline calling `notification()` on the `MainLoop` at the most caller's convenience.

Lastly, `get_mouse_position()` and `get_mouse_button_state()` now just call through `InputDefault` to avoid the need of sync of mouse data tracked on the UI thread.
2021-08-08 13:41:27 +02:00
Rémi Verschelde
c7c93355e3
Merge pull request #49436 from madmiraal/add-android-external-dir-3.x
[3.x] Add OS.get_external_data_dir() to get Android external directory
2021-06-10 18:24:21 +02:00
Marcel Admiraal
6d63ccba31 Add OS.get_external_data_dir() to get Android external directory 2021-06-10 16:48:37 +01:00
Marcel Admiraal
cdba79ca72 Remove unused AudioDriverAndroid from Android 2021-06-10 08:31:23 +01:00
Rémi Verschelde
e96f0ea1d7
Android: Remove non-functional native video OS methods
Those methods are only properly implemented for iOS.

Supersedes #43811.
2021-05-07 16:42:17 +02:00
bruvzg
dab4cf3ed6
Add physical_scancode (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2021-05-06 23:19:45 +03:00
Rémi Verschelde
b5e1e05ef2
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
Rémi Verschelde
49646383f1
Update copyright statements to 2021
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 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
Mark Riedesel
92ff6c5164 Implement OS.get_screen_orientation() for Android 2020-11-13 10:14:06 -05:00
thebestnom
8405f1225e [3.2] Android: Keyboard modifier and arrow key support 2020-11-13 15:10:17 +02:00
thebestnom
191c84f952 Android: Mouse Implementation
Implement mouse
Move touch to inputManager
Change to use android/input.h
2020-10-30 15:23:29 +02:00
Mark Riedesel
2bec10fd1c Implement OS.get_window_safe_area() for Android 2020-10-27 11:52:20 -04:00
PouleyKetchoupp
c0b394572f Fix Return key events in LineEdit & TextEdit on Android
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.

Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.

Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.

Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
2020-07-17 18:25:40 +02:00
SkyJJ
2197ef0566 Fix Android LineEdit editing bugs
(cherry picked from commit cc473b948f)
2020-05-20 12:07:08 +02:00
Bruno Lourenço
a3bcdbeb78 Android virtual keyboard respecting LineEdit max length. 2020-01-23 01:52:49 +00:00
Alexander Holland
b1b308411a Fixes Android FileDialog
- Go up was not working, simplify was used one time too much
- Added GestureHandler
  - Added doubleTap to recognize open dir
  - Fixed scroll where sometimes the scroll jumped between start and end when pointer was outside or on the edge of the scroll area
2020-01-10 15:25:08 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
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.
2020-01-01 11:16:22 +01:00
bruvzg
2ef8c5fac5
iOS modular build and export implementation. 2019-12-01 21:57:18 +02:00
Cagdas
0088385556 Add request permission automatically at android 2019-10-22 22:52:13 +03:00
Alexander Holland
db582a2c8c Adds Pen support for Android 2019-10-04 23:57:01 +02:00
volzhs
4061e5bb75 Support vibration for Android and iOS 2019-08-21 23:38:53 +09:00
BastiaanOlij
02ea99129e Adding a new Camera Server implementation to Godot.
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.
2019-06-15 21:30:32 +10:00
hbina085
f78baa5f93 added a const keyword for a methods that return constant literal... 2019-05-21 02:16:30 -04:00
Guilherme Felipe
1bae73d7d0 Add Input::get_current_cursor_shape
[Clean up] Removed unused/unnecessary methods.
2019-04-15 15:22:09 -03:00
Bastiaan Olij
b2c0a687f1 Restructuring glue code to make it easier to extend 2019-04-05 21:44:06 +11:00
DESKTOP-3H3MR3A\eloisa
b22cf46fdb Request Android record permission when needed 2019-03-08 12:38:36 -03:00
Pedro J. Estébanez
2d0d64794e Restart game on GL context loss on Android
Bonus:
Remove useless old code about reload hooks

Fixes #22955.
2019-03-06 19:09:17 +01:00
Rémi Verschelde
bc26d0d6cd Platform: Ensure classes match their header filename
Also drop some unused files.

Renamed:
- `platform/iphone/sem_iphone.h` -> `semaphore_iphone.h`
  (same for `osx`)
- `platform/uwp/gl_context_egl.h` -> `context_egl_uwp.h`
- in `platform/windows`: `context_gl_win.h`, `crash_handler_win.h`,
  `godot_win.cpp`, `joypad.h` and `key_mapping_win.h` all renamed to
  use `windows`. Some classes renamed accordingly too.
- `EditorExportAndroid` and `EditorExportUWP` renamed to
  `EditorExportPlatformAndroid` and `EditorExportPlatformUWP`
- `power_android` and `power_osx` renamed to `PowerAndroid` and
  `PowerOSX`
- `OSUWP` renamed to `OS_UWP`

Dropped:
- `platform/windows/ctxgl_procaddr.h`
2019-02-12 16:56:25 +01:00