From 394342138a29a5072786e0a3d5277e21a28bdcb4 Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Fri, 6 Oct 2006 18:02:03 +0000 Subject: Clean up native resources and print error message if SetPixelFormat fail. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@712 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/native/ogl/NativeScreenInfo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/native/ogl/NativeScreenInfo.c') 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) { -- cgit v1.2.3