PySide6.QtOpenGL.QOpenGLVersionProfile¶
- class QOpenGLVersionProfile¶
QOpenGLVersionProfile
类表示 OpenGL 上下文的版本以及适用的配置文件。更多…概要¶
方法¶
def
__init__()
def
hasProfiles()
def
isValid()
def
__ne__()
def
__eq__()
def
profile()
def
setProfile()
def
setVersion()
def
version()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
此类的对象可以传递给 QOpenGLContext::versionFunctions(),以请求特定版本和配置的 OpenGL 函数对象。
它还包含一些辅助函数,用于检查版本是否支持配置文件或是否为旧版本。
- __init__()¶
创建一个默认无效的
QOpenGLVersionProfile
对象。- __init__(other)
- Parameters:
构造
other
的副本。- __init__(format)
- Parameters:
格式 –
QSurfaceFormat
创建一个
QOpenGLVersionProfile
对象,并使用format
中的版本和配置文件进行初始化。- hasProfiles()¶
- Return type:
布尔
如果由
version()
返回的OpenGL版本支持配置文件,则返回true
。只有OpenGL版本 >= 3.2 支持配置文件。- isLegacyVersion()¶
- Return type:
布尔
如果由
version()
返回的OpenGL版本包含已弃用的函数并且不支持配置文件,即如果OpenGL版本小于或等于3.1,则返回true
。- isValid()¶
- Return type:
布尔
如果版本号有效,则返回
true
。请注意,对于默认构造的QOpenGLVersionProfile
对象,此函数将返回false
。另请参阅
- __ne__(rhs)¶
- Parameters:
rhs –
QOpenGLVersionProfile
- Return type:
布尔
- __eq__(rhs)¶
- Parameters:
rhs –
QOpenGLVersionProfile
- Return type:
布尔
- profile()¶
- Return type:
返回OpenGL配置文件。仅在此版本支持配置文件时才有意义。
另请参阅
- setProfile(profile)¶
- Parameters:
配置文件 –
OpenGLContextProfile
设置OpenGL配置文件
profile
。仅在此版本支持配置文件时才有意义。另请参阅
- setVersion(majorVersion, minorVersion)¶
- Parameters:
majorVersion – int
minorVersion – int
将主要和次要版本号分别设置为
majorVersion
和minorVersion
。另请参阅
- version()¶
- Return type:
.std.pairint,int
返回一个QPair
,其中组件分别表示主要和次要的OpenGL版本号。 另请参阅