user14416
user14416

Reputation: 3032

QGLWidget get gl contextes for Windows

I am using `QGLWidget and OpenCL. To set the CL-GL interoperation I need

HGLRC glContext
HDC   deviceGLContext

How to get it using Qt?

Upvotes: 0

Views: 592

Answers (1)

Dmitry Shkuropatsky
Dmitry Shkuropatsky

Reputation: 3965

You can select the QGLWidget for current OpenGL operations with QGLWidget::makeCurrent() and then retrieve current HGLRC and HDC with wglGetCurrentContext and wglGetCurrentDC, respectively.

Upvotes: 2

Related Questions