diff options
Diffstat (limited to 'platform/macos/gl_manager_macos_legacy.h')
-rw-r--r-- | platform/macos/gl_manager_macos_legacy.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/platform/macos/gl_manager_macos_legacy.h b/platform/macos/gl_manager_macos_legacy.h index 94d966f4ed..bafe825efb 100644 --- a/platform/macos/gl_manager_macos_legacy.h +++ b/platform/macos/gl_manager_macos_legacy.h @@ -45,17 +45,12 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in macOS 10.14 -class GLManager_MacOS { -public: - enum ContextType { - GLES_3_0_COMPATIBLE, - }; +typedef CGLError (*CGLEnablePtr)(CGLContextObj ctx, CGLContextEnable pname); +typedef CGLError (*CGLSetParameterPtr)(CGLContextObj ctx, CGLContextParameter pname, const GLint *params); +typedef CGLContextObj (*CGLGetCurrentContextPtr)(void); -private: +class GLManagerLegacy_MacOS { struct GLWindow { - int width = 0; - int height = 0; - id window_view = nullptr; NSOpenGLContext *context = nullptr; }; @@ -68,23 +63,21 @@ private: Error create_context(GLWindow &win); bool use_vsync = false; - ContextType context_type; + CGLEnablePtr CGLEnable = nullptr; + CGLSetParameterPtr CGLSetParameter = nullptr; + CGLGetCurrentContextPtr CGLGetCurrentContext = nullptr; public: Error window_create(DisplayServer::WindowID p_window_id, id p_view, int p_width, int p_height); void window_destroy(DisplayServer::WindowID p_window_id); void window_resize(DisplayServer::WindowID p_window_id, int p_width, int p_height); - int window_get_width(DisplayServer::WindowID p_window_id = 0); - int window_get_height(DisplayServer::WindowID p_window_id = 0); - void release_current(); void make_current(); void swap_buffers(); void window_make_current(DisplayServer::WindowID p_window_id); - void window_update(DisplayServer::WindowID p_window_id); void window_set_per_pixel_transparency_enabled(DisplayServer::WindowID p_window_id, bool p_enabled); Error initialize(); @@ -94,8 +87,8 @@ public: NSOpenGLContext *get_context(DisplayServer::WindowID p_window_id); - GLManager_MacOS(ContextType p_context_type); - ~GLManager_MacOS(); + GLManagerLegacy_MacOS(); + ~GLManagerLegacy_MacOS(); }; #pragma clang diagnostic push |