<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # QGLFormat Class Reference ## [[QtOpenGL](index.htm) module] 該QGLFormat類指定一個OpenGL渲染上下文的顯示格式。[More...](#details) ### Types * `enum OpenGLContextProfile { NoProfile, CoreProfile, CompatibilityProfile }` * `enum OpenGLVersionFlag { OpenGL_Version_None, OpenGL_Version_1_1, OpenGL_Version_1_2, OpenGL_Version_1_3, ..., OpenGL_ES_Version_2_0 }` * `class **[OpenGLVersionFlags](index.htm)**` ### Methods * `__init__ (self)` * `__init__ (self, QGL.FormatOptions?options, int?plane?=?0)` * `__init__ (self, QGLFormat?other)` * `bool accum (self)` * `int accumBufferSize (self)` * `bool alpha (self)` * `int alphaBufferSize (self)` * `int blueBufferSize (self)` * `bool depth (self)` * `int depthBufferSize (self)` * `bool directRendering (self)` * `bool doubleBuffer (self)` * `int greenBufferSize (self)` * `bool hasOverlay (self)` * `int majorVersion (self)` * `int minorVersion (self)` * `int plane (self)` * `OpenGLContextProfile profile (self)` * `int redBufferSize (self)` * `bool rgba (self)` * `bool sampleBuffers (self)` * `int samples (self)` * `setAccum (self, bool?enable)` * `setAccumBufferSize (self, int?size)` * `setAlpha (self, bool?enable)` * `setAlphaBufferSize (self, int?size)` * `setBlueBufferSize (self, int?size)` * `setDepth (self, bool?enable)` * `setDepthBufferSize (self, int?size)` * `setDirectRendering (self, bool?enable)` * `setDoubleBuffer (self, bool?enable)` * `setGreenBufferSize (self, int?size)` * `setOption (self, QGL.FormatOptions?opt)` * `setOverlay (self, bool?enable)` * `setPlane (self, int?plane)` * `setProfile (self, OpenGLContextProfile?profile)` * `setRedBufferSize (self, int?size)` * `setRgba (self, bool?enable)` * `setSampleBuffers (self, bool?enable)` * `setSamples (self, int?numSamples)` * `setStencil (self, bool?enable)` * `setStencilBufferSize (self, int?size)` * `setStereo (self, bool?enable)` * `setSwapInterval (self, int?interval)` * `setVersion (self, int?major, int?minor)` * `bool stencil (self)` * `int stencilBufferSize (self)` * `bool stereo (self)` * `int swapInterval (self)` * `bool testOption (self, QGL.FormatOptions?opt)` ### Static Methods * `QGLFormat defaultFormat ()` * `QGLFormat defaultOverlayFormat ()` * `bool hasOpenGL ()` * `bool hasOpenGLOverlays ()` * `OpenGLVersionFlags openGLVersionFlags ()` * `setDefaultFormat (QGLFormat?f)` * `setDefaultOverlayFormat (QGLFormat?f)` ### Special Methods * `bool __eq__ (self, QGLFormat)` * `bool __ne__ (self, QGLFormat)` * * * ## Detailed Description 該QGLFormat類指定一個OpenGL渲染上下文的顯示格式。 一種顯示格式有幾個特點: * [Double or single buffering.](qglformat.html#setDoubleBuffer) * [Depth buffer.](qglformat.html#setDepth) * [RGBA or color index mode.](qglformat.html#setRgba) * [Alpha channel.](qglformat.html#setAlpha) * [Accumulation buffer.](qglformat.html#setAccum) * [Stencil buffer.](qglformat.html#setStencil) * [Stereo buffers.](qglformat.html#setStereo) * [Direct rendering.](qglformat.html#setDirectRendering) * [Presence of an overlay.](qglformat.html#setOverlay) * [Plane of an overlay.](qglformat.html#setPlane) * [Multisample buffers.](qglformat.html#setSampleBuffers) 您也可以指定首選位深度的顏色緩沖,深度緩沖,阿爾法緩沖,緩沖的積累以及與功能模板緩沖區:[setRedBufferSize](qglformat.html#setRedBufferSize)( )[setGreenBufferSize](qglformat.html#setGreenBufferSize)( )[setBlueBufferSize](qglformat.html#setBlueBufferSize)( )[setDepthBufferSize](qglformat.html#setDepthBufferSize)( )[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( )[setAccumBufferSize](qglformat.html#setAccumBufferSize)()和[setStencilBufferSize](qglformat.html#setStencilBufferSize)( ) 。 請注意,即使您指定你喜歡一個32位深度緩沖(如帶setDepthBufferSize ( 32 ) ) ,選擇該格式可能不具有一個32位的深度緩沖區,即使有可用的帶有32位深度緩沖的格式。主要的原因是系統依賴采摘算法在不同的平臺上是如何工作的,以及一些格式選項可能有優先級比別人高。 您可以創建和告訴QGLFormat對象,你想從一個OpenGL渲染上下文是什么渲染選項。 OpenGL驅動程序或硬件加速的可能或可能不支持高級功能,例如alpha通道或立體視。如果您要求一些功能,驅動器/硬件不提供當你創建一個[QGLWidget](qglwidget.html),你會得到一個渲染上下文的功能最接近的子集。 有不同的方式來定義一個渲染上下文的顯示特性。一個是創建一個QGLFormat并使其成為默認為整個應用程序: ``` QGLFormat fmt; fmt.setAlpha(true); fmt.setStereo(true); QGLFormat.setDefaultFormat(fmt); ``` 或者,您可以創建一個對象時指定所需的格式的[QGLWidget](qglwidget.html)子類: ``` QGLFormat fmt; fmt.setDoubleBuffer(false); // single buffer fmt.setDirectRendering(false); // software rendering MyGLWidget* myWidget = new MyGLWidget(fmt, ...); ``` 窗口小部件被創建之后,你可以找出其中所要求的功能的系統能夠提供: ``` QGLFormat fmt; fmt.setOverlay(true); fmt.setStereo(true); MyGLWidget* myWidget = new MyGLWidget(fmt, ...); if (!myWidget->format().stereo()) { // ok, goggles off if (!myWidget->format().hasOverlay()) { qFatal("Cool hardware required"); } } ``` OpenGL是Silicon Graphics公司在美國和其他國家的商標。 * * * ## Type Documentation ``` QGLFormat.OpenGLContextProfile ``` 這個枚舉變量描述了可以為上下文實現的OpenGL 3.2或更高版本中指定的OpenGL上下文配置文件。這些配置文件是從OpenGL ES的配置文件不同。 | Constant | Value | Description | | --- | --- | --- | | `QGLFormat.NoProfile` | `0` | OpenGL的版本比3.2更低。 | | `QGLFormat.CoreProfile` | `1` | 不推薦使用的功能在OpenGL 3.0版無法使用。 | | `QGLFormat.CompatibilityProfile` | `2` | 從早期的OpenGL版本功能可用。 | 這個枚舉被引入或修改的Qt 4.7 。 ``` QGLFormat.OpenGLVersionFlag ``` 這個枚舉變量描述了各種OpenGL版本是由Qt的認可。使用[QGLFormat.openGLVersionFlags](qglformat.html#openGLVersionFlags)( )函數來確定哪些版本的在運行時支持??。 | Constant | Value | Description | | --- | --- | --- | | `QGLFormat.OpenGL_Version_None` | `0x00000000` | 如果沒有OpenGL是或者沒有OpenGL上下文是最新的。 | | `QGLFormat.OpenGL_Version_1_1` | `0x00000001` | OpenGL版本1.1或更高版本存在。 | | `QGLFormat.OpenGL_Version_1_2` | `0x00000002` | OpenGL版本1.2或更高版本存在。 | | `QGLFormat.OpenGL_Version_1_3` | `0x00000004` | OpenGL版本1.3或更高版本存在。 | | `QGLFormat.OpenGL_Version_1_4` | `0x00000008` | OpenGL版本1.4或更高版本存在。 | | `QGLFormat.OpenGL_Version_1_5` | `0x00000010` | OpenGL版本1.5或更高版本存在。 | | `QGLFormat.OpenGL_Version_2_0` | `0x00000020` | OpenGL版本2.0或更高版本存在。請注意, 2.0版支持1.5版的所有功能。 | | `QGLFormat.OpenGL_Version_2_1` | `0x00000040` | OpenGL的2.1或更高版本的存在。 | | `QGLFormat.OpenGL_Version_3_0` | `0x00001000` | OpenGL版本3.0或更高版本存在。 | | `QGLFormat.OpenGL_Version_3_1` | `0x00002000` | OpenGL的3.1或更高的版本存在。需要注意的是OpenGL的3.1或更高版本不一定支持3.0版和更低的所有功能。 | | `QGLFormat.OpenGL_Version_3_2` | `0x00004000` | OpenGL版本3.2或更高版本存在。 | | `QGLFormat.OpenGL_Version_3_3` | `0x00008000` | OpenGL版本3.3或更高版本存在。 | | `QGLFormat.OpenGL_Version_4_0` | `0x00010000` | OpenGL版本4.0或更高版本存在。 | | `QGLFormat.OpenGL_ES_CommonLite_Version_1_0` | `0x00000100` | 的OpenGL ES 1.0版通用精簡版或更高版本存在。 | | `QGLFormat.OpenGL_ES_Common_Version_1_0` | `0x00000080` | OpenGL ES的1.0版本通用或更高版本存在。 Common文件支持常見的精簡版的所有功能。 | | `QGLFormat.OpenGL_ES_CommonLite_Version_1_1` | `0x00000400` | 的OpenGL ES 1.1版通用精簡版或更高版本存在。 | | `QGLFormat.OpenGL_ES_Common_Version_1_1` | `0x00000200` | OpenGL ES的1.1版本通用或更高版本存在。 Common文件支持常見的精簡版的所有功能。 | | `QGLFormat.OpenGL_ES_Version_2_0` | `0x00000800` | 的OpenGL ES 2.0或更高版本存在。需要注意的是OpenGL ES的2.0版本不支持的OpenGL ES 1.x的所有功能所以,如果OpenGL_ES_Version_2_0返回,返回沒有的ES 1.x的標志。 | 另請參閱[http://www.opengl.org](http://www.opengl.org/)關于OpenGL的不同版本的更多信息。 這個枚舉被引入或修改的Qt 4.2 。 該OpenGLVersionFlags類型是一個typedef為[QFlags](index.htm)\u003cOpenGLVersionFlag\u003e 。它存儲OpenGLVersionFlag值的或組合。 **See also** [openGLVersionFlags](qglformat.html#openGLVersionFlags)( ) 。 * * * ## Method Documentation ``` QGLFormat.__init__ (self) ``` 構造一個[QGLFormat](qglformat.html)用下面的默認設置對象: * [Double buffer:](qglformat.html#setDoubleBuffer) Enabled. * [Depth buffer:](qglformat.html#setDepth) Enabled. * [RGBA:](qglformat.html#setRgba) Enabled (i.e., color index disabled). * [Alpha channel:](qglformat.html#setAlpha) Disabled. * [Accumulator buffer:](qglformat.html#setAccum) Disabled. * [Stencil buffer:](qglformat.html#setStencil) Enabled. * [Stereo:](qglformat.html#setStereo) Disabled. * [Direct rendering:](qglformat.html#setDirectRendering) Enabled. * [Overlay:](qglformat.html#setOverlay) Disabled. * [Plane:](qglformat.html#setPlane) 0 (i.e., normal plane). * [Multisample buffers:](qglformat.html#setSampleBuffers) Disabled. ``` QGLFormat.__init__ (self, QGL.FormatOptions?options, int?plane?=?0) ``` 創建[QGLFormat](qglformat.html)對象,它是當前的一個副本[defaultFormat](qglformat.html#defaultFormat)( ) 。 If _options_不為0 ,則默認格式是由特定的格式選項修改。該_options_參數應該是[QGL.FormatOption](qgl.html#FormatOption-enum)值OR'ed在一起。 這個構造函數可以很容易地從指定的派生類一定想要的格式[QGLWidget](qglwidget.html)例如: ``` // The rendering in MyGLWidget depends on using // stencil buffer and alpha channel MyGLWidget.MyGLWidget([QWidget](qwidget.html)* parent) : [QGLWidget](qglwidget.html)([QGLFormat](qglformat.html)(QGL.StencilBuffer | QGL.AlphaChannel), parent) { if (!format().stencil()) qWarning("Could not get stencil buffer; results will be suboptimal"); if (!format().alpha()) qWarning("Could not get alpha channel; results will be suboptimal"); ... } ``` 請注意,有[QGL.FormatOption](qgl.html#FormatOption-enum)值開啟和關閉都,如格式設置[QGL.DepthBuffer](qgl.html#FormatOption-enum)和[QGL.NoDepthBuffer](qgl.html#FormatOption-enum),[QGL.DirectRendering](qgl.html#FormatOption-enum)和[QGL.IndirectRendering](qgl.html#FormatOption-enum)等。 該_plane_參數默認為0 ,并且是這種格式應該與相關的平面。并非所有的OpenGL實現支持復蓋/襯底渲染的飛機。 **See also** [defaultFormat](qglformat.html#defaultFormat)( )[setOption](qglformat.html#setOption)()和[setPlane](qglformat.html#setPlane)( ) 。 ``` QGLFormat.__init__ (self, QGLFormat?other) ``` 構造的副本_other_。 ``` bool QGLFormat.accum (self) ``` 返回True如果累積緩沖器被啟用,否則返回False 。積累緩沖區默認是禁用的。 **See also** [setAccum](qglformat.html#setAccum)()和[setAccumBufferSize](qglformat.html#setAccumBufferSize)( ) 。 ``` int QGLFormat.accumBufferSize (self) ``` 返回累積緩沖區的大小。 **See also** [setAccumBufferSize](qglformat.html#setAccumBufferSize)( )[accum](qglformat.html#accum)()和[setAccum](qglformat.html#setAccum)( ) 。 ``` bool QGLFormat.alpha (self) ``` 返回True如果在framebuffer的阿爾法緩沖啟用,否則返回False 。阿爾法緩沖默認情況下禁用。 **See also** [setAlpha](qglformat.html#setAlpha)()和[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( ) 。 ``` int QGLFormat.alphaBufferSize (self) ``` 返回阿爾法緩沖區大小。 **See also** [alpha](qglformat.html#alpha)( )[setAlpha](qglformat.html#setAlpha)()和[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( ) 。 ``` int QGLFormat.blueBufferSize (self) ``` 返回藍色的緩沖區大小。 這個函數中引入了Qt 4.2中。 **See also** [setBlueBufferSize](qglformat.html#setBlueBufferSize)( ) 。 ``` QGLFormat QGLFormat.defaultFormat () ``` [](qglformat.html) [返回默認](qglformat.html)[QGLFormat](qglformat.html)應用程序。所有[QGLWidget](qglwidget.html)除非指定了其他格式的創建使用這種格式的對象,如當它們被構造。 如果沒有特殊的默認格式已設定使用[setDefaultFormat](qglformat.html#setDefaultFormat)() ,默認格式是相同的,與建立[QGLFormat](qglformat.html#QGLFormat)( ) 。 **See also** [setDefaultFormat](qglformat.html#setDefaultFormat)( ) 。 ``` QGLFormat QGLFormat.defaultOverlayFormat () ``` [](qglformat.html) [返回默認](qglformat.html)[QGLFormat](qglformat.html)對于疊加背景。 默認疊加格式為: * [Double buffer:](qglformat.html#setDoubleBuffer) Disabled. * [Depth buffer:](qglformat.html#setDepth) Disabled. * [RGBA:](qglformat.html#setRgba) Disabled (i.e., color index enabled). * [Alpha channel:](qglformat.html#setAlpha) Disabled. * [Accumulator buffer:](qglformat.html#setAccum) Disabled. * [Stencil buffer:](qglformat.html#setStencil) Disabled. * [Stereo:](qglformat.html#setStereo) Disabled. * [Direct rendering:](qglformat.html#setDirectRendering) Enabled. * [Overlay:](qglformat.html#setOverlay) Disabled. * [Multisample buffers:](qglformat.html#setSampleBuffers) Disabled. * [Plane:](qglformat.html#setPlane) 1 (i.e., first overlay plane). **See also** [setDefaultOverlayFormat](qglformat.html#setDefaultOverlayFormat)()和[setDefaultFormat](qglformat.html#setDefaultFormat)( ) 。 ``` bool QGLFormat.depth (self) ``` 返回True如果深度緩沖被啟用,否則返回False 。深度緩存是默認啟用的。 **See also** [setDepth](qglformat.html#setDepth)()和[setDepthBufferSize](qglformat.html#setDepthBufferSize)( ) 。 ``` int QGLFormat.depthBufferSize (self) ``` 返回深度緩沖區的大小。 **See also** [depth](qglformat.html#depth)( )[setDepth](qglformat.html#setDepth)()和[setDepthBufferSize](qglformat.html#setDepthBufferSize)( ) 。 ``` bool QGLFormat.directRendering (self) ``` 返回True如果直接渲染啟用,否則返回False 。 直接渲染是默認啟用的。 **See also** [setDirectRendering](qglformat.html#setDirectRendering)( ) 。 ``` bool QGLFormat.doubleBuffer (self) ``` 返回True如果雙緩沖使能,否則返回False 。雙緩沖是默認啟用的。 **See also** [setDoubleBuffer](qglformat.html#setDoubleBuffer)( ) 。 ``` int QGLFormat.greenBufferSize (self) ``` 返回綠化緩沖區大小。 這個函數中引入了Qt 4.2中。 **See also** [setGreenBufferSize](qglformat.html#setGreenBufferSize)( ) 。 ``` bool QGLFormat.hasOpenGL () ``` 返回True如果窗口系統有任何的OpenGL支持,否則返回False 。 **Warning:**此函數不能被調用,直到[QApplication](qapplication.html)對象被創建。 ``` bool QGLFormat.hasOpenGLOverlays () ``` 返回True如果窗口系統支持OpenGL復蓋,否則返回False 。 **Warning:**此函數不能被調用,直到[QApplication](qapplication.html)對象被創建。 ``` bool QGLFormat.hasOverlay (self) ``` 返回True如果復蓋面已啟用,否則返回False 。 復蓋默認是禁用的。 **See also** [setOverlay](qglformat.html#setOverlay)( ) 。 ``` int QGLFormat.majorVersion (self) ``` 返回OpenGL的主要版本。 此功能被引入Qt的4.7 。 **See also** [setVersion](qglformat.html#setVersion)()和[minorVersion](qglformat.html#minorVersion)( ) 。 ``` int QGLFormat.minorVersion (self) ``` 返回OpenGL的次要版本。 此功能被引入Qt的4.7 。 **See also** [setVersion](qglformat.html#setVersion)()和[majorVersion](qglformat.html#majorVersion)( ) 。 ``` OpenGLVersionFlags QGLFormat.openGLVersionFlags () ``` [ 標識,在運行時,它的OpenGL是由當前平臺支持的版本。 請注意,如果OpenGL版本1.5的支持,也支持它的前輩(即1.4版,下) 。識別特定功能??的支持,如多紋理,測試中首次引入的功能的版本(即版本在多紋理的情況下1.3) ,以適應運行時平臺的最大可能的組。 ](index.htm) [此功能需要一個有效的當前的OpenGL上下文中工作,否則它會返回](index.htm)[OpenGL_Version_None](qglformat.html#OpenGLVersionFlag-enum)。 這個函數中引入了Qt 4.2中。 **See also** [hasOpenGL](qglformat.html#hasOpenGL)()和[hasOpenGLOverlays](qglformat.html#hasOpenGLOverlays)( ) 。 ``` int QGLFormat.plane (self) ``` 返回此格式的平面。默認為正常格式是0,這意味著在正常平面。默認為復蓋格式是1 ,這是第一個復蓋面。 **See also** [setPlane](qglformat.html#setPlane)()和[defaultOverlayFormat](qglformat.html#defaultOverlayFormat)( ) 。 ``` OpenGLContextProfile QGLFormat.profile (self) ``` [ 返回OpenGL上下文配置文件。 此功能被引入Qt的4.7 。 ](qglformat.html#OpenGLContextProfile-enum) [**See also**](qglformat.html#OpenGLContextProfile-enum) [setProfile](qglformat.html#setProfile)( ) 。 ``` int QGLFormat.redBufferSize (self) ``` 返回紅色的緩沖區大小。 這個函數中引入了Qt 4.2中。 **See also** [setRedBufferSize](qglformat.html#setRedBufferSize)( ) 。 ``` bool QGLFormat.rgba (self) ``` 返回True如果RGBA顏色模式設置。返回False,如果顏色索引模式設置。默認的色彩模式是RGBA 。 **See also** [setRgba](qglformat.html#setRgba)( ) 。 ``` bool QGLFormat.sampleBuffers (self) ``` 返回True如果多重采樣緩沖支持允許,否則返回False 。 多重采樣緩沖區默認是禁用的。 **See also** [setSampleBuffers](qglformat.html#setSampleBuffers)( ) 。 ``` int QGLFormat.samples (self) ``` 返回每個像素的樣本多重采樣時啟用的數量。默認情況下,最高的樣本數是可被使用。 **See also** [setSampleBuffers](qglformat.html#setSampleBuffers)( )[sampleBuffers](qglformat.html#sampleBuffers)()和[setSamples](qglformat.html#setSamples)( ) 。 ``` QGLFormat.setAccum (self, bool?enable) ``` If _enable_是真正的使積累緩沖,否則將禁用積累緩沖區。 積累緩沖區默認是禁用的。 積累緩沖區用于創建模糊效果和多重曝光。 **See also** [accum](qglformat.html#accum)()和[setAccumBufferSize](qglformat.html#setAccumBufferSize)( ) 。 ``` QGLFormat.setAccumBufferSize (self, int?size) ``` 設置首選累加緩沖器的大小,其中_size_是比特深度的每個RGBA分量。 **See also** [accum](qglformat.html#accum)( )[setAccum](qglformat.html#setAccum)()和[accumBufferSize](qglformat.html#accumBufferSize)( ) 。 ``` QGLFormat.setAlpha (self, bool?enable) ``` If _enable_是真的讓阿爾法緩沖,否則將禁用阿爾法緩沖區。 阿爾法緩沖默認情況下禁用。 阿爾法緩沖器通常用于實現透明性或半透明性。 RGBA中的A指定像素的透明度。 **See also** [alpha](qglformat.html#alpha)()和[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( ) 。 ``` QGLFormat.setAlphaBufferSize (self, int?size) ``` 設置優選的α緩沖區的大小為_size_。此功能允許隱式的alpha通道。 **See also** [setRedBufferSize](qglformat.html#setRedBufferSize)( )[setGreenBufferSize](qglformat.html#setGreenBufferSize)()和[alphaBufferSize](qglformat.html#alphaBufferSize)( ) 。 ``` QGLFormat.setBlueBufferSize (self, int?size) ``` 設置首選藍色的緩沖區大小_size_。 這個函數中引入了Qt 4.2中。 **See also** [blueBufferSize](qglformat.html#blueBufferSize)( )[setRedBufferSize](qglformat.html#setRedBufferSize)( )[setGreenBufferSize](qglformat.html#setGreenBufferSize)()和[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( ) 。 ``` QGLFormat.setDefaultFormat (QGLFormat?f) ``` 設置新的默認[QGLFormat](qglformat.html)為應用程序_f_。例如,要設置單緩沖為默認,而不是雙緩沖,你的main()中可能包含這樣的代碼: ``` [QApplication](qapplication.html) a(argc, argv); [QGLFormat](qglformat.html) f; f.setDoubleBuffer(false); [QGLFormat](qglformat.html).setDefaultFormat(f); ``` **See also** [defaultFormat](qglformat.html#defaultFormat)( ) 。 ``` QGLFormat.setDefaultOverlayFormat (QGLFormat?f) ``` 設置新的默認[QGLFormat](qglformat.html)為復蓋到上下文_f_。這個格式被用于每當一個[QGLWidget](qglwidget.html)與一個格式創建的[hasOverlay](qglformat.html#hasOverlay)( )啟用。 例如,要獲得雙重緩沖的復蓋范圍內(如果有的話) ,使用如下代碼: ``` [QGLFormat](qglformat.html) f = [QGLFormat](qglformat.html).defaultOverlayFormat(); f.setDoubleBuffer(true); [QGLFormat](qglformat.html).setDefaultOverlayFormat(f); ``` 像往常一樣,你可以創建小部件的底層OpenGL的系統是否能夠提供所要求的規格后發現: ``` // ...continued from above MyGLWidget* myWidget = new MyGLWidget([QGLFormat](qglformat.html)(QGL.HasOverlay), ...); if (myWidget->format().hasOverlay()) { // Yes, we got an overlay, let's check _its_ format: [QGLContext](qglcontext.html)* olContext = myWidget->overlayContext(); if (olContext->format().doubleBuffer()) ; // yes, we got a double buffered overlay else ; // no, only single buffered overlays are available } ``` **See also** [defaultOverlayFormat](qglformat.html#defaultOverlayFormat)( ) 。 ``` QGLFormat.setDepth (self, bool?enable) ``` If _enable_是真正的使深度緩沖區,否則禁用深度緩沖。 深度緩存是默認啟用的。 深度緩沖(或Z緩沖)的目的是去除隱藏的表面。像素的基礎上,以觀眾的距離分配的Z值。具有高Z值的像素更靠近觀看者比具有低Z值的像素。此信息用于決定是否要繪制的像素或沒有。 **See also** [depth](qglformat.html#depth)()和[setDepthBufferSize](qglformat.html#setDepthBufferSize)( ) 。 ``` QGLFormat.setDepthBufferSize (self, int?size) ``` 設置最小深度緩沖區的大小為_size_。 **See also** [depthBufferSize](qglformat.html#depthBufferSize)( )[setDepth](qglformat.html#setDepth)()和[depth](qglformat.html#depth)( ) 。 ``` QGLFormat.setDirectRendering (self, bool?enable) ``` If _enable_是真的,可直接渲染,否則禁止直接渲染。 直接渲染是默認啟用的。 啟用此選項將使繞過OpenGL的底層窗口系統,并直接從硬件渲染到屏幕上,如果這是支持的系統。 **See also** [directRendering](qglformat.html#directRendering)( ) 。 ``` QGLFormat.setDoubleBuffer (self, bool?enable) ``` If _enable_是真正的集雙緩沖,否則設置一個緩沖。 雙緩沖是默認啟用的。 雙緩沖就是圖形呈現在屏幕外的緩沖區,而不是直接到屏幕上的技術。當繪圖完成時,程序調用一個swapBuffers ()函數來交換與緩沖器中的畫面的內容。其結果是無閃爍畫圖,常常更好的性能。 需要注意的是單緩沖環境目前不支持與EGL 。 **See also** [doubleBuffer](qglformat.html#doubleBuffer)( )[QGLContext.swapBuffers](qglcontext.html#swapBuffers)()和[QGLWidget.swapBuffers](qglwidget.html#swapBuffers)( ) 。 ``` QGLFormat.setGreenBufferSize (self, int?size) ``` 設置首選的綠色緩沖區大小_size_。 這個函數中引入了Qt 4.2中。 **See also** [greenBufferSize](qglformat.html#greenBufferSize)( )[setRedBufferSize](qglformat.html#setRedBufferSize)( )[setBlueBufferSize](qglformat.html#setBlueBufferSize)()和[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( ) 。 ``` QGLFormat.setOption (self, QGL.FormatOptions?opt) ``` 設置格式選項_opt_。 **See also** [testOption](qglformat.html#testOption)( ) 。 ``` QGLFormat.setOverlay (self, bool?enable) ``` If _enable_是真的讓一個復蓋面,否則禁止復蓋面。 啟用復蓋面會造成[QGLWidget](qglwidget.html)創建一個復蓋面的附加上下文。請參閱[QGLWidget](qglwidget.html)文檔了解更多信息。 **See also** [hasOverlay](qglformat.html#hasOverlay)( ) 。 ``` QGLFormat.setPlane (self, int?plane) ``` 所要求的平面設置為_plane_。 0是正常的平面中, 1是第一復蓋面, 2是第二復蓋面等; -1,-2等是底層平面。 請注意,相對于其他格式規范,飛機規格將完全匹配。這意味著,如果你指定一個平面底層OpenGL的系統不能提供,一個[invalid](qglwidget.html#isValid) [QGLWidget](qglwidget.html)將被創建。 **See also** [plane](qglformat.html#plane)( ) 。 ``` QGLFormat.setProfile (self, OpenGLContextProfile?profile) ``` 設置OpenGL上下文配置文件_profile_。該_profile_如果所請求的OpenGL版本小于3.2被忽略。 此功能被引入Qt的4.7 。 **See also** [profile](qglformat.html#profile)( ) 。 ``` QGLFormat.setRedBufferSize (self, int?size) ``` 設置首選紅色的緩沖區大小_size_。 這個函數中引入了Qt 4.2中。 **See also** [redBufferSize](qglformat.html#redBufferSize)( )[setGreenBufferSize](qglformat.html#setGreenBufferSize)( )[setBlueBufferSize](qglformat.html#setBlueBufferSize)()和[setAlphaBufferSize](qglformat.html#setAlphaBufferSize)( ) 。 ``` QGLFormat.setRgba (self, bool?enable) ``` If _enable_是真正的集RGBA模式。如果_enable_是假套顏色索引模式。 默認的色彩模式是RGBA 。 RGBA是大多數的OpenGL應用程序的首選模式。在RGBA顏色模式指定的顏色為紅+綠+藍+阿爾法四胞胎。 在顏色索引模式中指定一個索引顏色查找表。 **See also** [rgba](qglformat.html#rgba)( ) 。 ``` QGLFormat.setSampleBuffers (self, bool?enable) ``` If _enable_誠然,一個GL上下文與多重采樣緩沖支持回升,否則忽略。 **See also** [sampleBuffers](qglformat.html#sampleBuffers)( )[setSamples](qglformat.html#setSamples)()和[samples](qglformat.html#samples)( ) 。 ``` QGLFormat.setSamples (self, int?numSamples) ``` 設置每個像素的樣本的首選號碼時,多重采樣已啟用_numSamples_。默認情況下,最多可用樣本的使用。 **See also** [setSampleBuffers](qglformat.html#setSampleBuffers)( )[sampleBuffers](qglformat.html#sampleBuffers)()和[samples](qglformat.html#samples)( ) 。 ``` QGLFormat.setStencil (self, bool?enable) ``` If _enable_是真正的使模板緩沖,否則將禁用模板緩存。 模板緩沖區是默認啟用的。 模板緩沖區口罩繪圖區域的某些部分,這樣蒙面零件不上繪制。 **See also** [stencil](qglformat.html#stencil)()和[setStencilBufferSize](qglformat.html#setStencilBufferSize)( ) 。 ``` QGLFormat.setStencilBufferSize (self, int?size) ``` 設置首選模板緩沖區大小_size_。 **See also** [stencilBufferSize](qglformat.html#stencilBufferSize)( )[setStencil](qglformat.html#setStencil)()和[stencil](qglformat.html#stencil)( ) 。 ``` QGLFormat.setStereo (self, bool?enable) ``` If _enable_是真的讓立體聲緩沖,否則將禁用立體聲緩沖。 立體聲緩沖默認情況下禁用。 立體聲緩沖提供額外的顏色緩沖區生成左眼和右眼的圖像。 **See also** [stereo](qglformat.html#stereo)( ) 。 ``` QGLFormat.setSwapInterval (self, int?interval) ``` 設置首選的交換??間隔。這可用于同步的GL繪圖成一個系統的窗口,以在屏幕的垂直刷新。設置一個_interval_值為0將關閉垂直同步刷新關閉,大于0的任何值將變為垂直同步的。 在Windows和X11下,其中`WGL_EXT_swap_control`和`GLX_SGI_video_sync`擴展的使用,_interval_參數可被用來設定顯示之前將發生緩沖交換的視頻幀的最小數目。實際上,在設置_interval_10 ,意味著將有每一個緩沖區交換之間的10個垂直回掃。 在Windows下的`WGL_EXT_swap_control`擴展名必須存在,而且在X11下的`GLX_SGI_video_sync`擴展名必須存在。 這個函數中引入了Qt 4.2中。 **See also** [swapInterval](qglformat.html#swapInterval)( ) 。 ``` QGLFormat.setVersion (self, int?major, int?minor) ``` 設置OpenGL版本到_major_和_minor_號碼。如果所請求的OpenGL版本兼容的情況下不能創建,與1.x版本兼容的上下文被創建來代替。 此功能被引入Qt的4.7 。 **See also** [majorVersion](qglformat.html#majorVersion)()和[minorVersion](qglformat.html#minorVersion)( ) 。 ``` bool QGLFormat.stencil (self) ``` 返回True如果模板緩存被啟用,否則返回False 。模板緩沖區是默認啟用的。 **See also** [setStencil](qglformat.html#setStencil)()和[setStencilBufferSize](qglformat.html#setStencilBufferSize)( ) 。 ``` int QGLFormat.stencilBufferSize (self) ``` 返回模板緩沖區大小。 **See also** [stencil](qglformat.html#stencil)( )[setStencil](qglformat.html#setStencil)()和[setStencilBufferSize](qglformat.html#setStencilBufferSize)( ) 。 ``` bool QGLFormat.stereo (self) ``` 返回True如果立體聲緩沖使能,否則返回False 。立體聲緩沖默認情況下禁用。 **See also** [setStereo](qglformat.html#setStereo)( ) 。 ``` int QGLFormat.swapInterval (self) ``` 返回當前設置的交換間隔。如果設定的時間間隔交換不支持在系統總帳實現返回-1。 這個函數中引入了Qt 4.2中。 **See also** [setSwapInterval](qglformat.html#setSwapInterval)( ) 。 ``` bool QGLFormat.testOption (self, QGL.FormatOptions?opt) ``` 返回True如果格式選項_opt_被置位,否則返回False 。 **See also** [setOption](qglformat.html#setOption)( ) 。 ``` bool QGLFormat.__eq__ (self, QGLFormat) ``` ``` bool QGLFormat.__ne__ (self, QGLFormat) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看