Ticket #4807 (closed defect: obsolete)
wglMakeCurrent fails when 3D acceleration is enabled
|Reported by:||bboaz||Owned by:|
|Version:||VirtualBox 3.0.4||Keywords:||OpenGL 3D acceleration|
Description (last modified by aeichner) (diff)
I'm trying to get a commercial visualization product running on a Windows XP32 (sp2) guest hosted by either Windows Vista64 or Windows 7. The render/paint method for a canvas is basically:
The method that enables the context first saves away the current rendering and device contexts by calling wglGetCurrentContext() and wglGetCurrentDC(); then it calls wglMakeCurrent to make the canvas's context current. This call to wglMakeCurrent succeeds.
However, when the disable context method is called after rendering, which tries to restore the context previously saved by the enable method, wglMakeCurrent fails.
All of this happens very soon after app startup, so it appears to crash almost immediately. However, since I can't debug the low-level code, I can't say for certain if the problem occurs on the first rendering pass, or very soon thereafter.
If the app is run outside of vbox - or if the app is run in vbox w/o 3D acceleration enabled - everything works dandy. (Obviously if run in vbox w/o 3D acceleration it is very slow).
A couple of possibilities come to mind for reasons why this issue occurs:
1) There's a good chance that on the first rendering pass the previous context is NULL; maybe your implementation of wglMakeCurrent is not handling a NULL context properly.
2) A threading issue. There's some small chance that the previous context is from a different thread. Are these vbox drivers threadsafe?
One other interesting tidbit from our internally generated log file (which may or may not be useful): right before the app crashes, the following is logged: OpenGL Warning: No pincher, please call crStateSetCurrentPointers() in your SPU