|
5 | 5 | jboolean glPlatformInit(); |
6 | 6 | jboolean glGetFunction(void **funcPtr, const char *name); //platform impl |
7 | 7 |
|
8 | | -void (*_glActiveTexture)(int); |
9 | | -void (*_glAlphaFunc)(int,int); |
10 | | -void (*_glAttachShader)(int,int); |
11 | | -void (*_glBindBuffer)(int,int); |
12 | | -void (*_glBindFramebuffer)(int,int); |
13 | | -void (*_glBindRenderbuffer)(int,int); |
14 | | -void (*_glBindTexture)(int,int); |
15 | | -void (*_glBlendFunc)(int,int); |
16 | | -void (*_glBufferData)(int,void*,void *,int); |
17 | | -void (*_glClear)(int); |
18 | | -void (*_glClearColor)(float,float,float,float); |
19 | | -void (*_glClearStencil)(int); |
20 | | -void (*_glColorMask)(jboolean,jboolean,jboolean,jboolean); |
21 | | -void (*_glCompileShader)(int); |
22 | | -int (*_glCreateProgram)(); |
23 | | -int (*_glCreateShader)(int); |
24 | | -void (*_glCullFace)(int); |
25 | | -void (*_glDeleteBuffers)(int,int *); |
26 | | -void (*_glDeleteFramebuffers)(int,int *); |
27 | | -void (*_glDeleteRenderbuffers)(int,int *); |
28 | | -void (*_glDeleteTextures)(int,int *); |
29 | | -void (*_glDrawElements)(int,int,int,void*); |
30 | | -void (*_glDepthFunc)(int); |
31 | | -void (*_glDisable)(int); |
32 | | -void (*_glDisableVertexAttribArray)(int); |
33 | | -void (*_glDepthMask)(); |
34 | | -void (*_glEnable)(); |
35 | | -void (*_glEnableVertexAttribArray)(); |
36 | | -void (*_glFlush)(); |
37 | | -void (*_glFramebufferTexture2D)(int,int,int,int,int); |
38 | | -void (*_glFramebufferRenderbuffer)(int,int,int,int); |
39 | | -void (*_glFrontFace)(int); |
40 | | -int (*_glGetAttribLocation)(int,const char *); |
41 | | -int (*_glGetError)(); |
42 | | -const char* (*_glGetProgramInfoLog)(int,int,int*,char*); |
43 | | -const char* (*_glGetShaderInfoLog)(int,int,int*,char*); |
44 | | -const char* (*_glGetString)(int); |
45 | | -void (*_glGetIntegerv)(int,int *); |
46 | | -void (*_glGenBuffers)(int,int *); |
47 | | -void (*_glGenFramebuffers)(int,int *); |
48 | | -void (*_glGenRenderbuffers)(int,int *); |
49 | | -void (*_glGenTextures)(int,int *); |
50 | | -int (*_glGetUniformLocation)(int,const char *); |
51 | | -void (*_glLinkProgram)(int); |
52 | | -void (*_glPixelStorei)(int,int); |
53 | | -void (*_glReadPixels)(int,int,int,int,int,int,int *); |
54 | | -void (*_glRenderbufferStorage)(int,int,int,int); |
55 | | -int (*_glShaderSource)(int,int,const char**,int *); |
56 | | -int (*_glStencilFunc)(int,int,int); |
57 | | -int (*_glStencilMask)(int); |
58 | | -int (*_glStencilOp)(int,int,int); |
59 | | -void (*_glTexImage2D)(int,int,int,int,int,int,int,int,int *); |
60 | | -void (*_glTexSubImage2D)(int,int,int,int,int,int,int,int,int *); |
61 | | -void (*_glTexParameteri)(int,int,int); |
62 | | -void (*_glUseProgram)(int); |
63 | | -void (*_glUniformMatrix4fv)(int,int,int,float *); |
64 | | -void (*_glUniform4fv)(int,int,float *); |
65 | | -void (*_glUniform3fv)(int,int,float *); |
66 | | -void (*_glUniform2fv)(int,int,float *); |
67 | | -void (*_glUniform1f)(int, float); |
68 | | -void (*_glUniform4iv)(int,int,int *); |
69 | | -void (*_glUniform3iv)(int,int,int *); |
70 | | -void (*_glUniform2iv)(int,int,int *); |
71 | | -void (*_glUniform1i)(int,int); |
72 | | -void (*_glVertexAttribPointer)(int, int, int, int, int, void*); |
73 | | -void (*_glViewport)(int, int, int, int); |
74 | | - |
75 | | -// _jni_GLJNI_ -> _jni_GLJNI_ |
76 | | - |
77 | | -JNIEXPORT jboolean JNICALL Java_javaforce_jni_GLJNI_init |
78 | | - (JNIEnv *e, jobject c) |
| 8 | +#ifdef __cplusplus |
| 9 | +extern "C" { |
| 10 | +#endif |
| 11 | + |
| 12 | +JNIEXPORT jboolean JNICALL GLinit(); |
| 13 | + |
| 14 | +JNIEXPORT void (*_glActiveTexture)(int); |
| 15 | +JNIEXPORT void (*_glAlphaFunc)(int,int); |
| 16 | +JNIEXPORT void (*_glAttachShader)(int,int); |
| 17 | +JNIEXPORT void (*_glBindBuffer)(int,int); |
| 18 | +JNIEXPORT void (*_glBindFramebuffer)(int,int); |
| 19 | +JNIEXPORT void (*_glBindRenderbuffer)(int,int); |
| 20 | +JNIEXPORT void (*_glBindTexture)(int,int); |
| 21 | +JNIEXPORT void (*_glBlendFunc)(int,int); |
| 22 | +JNIEXPORT void (*_glBufferData)(int,void*,void*,int); |
| 23 | +JNIEXPORT void (*_glClear)(int); |
| 24 | +JNIEXPORT void (*_glClearColor)(float,float,float,float); |
| 25 | +JNIEXPORT void (*_glClearStencil)(int); |
| 26 | +JNIEXPORT void (*_glColorMask)(jboolean,jboolean,jboolean,jboolean); |
| 27 | +JNIEXPORT void (*_glCompileShader)(int); |
| 28 | +JNIEXPORT int (*_glCreateProgram)(); |
| 29 | +JNIEXPORT int (*_glCreateShader)(int); |
| 30 | +JNIEXPORT void (*_glCullFace)(int); |
| 31 | +JNIEXPORT void (*_glDeleteBuffers)(int,int *); |
| 32 | +JNIEXPORT void (*_glDeleteFramebuffers)(int,int *); |
| 33 | +JNIEXPORT void (*_glDeleteRenderbuffers)(int,int *); |
| 34 | +JNIEXPORT void (*_glDeleteTextures)(int,int *); |
| 35 | +JNIEXPORT void (*_glDrawElements)(int,int,int,void*); |
| 36 | +JNIEXPORT void (*_glDepthFunc)(int); |
| 37 | +JNIEXPORT void (*_glDisable)(int); |
| 38 | +JNIEXPORT void (*_glDisableVertexAttribArray)(int); |
| 39 | +JNIEXPORT void (*_glDepthMask)(); |
| 40 | +JNIEXPORT void (*_glEnable)(); |
| 41 | +JNIEXPORT void (*_glEnableVertexAttribArray)(); |
| 42 | +JNIEXPORT void (*_glFlush)(); |
| 43 | +JNIEXPORT void (*_glFramebufferTexture2D)(int,int,int,int,int); |
| 44 | +JNIEXPORT void (*_glFramebufferRenderbuffer)(int,int,int,int); |
| 45 | +JNIEXPORT void (*_glFrontFace)(int); |
| 46 | +JNIEXPORT int (*_glGetAttribLocation)(int,const char *); |
| 47 | +JNIEXPORT int (*_glGetError)(); |
| 48 | +JNIEXPORT const char* (*_glGetProgramInfoLog)(int,int,int*,char*); |
| 49 | +JNIEXPORT const char* (*_glGetShaderInfoLog)(int,int,int*,char*); |
| 50 | +JNIEXPORT const char* (*_glGetString)(int); |
| 51 | +JNIEXPORT void (*_glGetIntegerv)(int,int *); |
| 52 | +JNIEXPORT void (*_glGenBuffers)(int,int *); |
| 53 | +JNIEXPORT void (*_glGenFramebuffers)(int,int *); |
| 54 | +JNIEXPORT void (*_glGenRenderbuffers)(int,int *); |
| 55 | +JNIEXPORT void (*_glGenTextures)(int,int *); |
| 56 | +JNIEXPORT int (*_glGetUniformLocation)(int,const char *); |
| 57 | +JNIEXPORT void (*_glLinkProgram)(int); |
| 58 | +JNIEXPORT void (*_glPixelStorei)(int,int); |
| 59 | +JNIEXPORT void (*_glReadPixels)(int,int,int,int,int,int,int *); |
| 60 | +JNIEXPORT void (*_glRenderbufferStorage)(int,int,int,int); |
| 61 | +JNIEXPORT int (*_glShaderSource)(int,int,const char**,int *); |
| 62 | +JNIEXPORT int (*_glStencilFunc)(int,int,int); |
| 63 | +JNIEXPORT int (*_glStencilMask)(int); |
| 64 | +JNIEXPORT int (*_glStencilOp)(int,int,int); |
| 65 | +JNIEXPORT void (*_glTexImage2D)(int,int,int,int,int,int,int,int,int *); |
| 66 | +JNIEXPORT void (*_glTexSubImage2D)(int,int,int,int,int,int,int,int,int *); |
| 67 | +JNIEXPORT void (*_glTexParameteri)(int,int,int); |
| 68 | +JNIEXPORT void (*_glUseProgram)(int); |
| 69 | +JNIEXPORT void (*_glUniformMatrix4fv)(int,int,int,float *); |
| 70 | +JNIEXPORT void (*_glUniform4fv)(int,int,float *); |
| 71 | +JNIEXPORT void (*_glUniform3fv)(int,int,float *); |
| 72 | +JNIEXPORT void (*_glUniform2fv)(int,int,float *); |
| 73 | +JNIEXPORT void (*_glUniform1f)(int, float); |
| 74 | +JNIEXPORT void (*_glUniform4iv)(int,int,int *); |
| 75 | +JNIEXPORT void (*_glUniform3iv)(int,int,int *); |
| 76 | +JNIEXPORT void (*_glUniform2iv)(int,int,int *); |
| 77 | +JNIEXPORT void (*_glUniform1i)(int,int); |
| 78 | +JNIEXPORT void (*_glVertexAttribPointer)(int, int, int, int, int, void*); |
| 79 | +JNIEXPORT void (*_glViewport)(int, int, int, int); |
| 80 | + |
| 81 | +#ifdef __cplusplus |
| 82 | +} |
| 83 | +#endif |
| 84 | + |
| 85 | +JNIEXPORT jboolean JNICALL GLinit() |
79 | 86 | { |
80 | 87 | if (!glPlatformInit()) return JNI_FALSE; |
81 | 88 | glGetFunction((void**)&_glActiveTexture,"glActiveTexture"); |
@@ -147,6 +154,12 @@ JNIEXPORT jboolean JNICALL Java_javaforce_jni_GLJNI_init |
147 | 154 | return JNI_TRUE; |
148 | 155 | } |
149 | 156 |
|
| 157 | +JNIEXPORT jboolean JNICALL Java_javaforce_jni_GLJNI_init |
| 158 | + (JNIEnv *e, jobject c) |
| 159 | +{ |
| 160 | + return GLinit(); |
| 161 | +} |
| 162 | + |
150 | 163 | JNIEXPORT void JNICALL Java_javaforce_jni_GLJNI_glActiveTexture |
151 | 164 | (JNIEnv *e, jobject c, jint i1) |
152 | 165 | { |
|
0 commit comments