macOS: support of FLTK widgets in OpenGL 3 windows - cont'd.

This code is OK under macOS 10 9 and 13.
This commit is contained in:
ManoloFLTK
2022-09-28 17:06:00 +02:00
parent 7d58e23854
commit c2efb0d849
5 changed files with 48 additions and 16 deletions

View File

@@ -191,8 +191,10 @@ void toggle_double(Fl_Widget *wid, void *data) {
SimpleGL3Window *glwin = (SimpleGL3Window*)data;
int flags = glwin->mode();
if (doublebuff) flags |= FL_DOUBLE; else flags &= ~FL_DOUBLE;
glwin->mode(flags);
glwin->reset();
glwin->hide();
glwin->mode(flags);
glwin->show();
}
@@ -227,7 +229,7 @@ void button_cb(Fl_Widget *, void *) {
}
void add_widgets(Fl_Gl_Window *g) {
Fl::set_color(FL_FREE_COLOR, 255, 0, 0, 140); // partially transparent red
Fl::set_color(FL_FREE_COLOR, 255, 255, 255, 140); // partially transparent white
g->begin();
// Create here widgets to go above the GL3 scene
Fl_Button* b = new Fl_Button( 0, 170, 60, 30, "button");