FLTK logo

[master] abc6709 - macOS: simpler way to delete the GL1 context of widgets-using GL3 windows.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] abc6709 - macOS: simpler way to delete the GL1 context of widgets-using GL3 windows. "ManoloFLTK" Oct 01, 2022  
 
commit abc6709e8e93594152e27710f25f24c36318d520
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sun Oct 2 08:40:38 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sun Oct 2 08:40:38 2022 +0200

    macOS: simpler way to delete the GL1 context of widgets-using GL3 windows.

 src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H  |  1 -
 src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm | 12 ++++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H
index 01ab231..9d7e6df 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H
+++ src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H
@@ -52,7 +52,6 @@ class Fl_Cocoa_Gl_Window_Driver : public Fl_Gl_Window_Driver {
   void apply_scissor();
   virtual void switch_to_GL1();
   virtual void switch_back();
-  virtual void gl_hide_before(void *&);
 };
 
 
diff --git src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index 429fad3..fb6690d 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -217,6 +217,10 @@ void Fl_Cocoa_Gl_Window_Driver::delete_gl_context(GLContext context) {
   }
   [(NSOpenGLContext*)context release];
   del_context(context);
+  if (gl1ctxt) {
+    [gl1ctxt release];
+    gl1ctxt = 0;
+  }
 }
 
 void Fl_Cocoa_Gl_Window_Driver::make_overlay_current() {
@@ -492,14 +496,6 @@ void Fl_Cocoa_Gl_Window_Driver::switch_back() {
 }
 
 
-void Fl_Cocoa_Gl_Window_Driver::gl_hide_before(void *&) {
-  if (gl1ctxt) {
-    [gl1ctxt release];
-    gl1ctxt = 0;
-  }
-}
-
-
 class Fl_Gl_Cocoa_Plugin : public Fl_Cocoa_Plugin {
 public:
   Fl_Gl_Cocoa_Plugin() : Fl_Cocoa_Plugin(name()) { }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.