// // OpenGL visual selection code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2021 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // // https://www.fltk.org/COPYING.php // // Please see the following page on how to report bugs and issues: // // https://www.fltk.org/bugs.php // #include #if HAVE_GL /** \cond DriverDev \addtogroup DriverDeveloper \{ */ #include #include "Fl_Gl_Choice.H" #include #include "Fl_Gl_Window_Driver.H" #include #include #ifndef GL_CURRENT_PROGRAM // from glew.h in Windows, glext.h in Unix, not used by FLTK's macOS platform # define GL_CURRENT_PROGRAM 0x8B8D #endif typedef void (*glUseProgram_type)(GLint); static glUseProgram_type glUseProgram_f = NULL; GLContext *Fl_Gl_Window_Driver::context_list = 0; int Fl_Gl_Window_Driver::nContext = 0; static int NContext = 0; void Fl_Gl_Window_Driver::add_context(GLContext ctx) { if (!ctx) return; if (nContext==NContext) { if (!NContext) NContext = 8; NContext *= 2; context_list = (GLContext*)realloc( context_list, NContext*sizeof(GLContext)); } context_list[nContext++] = ctx; } void Fl_Gl_Window_Driver::del_context(GLContext ctx) { int i; for (i=0; inext) if (g->mode == m && g->alist == alistp) return g; return NULL; } /** \} \endcond */ #endif // HAVE_GL