summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/context_gl_osx.h6
-rw-r--r--platform/osx/context_gl_osx.mm8
-rw-r--r--platform/osx/detect.py2
-rw-r--r--platform/osx/display_server_osx.h6
-rw-r--r--platform/osx/display_server_osx.mm30
-rw-r--r--platform/osx/platform_config.h1
6 files changed, 27 insertions, 26 deletions
diff --git a/platform/osx/context_gl_osx.h b/platform/osx/context_gl_osx.h
index ac45559217..77bae3247d 100644
--- a/platform/osx/context_gl_osx.h
+++ b/platform/osx/context_gl_osx.h
@@ -31,7 +31,7 @@
#ifndef CONTEXT_GL_OSX_H
#define CONTEXT_GL_OSX_H
-#if defined(OPENGL_ENABLED) || defined(GLES_ENABLED)
+#if defined(GLES3_ENABLED) || defined(GLES_ENABLED)
#include "core/error/error_list.h"
#include "core/os/os.h"
@@ -41,7 +41,7 @@
#include <CoreVideo/CoreVideo.h>
class ContextGL_OSX {
- bool opengl_3_context;
+ bool gles3_context;
bool use_vsync;
void *framework;
@@ -66,7 +66,7 @@ public:
void set_use_vsync(bool p_use);
bool is_using_vsync() const;
- ContextGL_OSX(id p_view, bool p_opengl_3_context);
+ ContextGL_OSX(id p_view, bool p_gles3_context);
~ContextGL_OSX();
};
diff --git a/platform/osx/context_gl_osx.mm b/platform/osx/context_gl_osx.mm
index 88db1a296e..eab9d8dc0c 100644
--- a/platform/osx/context_gl_osx.mm
+++ b/platform/osx/context_gl_osx.mm
@@ -30,7 +30,7 @@
#include "context_gl_osx.h"
-#if defined(OPENGL_ENABLED) || defined(GLES_ENABLED)
+#if defined(GLES3_ENABLED) || defined(GLES_ENABLED)
void ContextGL_OSX::release_current() {
[NSOpenGLContext clearCurrentContext];
@@ -98,7 +98,7 @@ Error ContextGL_OSX::initialize() {
ADD_ATTR(NSOpenGLPFADoubleBuffer);
ADD_ATTR(NSOpenGLPFAClosestPolicy);
- if (!opengl_3_context) {
+ if (!gles3_context) {
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy);
} else {
//we now need OpenGL 3 or better, maybe even change this to 3_3Core ?
@@ -150,8 +150,8 @@ Error ContextGL_OSX::initialize() {
return OK;
}
-ContextGL_OSX::ContextGL_OSX(id p_view, bool p_opengl_3_context) {
- opengl_3_context = p_opengl_3_context;
+ContextGL_OSX::ContextGL_OSX(id p_view, bool p_gles3_context) {
+ gles3_context = p_gles3_context;
window_view = p_view;
use_vsync = false;
}
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 6c07c2416e..d9b55631cd 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -189,4 +189,4 @@ def configure(env):
if not env["use_volk"]:
env.Append(LINKFLAGS=["-L$VULKAN_SDK_PATH/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/", "-lMoltenVK"])
- # env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_ENABLED'])
+ # env.Append(CPPDEFINES=['GLES_ENABLED', 'GLES3_ENABLED'])
diff --git a/platform/osx/display_server_osx.h b/platform/osx/display_server_osx.h
index e8f2858489..96baeb4dec 100644
--- a/platform/osx/display_server_osx.h
+++ b/platform/osx/display_server_osx.h
@@ -36,7 +36,7 @@
#include "core/input/input.h"
#include "servers/display_server.h"
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
#include "context_gl_osx.h"
//TODO - reimplement OpenGLES
#endif
@@ -64,7 +64,7 @@ public:
NSMenu *_get_dock_menu() const;
void _menu_callback(id p_sender);
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
ContextGL_OSX *context_gles2;
#endif
#if defined(VULKAN_ENABLED)
@@ -109,7 +109,7 @@ public:
Vector<Vector2> mpath;
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
ContextGL_OSX *context_gles2 = nullptr;
#endif
Point2i mouse_pos;
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index 3fe055a511..d89e64cd7d 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -45,7 +45,7 @@
#include <IOKit/hid/IOHIDKeys.h>
#include <IOKit/hid/IOHIDLib.h>
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
//TODO - reimplement OpenGLES
#import <AppKit/NSOpenGLView.h>
@@ -166,7 +166,7 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
[pwd.window_object makeKeyAndOrderFront:nil]; // Move focus back to main window if there is no parent or other windows left.
}
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (DS_OSX->rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -271,7 +271,7 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
layer.contentsScale = scale;
}
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (DS_OSX->rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -405,7 +405,7 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
}
- (CALayer *)makeBackingLayer {
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (DS_OSX->rendering_driver == "opengl_es") {
CALayer *layer = [[NSOpenGLLayer class] layer];
return layer;
@@ -421,7 +421,7 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
}
- (void)updateLayer {
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (DS_OSX->rendering_driver == "opengl_es") {
[super updateLayer];
//TODO - reimplement OpenGLES
@@ -2586,7 +2586,7 @@ void DisplayServerOSX::_set_window_per_pixel_transparency_enabled(bool p_enabled
//TODO - implement transparency for Vulkan
}
#endif
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -2605,14 +2605,14 @@ void DisplayServerOSX::_set_window_per_pixel_transparency_enabled(bool p_enabled
//TODO - implement transparency for Vulkan
}
#endif
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
#endif
wd.layered_window = false;
}
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -3475,7 +3475,7 @@ Vector<String> DisplayServerOSX::get_rendering_drivers_func() {
#if defined(VULKAN_ENABLED)
drivers.push_back("vulkan");
#endif
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
drivers.push_back("opengl_es");
#endif
@@ -3579,7 +3579,7 @@ DisplayServerOSX::WindowID DisplayServerOSX::_create_window(WindowMode p_mode, V
}
}
#endif
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -3600,7 +3600,7 @@ DisplayServerOSX::WindowID DisplayServerOSX::_create_window(WindowMode p_mode, V
layer.contentsScale = scale;
}
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -3750,7 +3750,7 @@ DisplayServerOSX::DisplayServerOSX(const String &p_rendering_driver, WindowMode
[main_menu setSubmenu:apple_menu forItem:menu_item];
//!!!!!!!!!!!!!!!!!!!!!!!!!!
- //TODO - do Vulkan and GLES2 support checks, driver selection and fallback
+ //TODO - do Vulkan and OpenGL support checks, driver selection and fallback
rendering_driver = p_rendering_driver;
#ifndef _MSC_VER
@@ -3758,7 +3758,7 @@ DisplayServerOSX::DisplayServerOSX(const String &p_rendering_driver, WindowMode
#endif
rendering_driver = "vulkan";
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -3787,7 +3787,7 @@ DisplayServerOSX::DisplayServerOSX(const String &p_rendering_driver, WindowMode
}
show_window(MAIN_WINDOW_ID);
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
@@ -3820,7 +3820,7 @@ DisplayServerOSX::~DisplayServerOSX() {
}
//destroy drivers
-#if defined(OPENGL_ENABLED)
+#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl_es") {
//TODO - reimplement OpenGLES
}
diff --git a/platform/osx/platform_config.h b/platform/osx/platform_config.h
index 2d0fd872dc..7bfa466b97 100644
--- a/platform/osx/platform_config.h
+++ b/platform/osx/platform_config.h
@@ -30,4 +30,5 @@
#include <alloca.h>
+#define OPENGL_INCLUDE_H "thirdparty/glad/glad/glad.h"
#define PTHREAD_RENAME_SELF