diff options
author | Kevin Rushforth <[email protected]> | 2004-12-23 00:11:57 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2004-12-23 00:11:57 +0000 |
commit | 8c35250bbf0450493d8fa71b150b3331770b6907 (patch) | |
tree | e72622a5b49bdf5513e246b6862fd41762850f38 /src/native/ogl | |
parent | 451909b8beecf3a915587538495dd47d4e635d08 (diff) |
Issue number: 5
Fixed Issue 5 (FlyingGuns crash in native code on Canvas removal).
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@94 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/ogl')
-rw-r--r-- | src/native/ogl/Canvas3D.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c index 4db442f..1899e9c 100644 --- a/src/native/ogl/Canvas3D.c +++ b/src/native/ogl/Canvas3D.c @@ -2334,7 +2334,11 @@ void JNICALL Java_javax_media_j3d_Canvas3D_newDisplayList( jlong ctxInfo, jint id) { - + if (id <= 0) { + fprintf(stderr, "JAVA 3D ERROR : glNewList(%d) -- IGNORED\n", id); + return; + } + glNewList(id, GL_COMPILE); } @@ -2391,6 +2395,19 @@ void JNICALL Java_javax_media_j3d_Canvas3D_callDisplayList( { GraphicsContextPropertiesInfo *ctxProperties = (GraphicsContextPropertiesInfo *)ctxInfo; jlong ctx = ctxProperties->context; + static int numInvalidLists = 0; + + if (id <= 0) { + if (numInvalidLists < 3) { + fprintf(stderr, "JAVA 3D ERROR : glCallList(%d) -- IGNORED\n", id); + ++numInvalidLists; + } + else if (numInvalidLists == 3) { + fprintf(stderr, "JAVA 3D : further glCallList error messages discarded\n"); + ++numInvalidLists; + } + return; + } /* resale_normal_ext */ if (ctxProperties->rescale_normal_ext && isNonUniformScale) { @@ -2412,6 +2429,11 @@ void JNICALL Java_javax_media_j3d_Canvas3D_freeDisplayList( jint id) { + if (id <= 0) { + fprintf(stderr, "JAVA 3D ERROR : glDeleteLists(%d,1) -- IGNORED\n", id); + return; + } + glDeleteLists(id, 1); } |