Windows WGL 上下文的本机接口。 更多...
头: | #include < QOpenGLContext > |
CMake: |
find_package(Qt6 COMPONENTS Gui REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
Since: | Qt 6.0 |
virtual HGLRC | nativeContext () const = 0 |
QOpenGLContext * | fromNative (HGLRC context , HWND window , QOpenGLContext * shareContext = nullptr) |
HMODULE | openGLModuleHandle () |
访问透过 QOpenGLContext::nativeInterface ().
[static]
QOpenGLContext
*QWGLContext::
fromNative
(
HGLRC
context
,
HWND
window
,
QOpenGLContext
*
shareContext
= nullptr)
Adopts an WGL context 句柄。
window is needed because the its pixel format will be queried. When the adoption is successful, QOpenGLContext::format () 会返回 QSurfaceFormat 描述此像素格式。
注意: 窗口的指定通过 window 必须将其像素格式设为兼容上下文格式。若未在属于窗口的任何设备上下文中调用 SetPixelFormat(),采纳上下文会失败。
Ownership of the created QOpenGLContext shareContext is transferred to the caller.
[pure virtual]
HGLRC
QWGLContext::
nativeContext
() const
Returns the underlying context handle.
[static]
HMODULE
QWGLContext::
openGLModuleHandle
()
Returns the handle for the OpenGL implementation that is currently in use.
注意: 此函数要求 QGuiApplication instance is already created.