IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QOpenGLVersionProfile Class

The QOpenGLVersionProfile class represents the version and if applicable the profile of an OpenGL context.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QOpenGLVersionProfile Class

  • Header: QOpenGLVersionProfile

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS OpenGL)

    target_link_libraries(mytarget PRIVATE Qt6::OpenGL)

  • qmake: QT += opengl

Detailed Description

An object of this class can be passed to QOpenGLContext::versionFunctions() to request a functions object for a specific version and profile of OpenGL.

It also contains some helper functions to check if a version supports profiles or is a legacy version.

Member Function Documentation

 

QOpenGLVersionProfile::QOpenGLVersionProfile()

Creates a default invalid QOpenGLVersionProfile object.

[explicit] QOpenGLVersionProfile::QOpenGLVersionProfile(const QSurfaceFormat &format)

Creates a QOpenGLVersionProfile object initialised with the version and profile from format.

QOpenGLVersionProfile::QOpenGLVersionProfile(const QOpenGLVersionProfile &other)

Constructs a copy of other.

QOpenGLVersionProfile::~QOpenGLVersionProfile()

Destroys the QOpenGLVersionProfile object.

bool QOpenGLVersionProfile::hasProfiles() const

Returns true if profiles are supported by the OpenGL version returned by version(). Only OpenGL versions >= 3.2 support profiles.

See Also

See also profile(), version()

bool QOpenGLVersionProfile::isLegacyVersion() const

Returns true is the OpenGL version returned by version() contains deprecated functions and does not support profiles i.e. if the OpenGL version is <= 3.1.

bool QOpenGLVersionProfile::isValid() const

Returns true if the version number is valid. Note that for a default constructed QOpenGLVersionProfile object this function will return false.

See Also

See also setVersion(), version()

QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile() const

Returns the OpenGL profile. Only makes sense if profiles are supported by this version.

See Also

See also setProfile()

void QOpenGLVersionProfile::setProfile(QSurfaceFormat::OpenGLContextProfile profile)

Sets the OpenGL profile profile. Only makes sense if profiles are supported by this version.

See Also

See also profile()

void QOpenGLVersionProfile::setVersion(int majorVersion, int minorVersion)

Sets the major and minor version numbers to majorVersion and minorVersion respectively.

See Also

See also version()

QPair<int, int> QOpenGLVersionProfile::version() const

Returns a QPair<int,int> where the components represent the major and minor OpenGL version numbers respectively.

See Also

See also setVersion()

QOpenGLVersionProfile &QOpenGLVersionProfile::operator=(const QOpenGLVersionProfile &rhs)

Assigns the version and profile of rhs to this QOpenGLVersionProfile object.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+