replicant-frameworks_native/opengl/tools/glgen/stubs/gles11/glGetProgramPipelineInfoLog.cpp
Jesse Hall 16f0392874 opengl: Add GLES31 and GLES31Ext class templates
Bug: 15028495
Change-Id: I276d04f029d441e092428fad72f09ca15e1d233a
2014-05-20 13:31:05 -07:00

20 lines
688 B
C++

#include <stdlib.h>
/* void glGetProgramPipelineInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
static jstring android_glGetProgramPipelineInfoLog(JNIEnv *_env, jobject, jint shader) {
GLint infoLen = 0;
glGetProgramPipelineiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
if (!infoLen) {
return _env->NewStringUTF("");
}
char* buf = (char*) malloc(infoLen);
if (buf == NULL) {
jniThrowException(_env, "java/lang/OutOfMemoryError", "out of memory");
return NULL;
}
glGetProgramPipelineInfoLog(shader, infoLen, NULL, buf);
jstring result = _env->NewStringUTF(buf);
free(buf);
return result;
}