PySide6.QtOpenGL.QOpenGLVersionProfile

class QOpenGLVersionProfile

QOpenGLVersionProfile 类表示 OpenGL 上下文的版本以及适用的配置文件。更多

概要

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

此类的对象可以传递给 QOpenGLContext::versionFunctions(),以请求特定版本和配置的 OpenGL 函数对象。

它还包含一些辅助函数,用于检查版本是否支持配置文件或是否为旧版本。

__init__()

创建一个默认无效的QOpenGLVersionProfile对象。

__init__(other)
Parameters:

其他QOpenGLVersionProfile

构造other的副本。

__init__(format)
Parameters:

格式QSurfaceFormat

创建一个QOpenGLVersionProfile对象,并使用format中的版本和配置文件进行初始化。

hasProfiles()
Return type:

布尔

如果由version()返回的OpenGL版本支持配置文件,则返回true。只有OpenGL版本 >= 3.2 支持配置文件。

另请参阅

profile() version()

isLegacyVersion()
Return type:

布尔

如果由version()返回的OpenGL版本包含已弃用的函数并且不支持配置文件,即如果OpenGL版本小于或等于3.1,则返回true

isValid()
Return type:

布尔

如果版本号有效,则返回true。请注意,对于默认构造的QOpenGLVersionProfile对象,此函数将返回false

另请参阅

setVersion() version()

__ne__(rhs)
Parameters:

rhsQOpenGLVersionProfile

Return type:

布尔

__eq__(rhs)
Parameters:

rhsQOpenGLVersionProfile

Return type:

布尔

profile()
Return type:

OpenGLContextProfile

返回OpenGL配置文件。仅在此版本支持配置文件时才有意义。

另请参阅

setProfile()

setProfile(profile)
Parameters:

配置文件OpenGLContextProfile

设置OpenGL配置文件 profile。仅在此版本支持配置文件时才有意义。

另请参阅

profile()

setVersion(majorVersion, minorVersion)
Parameters:
  • majorVersion – int

  • minorVersion – int

将主要和次要版本号分别设置为majorVersionminorVersion

另请参阅

version()

version()
Return type:

.std.pairint,int

返回一个QPair,其中组件分别表示主要和次要的OpenGL版本号。

另请参阅

setVersion()