On 14 February 2014 00:31, Ken Thomases ken@codeweavers.com wrote:
- /* If no opengl32 function has been called, GetPixelFormat() doesn't reflect a
prior SetPixelFormat(). So, call wglCreateContext() even though it will fail. */
- hglrc = wglCreateContext(hdc);
- ok(hglrc == NULL, "wglCreateContext succeeded when no pixel format has been set\n");
- if (hglrc) wglDeleteContext(hglrc);
I decided to look into this a bit, but could only reproduce it on the testbot. It seems just loading opengl32 is enough to make GetPixelFormat() work. (Also see https://newtestbot.winehq.org/JobDetails.pl?Key=4908.)
On Feb 14, 2014, at 11:53 AM, Henri Verbeet wrote:
On 14 February 2014 00:31, Ken Thomases ken@codeweavers.com wrote:
- /* If no opengl32 function has been called, GetPixelFormat() doesn't reflect a
prior SetPixelFormat(). So, call wglCreateContext() even though it will fail. */
- hglrc = wglCreateContext(hdc);
- ok(hglrc == NULL, "wglCreateContext succeeded when no pixel format has been set\n");
- if (hglrc) wglDeleteContext(hglrc);
I decided to look into this a bit, but could only reproduce it on the testbot. It seems just loading opengl32 is enough to make GetPixelFormat() work. (Also see https://newtestbot.winehq.org/JobDetails.pl?Key=4908.)
Hmm. I won't be able to double-check until Monday, but I'm pretty sure I got the opengl32 test_setpixelformat() to fail on a real Win7 machine just by commenting out the wglCreateContext() call (and the other tests) that is done before it. That is, running the executable from https://newtestbot.winehq.org/JobDetails.pl?Key=4752.
Assuming it works without the wglCreateContext(), would you prefer the dynamic loading approach to the import I had done?
-Ken
On 15 February 2014 03:52, Ken Thomases ken@codeweavers.com wrote:
Hmm. I won't be able to double-check until Monday, but I'm pretty sure I got the opengl32 test_setpixelformat() to fail on a real Win7 machine just by commenting out the wglCreateContext() call (and the other tests) that is done before it. That is, running the executable from https://newtestbot.winehq.org/JobDetails.pl?Key=4752.
Assuming it works without the wglCreateContext(), would you prefer the dynamic loading approach to the import I had done?
Yeah.
On Feb 14, 2014, at 11:53 AM, Henri Verbeet wrote:
On 14 February 2014 00:31, Ken Thomases ken@codeweavers.com wrote:
- /* If no opengl32 function has been called, GetPixelFormat() doesn't reflect a
prior SetPixelFormat(). So, call wglCreateContext() even though it will fail. */
- hglrc = wglCreateContext(hdc);
- ok(hglrc == NULL, "wglCreateContext succeeded when no pixel format has been set\n");
- if (hglrc) wglDeleteContext(hglrc);
I decided to look into this a bit, but could only reproduce it on the testbot. It seems just loading opengl32 is enough to make GetPixelFormat() work. (Also see https://newtestbot.winehq.org/JobDetails.pl?Key=4908.)
It seems that dynamically linked libraries are not initialized until called, while dynamically loaded libraries are initialized immediately. Or something like that.
If I take your patch and remove the LoadLibraryA()/FreeLibrary() calls but add opengl32 to the IMPORTS, then it fails on a real Windows 7 machine. Patch and executable are available from https://newtestbot.winehq.org/JobDetails.pl?Key=4980 although, at this writing, the test itself hadn't completed on the testbot.
I guess dynamic loading is good enough for me. I'll rework the patches and resubmit.
-Ken