QWGLContext Struct

struct QNativeInterface::QWGLContext

Native Schnittstelle zu einem WGL-Kontext unter Windows. Mehr...

Kopfzeile: #include <QOpenGLContext>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Seit: Qt 6.0

Öffentliche Funktionen

virtual HGLRC nativeContext() const = 0

Statische öffentliche Mitglieder

QOpenGLContext *fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext = nullptr)
HMODULE openGLModuleHandle()

Detaillierte Beschreibung

Zu erreichen über QOpenGLContext::nativeInterface().

Dokumentation der Mitgliedsfunktionen

[static] QOpenGLContext *QWGLContext::fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext = nullptr)

Nimmt ein WGL context -Handle an.

Die window wird benötigt, weil das zugehörige Pixelformat abgefragt werden soll. Wenn die Übernahme erfolgreich ist, gibt QOpenGLContext::format() ein QSurfaceFormat zurück, das dieses Pixelformat beschreibt.

Hinweis: Das von window angegebene Fenster muss sein Pixelformat auf ein mit dem des Kontexts kompatibles Format eingestellt haben. Wenn kein SetPixelFormat()-Aufruf in einem zum Fenster gehörenden Gerätekontext erfolgt ist, schlägt die Übernahme des Kontexts fehl.

Das Eigentum an der erstellten QOpenGLContext shareContext wird an den Aufrufer übertragen.

[pure virtual] HGLRC QWGLContext::nativeContext() const

Gibt das zugrunde liegende Kontext-Handle zurück.

[static] HMODULE QWGLContext::openGLModuleHandle()

Gibt das Handle für die OpenGL-Implementierung zurück, die derzeit verwendet wird.

Hinweis: Diese Funktion setzt voraus, dass die Instanz QGuiApplication bereits erstellt wurde.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.