summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_win.cpp
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-09-29 10:56:05 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-09-29 10:56:05 (GMT)
commit17c17adbd706d32723ecedeb207c7e467f9fa8eb (patch)
tree22d6d314dc7320d0b728578a734d636a1d74d9ae /src/opengl/qgl_win.cpp
parent1ff83d2b44fe07d1bc6b243fad270dfa7d860dc7 (diff)
parentdcd185e58face87105f484e98ecb195af0790a22 (diff)
downloadQt-17c17adbd706d32723ecedeb207c7e467f9fa8eb.zip
Qt-17c17adbd706d32723ecedeb207c7e467f9fa8eb.tar.gz
Qt-17c17adbd706d32723ecedeb207c7e467f9fa8eb.tar.bz2
Merge commit 'qt/4.6' into mmfphonon
Diffstat (limited to 'src/opengl/qgl_win.cpp')
-rw-r--r--src/opengl/qgl_win.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp
index 2f9e225..5b5820a 100644
--- a/src/opengl/qgl_win.cpp
+++ b/src/opengl/qgl_win.cpp
@@ -660,6 +660,8 @@ public:
int dmy_pf = ChoosePixelFormat(dmy_pdc, &dmy_pfd);
SetPixelFormat(dmy_pdc, dmy_pf, &dmy_pfd);
dmy_rc = wglCreateContext(dmy_pdc);
+ old_dc = wglGetCurrentDC();
+ old_context = wglGetCurrentContext();
wglMakeCurrent(dmy_pdc, dmy_rc);
}
@@ -668,10 +670,14 @@ public:
wglDeleteContext(dmy_rc);
ReleaseDC(dmy_id, dmy_pdc);
DestroyWindow(dmy_id);
+ if (old_dc && old_context)
+ wglMakeCurrent(old_dc, old_context);
}
HDC dmy_pdc;
HGLRC dmy_rc;
+ HDC old_dc;
+ HGLRC old_context;
WId dmy_id;
};