Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ
îðèãèíàëüíîãî äîêóìåíòà
: http://rtm-cs.sinp.msu.ru/manual/qt/qglformat.html
Äàòà èçìåíåíèÿ: Sun Jul 12 02:58:59 1998 Äàòà èíäåêñèðîâàíèÿ: Mon Oct 1 20:15:18 2012 Êîäèðîâêà: |
The QGLFormat class specifies the display format of an OpenGL rendering context. This class is part of the Qt OpenGL Extension. More...
#include <qgl.h>
The QGLFormat class specifies the display format of an OpenGL rendering context.
A display format has several characteristics:
You create and tell a QGLFormat object what rendering options you want from an OpenGL rendering context.
OpenGL drivers or accelerated hardware may or may not support advanced features like alpha blending or stereographic viewing. If you request alpha blending and the driver/hardware does not provide it, you will get an invalid context. You can then try again with a less demanding format.
There are different ways of defining the display characteristics of a rendering context. One is to create a QGLFormat and make it default for the entire application:
QGLFormat f; f.setAlpha( TRUE ); f.setStereo( TRUE ); QGLFormat::setDefaultFormat( f );
You can also set a format for a specific widget (subclassed from QGLWidget):
MyGLWidget *w; ... QGLFormat f; f.setAlpha( TRUE ); f.setStereo( TRUE ); w->setFormat( f ); if ( !w->isValid() ) { f.setStereo( FALSE ); // ok, goggles off w->setFormat( f ); if ( !w->isValid() ) { fatal( "Cool hardware wanted" ); } }
Implementation note: QGLFormat objects use implicit sharing. This is an internal optimization that minimizes copying and memory overhead. When you pass a QGLFormat as an argument to a function, or return a QGLFormat from a function, a reference count is incremented or decremented. Objects stay shared until one of them is changed.
See also: QGLContext and QGLWidget.
Constructs a QGLFormat object with the default settings:
Constructs a QGLFormat object which is a copy of f.
[virtual]
Destroys the object.
Returns TRUE if the accumulation buffer is enabled, otherwise FALSE. The accumulation buffer is disabled by default.
See also: setAccum().
Returns TRUE if the alpha buffer is enabled, otherwise FALSE. The alpha buffer is disabled by default.
See also: setAlpha().
[static]
Returns the default QGLFormat for the application. All QGLWidgets that are created are assigned this format unless anything else is specified.
Returns TRUE if the depth buffer is enabled, otherwise FALSE. The depth buffer is enabled by default.
See also: setDepth().
Returns TRUE if double buffering is enabled, otherwise FALSE. Double buffering is enabled by default.
See also: setDoubleBuffer().
[static]
Returns TRUE if the window system has any OpenGL support, otherwise FALSE.
Assigns f to this QGLFormat object and returns a reference to this object.
Returns TRUE if RGBA color mode is set, or FALSE if color index mode is set. The default color mode is RGBA.
See also: setRgba().
Enables the accumulation buffer if enable is TRUE, or disables it if enable is FALSE.
The accumulation buffer is disabled by default.
The accumulation buffer is used for create blur effects and multiple exposures.
See also: accum().
Enables the alpha buffer if enable is TRUE, or disables it if enable is FALSE.
The alpha buffer is disabled by default.
Alpha blending lets you draw transparent or translucent objects. The A in RGBA specifies the transparency of a pixel.
See also: alpha().
[static]
Sets a new default QGLFormat for the application. For example, to set single buffering as default instead of double buffering, your main() can contain:
QApplication a(argc, argv); QGLFormat f; f.setDoubleBuffer( FALSE ); QGLFormat::setDefaultFormat( f );
Enables the depth buffer if enable is TRUE, or disables it if enable is FALSE.
The depth buffer is enabled by default.
The purpose of a depth buffer (or z-buffering) is to remove hidden surfaces. Pixels are assigned z values based on the distance to the viewer. A pixel with a high z value is closer to the viewer than a pixel with a low z value. This information is used to decide whether to draw a pixel or not.
See also: depth().
Sets double buffering if enable is TRUE og single buffering if enable is FALSE.
Double buffering is enabled by default.
Double buffering is a technique where graphics is rendered to an off-screen buffer and not directly to the screen. When the drawing has been completed, the program calls a swapBuffers function to exchange the screen contents with the buffer. The result is flicker-free drawing and often better performance.
See also: doubleBuffer(), QGLContext::swapBuffers() and QGLWidget::swapBuffers().
Sets RGBA mode if enable is TRUE, or color index mode if enable is FALSE.
The default color mode is RGBA.
RGBA is the preferred mode for most OpenGL applications. In RGBA color mode you specify colors as a red + green + blue + alpha quadruplet
In color index mode you specify an index into a color lookup table.
See also: rgba().
Enables the stencil buffer if enable is TRUE, or disables it if enable is FALSE.
The stencil buffer is disabled by default.
The stencil buffer masks away drawing from certain parts of the screen.
See also: stencil().
Enables stereo buffering if enable is TRUE, or disables it if enable is FALSE.
Stereo buffering is disabled by default.
Stereo buffering provides extra color buffers to generate left-eye and right-eye images.
See also: stereo().
Returns TRUE if the stencil buffer is enabled, otherwise FALSE. The stencil buffer is disabled by default.
See also: setStencil().
Returns TRUE if stereo buffering is enabled, otherwise FALSE. Stereo buffering is disabled by default.
See also: setStereo().
Returns the version number string for the Qt OpenGL extension, e.g. "1.0".
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright © 1998 Troll Tech | Trademarks | Qt version 1.40
|