mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 13:55:38 +08:00
Mac OS X: restored the possibility to set a GL context mode with the
Fl_Gl_Window::(const int *a) member function that uses a zero-ending array of system-dependent attributes. This procedure failed whenever a double buffer was asked for. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10854 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+12
-2
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// OpenGL window code for the Fast Light Tool Kit (FLTK).
|
// OpenGL window code for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2010 by Bill Spitzak and others.
|
// Copyright 1998-2015 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// 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
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@@ -26,6 +26,7 @@ extern int fl_gl_load_plugin;
|
|||||||
#include "Fl_Gl_Choice.H"
|
#include "Fl_Gl_Choice.H"
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <FL/gl.h>
|
#include <FL/gl.h>
|
||||||
|
#include <OpenGL/OpenGL.h>
|
||||||
#endif
|
#endif
|
||||||
#include <FL/Fl_Gl_Window.H>
|
#include <FL/Fl_Gl_Window.H>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -68,7 +69,16 @@ void Fl_Gl_Window::show() {
|
|||||||
if (!shown()) {
|
if (!shown()) {
|
||||||
if (!g) {
|
if (!g) {
|
||||||
g = Fl_Gl_Choice::find(mode_,alist);
|
g = Fl_Gl_Choice::find(mode_,alist);
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
if (g && alist) {
|
||||||
|
// when the mode is set using the system-dependent alist, and if asking for double buffer,
|
||||||
|
// the FL_DOUBLE flag must be set in the mode_ member variable
|
||||||
|
const int *a = alist;
|
||||||
|
while (*a) {
|
||||||
|
if (*(a++) == kCGLPFADoubleBuffer) mode_ |= FL_DOUBLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!g && (mode_ & FL_DOUBLE) == FL_SINGLE) {
|
if (!g && (mode_ & FL_DOUBLE) == FL_SINGLE) {
|
||||||
g = Fl_Gl_Choice::find(mode_ | FL_DOUBLE,alist);
|
g = Fl_Gl_Choice::find(mode_ | FL_DOUBLE,alist);
|
||||||
if (g) mode_ |= FL_FAKE_SINGLE;
|
if (g) mode_ |= FL_FAKE_SINGLE;
|
||||||
|
|||||||
Reference in New Issue
Block a user