⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qglformat.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
字号:
.TH QGLFormat 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQGLFormat \- The display format of an OpenGL rendering context [Qt OpenGL Extension].SH SYNOPSIS.br.PP\fC#include <qgl.h>\fR.PPInherits QGL..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQGLFormat\fR ()".br.ti -1c.BI "\fBQGLFormat\fR ( int options )".br.ti -1c.BI "bool \fBdoubleBuffer\fR () const".br.ti -1c.BI "void \fBsetDoubleBuffer\fR ( bool enable )".br.ti -1c.BI "bool \fBdepth\fR () const".br.ti -1c.BI "void \fBsetDepth\fR ( bool enable )".br.ti -1c.BI "bool \fBrgba\fR () const".br.ti -1c.BI "void \fBsetRgba\fR ( bool enable )".br.ti -1c.BI "bool \fBalpha\fR () const".br.ti -1c.BI "void \fBsetAlpha\fR ( bool enable )".br.ti -1c.BI "bool \fBaccum\fR () const".br.ti -1c.BI "void \fBsetAccum\fR ( bool enable )".br.ti -1c.BI "bool \fBstencil\fR () const".br.ti -1c.BI "void \fBsetStencil\fR ( bool enable )".br.ti -1c.BI "bool \fBstereo\fR () const".br.ti -1c.BI "void \fBsetStereo\fR ( bool enable )".br.ti -1c.BI "bool \fBdirectRendering\fR () const".br.ti -1c.BI "void \fBsetDirectRendering\fR ( bool enable )".br.ti -1c.BI "void \fBsetOption\fR ( FormatOption opt )".br.ti -1c.BI "bool \fBtestOption\fR ( FormatOption opt ) const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QGLFormat \fBdefaultFormat\fR ()".br.ti -1c.BI "void \fBsetDefaultFormat\fR ( const QGLFormat & f )".br.ti -1c.BI "bool \fBhasOpenGL\fR ()".br.in -1c.SH RELATED FUNCTION DOCUMENTATION(Note that these are not member functions.).in +1c.ti -1c.BI "const char * \fBqGLVersion\fR ()".br.in -1c.SH DESCRIPTIONThis class is defined in the \fBQt OpenGL Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main Qt API..PPThe QGLFormat class specifies the display format of an OpenGL rendering context..PPA display format has several characteristics:.TPDouble or single buffering..TPDepth buffer..TPRGBA or color index mode..TPAlpha channel..TPAccumulation buffer..TPStencil buffer..TPStereo buffers..TPDirect rendering...PPYou create and tell a QGLFormat object what rendering options you want from an OpenGL rendering context..PPOpenGL drivers or accelerated hardware may or may not support advanced features like alpha channel or stereographic viewing. If you request some features the driver/hardware does not provide when you create a QGLWidget, you will get the a rendering context with the nearest subset of features..PPThere 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:.PP.nf.br    QGLFormat f;.br    f.setAlpha( TRUE );.br    f.setStereo( TRUE );.br    QGLFormat::setDefaultFormat( f );.fi.PPOr you can specify the desired format when creating an object of your QGLWidget subclass:.PP.nf.br    QGLFormat f;.br    f.setDoubleBuffer( FALSE );.br    f.setDirectRendering( FALSE );.br    MyGLWidget* myWidget = new MyGLWidget( f, ... );.fi.PPYou can even set the format for an already existing QGLWidget:.PP.nf.br    MyGLWidget *w;.br      ....br    QGLFormat f;.br    f.setAlpha( TRUE );.br    f.setStereo( TRUE );.br    w->setFormat( f );.br    if ( !w->format().stereo() ) {.br        // ok, goggles off.br        if ( !w->format().alpha() ) {.br            qFatal( "Cool hardware wanted" );.br        }.br    }.fi.PPSee also: QGLContext and QGLWidget..SH MEMBER FUNCTION DOCUMENTATION.SH "QGLFormat::QGLFormat ()"Constructs a QGLFormat object with the factory default settings:.TPDouble buffer: Enabled..TPDepth buffer: Enabled..TPRGBA: Enabled (i.e. color index disabled)..TPAlpha channel: Disabled..TPAccumulator buffer: Disabled..TPStencil buffer: Disabled..TPStereo: Disabled..TPDirect rendering: Enabled..SH "QGLFormat::QGLFormat ( int options )"Creates a QGLFormat object that is a copy of the current application default format..PPIf \fIoptions\fR is not 0, this copy will be modified by these format options. The \fIoptions\fR parameter must be FormatOption values OR'ed together..PPThis constructor makes it easy to specify a certain desired format in classes derived from QGLWidget, for example:.PP.nf.br    // The rendering in MyGLWidget depends on using.br    // stencil buffer and alpha channel.br    MyGLWidget::MyGLWidget( QWidget* parent, const char* name ).br        : QGLWidget( QGLFormat( StencilBuffer | AlphaChannel ), parent, name ).br    {.br      if ( !format().stencil() ).br        qWarning( "Could not get stencil buffer; results will be suboptimal" );.br      if ( !format().alphaChannel() ).br        qWarning( "Could not get alpha channel; results will be suboptimal" );.br      ....br   }.fi.PPNote that there exists FormatOption values for both turning on and off all format settings, e.g. DepthBuffer and NoDepthBuffer, DirectRendering and IndirectRendering, etc..PPSee also: defaultFormat() and setOption()..SH "bool QGLFormat::accum () const"Returns TRUE if the accumulation buffer is enabled, otherwise FALSE. The accumulation buffer is disabled by default..PPSee also: setAccum()..SH "bool QGLFormat::alpha () const"Returns TRUE if the alpha channel of the framebuffer is enabled, otherwise FALSE. The alpha channel is disabled by default..PPSee also: setAlpha()..SH "QGLFormat QGLFormat::defaultFormat () \fC[static]\fR"Returns the default QGLFormat for the application. All QGLWidgets that are created use this format unless anything else is specified..PPIf no special default format has been set using setDefaultFormat(), the default format is the same as that created with QGLFormat()..PPSee also: setDefaultFormat()..SH "bool QGLFormat::depth () const"Returns TRUE if the depth buffer is enabled, otherwise FALSE. The depth buffer is enabled by default..PPSee also: setDepth()..SH "bool QGLFormat::directRendering () const"Returns TRUE if direct rendering is enabled, otherwise FALSE..PPDirect rendering is enabled by default..PPSee also: setDirectRendering()..SH "bool QGLFormat::doubleBuffer () const"Returns TRUE if double buffering is enabled, otherwise FALSE. Double buffering is enabled by default..PPSee also: setDoubleBuffer()..SH "bool QGLFormat::hasOpenGL () \fC[static]\fR"Returns TRUE if the window system has any OpenGL support, otherwise FALSE..SH "bool QGLFormat::rgba () const"Returns TRUE if RGBA color mode is set, or FALSE if color index mode is set. The default color mode is RGBA..PPSee also: setRgba()..SH "void QGLFormat::setAccum ( bool enable )"Enables the accumulation buffer if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPThe accumulation buffer is disabled by default..PPThe accumulation buffer is used for create blur effects and multiple exposures..PPSee also: accum()..SH "void QGLFormat::setAlpha ( bool enable )"Enables the alpha channel of the framebuffer if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPThe alpha buffer is disabled by default..PPThe alpha channel is typically used for implementing transparency or translucency. The A in RGBA specifies the transparency of a pixel..PPSee also: alpha()..SH "void QGLFormat::setDefaultFormat ( const QGLFormat & f ) \fC[static]\fR"Sets a new default QGLFormat for the application. For example, to set single buffering as default instead of double buffering, your main() can contain:.PP.nf.br    QApplication a(argc, argv);.br    QGLFormat f;.br    f.setDoubleBuffer( FALSE );.br    QGLFormat::setDefaultFormat( f );.fi.PPSee also: defaultFormat()..SH "void QGLFormat::setDepth ( bool enable )"Enables the depth buffer if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPThe depth buffer is enabled by default..PPThe 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..PPSee also: depth()..SH "void QGLFormat::setDirectRendering ( bool enable )"Enables direct rendering if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPDirect rendering is enabled by default..PPEnabling this option will make OpenGL bypass the underlying window system and render directly from hardware to the screen, if this is supported by the system..PPSee also: directRendering()..SH "void QGLFormat::setDoubleBuffer ( bool enable )"Sets double buffering if \fIenable\fR is TRUE og single buffering if \fIenable\fR is FALSE..PPDouble buffering is enabled by default..PPDouble 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..PPSee also: doubleBuffer(), QGLContext::swapBuffers() and QGLWidget::swapBuffers()..SH "void QGLFormat::setOption ( FormatOption opt )"Sets the option \fIopt.\fR.PPSee also: testOption()..SH "void QGLFormat::setRgba ( bool enable )"Sets RGBA mode if \fIenable\fR is TRUE, or color index mode if \fIenable\fR is FALSE..PPThe default color mode is RGBA..PPRGBA is the preferred mode for most OpenGL applications. In RGBA color mode you specify colors as a red + green + blue + alpha quadruplet..PPIn color index mode you specify an index into a color lookup table..PPSee also: rgba()..SH "void QGLFormat::setStencil ( bool enable )"Enables the stencil buffer if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPThe stencil buffer is disabled by default..PPThe stencil buffer masks away drawing from certain parts of the screen..PPSee also: stencil()..SH "void QGLFormat::setStereo ( bool enable )"Enables stereo buffering if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPStereo buffering is disabled by default..PPStereo buffering provides extra color buffers to generate left-eye and right-eye images..PPSee also: stereo()..SH "bool QGLFormat::stencil () const"Returns TRUE if the stencil buffer is enabled, otherwise FALSE. The stencil buffer is disabled by default..PPSee also: setStencil()..SH "bool QGLFormat::stereo () const"Returns TRUE if stereo buffering is enabled, otherwise FALSE. Stereo buffering is disabled by default..PPSee also: setStereo()..SH "bool QGLFormat::testOption ( FormatOption opt ) const"Returns TRUE if format option \fIopt\fR is set, otherwise FALSE..PPSee also: setOption()..SH RELATED FUNCTION DOCUMENTATION.SH "const char * qGLVersion ()"Returns the version number string for the Qt OpenGL extension,e.g. "1.0"..SH "SEE ALSO".BR http://www.troll.no/qt/qglformat.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -