PDA

View Full Version : QGLWidget : wrong DC



pl01
30th April 2013, 14:43
Hi,

I'm using the WGLWidget under windows 7 64 bits and when I call "wglGetCurrentDC" from the "resizeEvent" I got another value than from the "paintEvent" !
Also, I have checked and it is the same thread !

How is it possible ?

Here is some code :



void GLViewport::resizeEvent(QResizeEvent* e)
{
if (_isInitialized)
return;

glInit();

_win32HDC = wglGetCurrentDC();
}

void GLViewport::paintEvent(QPaintEvent *)
{
_win32HDC = wglGetCurrentDC();
}

wysota
2nd May 2013, 01:25
when I call "wglGetCurrentDC" from the "resizeEvent" I got another value than from the "paintEvent" !
Yeah, and?


How is it possible ?
QGLWidget::makeCurrent(), QGLWidget::doneCurrent()

pl01
2nd May 2013, 14:02
Thanks :-)