diff options
Diffstat (limited to 'src/native/ogl')
-rw-r--r-- | src/native/ogl/Canvas3D.c | 7 | ||||
-rw-r--r-- | src/native/ogl/NativeConfigTemplate3D.c | 9 | ||||
-rw-r--r-- | src/native/ogl/NativeScreenInfo.c | 7 |
3 files changed, 19 insertions, 4 deletions
diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c index f3bb2da..1e41934 100644 --- a/src/native/ogl/Canvas3D.c +++ b/src/native/ogl/Canvas3D.c @@ -1108,7 +1108,7 @@ jlong JNICALL Java_javax_media_j3d_NativePipeline_createNewContext( LPTSTR errString; jboolean result; PixelFormatInfo *PixelFormatInfoPtr = (PixelFormatInfo *)fbConfigListPtr; - + int i; /* Fix for issue 76 */ @@ -1147,7 +1147,10 @@ jlong JNICALL Java_javax_media_j3d_NativePipeline_createNewContext( } } - SetPixelFormat(hdc, PixelFormatID, NULL); + if (SetPixelFormat(hdc, pixelFormat, NULL)) { + printErrorMessage("Canvas3D_createNewContext: Failed in SetPixelFormat"); + return 0; + } /* fprintf(stderr, "Before wglCreateContext\n"); */ diff --git a/src/native/ogl/NativeConfigTemplate3D.c b/src/native/ogl/NativeConfigTemplate3D.c index 2d7ace7..692ebfb 100644 --- a/src/native/ogl/NativeConfigTemplate3D.c +++ b/src/native/ogl/NativeConfigTemplate3D.c @@ -1436,6 +1436,8 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat( jlong * offScreenPFListPtr; PIXELFORMATDESCRIPTOR dummy_pfd = getDummyPFD(); + int i; + /* * Select any pixel format and bound current context to * it so that we can get the wglChoosePixelFormatARB entry point. @@ -1458,7 +1460,12 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat( return -1; } - SetPixelFormat(hdc, pixelFormat, NULL); + if (SetPixelFormat(hdc, pixelFormat, NULL)) { + printErrorMessage("In NativeConfigTemplate : Failed in SetPixelFormat"); + DestroyWindow(hwnd); + UnregisterClass(szAppName, (HINSTANCE)NULL); + return -1; + } hrc = wglCreateContext(hdc); if (!hrc) { 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) { |