aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/ogl/NativeScreenInfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/native/ogl/NativeScreenInfo.c')
-rw-r--r--src/native/ogl/NativeScreenInfo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/native/ogl/NativeScreenInfo.c b/src/native/ogl/NativeScreenInfo.c
index 9d1cd36..b9775e7 100644
--- a/src/native/ogl/NativeScreenInfo.c
+++ b/src/native/ogl/NativeScreenInfo.c
@@ -187,7 +187,12 @@ Java_javax_media_j3d_NativeScreenInfo_queryWglARB(
return JNI_FALSE;
}
- SetPixelFormat(hdc, pixelFormat, NULL);
+ if (SetPixelFormat(hdc, pixelFormat, NULL)) {
+ printErrorMessage("Failed in SetPixelFormat");
+ DestroyWindow(hwnd);
+ UnregisterClass(szAppName, (HINSTANCE)NULL);
+ return -1;
+ }
hrc = wglCreateContext(hdc);
if (!hrc) {