summaryrefslogtreecommitdiff
path: root/src/gl_start.cxx
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2008-10-13 23:10:43 +0000
committerFabien Costantini <fabien@onepost.net>2008-10-13 23:10:43 +0000
commit92051890f1127429142cc0b60e3e9a1e567bf01d (patch)
tree4c0e7f28192914b24202d08aa3eaa72a7bf5f7e4 /src/gl_start.cxx
parent8e9c1d1ab030dc7beed522f368c467dd94e1f8bb (diff)
Quickdraw removal: option removed from configure, all Qd code removed from sources. Also took this opportunity to sort the ifdef clauses so that USE_X11 shows first. Also added error pragma to enforce proper target checking, thus make even less assumptions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6423 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/gl_start.cxx')
-rw-r--r--src/gl_start.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gl_start.cxx b/src/gl_start.cxx
index f83a04889..f3933dddd 100644
--- a/src/gl_start.cxx
+++ b/src/gl_start.cxx
@@ -64,17 +64,16 @@ Fl_Region XRectangleRegion(int x, int y, int w, int h); // in fl_rect.cxx
void gl_start() {
if (!context) {
-#ifdef WIN32
+#if defined(USE_X11)
+ context = fl_create_gl_context(fl_visual);
+#elif defined(WIN32)
if (!gl_choice) Fl::gl_visual(0);
context = fl_create_gl_context(Fl_Window::current(), gl_choice);
-#elif defined(__APPLE_QD__)
- // \todo Mac : We need to check the code and verify it with Apple Sample code. The 'shiny'-test should at least work with the software OpenGL emulator
- context = fl_create_gl_context(Fl_Window::current(), gl_choice);
#elif defined(__APPLE_QUARTZ__)
// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
context = fl_create_gl_context(Fl_Window::current(), gl_choice);
#else
- context = fl_create_gl_context(fl_visual);
+# error Unsupported platform
#endif
}
fl_set_gl_context(Fl_Window::current(), context);
@@ -109,23 +108,23 @@ void gl_finish() {
glXWaitGL();
#endif
}
+
int Fl::gl_visual(int mode, int *alist) {
Fl_Gl_Choice *c = Fl_Gl_Choice::find(mode,alist);
if (!c) return 0;
-#ifdef WIN32
- gl_choice = c;
-#elif defined(__APPLE_QD__)
+#if defined(USE_X11)
+ fl_visual = c->vis;
+ fl_colormap = c->colormap;
+#elif defined(WIN32)
gl_choice = c;
#elif defined(__APPLE_QUARTZ__)
// warning: the Quartz version should probably use Core GL (CGL) instead of AGL
gl_choice = c;
#else
- fl_visual = c->vis;
- fl_colormap = c->colormap;
+# error Unsupported platform
#endif
return 1;
}
-
#endif
//