summaryrefslogtreecommitdiffstats
path: root/platform/macos/display_server_macos.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/display_server_macos.mm')
-rw-r--r--platform/macos/display_server_macos.mm75
1 files changed, 46 insertions, 29 deletions
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm
index 48cc7bbba3..f1078d9868 100644
--- a/platform/macos/display_server_macos.mm
+++ b/platform/macos/display_server_macos.mm
@@ -752,6 +752,7 @@ bool DisplayServerMacOS::has_feature(Feature p_feature) const {
case FEATURE_NATIVE_DIALOG:
case FEATURE_NATIVE_DIALOG_INPUT:
case FEATURE_NATIVE_DIALOG_FILE:
+ case FEATURE_NATIVE_DIALOG_FILE_EXTRA:
case FEATURE_IME:
case FEATURE_WINDOW_TRANSPARENCY:
case FEATURE_HIDPI:
@@ -2676,6 +2677,18 @@ int64_t DisplayServerMacOS::window_get_native_handle(HandleType p_handle_type, W
}
return 0;
}
+ case EGL_DISPLAY: {
+ if (gl_manager_angle) {
+ return (int64_t)gl_manager_angle->get_display(p_window);
+ }
+ return 0;
+ }
+ case EGL_CONFIG: {
+ if (gl_manager_angle) {
+ return (int64_t)gl_manager_angle->get_config(p_window);
+ }
+ return 0;
+ }
#endif
default: {
return 0;
@@ -3611,6 +3624,39 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM
//TODO - do Vulkan and OpenGL support checks, driver selection and fallback
rendering_driver = p_rendering_driver;
+#if defined(RD_ENABLED)
+#if defined(VULKAN_ENABLED)
+ if (rendering_driver == "vulkan") {
+ rendering_context = memnew(RenderingContextDriverVulkanMacOS);
+ }
+#endif
+#if defined(METAL_ENABLED)
+ if (rendering_driver == "metal") {
+ rendering_context = memnew(RenderingContextDriverMetal);
+ }
+#endif
+
+ if (rendering_context) {
+ if (rendering_context->initialize() != OK) {
+ memdelete(rendering_context);
+ rendering_context = nullptr;
+#if defined(GLES3_ENABLED)
+ bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
+ if (fallback_to_opengl3 && rendering_driver != "opengl3") {
+ WARN_PRINT("Your device seem not to support MoltenVK or Metal, switching to OpenGL 3.");
+ rendering_driver = "opengl3";
+ OS::get_singleton()->set_current_rendering_method("gl_compatibility");
+ OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
+ } else
+#endif
+ {
+ r_error = ERR_CANT_CREATE;
+ ERR_FAIL_MSG("Could not initialize " + rendering_driver);
+ }
+ }
+ }
+#endif
+
#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl3_angle") {
gl_manager_angle = memnew(GLManagerANGLE_MacOS);
@@ -3643,35 +3689,6 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM
}
}
#endif
-#if defined(RD_ENABLED)
-#if defined(VULKAN_ENABLED)
- if (rendering_driver == "vulkan") {
- rendering_context = memnew(RenderingContextDriverVulkanMacOS);
- }
-#endif
-#if defined(METAL_ENABLED)
- if (rendering_driver == "metal") {
- rendering_context = memnew(RenderingContextDriverMetal);
- }
-#endif
-
- if (rendering_context) {
- if (rendering_context->initialize() != OK) {
- memdelete(rendering_context);
- rendering_context = nullptr;
- bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
- if (fallback_to_opengl3 && rendering_driver != "opengl3") {
- WARN_PRINT("Your device seem not to support MoltenVK or Metal, switching to OpenGL 3.");
- rendering_driver = "opengl3";
- OS::get_singleton()->set_current_rendering_method("gl_compatibility");
- OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
- } else {
- r_error = ERR_CANT_CREATE;
- ERR_FAIL_MSG("Could not initialize " + rendering_driver);
- }
- }
- }
-#endif
Point2i window_position;
if (p_position != nullptr) {