replicant-frameworks_native/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
Andreas Gampe b5da0d78d2 Frameworks/native: Add pragmas to glgen headers
The code currently being generated by glgen is not the cleanest, but
we would like to get core/jni onto -Werror. Thus add pragmas turning
off warnings locally to the C headers.

Also fix signed-comparison in two functions.

Longer term TODO: Emit clean code.

Change-Id: Iee8582f8c0c1de076d64851d3b6ca467afd5bc43
2014-11-12 10:10:12 -08:00

13 lines
645 B
C++

/* void glDrawArraysIndirect ( GLenum mode, const void *indirect ) */
static void android_glDrawArraysIndirect(JNIEnv *_env, jobject, int mode, jlong indirect) {
// In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
// GL checks for too-large values. Here we only need to check for successful signed 64-bit
// to unsigned 32-bit conversion.
if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
return;
}
glDrawArraysIndirect(mode, (const void*)indirect);
}