summaryrefslogtreecommitdiff
path: root/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-11-19 16:34:55 +0800
committerJack Palevich <jackpal@google.com>2009-11-19 16:34:55 +0800
commit560814f6b11abe83ff0c4ed18cac015c276b3181 (patch)
treeef52858af693f7e154514349d2f300c69e3183b0 /opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp
parentf9cf96ae1d342b1af659041e1bc5d464126f8e49 (diff)
Add a Java API for OpenGL ES 2.0.
Currently this API is hidden. Add a test program.
Diffstat (limited to 'opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp')
-rw-r--r--opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp
new file mode 100644
index 000000000000..d92f51598352
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp
@@ -0,0 +1,27 @@
+#include <string.h>
+
+/* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
+static
+jstring
+android_glGetProgramInfoLog (JNIEnv *_env, jobject _this, jint shader) {
+ GLint infoLen = 0;
+ jstring _result = 0;
+ char* buf = 0;
+ glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
+ if (infoLen) {
+ char* buf = (char*) malloc(infoLen);
+ if (buf == 0) {
+ _env->ThrowNew(IAEClass, "out of memory");
+ goto exit;
+ }
+ glGetProgramInfoLog(shader, infoLen, NULL, buf);
+ _result = _env->NewStringUTF(buf);
+ } else {
+ _result = _env->NewStringUTF("");
+ }
+exit:
+ if (buf) {
+ free(buf);
+ }
+ return _result;
+} \ No newline at end of file