diff options
author | Chien Yang <[email protected]> | 2006-10-06 18:02:03 +0000 |
---|---|---|
committer | Chien Yang <[email protected]> | 2006-10-06 18:02:03 +0000 |
commit | 394342138a29a5072786e0a3d5277e21a28bdcb4 (patch) | |
tree | 5e89d41ac5d4533b2be0e0baf25aacb665999465 /src/native/ogl/NativeConfigTemplate3D.c | |
parent | 9eef9af05c78cdad57526c633aa3b31fc74f7aaa (diff) |
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
Diffstat (limited to 'src/native/ogl/NativeConfigTemplate3D.c')
-rw-r--r-- | src/native/ogl/NativeConfigTemplate3D.c | 9 |
1 files changed, 8 insertions, 1 deletions
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) { |