Commit Graph

242 Commits

Author SHA1 Message Date
bruvzg 8033270852 Fix non-HiDPI mode on HiDPI displays on macOS Catalina.
(cherry picked from commit 509afcea92)
2019-10-25 16:28:38 +02:00
KLee1248 e3b1f3c1ad Re-maps KEY_BRACELEFT/RIGHT for OSX users
Should fix #28098.

(cherry picked from commit 8cbfc0365b)
2019-07-03 16:21:30 +02:00
bruvzg d9aa43e793 [macOS] Allow non-resizeable windows to enter fullscreen mode.
(cherry picked from commit 7c7182483f)
2019-04-20 22:23:25 +02:00
bruvzg 754e1b073a [macOS] Fix hiDPI scaling support in `OS.get_real_window_size` and `OS.set_window.size` functions.
(cherry picked from commit 1b6330b125)
2019-04-01 11:11:50 +02:00
Philip Whitfield b717eb714c osx: update mouse position on mouse press 2019-03-07 10:10:33 +01:00
bruvzg 24d59b56d3
[macOS] Fixes NumPad keys detection, adds some missing key mappings. 2019-03-06 22:03:15 +02:00
bruvzg 37f0a6d99a
Fix macOS accumulated mouse scroll events. 2019-03-06 15:35:19 +02:00
Rémi Verschelde b0f782a0e3 Disable driver fallback to GLES2 by default
GLES2 is not designed to be a drop-in replacement for the GLES3 backend,
so the fallback mode has to be used knowingly. It *can* make sense for
simple projects which make sure to handle the differences between both
rendering backends, but most users should stick to one supported backend.

By making it opt-in, we can now use this parameter to define whether to
export ETC textures to Android and iOS when using GLES3 + Fallback.

When using GLES3 without Fallback on Android, set the proper min GLES
version in the AndroidManifest.

Also made the option boolean and renamed it for clarity and to avoid
conflict with the previous String option (which would always evaluate as
"true" otherwise).

Fixes #26569.
2019-03-05 16:36:46 +01:00
Rémi Verschelde b811207406 More style cleanup... 2019-03-04 10:11:29 +01:00
Juan Linietsky a1e73dcc94 Add support for event accumlation (off by default, on for editor), fixes #26536 2019-03-03 19:53:13 -03:00
Juan Linietsky 5eeb06ffd1 -Remove harcoded opengl extension testing from OS, ask rasterizer instead.
-Fixed a bug where etc textures were imported broken
2019-02-26 11:58:47 -03:00
bruvzg ac3158332b
[macOS] Make `move_window_to_foreground` to take focus in addition to moving window to front. 2019-02-23 20:06:33 +02: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
bruvzg 50e2c1e184
[macOS] Fix rendering on retina displays with HiDPI support disabled. 2019-01-31 19:24:57 +02:00
Bastiaan Olij b53f2d1d59 Using DisplayLink to emulate vsync on OSX 2019-01-29 17:00:35 +11:00
Juan Linietsky 0c9fd3c4b4 Avoid cyclic iteration check, fixes #24969 2019-01-22 13:17:39 -03:00
bruvzg b7e9e184aa
[macOS] Fix missing mouse move event speed. 2019-01-11 16:53:11 +02:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde 57c3f6a94b
Merge pull request #20063 from moiman100/fix-button-mask
Unified button mask behavior across platforms
2018-12-14 23:31:52 +01:00
bruvzg 4554c682e6
Changes IME input to use notification instead of callback, exposes IME methods to gdscript/gdnative. 2018-11-23 14:07:48 +02:00
bruvzg bbac90c859
[macOS] Change runtime OS version checks to allow build with MacOS 10.9 SDK, 2018-11-19 23:24:28 +02:00
bruvzg 4aa441591c
[macOS] Disable setWantsLayer on macOS < 10.14 2018-11-18 16:20:29 +02:00
bruvzg 30852d0237
[macOS] Fix blank splash screen 2018-11-09 21:47:23 +02:00
bruvzg 07aee14dd7
Fix initial blank screen on macOS Mojave (except splash). 2018-11-04 11:19:28 +02:00
bruvzg cfce8de0b5
Fix .app bundle crash on macOS 2018-11-04 11:19:28 +02:00
Rémi Verschelde 63d7c9be45
Merge pull request #23431 from buresu/fix-keycode
Fix keycode problem on OSX
2018-11-02 11:02:39 +01:00
Rémi Verschelde 8ac1bcfd3d Fix init of VisualServerRaster
Contrarily to what #23434 assumed, this is not a memory leak,
the VisualServerRaster instance is passed as a parameter to
VisualServerWrapMT's constructor.

Fixes #23437.
2018-11-01 19:23:12 +01:00
George Marques 4c9d734a75 Fix initialization of visual server in all platforms
Avoid leaking an extra instance when using threads. Also fix threaded
loading issues on Android and iOS.
2018-11-01 10:27:04 -03:00
Naoto Kondo ca2476cdb4 Fix keycode problem on OSX 2018-11-01 20:00:02 +09:00
Marcelo Fernandez a069685fbb Fix OS X crash when running as .app 2018-10-29 21:50:41 -03:00
Marcelo Fernandez fe93bb03fe Server platform works on OS X too 2018-10-29 12:54:51 -03:00
Colin Kinloch 464842c62c Update mouse location on background scroll and window focus in macOS 2018-10-24 14:47:37 +01:00
Patrick Beard d2ed3b224a Call -update when window becomes the key window 2018-10-23 07:22:40 -07:00
Rémi Verschelde da6646dd5e
Merge pull request #22685 from remmah/patch-1
Modernized copy/paste APIs on macOS #7185
2018-10-05 12:20:57 +02:00
Rémi Verschelde 97b9697ea2 Fix some OSX and iOS Clang warnings
Fixes the following XCode 9.4.1 warnings:
```
core/os/memory.cpp:175:13: warning: unused variable 's' [-Wunused-variable]
drivers/coremidi/core_midi.cpp:68:14: warning: comparison between NULL and non-pointer ('MIDIEndpointRef' (aka 'unsigned int') and NULL) [-Wnull-arithmetic]
drivers/gles2/rasterizer_gles2.cpp:77:24: warning: unused function '_gl_debug_print' [-Wunused-function,34]
drivers/unix/thread_posix.cpp:106:12: warning: unused variable 'running_thread' [-Wunused-variable,34]
modules/gdnative/nativescript/nativescript.h:371:16: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
platform/iphone/gl_view.mm:56:14: warning: unused variable 'video_previous_volume' [-Wunused-variable,34]
platform/iphone/gl_view.mm:251:12: warning: unused function 'get_first_id' [-Wunused-function,34]
platform/iphone/main.m:45:15: warning: unused variable 'app' [-Wunused-variable,34]
platform/osx/os_osx.mm:79:15: warning: unused function 'convertRectToBacking' [-Wunused-function]
```
2018-10-04 11:50:16 +02:00
remmah 77fddfc7ea
Modernized copy/paste APIs on macOS #7185 2018-10-03 12:56:16 -04:00
Guilherme Felipe 360204e532 Fix Input::set_custom_mouse_cursor showing cursor when it's invisible 2018-09-17 11:37:54 -03:00
Guilherme Felipe 04aef23585 Fix set_custom_mouse_cursor changing to incorrect cursor shape
[Docs] Add class ref for Input::set_default_cursor_shape
2018-09-13 15:13:57 -03:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
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.
2018-09-12 09:52:22 +02:00
Martin Capitanio bcee65284e Really fix the custom cursor hotspot
Add check for negative values.

Fixes #21721
2018-09-04 04:42:23 +02:00
Guilherme Felipe e5470cfa70 Fix custom cursor hotspot
Cursor hotspot must be inside image on Linux. Adding validation for all
platforms for consistency.
2018-09-03 09:57:07 -03:00
Hein-Pieter van Braam 08f452d1a9 Fall back to GLES2 if GLES3 is not working
This adds a static is_viable() method to all rasterizers which has to be
called before initializing the rasterizer. This allows us to check what
rasterizer to use in OS::initialize together with the GL context
initialization.

This commit also adds a new project setting
"rendering/quality/driver/driver_fallback" which allows the creator of a
project to specify whether or not fallback to GLES2 is allowed. This
setting is ignored for the editor so the editor will always open even if
the project itself cannot run. This will hopefully reduce confusion for
users downloading projects from the internet.

We also no longer crash when GLES3 is not functioning on a platform.

This fixes #15324
2018-08-26 16:40:46 +02:00
Marcelo Fernandez 05fc12ddb6 Add OS::open_midi_inputs and OS::close_midi_inputs 2018-08-04 10:07:46 -03:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Marcelo Fernandez 7a5f9fc08e Added a new MIDIDriver class 2018-07-21 09:09:42 -03:00
Juan Linietsky c69de2ba46 -Project/Editor settings now use new inspector
-Project/Editor settings now show tooltips properly
-Settings thar require restart now will show a restart warning
-Video driver is now visible all the time, can be changed easily
-Added function to request current video driver
2018-07-19 19:02:04 -03:00
mm bd9c592c52 Fixed button mask behavior 2018-07-11 01:15:03 +03:00
unknown 9cc41a59ac Added support for extra mouse buttons. 2018-07-09 14:34:19 +03:00
Saracen c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
Guilherme Felipe c8e0ec0580 Change position of validation in set_custom_mouse_cursor 2018-05-28 09:36:30 -03:00