diff options
Diffstat (limited to 'CNativeCode/GLCallbackHelperJNI.h')
-rw-r--r-- | CNativeCode/GLCallbackHelperJNI.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/CNativeCode/GLCallbackHelperJNI.h b/CNativeCode/GLCallbackHelperJNI.h new file mode 100644 index 0000000..102f65a --- /dev/null +++ b/CNativeCode/GLCallbackHelperJNI.h @@ -0,0 +1,71 @@ + +#ifndef GLCALLBACKHELPERJNI + #define GLCALLBACKHELPERJNI + + #include <stdio.h> + #include <stdlib.h> + #include <stdarg.h> + + #ifdef _WIN32_ + #include "winstuff.h" + #endif + + #include <jni.h> + + #include<GL/gl.h> + #include <GL/glu.h> + + #ifndef LIBAPIENTRY + #define LIBAPIENTRY + #endif + #ifndef LIBAPI + #define LIBAPI + #endif + + typedef struct { + /* The Java Handles */ + JNIEnv *env; /* non-copy */ + jobject jobj; /* copy */ + char *methodName; /* copy */ + char *signature; /* copy */ + int argListNumber; /* copy */ + int arrayLen1; /* copy */ + int arrayLen2; /* copy */ + int arrayLen3; /* copy */ + int arrayLen4; /* copy */ + int arrayLen5; /* copy */ + + /* The Native Handles */ + void *cb_obj; /* non-copy, the tesselator, quadratics, etc. object */ + GLenum which; /* copy, the function type */ + jlong glx; /* copy, the GL-Context */ + } CallbackEntry; + + typedef struct _CallbackNode { + struct _CallbackNode *prev; + CallbackEntry *this; + struct _CallbackNode *next; + } CallbackNode; + + LIBAPI void LIBAPIENTRY PrintCallbackEntry(const char *title, CallbackEntry * cbe); + + LIBAPI void LIBAPIENTRY PrintCallbackNode(const char *title, CallbackNode * cbn); + + LIBAPI CallbackNode * LIBAPIENTRY LastCallbackNode(); + + LIBAPI CallbackNode * LIBAPIENTRY FindNextCallbackNodeOfCbObj(void *cb_obj); + LIBAPI CallbackNode * LIBAPIENTRY FindCallbackNode(GLenum which, jlong glx); + + LIBAPI CallbackEntry * LIBAPIENTRY FindCallbackEntry(GLenum which, jlong glx); + + LIBAPI void LIBAPIENTRY AddCallbackNode(JNIEnv * env, jobject jobj, + const char *methodName, const char *signature, + int arrayLen1, int arrayLen2, int arrayLen3, + int arrayLen4, int arrayLen5, + void *cb_obj, GLenum which, jlong glx); + + LIBAPI void LIBAPIENTRY RemoveCallbackNodes(void *cb_obj); + + LIBAPI jlong LIBAPIENTRY GetCurrentGLContext(); + +#endif |