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

This commit is contained in:
ManoloFLTK 2022-10-02 08:40:38 +02:00
parent 63a7942a66
commit abc6709e8e
2 changed files with 4 additions and 9 deletions

View File

@ -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 *&);
};

View File

@ -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()) { }