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/Canvas3D.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/native/ogl/Canvas3D.c') 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"); */ -- cgit v1.2.3