From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- doc/html/opengl-overlay-x11-example.html | 105 +++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 doc/html/opengl-overlay-x11-example.html (limited to 'doc/html/opengl-overlay-x11-example.html') diff --git a/doc/html/opengl-overlay-x11-example.html b/doc/html/opengl-overlay-x11-example.html new file mode 100644 index 000000000..554f6e79b --- /dev/null +++ b/doc/html/opengl-overlay-x11-example.html @@ -0,0 +1,105 @@ + + + + + +OpenGL Overlay X11 Example + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

OpenGL Overlay X11 Example

+ + +

+Warning: From version 5.0 onwards, the TQt OpenGL Extension includes +direct support for use of OpenGL overlays. For many uses of overlays, +this makes the technique described below redundant. See the overlay example program. The +following is a discussion on how to use non-TQGL widgets in overlay +planes. +

Overlayrubber: An example program showing how to use TQt and TQt OpenGL +Extension with X11 overlay visuals. +

See $QTDIR/examples/opengl/overlay_x11 for the source code. +

Background information for this example can be found in the +information on overlays. +

The example program has three main parts: +

    +
  1. GearWidget - a normal, simple TQGLWidget. This renders the usual +gears. It has been modified to print a debug message every time it +redraws (renders) itself. Thus, you can easily confirm that drawing in +the overlay plane does not cause redrawings in the main plane where +the TQGLWidget resides. +

  2. RubberbandWidget - Very simple standard (non-GL) TQt widget that +implements rubberband drawing. Designed for use in an overlay plane. +It takes the plane's transparent color as a constructor argument and +uses that for its background color. Thus, the widget itself will be +invisible, only the rubberbands it draws will be visible. +

  3. main.cpp Creates a GearWidget and a Rubberbandwidget and puts the +latter on top of the former. Contains a routine that checks that the +default visual is in an overlay plane, and returns the transparent +color of that plane. +
+

Running the Example +

+

Start the overlayrubber executable. Click and drag with the left +mouse button to see rubberband drawing. Observe that the TQGLWidget +does not redraw itself (no redraw debug messages are output), and yet +the image is not destroyed. Marvel at the coolness of X11 overlays! +

Using this technique in a real application +

+

For clarity, this example program has been kept very simple. Here are +some hints for real application usage: +

+

See also OpenGL Examples. + + +


+ +
Copyright © 2007 +TrolltechTrademarks +
TQt 3.3.8
+
+ -- cgit v1.2.1