From 44f8e8e32a07c083d9e55df47becd684d3fd1a9f Mon Sep 17 00:00:00 2001
From: Michael R Sweet
Date: Mon, 1 Feb 1999 20:38:57 +0000
Subject: Added a section on damage() for widget writers.
git-svn-id: file:///fltk/svn/fltk/trunk@266 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
---
documentation/opengl.html | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
(limited to 'documentation')
diff --git a/documentation/opengl.html b/documentation/opengl.html
index 807908a68..5ed567992 100644
--- a/documentation/opengl.html
+++ b/documentation/opengl.html
@@ -17,13 +17,31 @@ include the file <GL/gl.h>, define some extra drawing
functions provided by FLTK, and include the <windows.h> header
file needed by WIN32 applications.
Making a Subclass of Fl_Gl_Window
- To make a subclass of Fl_Gl_Window, you must provide:
+To make a subclass of Fl_Gl_Window, you must provide:
- A class definition.
- A draw() method.
- A handle() method (if you need to recieve input from the
user).
+If your subclass provides static controls in the window, they must be
+redrawn whenever the FL_DAMAGE_ALL bit is set in the value
+returned by damage(). For double-buffered windows you will
+need to surround the drawing code with the following code to make sure
+that both buffers are redrawn:
+
+#ifndef MESA
+glDrawBuffer(GL_FRONT_AND_BACK);
+#endif // !MESA
+... draw stuff here ...
+#ifndef MESA
+glDrawBuffer(GL_BACK);
+#endif // !MESA
+
+Note: If you are using the Mesa graphics library, the call to
+glDrawBuffer() is not required and will slow down drawing
+considerably. The preprocessor instructions shown above will optimize
+your code based upon the graphics library used.
Defining the Subclass
To define the subclass you just subclass the Fl_Gl_Window class:
@@ -163,12 +181,11 @@ for maximum portability:
- You must choose a default visual with
Fl::gl_visual().
-- You cannot pass FL_DOUBLE to Fl::gl_visual().
-- You cannot use Fl_Double_Window or Fl_Overlay_Window
-.
+- You cannot pass FL_DOUBLE to Fl::gl_visual().
+- You cannot use Fl_Double_Window or Fl_Overlay_Window.
Do not call gl_start() or gl_finish() when
-drawing into an Fl_Gl_Window!
+drawing into an Fl_Gl_Window!
OpenGL Drawing Functions
FLTK provides some useful OpenGL drawing functions. They can be
freely mixed with any OpenGL calls, and are defined by including
--
cgit v1.2.3