opengl32/tests: Only use functions if they are implemented.
This commit is contained in:
parent
e2539cb9e5
commit
82cbbbdb46
|
@ -236,6 +236,12 @@ static void test_colorbits(HDC hdc)
|
||||||
int res;
|
int res;
|
||||||
int iPixelFormat = 0;
|
int iPixelFormat = 0;
|
||||||
|
|
||||||
|
if (!pwglChoosePixelFormatARB)
|
||||||
|
{
|
||||||
|
skip("wglChoosePixelFormatARB is not available\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* We need a pixel format with at least one bit of alpha */
|
/* We need a pixel format with at least one bit of alpha */
|
||||||
res = pwglChoosePixelFormatARB(hdc, iAttribs, NULL, 1, &iPixelFormat, &nFormats);
|
res = pwglChoosePixelFormatARB(hdc, iAttribs, NULL, 1, &iPixelFormat, &nFormats);
|
||||||
if(res == FALSE || nFormats == 0)
|
if(res == FALSE || nFormats == 0)
|
||||||
|
@ -264,6 +270,12 @@ static void test_gdi_dbuf(HDC hdc)
|
||||||
int iPixelFormat;
|
int iPixelFormat;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
if (!pwglGetPixelFormatAttribivARB)
|
||||||
|
{
|
||||||
|
skip("wglGetPixelFormatAttribivARB is not available\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nFormats = DescribePixelFormat(hdc, 0, 0, NULL);
|
nFormats = DescribePixelFormat(hdc, 0, 0, NULL);
|
||||||
for(iPixelFormat = 1;iPixelFormat <= nFormats;iPixelFormat++)
|
for(iPixelFormat = 1;iPixelFormat <= nFormats;iPixelFormat++)
|
||||||
{
|
{
|
||||||
|
@ -383,6 +395,13 @@ START_TEST(opengl)
|
||||||
test_colorbits(hdc);
|
test_colorbits(hdc);
|
||||||
test_gdi_dbuf(hdc);
|
test_gdi_dbuf(hdc);
|
||||||
|
|
||||||
|
if (!pwglGetExtensionsStringARB)
|
||||||
|
{
|
||||||
|
skip("wglGetExtensionsStringARB is not available\n");
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wgl_extensions = pwglGetExtensionsStringARB(hdc);
|
wgl_extensions = pwglGetExtensionsStringARB(hdc);
|
||||||
if(wgl_extensions == NULL) skip("Skipping opengl32 tests because this OpenGL implementation doesn't support WGL extensions!\n");
|
if(wgl_extensions == NULL) skip("Skipping opengl32 tests because this OpenGL implementation doesn't support WGL extensions!\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue