M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
+120
View File
@@ -0,0 +1,120 @@
#!/bin/bash
set -u
set -e
rm -rf out generated
mkdir out
# Create dummy Java files for Android APIs that are used by the code we generate.
# This allows us to test the generated code without building the rest of Android.
mkdir -p out/javax/microedition/khronos/opengles
mkdir -p out/com/google/android/gles_jni
mkdir -p out/android/app
mkdir -p out/android/graphics
mkdir -p out/android/opengl
mkdir -p out/android/content
mkdir -p out/android/content/pm
mkdir -p out/android/os
mkdir -p out/android/util
echo "package android.graphics;" > out/android/graphics/Canvas.java
echo "public interface Canvas {}" >> out/android/graphics/Canvas.java
echo "package android.app; import android.content.pm.IPackageManager; public class ActivityThread { public static final ActivityThread currentActivityThread() { return null; } public static final String currentPackageName(){ return null; } public static IPackageManager getPackageManager() { return null;} }" > out/android/app/ActivityThread.java
# echo "package android.content; import android.content.pm.PackageManager; public interface Context { public PackageManager getPackageManager(); }" > out/android/content/Context.java
echo "package android.content.pm; public class ApplicationInfo {public int targetSdkVersion;}" > out/android/content/pm/ApplicationInfo.java
echo "package android.content.pm; public interface IPackageManager {ApplicationInfo getApplicationInfo(java.lang.String packageName, int flags) throws android.os.RemoteException;}" > out/android/content/pm/IPackageManager.java
echo "package android.os; public class Build {public static class VERSION_CODES { public static final int CUPCAKE = 3;}; }" > out/android/os/Build.java
echo "package android.os; public class RemoteException extends Exception {}" > out/android/os/RemoteException.java
echo "package android.util; public class Log {public static void w(String a, String b) {} public static void e(String a, String b) {}}" > out/android/util/Log.java
GLFILE=out/javax/microedition/khronos/opengles/GL.java
cp stubs/jsr239/GLHeader.java-if $GLFILE
GLGEN_FILES="CFunc.java CType.java CodeEmitter.java GenerateGL.java GenerateGLES.java GLESCodeEmitter.java JFunc.java JniCodeEmitter.java JType.java Jsr239CodeEmitter.java ParameterChecker.java"
pushd src > /dev/null
javac ${GLGEN_FILES}
JAVAC_RESULT=$?
if [ $JAVAC_RESULT -ne 0 ]; then
echo "Could not compile glgen."
exit $JAVAC_RESULT
fi
popd > /dev/null
echo "Generating JSR239-like APIs"
java -classpath src GenerateGL -c specs/jsr239/glspec-1.0 specs/jsr239/glspec-1.0ext specs/jsr239/glspec-1.1 specs/jsr239/glspec-1.1ext specs/jsr239/glspec-1.1extpack specs/jsr239/glspec-checks
JAVA_RESULT=$?
if [ $JAVA_RESULT -ne 0 ]; then
echo "Could not run GenerateGL."
exit $JAVA_RESULT
fi
echo "Generating static OpenGLES 1.1 bindings"
java -classpath src GenerateGLES
JAVA_RESULT=$?
if [ $JAVA_RESULT -ne 0 ]; then
echo "Could not run GenerateGLES."
exit $JAVA_RESULT
fi
rm src/*.class
pushd out > /dev/null
mkdir classes
javac -d classes com/google/android/gles_jni/GLImpl.java javax/microedition/khronos/opengles/GL10.java javax/microedition/khronos/opengles/GL10Ext.java javax/microedition/khronos/opengles/GL11.java javax/microedition/khronos/opengles/GL11Ext.java javax/microedition/khronos/opengles/GL11ExtensionPack.java android/opengl/GLES10.java android/opengl/GLES10Ext.java android/opengl/GLES11.java android/opengl/GLES11Ext.java android/opengl/GLES20.java
popd > /dev/null
JAVA_RESULT=$?
if [ $JAVA_RESULT -ne 0 ]; then
echo "Could not compile generated classes."
exit $JAVA_RESULT
fi
rm -rf generated
mkdir -p generated/C
cp out/com_google_android_gles_jni_GLImpl.cpp generated/C
cp -r out/com generated
cp -r out/javax generated
cp out/android_opengl_*.cpp generated/C
mkdir -p generated/android/opengl
cp -r out/android/opengl generated/android
rm -rf out
KEEP_GENERATED=0
SAID_PLEASE=0
# compareGenerated destDir generatedDir file
compareGenerated() {
if cmp -s $1/$3 $2/$3 ; then
echo "# " $3 unchanged
else
if [ $SAID_PLEASE == "0" ] ; then
echo Please evaluate the following commands:
echo
SAID_PLEASE=1
fi
echo " " cp $2/$3 $1
echo " " git add $1/$3
KEEP_GENERATED=1
fi
}
compareGenerated ../../../core/jni generated/C com_google_android_gles_jni_GLImpl.cpp
compareGenerated ../../java/com/google/android/gles_jni generated/com/google/android/gles_jni GLImpl.java
for x in GL.java GL10.java GL10Ext.java GL11.java GL11Ext.java GL11ExtensionPack.java
do
compareGenerated ../../java/javax/microedition/khronos/opengles generated/javax/microedition/khronos/opengles $x
done
for x in GLES10 GLES10Ext GLES11 GLES11Ext GLES20
do
compareGenerated ../../java/android/opengl generated/android/opengl ${x}.java
compareGenerated ../../../core/jni generated/C android_opengl_${x}.cpp
done
if [ $KEEP_GENERATED == "0" ] ; then
rm -rf generated
fi
@@ -0,0 +1,106 @@
void glActiveTexture ( GLenum texture )
void glAlphaFunc ( GLenum func, GLclampf ref )
void glAlphaFuncx ( GLenum func, GLclampx ref )
void glBindTexture ( GLenum target, GLuint texture )
void glBlendFunc ( GLenum sfactor, GLenum dfactor )
void glClear ( GLbitfield mask )
void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha )
void glClearDepthf ( GLclampf depth )
void glClearDepthx ( GLclampx depth )
void glClearStencil ( GLint s )
void glClientActiveTexture ( GLenum texture )
void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha )
void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
void glCullFace ( GLenum mode )
void glDeleteTextures ( GLsizei n, const GLuint *textures )
void glDepthFunc ( GLenum func )
void glDepthMask ( GLboolean flag )
void glDepthRangef ( GLclampf zNear, GLclampf zFar )
void glDepthRangex ( GLclampx zNear, GLclampx zFar )
void glDisable ( GLenum cap )
void glDisableClientState ( GLenum array )
void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
void glEnable ( GLenum cap )
void glEnableClientState ( GLenum array )
void glFinish ( void )
void glFlush ( void )
void glFogf ( GLenum pname, GLfloat param )
void glFogfv ( GLenum pname, const GLfloat *params )
void glFogx ( GLenum pname, GLfixed param )
void glFogxv ( GLenum pname, const GLfixed *params )
void glFrontFace ( GLenum mode )
void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
void glGenTextures ( GLsizei n, GLuint *textures )
GLenum glGetError ( void )
void glGetIntegerv ( GLenum pname, GLint *params )
const GLubyte * glGetString ( GLenum name )
void glHint ( GLenum target, GLenum mode )
void glLightModelf ( GLenum pname, GLfloat param )
void glLightModelfv ( GLenum pname, const GLfloat *params )
void glLightModelx ( GLenum pname, GLfixed param )
void glLightModelxv ( GLenum pname, const GLfixed *params )
void glLightf ( GLenum light, GLenum pname, GLfloat param )
void glLightfv ( GLenum light, GLenum pname, const GLfloat *params )
void glLightx ( GLenum light, GLenum pname, GLfixed param )
void glLightxv ( GLenum light, GLenum pname, const GLfixed *params )
void glLineWidth ( GLfloat width )
void glLineWidthx ( GLfixed width )
void glLoadIdentity ( void )
void glLoadMatrixf ( const GLfloat *m )
void glLoadMatrixx ( const GLfixed *m )
void glLogicOp ( GLenum opcode )
void glMaterialf ( GLenum face, GLenum pname, GLfloat param )
void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params )
void glMaterialx ( GLenum face, GLenum pname, GLfixed param )
void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params )
void glMatrixMode ( GLenum mode )
void glMultMatrixf ( const GLfloat *m )
void glMultMatrixx ( const GLfixed *m )
void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q )
void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q )
void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz )
void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz )
void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer )
void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
void glPixelStorei ( GLenum pname, GLint param )
void glPointSize ( GLfloat size )
void glPointSizex ( GLfixed size )
void glPolygonOffset ( GLfloat factor, GLfloat units )
void glPolygonOffsetx ( GLfixed factor, GLfixed units )
void glPopMatrix ( void )
void glPushMatrix ( void )
void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z )
void glSampleCoverage ( GLclampf value, GLboolean invert )
void glSampleCoveragex ( GLclampx value, GLboolean invert )
void glScalef ( GLfloat x, GLfloat y, GLfloat z )
void glScalex ( GLfixed x, GLfixed y, GLfixed z )
void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height )
void glShadeModel ( GLenum mode )
void glStencilFunc ( GLenum func, GLint ref, GLuint mask )
void glStencilMask ( GLuint mask )
void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass )
void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glTexEnvf ( GLenum target, GLenum pname, GLfloat param )
void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params )
void glTexEnvx ( GLenum target, GLenum pname, GLfixed param )
void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params )
void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
void glTexParameterf ( GLenum target, GLenum pname, GLfloat param )
void glTexParameterx ( GLenum target, GLenum pname, GLfixed param )
void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
void glTranslatef ( GLfloat x, GLfloat y, GLfloat z )
void glTranslatex ( GLfixed x, GLfixed y, GLfixed z )
void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
@@ -0,0 +1 @@
GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent )
@@ -0,0 +1,44 @@
void glBindBuffer ( GLenum target, GLuint buffer )
void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage )
void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data )
void glClipPlanef ( GLenum plane, const GLfloat *equation )
void glClipPlanex ( GLenum plane, const GLfixed *equation )
void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
void glDeleteBuffers ( GLsizei n, const GLuint *buffers )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
void glGenBuffers ( GLsizei n, GLuint *buffers )
void glGetBooleanv ( GLenum pname, GLboolean *params )
void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params )
void glGetClipPlanef ( GLenum pname, GLfloat *eqn )
void glGetClipPlanex ( GLenum pname, GLfixed *eqn )
void glGetFixedv ( GLenum pname, GLfixed *params )
void glGetFloatv ( GLenum pname, GLfloat *params )
void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params )
void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params )
void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params )
void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params )
// void glGetPointerv ( GLenum pname, void **params )
void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params )
void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params )
void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params )
void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params )
void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params )
void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params )
GLboolean glIsBuffer ( GLuint buffer )
GLboolean glIsEnabled ( GLenum cap )
GLboolean glIsTexture ( GLuint texture )
void glNormalPointer ( GLenum type, GLsizei stride, GLint offset )
void glPointParameterf ( GLenum pname, GLfloat param )
void glPointParameterfv ( GLenum pname, const GLfloat *params )
void glPointParameterx ( GLenum pname, GLfixed param )
void glPointParameterxv ( GLenum pname, const GLfixed *params )
void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer )
void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
void glTexEnvi ( GLenum target, GLenum pname, GLint param )
void glTexEnviv ( GLenum target, GLenum pname, const GLint *params )
void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params )
void glTexParameteri ( GLenum target, GLenum pname, GLint param )
void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params )
void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params )
void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
@@ -0,0 +1,90 @@
void glBlendEquationSeparateOES ( GLenum modeRGB, GLenum modeAlpha )
void glBlendFuncSeparateOES ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
void glBlendEquationOES ( GLenum mode )
void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height )
void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height )
void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height )
void glDrawTexsvOES ( const GLshort *coords )
void glDrawTexivOES ( const GLint *coords )
void glDrawTexxvOES ( const GLfixed *coords )
void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height )
void glDrawTexfvOES ( const GLfloat *coords )
void glEGLImageTargetTexture2DOES ( GLenum target, GLeglImageOES image )
void glEGLImageTargetRenderbufferStorageOES ( GLenum target, GLeglImageOES image )
void glAlphaFuncxOES ( GLenum func, GLclampx ref )
void glClearColorxOES ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha )
void glClearDepthxOES ( GLclampx depth )
void glClipPlanexOES ( GLenum plane, const GLfixed *equation )
void glColor4xOES ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha )
void glDepthRangexOES ( GLclampx zNear, GLclampx zFar )
void glFogxOES ( GLenum pname, GLfixed param )
void glFogxvOES ( GLenum pname, const GLfixed *params )
void glFrustumxOES ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
void glGetClipPlanexOES ( GLenum pname, GLfixed *eqn )
void glGetFixedvOES ( GLenum pname, GLfixed *params )
void glGetLightxvOES ( GLenum light, GLenum pname, GLfixed *params )
void glGetMaterialxvOES ( GLenum face, GLenum pname, GLfixed *params )
void glGetTexEnvxvOES ( GLenum env, GLenum pname, GLfixed *params )
void glGetTexParameterxvOES ( GLenum target, GLenum pname, GLfixed *params )
void glLightModelxOES ( GLenum pname, GLfixed param )
void glLightModelxvOES ( GLenum pname, const GLfixed *params )
void glLightxOES ( GLenum light, GLenum pname, GLfixed param )
void glLightxvOES ( GLenum light, GLenum pname, const GLfixed *params )
void glLineWidthxOES ( GLfixed width )
void glLoadMatrixxOES ( const GLfixed *m )
void glMaterialxOES ( GLenum face, GLenum pname, GLfixed param )
void glMaterialxvOES ( GLenum face, GLenum pname, const GLfixed *params )
void glMultMatrixxOES ( const GLfixed *m )
void glMultiTexCoord4xOES ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q )
void glNormal3xOES ( GLfixed nx, GLfixed ny, GLfixed nz )
void glOrthoxOES ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
void glPointParameterxOES ( GLenum pname, GLfixed param )
void glPointParameterxvOES ( GLenum pname, const GLfixed *params )
void glPointSizexOES ( GLfixed size )
void glPolygonOffsetxOES ( GLfixed factor, GLfixed units )
void glRotatexOES ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z )
void glSampleCoveragexOES ( GLclampx value, GLboolean invert )
void glScalexOES ( GLfixed x, GLfixed y, GLfixed z )
void glTexEnvxOES ( GLenum target, GLenum pname, GLfixed param )
void glTexEnvxvOES ( GLenum target, GLenum pname, const GLfixed *params )
void glTexParameterxOES ( GLenum target, GLenum pname, GLfixed param )
void glTexParameterxvOES ( GLenum target, GLenum pname, const GLfixed *params )
void glTranslatexOES ( GLfixed x, GLfixed y, GLfixed z )
GLboolean glIsRenderbufferOES ( GLuint renderbuffer )
void glBindRenderbufferOES ( GLenum target, GLuint renderbuffer )
void glDeleteRenderbuffersOES ( GLsizei n, const GLuint *renderbuffers )
void glGenRenderbuffersOES ( GLsizei n, GLuint *renderbuffers )
void glRenderbufferStorageOES ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
void glGetRenderbufferParameterivOES ( GLenum target, GLenum pname, GLint *params )
GLboolean glIsFramebufferOES ( GLuint framebuffer )
void glBindFramebufferOES ( GLenum target, GLuint framebuffer )
void glDeleteFramebuffersOES ( GLsizei n, const GLuint *framebuffers )
void glGenFramebuffersOES ( GLsizei n, GLuint *framebuffers )
GLenum glCheckFramebufferStatusOES ( GLenum target )
void glFramebufferRenderbufferOES ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
void glFramebufferTexture2DOES ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
void glGetFramebufferAttachmentParameterivOES ( GLenum target, GLenum attachment, GLenum pname, GLint *params )
void glGenerateMipmapOES ( GLenum target )
// Hard to export to Java:
// void *glMapBufferOES ( GLenum target, GLenum access )
// GLboolean glUnmapBufferOES ( GLenum target )
// void glGetBufferPointervOES ( GLenum target, GLenum pname, void **params )
void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex )
void glLoadPaletteFromModelViewMatrixOES ( void )
void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glDepthRangefOES ( GLclampf zNear, GLclampf zFar )
void glFrustumfOES ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
void glOrthofOES ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
void glClipPlanefOES ( GLenum plane, const GLfloat *equation )
void glGetClipPlanefOES ( GLenum pname, GLfloat *eqn )
void glClearDepthfOES ( GLclampf depth )
void glTexGenfOES ( GLenum coord, GLenum pname, GLfloat param )
void glTexGenfvOES ( GLenum coord, GLenum pname, const GLfloat *params )
void glTexGeniOES ( GLenum coord, GLenum pname, GLint param )
void glTexGenivOES ( GLenum coord, GLenum pname, const GLint *params )
void glTexGenxOES ( GLenum coord, GLenum pname, GLfixed param )
void glTexGenxvOES ( GLenum coord, GLenum pname, const GLfixed *params )
void glGetTexGenfvOES ( GLenum coord, GLenum pname, GLfloat *params )
void glGetTexGenivOES ( GLenum coord, GLenum pname, GLint *params )
void glGetTexGenxvOES ( GLenum coord, GLenum pname, GLfixed *params )
@@ -0,0 +1,144 @@
void glActiveTexture ( GLenum texture )
void glAttachShader ( GLuint program, GLuint shader )
void glBindAttribLocation ( GLuint program, GLuint index, const char *name )
void glBindBuffer ( GLenum target, GLuint buffer )
void glBindFramebuffer ( GLenum target, GLuint framebuffer )
void glBindRenderbuffer ( GLenum target, GLuint renderbuffer )
void glBindTexture ( GLenum target, GLuint texture )
void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
void glBlendEquation ( GLenum mode )
void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha )
void glBlendFunc ( GLenum sfactor, GLenum dfactor )
void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage )
void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data )
GLenum glCheckFramebufferStatus ( GLenum target )
void glClear ( GLbitfield mask )
void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
void glClearDepthf ( GLclampf depth )
void glClearStencil ( GLint s )
void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
void glCompileShader ( GLuint shader )
void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
GLuint glCreateProgram ( void )
GLuint glCreateShader ( GLenum type )
void glCullFace ( GLenum mode )
void glDeleteBuffers ( GLsizei n, const GLuint *buffers )
void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers )
void glDeleteProgram ( GLuint program )
void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers )
void glDeleteShader ( GLuint shader )
void glDeleteTextures ( GLsizei n, const GLuint *textures )
void glDepthFunc ( GLenum func )
void glDepthMask ( GLboolean flag )
void glDepthRangef ( GLclampf zNear, GLclampf zFar )
void glDetachShader ( GLuint program, GLuint shader )
void glDisable ( GLenum cap )
void glDisableVertexAttribArray ( GLuint index )
void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
void glEnable ( GLenum cap )
void glEnableVertexAttribArray ( GLuint index )
void glFinish ( void )
void glFlush ( void )
void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
void glFrontFace ( GLenum mode )
void glGenBuffers ( GLsizei n, GLuint *buffers )
void glGenerateMipmap ( GLenum target )
void glGenFramebuffers ( GLsizei n, GLuint *framebuffers )
void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers )
void glGenTextures ( GLsizei n, GLuint *textures )
void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders )
int glGetAttribLocation ( GLuint program, const char *name )
void glGetBooleanv ( GLenum pname, GLboolean *params )
void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params )
GLenum glGetError ( void )
void glGetFloatv ( GLenum pname, GLfloat *params )
void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params )
void glGetIntegerv ( GLenum pname, GLint *params )
void glGetProgramiv ( GLuint program, GLenum pname, GLint *params )
void glGetProgramInfoLog ( GLuint program, GLsizei bufsize, GLsizei *length, char *infolog )
void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params )
void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params )
void glGetShaderInfoLog ( GLuint shader, GLsizei bufsize, GLsizei *length, char *infolog )
void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision )
void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source )
const GLubyte * glGetString ( GLenum name )
void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params )
void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params )
void glGetUniformfv ( GLuint program, GLint location, GLfloat *params )
void glGetUniformiv ( GLuint program, GLint location, GLint *params )
int glGetUniformLocation ( GLuint program, const char *name )
void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params )
void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params )
// void glGetVertexAttribPointerv ( GLuint index, GLenum pname, void **pointer )
void glHint ( GLenum target, GLenum mode )
GLboolean glIsBuffer ( GLuint buffer )
GLboolean glIsEnabled ( GLenum cap )
GLboolean glIsFramebuffer ( GLuint framebuffer )
GLboolean glIsProgram ( GLuint program )
GLboolean glIsRenderbuffer ( GLuint renderbuffer )
GLboolean glIsShader ( GLuint shader )
GLboolean glIsTexture ( GLuint texture )
void glLineWidth ( GLfloat width )
void glLinkProgram ( GLuint program )
void glPixelStorei ( GLenum pname, GLint param )
void glPolygonOffset ( GLfloat factor, GLfloat units )
void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
void glReleaseShaderCompiler ( void )
void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
void glSampleCoverage ( GLclampf value, GLboolean invert )
void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height )
void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length )
void glShaderSource ( GLuint shader )
void glStencilFunc ( GLenum func, GLint ref, GLuint mask )
void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask )
void glStencilMask ( GLuint mask )
void glStencilMaskSeparate ( GLenum face, GLuint mask )
void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass )
void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass )
void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
void glTexParameterf ( GLenum target, GLenum pname, GLfloat param )
void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params )
void glTexParameteri ( GLenum target, GLenum pname, GLint param )
void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params )
void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
void glUniform1f ( GLint location, GLfloat x )
void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v )
void glUniform1i ( GLint location, GLint x )
void glUniform1iv ( GLint location, GLsizei count, const GLint *v )
void glUniform2f ( GLint location, GLfloat x, GLfloat y )
void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v )
void glUniform2i ( GLint location, GLint x, GLint y )
void glUniform2iv ( GLint location, GLsizei count, const GLint *v )
void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z )
void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v )
void glUniform3i ( GLint location, GLint x, GLint y, GLint z )
void glUniform3iv ( GLint location, GLsizei count, const GLint *v )
void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v )
void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w )
void glUniform4iv ( GLint location, GLsizei count, const GLint *v )
void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value )
void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value )
void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value )
void glUseProgram ( GLuint program )
void glValidateProgram ( GLuint program )
void glVertexAttrib1f ( GLuint indx, GLfloat x )
void glVertexAttrib1fv ( GLuint indx, const GLfloat *values )
void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y )
void glVertexAttrib2fv ( GLuint indx, const GLfloat *values )
void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z )
void glVertexAttrib3fv ( GLuint indx, const GLfloat *values )
void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
void glVertexAttrib4fv ( GLuint indx, const GLfloat *values )
void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset )
void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr )
void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
@@ -0,0 +1,58 @@
glClipPlanef check eqn 4
glClipPlanex check eqn 4
glGetClipPlanefOES check eqn 4
glGetClipPlanexOES check eqn 4
glDeleteBuffers check buffers n
glDeleteTextures check textures n
glDrawElements check_AIOOBE indices count
glFog ifcheck params 1 pname GL_FOG_MODE,GL_FOG_DENSITY,GL_FOG_START,GL_FOG_END ifcheck params 4 pname GL_FOG_COLOR
glGenBuffers check buffers n
glGenTextures check textures n
glGetClipPlane check eqn 4
glGetIntegerv ifcheck params 1 pname GL_ALPHA_BITS,GL_ALPHA_TEST_FUNC,GL_ALPHA_TEST_REF,GL_BLEND_DST,GL_BLUE_BITS,GL_COLOR_ARRAY_BUFFER_BINDING,GL_COLOR_ARRAY_SIZE,GL_COLOR_ARRAY_STRIDE,GL_COLOR_ARRAY_TYPE,GL_CULL_FACE,GL_DEPTH_BITS,GL_DEPTH_CLEAR_VALUE,GL_DEPTH_FUNC,GL_DEPTH_WRITEMASK,GL_FOG_DENSITY,GL_FOG_END,GL_FOG_MODE,GL_FOG_START,GL_FRONT_FACE,GL_GREEN_BITS,GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,GL_IMPLEMENTATION_COLOR_READ_TYPE_OES,GL_LIGHT_MODEL_COLOR_CONTROL,GL_LIGHT_MODEL_LOCAL_VIEWER,GL_LIGHT_MODEL_TWO_SIDE,GL_LINE_SMOOTH_HINT,GL_LINE_WIDTH,GL_LOGIC_OP_MODE,GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES,GL_MATRIX_INDEX_ARRAY_SIZE_OES,GL_MATRIX_INDEX_ARRAY_STRIDE_OES,GL_MATRIX_INDEX_ARRAY_TYPE_OES,GL_MATRIX_MODE,GL_MAX_CLIP_PLANES,GL_MAX_ELEMENTS_INDICES,GL_MAX_ELEMENTS_VERTICES,GL_MAX_LIGHTS,GL_MAX_MODELVIEW_STACK_DEPTH,GL_MAX_PALETTE_MATRICES_OES,GL_MAX_PROJECTION_STACK_DEPTH,GL_MAX_TEXTURE_SIZE,GL_MAX_TEXTURE_STACK_DEPTH,GL_MAX_TEXTURE_UNITS,GL_MAX_VERTEX_UNITS_OES,GL_MODELVIEW_STACK_DEPTH,GL_NORMAL_ARRAY_BUFFER_BINDING,GL_NORMAL_ARRAY_STRIDE,GL_NORMAL_ARRAY_TYPE,GL_NUM_COMPRESSED_TEXTURE_FORMATS,GL_PACK_ALIGNMENT,GL_PERSPECTIVE_CORRECTION_HINT,GL_POINT_SIZE,GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES,GL_POINT_SIZE_ARRAY_STRIDE_OES,GL_POINT_SIZE_ARRAY_TYPE_OES,GL_POINT_SMOOTH_HINT,GL_POLYGON_OFFSET_FACTOR,GL_POLYGON_OFFSET_UNITS,GL_PROJECTION_STACK_DEPTH,GL_RED_BITS,GL_SHADE_MODEL,GL_STENCIL_BITS,GL_STENCIL_CLEAR_VALUE,GL_STENCIL_FAIL,GL_STENCIL_FUNC,GL_STENCIL_PASS_DEPTH_FAIL,GL_STENCIL_PASS_DEPTH_PASS,GL_STENCIL_REF,GL_STENCIL_VALUE_MASK,GL_STENCIL_WRITEMASK,GL_SUBPIXEL_BITS,GL_TEXTURE_BINDING_2D,GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING,GL_TEXTURE_COORD_ARRAY_SIZE,GL_TEXTURE_COORD_ARRAY_STRIDE,GL_TEXTURE_COORD_ARRAY_TYPE,GL_TEXTURE_STACK_DEPTH,GL_UNPACK_ALIGNMENT,GL_VERTEX_ARRAY_BUFFER_BINDING,GL_VERTEX_ARRAY_SIZE,GL_VERTEX_ARRAY_STRIDE,GL_VERTEX_ARRAY_TYPE,GL_WEIGHT_ARRAY_BUFFER_BINDING_OES,GL_WEIGHT_ARRAY_SIZE_OES,GL_WEIGHT_ARRAY_STRIDE_OES,GL_WEIGHT_ARRAY_TYPE_OES ifcheck params 2 pname GL_ALIASED_POINT_SIZE_RANGE,GL_ALIASED_LINE_WIDTH_RANGE,GL_DEPTH_RANGE,GL_MAX_VIEWPORT_DIMS,GL_SMOOTH_LINE_WIDTH_RANGE,GL_SMOOTH_POINT_SIZE_RANGE ifcheck params 4 pname GL_COLOR_CLEAR_VALUE,GL_COLOR_WRITEMASK,GL_FOG_COLOR,GL_LIGHT_MODEL_AMBIENT,GL_SCISSOR_BOX,GL_VIEWPORT ifcheck params 16 pname GL_MODELVIEW_MATRIX,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES,GL_PROJECTION_MATRIX,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES,GL_TEXTURE_MATRIX,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES ifcheck params getNumCompressedTextureFormats() pname GL_COMPRESSED_TEXTURE_FORMATS
glGetLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
glGetMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
glGetTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
glGetTexParameter check params 1
glLightModel ifcheck params 1 pname GL_LIGHT_MODEL_TWO_SIDE ifcheck params 4 pname GL_LIGHT_MODEL_AMBIENT
glLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
glLoadMatrix check m 16
glMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
glMultMatrix check m 16
glPointParameter check params 1
glTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
glTexImage2D nullAllowed
glTexSubImage2D nullAllowed
glBufferData nullAllowed check data size
glBufferSubData check data size
glTexParameter check params 1
glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
glDrawTexfvOES check coords 5
glDrawTexivOES check coords 5
glDrawTexsvOES check coords 5
glDrawTexxvOES check coords 5
glBindFramebufferOES unsupported
glBindRenderbufferOES unsupported
glBlendEquation unsupported
glBlendEquationSeparate unsupported
glBlendFuncSeparate unsupported
glCheckFramebufferStatusOES unsupported return 0
glDeleteFramebuffersOES unsupported
glDeleteRenderbuffersOES unsupported
glFramebufferRenderbufferOES unsupported
glFramebufferStorageOES unsupported
glFramebufferTexture2DOES unsupported
glGenFramebuffersOES unsupported
glGenRenderbuffersOES unsupported
glGenerateMipmapOES unsupported
glGetBufferParameter unsupported
glGetFramebufferAttachmentParameterivOES unsupported
glGetRenderbufferParameterivOES unsupported
glGetTexGen unsupported
glIsFramebufferOES unsupported return JNI_FALSE
glIsRenderbufferOES unsupported return JNI_FALSE
glRenderbufferStorageOES unsupported return false
glTexGen unsupported
glTexGenf unsupported
glTexGeni unsupported
glTexGenx unsupported
@@ -0,0 +1,106 @@
void glActiveTexture ( GLenum texture )
void glAlphaFunc ( GLenum func, GLclampf ref )
void glAlphaFuncx ( GLenum func, GLclampx ref )
void glBindTexture ( GLenum target, GLuint texture )
void glBlendFunc ( GLenum sfactor, GLenum dfactor )
void glClear ( GLbitfield mask )
void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha )
void glClearDepthf ( GLclampf depth )
void glClearDepthx ( GLclampx depth )
void glClearStencil ( GLint s )
void glClientActiveTexture ( GLenum texture )
void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha )
void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
void glCullFace ( GLenum mode )
void glDeleteTextures ( GLsizei n, const GLuint *textures )
void glDepthFunc ( GLenum func )
void glDepthMask ( GLboolean flag )
void glDepthRangef ( GLclampf zNear, GLclampf zFar )
void glDepthRangex ( GLclampx zNear, GLclampx zFar )
void glDisable ( GLenum cap )
void glDisableClientState ( GLenum array )
void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
void glEnable ( GLenum cap )
void glEnableClientState ( GLenum array )
void glFinish ( void )
void glFlush ( void )
void glFogf ( GLenum pname, GLfloat param )
void glFogfv ( GLenum pname, const GLfloat *params )
void glFogx ( GLenum pname, GLfixed param )
void glFogxv ( GLenum pname, const GLfixed *params )
void glFrontFace ( GLenum mode )
void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
void glGenTextures ( GLsizei n, GLuint *textures )
GLenum glGetError ( void )
void glGetIntegerv ( GLenum pname, GLint *params )
const GLubyte * glGetString ( GLenum name )
void glHint ( GLenum target, GLenum mode )
void glLightModelf ( GLenum pname, GLfloat param )
void glLightModelfv ( GLenum pname, const GLfloat *params )
void glLightModelx ( GLenum pname, GLfixed param )
void glLightModelxv ( GLenum pname, const GLfixed *params )
void glLightf ( GLenum light, GLenum pname, GLfloat param )
void glLightfv ( GLenum light, GLenum pname, const GLfloat *params )
void glLightx ( GLenum light, GLenum pname, GLfixed param )
void glLightxv ( GLenum light, GLenum pname, const GLfixed *params )
void glLineWidth ( GLfloat width )
void glLineWidthx ( GLfixed width )
void glLoadIdentity ( void )
void glLoadMatrixf ( const GLfloat *m )
void glLoadMatrixx ( const GLfixed *m )
void glLogicOp ( GLenum opcode )
void glMaterialf ( GLenum face, GLenum pname, GLfloat param )
void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params )
void glMaterialx ( GLenum face, GLenum pname, GLfixed param )
void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params )
void glMatrixMode ( GLenum mode )
void glMultMatrixf ( const GLfloat *m )
void glMultMatrixx ( const GLfixed *m )
void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q )
void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q )
void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz )
void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz )
void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer )
void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
void glPixelStorei ( GLenum pname, GLint param )
void glPointSize ( GLfloat size )
void glPointSizex ( GLfixed size )
void glPolygonOffset ( GLfloat factor, GLfloat units )
void glPolygonOffsetx ( GLfixed factor, GLfixed units )
void glPopMatrix ( void )
void glPushMatrix ( void )
void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z )
void glSampleCoverage ( GLclampf value, GLboolean invert )
void glSampleCoveragex ( GLclampx value, GLboolean invert )
void glScalef ( GLfloat x, GLfloat y, GLfloat z )
void glScalex ( GLfixed x, GLfixed y, GLfixed z )
void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height )
void glShadeModel ( GLenum mode )
void glStencilFunc ( GLenum func, GLint ref, GLuint mask )
void glStencilMask ( GLuint mask )
void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass )
void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glTexEnvf ( GLenum target, GLenum pname, GLfloat param )
void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params )
void glTexEnvx ( GLenum target, GLenum pname, GLfixed param )
void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params )
void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
void glTexParameterf ( GLenum target, GLenum pname, GLfloat param )
void glTexParameterx ( GLenum target, GLenum pname, GLfixed param )
void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
void glTranslatef ( GLfloat x, GLfloat y, GLfloat z )
void glTranslatex ( GLfixed x, GLfixed y, GLfixed z )
void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
@@ -0,0 +1 @@
GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent )
@@ -0,0 +1,42 @@
void glBindBuffer ( GLenum target, GLuint buffer )
void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage )
void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data )
void glClipPlanef ( GLenum plane, const GLfloat *equation )
void glClipPlanex ( GLenum plane, const GLfixed *equation )
void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
void glDeleteBuffers ( GLsizei n, const GLuint *buffers )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
void glGenBuffers ( GLsizei n, GLuint *buffers )
void glGetBooleanv ( GLenum pname, GLboolean *params )
void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params )
void glGetClipPlanef ( GLenum pname, GLfloat *eqn )
void glGetClipPlanex ( GLenum pname, GLfixed *eqn )
void glGetFixedv ( GLenum pname, GLfixed *params )
void glGetFloatv ( GLenum pname, GLfloat *params )
void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params )
void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params )
void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params )
void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params )
void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params )
void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params )
void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params )
void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params )
void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params )
GLboolean glIsBuffer ( GLuint buffer )
GLboolean glIsEnabled ( GLenum cap )
GLboolean glIsTexture ( GLuint texture )
void glNormalPointer ( GLenum type, GLsizei stride, GLint offset )
void glPointParameterf ( GLenum pname, GLfloat param )
void glPointParameterfv ( GLenum pname, const GLfloat *params )
void glPointParameterx ( GLenum pname, GLfixed param )
void glPointParameterxv ( GLenum pname, const GLfixed *params )
void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer )
void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
void glTexEnvi ( GLenum target, GLenum pname, GLint param )
void glTexEnviv ( GLenum target, GLenum pname, const GLint *params )
void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params )
void glTexParameteri ( GLenum target, GLenum pname, GLint param )
void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params )
void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params )
void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
@@ -0,0 +1,16 @@
void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex )
void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height )
void glDrawTexfvOES ( const GLfloat *coords )
void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height )
void glDrawTexivOES ( const GLint *coords )
void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height )
void glDrawTexsvOES ( const GLshort *coords )
void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height )
void glDrawTexxvOES ( const GLfixed *coords )
void glEnable ( GLenum cap )
void glEnableClientState ( GLenum array )
void glLoadPaletteFromModelViewMatrixOES ( void )
void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset )
void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset )
@@ -0,0 +1,38 @@
void glBindFramebufferOES ( GLint target, GLint framebuffer )
void glBindRenderbufferOES ( GLint target, GLint renderbuffer )
void glBindTexture ( GLint target, GLint texture )
void glBlendEquation ( GLint mode )
void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha )
void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha )
GLint glCheckFramebufferStatusOES ( GLint target )
void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
void glCopyTexImage2D ( GLint target, GLint level, GLint internalformat, GLint x, GLint y, GLint width, GLint height, GLint border )
void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers )
void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers )
void glEnable ( GLint cap )
void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer )
void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level )
void glGenerateMipmapOES ( GLint target )
void glGenFramebuffersOES ( GLint n, GLuint *framebuffers )
void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers )
void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params )
void glGetIntegerv ( GLint pname, GLint *params )
void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params )
void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params )
void glGetTexGeniv ( GLint coord, GLint pname, GLint *params )
void glGetTexGenxv ( GLint coord, GLint pname, GLint *params )
GLboolean glIsFramebufferOES ( GLint framebuffer )
GLboolean glIsRenderbufferOES ( GLint renderbuffer )
void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height )
void glStencilOp ( GLint fail, GLint zfail, GLint zpass )
void glTexEnvf ( GLint target, GLint pname, GLfloat param )
void glTexEnvfv ( GLint target, GLint pname, GLfloat *params )
void glTexEnvx ( GLint target, GLint pname, GLint param )
void glTexEnvxv ( GLint target, GLint pname, GLint *params )
void glTexGenf ( GLint coord, GLint pname, GLfloat param )
void glTexGenfv ( GLint coord, GLint pname, GLfloat *params )
void glTexGeni ( GLint coord, GLint pname, GLint param )
void glTexGeniv ( GLint coord, GLint pname, GLint *params )
void glTexGenx ( GLint coord, GLint pname, GLint param )
void glTexGenxv ( GLint coord, GLint pname, GLint *params )
void glTexParameterf ( GLint target, GLint pname, GLfloat param )
@@ -0,0 +1,56 @@
glClipPlanef check equation 4
glClipPlanex check equation 4
glDeleteBuffers check buffers n
glDeleteTextures check textures n
glDrawElements check_AIOOBE indices count
glFog ifcheck params 1 pname GL_FOG_MODE,GL_FOG_DENSITY,GL_FOG_START,GL_FOG_END ifcheck params 4 pname GL_FOG_COLOR
glGenBuffers check buffers n
glGenTextures check textures n
glGetClipPlane check eqn 4
glGetIntegerv ifcheck params 1 pname GL_ALPHA_BITS,GL_ALPHA_TEST_FUNC,GL_ALPHA_TEST_REF,GL_BLEND_DST,GL_BLUE_BITS,GL_COLOR_ARRAY_BUFFER_BINDING,GL_COLOR_ARRAY_SIZE,GL_COLOR_ARRAY_STRIDE,GL_COLOR_ARRAY_TYPE,GL_CULL_FACE,GL_DEPTH_BITS,GL_DEPTH_CLEAR_VALUE,GL_DEPTH_FUNC,GL_DEPTH_WRITEMASK,GL_FOG_DENSITY,GL_FOG_END,GL_FOG_MODE,GL_FOG_START,GL_FRONT_FACE,GL_GREEN_BITS,GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,GL_IMPLEMENTATION_COLOR_READ_TYPE_OES,GL_LIGHT_MODEL_COLOR_CONTROL,GL_LIGHT_MODEL_LOCAL_VIEWER,GL_LIGHT_MODEL_TWO_SIDE,GL_LINE_SMOOTH_HINT,GL_LINE_WIDTH,GL_LOGIC_OP_MODE,GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES,GL_MATRIX_INDEX_ARRAY_SIZE_OES,GL_MATRIX_INDEX_ARRAY_STRIDE_OES,GL_MATRIX_INDEX_ARRAY_TYPE_OES,GL_MATRIX_MODE,GL_MAX_CLIP_PLANES,GL_MAX_ELEMENTS_INDICES,GL_MAX_ELEMENTS_VERTICES,GL_MAX_LIGHTS,GL_MAX_MODELVIEW_STACK_DEPTH,GL_MAX_PALETTE_MATRICES_OES,GL_MAX_PROJECTION_STACK_DEPTH,GL_MAX_TEXTURE_SIZE,GL_MAX_TEXTURE_STACK_DEPTH,GL_MAX_TEXTURE_UNITS,GL_MAX_VERTEX_UNITS_OES,GL_MODELVIEW_STACK_DEPTH,GL_NORMAL_ARRAY_BUFFER_BINDING,GL_NORMAL_ARRAY_STRIDE,GL_NORMAL_ARRAY_TYPE,GL_NUM_COMPRESSED_TEXTURE_FORMATS,GL_PACK_ALIGNMENT,GL_PERSPECTIVE_CORRECTION_HINT,GL_POINT_SIZE,GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES,GL_POINT_SIZE_ARRAY_STRIDE_OES,GL_POINT_SIZE_ARRAY_TYPE_OES,GL_POINT_SMOOTH_HINT,GL_POLYGON_OFFSET_FACTOR,GL_POLYGON_OFFSET_UNITS,GL_PROJECTION_STACK_DEPTH,GL_RED_BITS,GL_SHADE_MODEL,GL_STENCIL_BITS,GL_STENCIL_CLEAR_VALUE,GL_STENCIL_FAIL,GL_STENCIL_FUNC,GL_STENCIL_PASS_DEPTH_FAIL,GL_STENCIL_PASS_DEPTH_PASS,GL_STENCIL_REF,GL_STENCIL_VALUE_MASK,GL_STENCIL_WRITEMASK,GL_SUBPIXEL_BITS,GL_TEXTURE_BINDING_2D,GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING,GL_TEXTURE_COORD_ARRAY_SIZE,GL_TEXTURE_COORD_ARRAY_STRIDE,GL_TEXTURE_COORD_ARRAY_TYPE,GL_TEXTURE_STACK_DEPTH,GL_UNPACK_ALIGNMENT,GL_VERTEX_ARRAY_BUFFER_BINDING,GL_VERTEX_ARRAY_SIZE,GL_VERTEX_ARRAY_STRIDE,GL_VERTEX_ARRAY_TYPE,GL_WEIGHT_ARRAY_BUFFER_BINDING_OES,GL_WEIGHT_ARRAY_SIZE_OES,GL_WEIGHT_ARRAY_STRIDE_OES,GL_WEIGHT_ARRAY_TYPE_OES ifcheck params 2 pname GL_ALIASED_POINT_SIZE_RANGE,GL_ALIASED_LINE_WIDTH_RANGE,GL_DEPTH_RANGE,GL_MAX_VIEWPORT_DIMS,GL_SMOOTH_LINE_WIDTH_RANGE,GL_SMOOTH_POINT_SIZE_RANGE ifcheck params 4 pname GL_COLOR_CLEAR_VALUE,GL_COLOR_WRITEMASK,GL_FOG_COLOR,GL_LIGHT_MODEL_AMBIENT,GL_SCISSOR_BOX,GL_VIEWPORT ifcheck params 16 pname GL_MODELVIEW_MATRIX,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES,GL_PROJECTION_MATRIX,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES,GL_TEXTURE_MATRIX,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES ifcheck params getNumCompressedTextureFormats() pname GL_COMPRESSED_TEXTURE_FORMATS
glGetLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
glGetMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
glGetTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
glGetTexParameter check params 1
glLightModel ifcheck params 1 pname GL_LIGHT_MODEL_TWO_SIDE ifcheck params 4 pname GL_LIGHT_MODEL_AMBIENT
glLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
glLoadMatrix check m 16
glMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
glMultMatrix check m 16
glPointParameter check params 1
glTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
glTexImage2D nullAllowed
glTexSubImage2D nullAllowed
glBufferData nullAllowed check data size
glBufferSubData check data size
glTexParameter check params 1
glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
glDrawTexfvOES check coords 5
glDrawTexivOES check coords 5
glDrawTexsvOES check coords 5
glDrawTexxvOES check coords 5
glBindFramebufferOES requires OES_framebuffer_object
glBindRenderbufferOES requires OES_framebuffer_object
glBlendEquation requires OES_blend_subtract
glBlendEquationSeparate requires OES_blend_equation_separate
glBlendFuncSeparate requires OES_blend_equation_separate
glCheckFramebufferStatusOES requires OES_framebuffer_object return 0
glDeleteFramebuffersOES requires OES_framebuffer_object check framebuffers n
glDeleteRenderbuffersOES requires OES_framebuffer_object check renderbuffers n
glFramebufferRenderbufferOES requires OES_framebuffer_object
glFramebufferStorageOES requires OES_framebuffer_object
glFramebufferTexture2DOES requires OES_framebuffer_object
glGenFramebuffersOES requires OES_framebuffer_object check framebuffers n
glGenRenderbuffersOES requires OES_framebuffer_object check renderbuffers n
glGenerateMipmapOES requires OES_framebuffer_object
glGetFramebufferAttachmentParameterivOES requires OES_framebuffer_object
glGetRenderbufferParameterivOES requires OES_framebuffer_object
glIsFramebufferOES requires OES_framebuffer_object return JNI_FALSE
glIsRenderbufferOES requires OES_framebuffer_object return JNI_FALSE
glRenderbufferStorageOES requires OES_framebuffer_object
glGetTexGen requires OES_texture_cube_map
glTexGen requires OES_texture_cube_map
glTexGenf requires OES_texture_cube_map
glTexGeni requires OES_texture_cube_map
glTexGenx requires OES_texture_cube_map
glGetBufferParameter unsupported
+171
View File
@@ -0,0 +1,171 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.*;
public class CFunc {
String original;
CType ftype;
String fname;
List<String> argNames = new ArrayList<String>();
List<CType> argTypes = new ArrayList<CType>();
boolean hasPointerArg = false;
boolean hasTypedPointerArg = false;
public CFunc(String original) {
this.original = original;
}
public String getOriginal() {
return original;
}
public void setName(String fname) {
this.fname = fname;
}
public String getName() {
return fname;
}
public void setType(CType ftype) {
this.ftype = ftype;
}
public CType getType() {
return ftype;
}
public void addArgument(String argName, CType argType) {
argNames.add(argName);
argTypes.add(argType);
if (argType.isPointer()) {
hasPointerArg = true;
}
if (argType.isTypedPointer()) {
hasTypedPointerArg = true;
}
}
public int getNumArgs() {
return argNames.size();
}
public int getArgIndex(String name) {
int len = argNames.size();
for (int i = 0; i < len; i++) {
if (name.equals(argNames.get(i))) {
return i;
}
}
return -1;
}
public String getArgName(int index) {
return argNames.get(index);
}
public CType getArgType(int index) {
return argTypes.get(index);
}
public boolean hasPointerArg() {
return hasPointerArg;
}
public boolean hasTypedPointerArg() {
return hasTypedPointerArg;
}
@Override
public String toString() {
String s = "Function " + fname + " returns " + ftype + ": ";
for (int i = 0; i < argNames.size(); i++) {
if (i > 0) {
s += ", ";
}
s += argTypes.get(i) + " " + argNames.get(i);
}
return s;
}
public static CFunc parseCFunc(String s) {
CFunc cfunc = new CFunc(s);
String[] tokens = s.split("\\s");
int i = 0;
CType ftype = new CType();
String ftypeName = tokens[i++];
if (ftypeName.equals("const")) {
ftype.setIsConst(true);
ftypeName = tokens[i++];
}
ftype.setBaseType(ftypeName);
String fname = tokens[i++];
if (fname.equals("*")) {
ftype.setIsPointer(true);
fname = tokens[i++];
}
cfunc.setName(fname);
cfunc.setType(ftype);
while (i < tokens.length) {
String tok = tokens[i++];
if (tok.equals("(")) {
continue;
}
if (tok.equals(")")) {
break;
}
CType argType = new CType();
String argTypeName = tok;
String argName = "";
if (argTypeName.equals("const")) {
argType.setIsConst(true);
argTypeName = tokens[i++];
}
argType.setBaseType(argTypeName);
if (argTypeName.equals("void")) {
break;
}
argName = tokens[i++];
if (argName.startsWith("*")) {
argType.setIsPointer(true);
argName = argName.substring(1, argName.length());
}
if (argName.endsWith(",")) {
argName = argName.substring(0, argName.length() - 1);
}
cfunc.addArgument(argName, argType);
}
return cfunc;
}
}
+107
View File
@@ -0,0 +1,107 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class CType {
String baseType;
boolean isConst;
boolean isPointer;
public CType() {
}
public CType(String baseType) {
setBaseType(baseType);
}
public CType(String baseType, boolean isConst, boolean isPointer) {
setBaseType(baseType);
setIsConst(isConst);
setIsPointer(isPointer);
}
public String getDeclaration() {
return baseType + (isPointer ? " *" : "");
}
public void setIsConst(boolean isConst) {
this.isConst = isConst;
}
public boolean isConst() {
return isConst;
}
public void setIsPointer(boolean isPointer) {
this.isPointer = isPointer;
}
public boolean isPointer() {
return isPointer;
}
boolean isVoid() {
String baseType = getBaseType();
return baseType.equals("GLvoid") ||
baseType.equals("void");
}
public boolean isConstCharPointer() {
return isConst && isPointer && baseType.equals("char");
}
public boolean isTypedPointer() {
return isPointer() && !isVoid() && !isConstCharPointer();
}
public void setBaseType(String baseType) {
this.baseType = baseType;
}
public String getBaseType() {
return baseType;
}
@Override
public String toString() {
String s = "";
if (isConst()) {
s += "const ";
}
s += baseType;
if (isPointer()) {
s += "*";
}
return s;
}
@Override
public int hashCode() {
return baseType.hashCode() ^ (isPointer ? 2 : 0) ^ (isConst ? 1 : 0);
}
@Override
public boolean equals(Object o) {
if (o != null && o instanceof CType) {
CType c = (CType)o;
return baseType.equals(c.baseType) &&
isPointer() == c.isPointer() &&
isConst() == c.isConst();
}
return false;
}
}
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public interface CodeEmitter {
void setVersion(int version, boolean ext, boolean pack);
void emitCode(CFunc cfunc, String original);
void addNativeRegistration(String fname);
void emitNativeRegistration();
}
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.PrintStream;
/**
* Emits a Java interface and Java & C implementation for a C function.
*
* <p> The Java interface will have Buffer and array variants for functions that
* have a typed pointer argument. The array variant will convert a single "<type> *data"
* argument to a pair of arguments "<type>[] data, int offset".
*/
public class GLESCodeEmitter extends JniCodeEmitter {
PrintStream mJavaImplStream;
PrintStream mCStream;
PrintStream mJavaInterfaceStream;
/**
*/
public GLESCodeEmitter(String classPathName,
ParameterChecker checker,
PrintStream javaImplStream,
PrintStream cStream) {
mClassPathName = classPathName;
mChecker = checker;
mJavaImplStream = javaImplStream;
mCStream = cStream;
mUseContextPointer = false;
mUseStaticMethods = true;
}
public void emitCode(CFunc cfunc, String original) {
emitCode(cfunc, original, null, mJavaImplStream,
mCStream);
}
public void emitNativeRegistration(String nativeRegistrationName) {
emitNativeRegistration(nativeRegistrationName, mCStream);
}
}
+182
View File
@@ -0,0 +1,182 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class GenerateGL {
static void copy(String filename, PrintStream out) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(filename));
String s;
while ((s = br.readLine()) != null) {
out.println(s);
}
}
private static void emit(int version, boolean ext, boolean pack,
CodeEmitter emitter,
BufferedReader specReader,
PrintStream glStream,
PrintStream glImplStream,
PrintStream cStream) throws Exception {
String s = null;
while ((s = specReader.readLine()) != null) {
if (s.trim().startsWith("//")) {
continue;
}
CFunc cfunc = CFunc.parseCFunc(s);
String fname = cfunc.getName();
File f = new File("stubs/jsr239/" + fname +
".java-1" + version + "-if");
if (f.exists()) {
System.out.println("Special-casing function " + fname);
copy("stubs/jsr239/" + fname +
".java-1" + version + "-if", glStream);
copy("stubs/jsr239/" + fname + ".java-impl", glImplStream);
copy("stubs/jsr239/" + fname + ".cpp", cStream);
// Register native function names
// This should be improved to require fewer discrete files
String filename = "stubs/jsr239/" + fname + ".nativeReg";
BufferedReader br =
new BufferedReader(new FileReader(filename));
String nfunc;
while ((nfunc = br.readLine()) != null) {
emitter.addNativeRegistration(nfunc);
}
} else {
emitter.setVersion(version, ext, pack);
emitter.emitCode(cfunc, s);
}
}
}
public static void main(String[] args) throws Exception {
String classPathName = "com/google/android/gles_jni/GLImpl";
boolean useContextPointer = true;
int aidx = 0;
while (args[aidx].charAt(0) == '-') {
switch (args[aidx].charAt(1)) {
case 'c':
useContextPointer = false;
break;
default:
System.err.println("Unknown flag: " + args[aidx]);
System.exit(1);
}
aidx++;
}
System.out.println("useContextPointer = " + useContextPointer);
BufferedReader spec10Reader =
new BufferedReader(new FileReader(args[aidx++]));
BufferedReader spec10ExtReader =
new BufferedReader(new FileReader(args[aidx++]));
BufferedReader spec11Reader =
new BufferedReader(new FileReader(args[aidx++]));
BufferedReader spec11ExtReader =
new BufferedReader(new FileReader(args[aidx++]));
BufferedReader spec11ExtPackReader =
new BufferedReader(new FileReader(args[aidx++]));
BufferedReader checksReader =
new BufferedReader(new FileReader(args[aidx++]));
String gl10Filename = "javax/microedition/khronos/opengles/GL10.java";
String gl10ExtFilename =
"javax/microedition/khronos/opengles/GL10Ext.java";
String gl11Filename = "javax/microedition/khronos/opengles/GL11.java";
String gl11ExtFilename =
"javax/microedition/khronos/opengles/GL11Ext.java";
String gl11ExtPackFilename =
"javax/microedition/khronos/opengles/GL11ExtensionPack.java";
String glImplFilename = "com/google/android/gles_jni/GLImpl.java";
String cFilename = "com_google_android_gles_jni_GLImpl.cpp";
PrintStream gl10Stream =
new PrintStream(new FileOutputStream("out/" + gl10Filename));
PrintStream gl10ExtStream =
new PrintStream(new FileOutputStream("out/" + gl10ExtFilename));
PrintStream gl11Stream =
new PrintStream(new FileOutputStream("out/" + gl11Filename));
PrintStream gl11ExtStream =
new PrintStream(new FileOutputStream("out/" + gl11ExtFilename));
PrintStream gl11ExtPackStream =
new PrintStream(new FileOutputStream("out/" + gl11ExtPackFilename));
PrintStream glImplStream =
new PrintStream(new FileOutputStream("out/" + glImplFilename));
PrintStream cStream =
new PrintStream(new FileOutputStream("out/" + cFilename));
ParameterChecker checker = new ParameterChecker(checksReader);
CodeEmitter emitter =
new Jsr239CodeEmitter(classPathName,
checker,
gl10Stream, gl10ExtStream,
gl11Stream, gl11ExtStream, gl11ExtPackStream,
glImplStream, cStream,
useContextPointer);
gl10Stream.println("/* //device/java/android/" + gl10Filename);
gl10ExtStream.println("/* //device/java/android/" + gl10ExtFilename);
gl11Stream.println("/* //device/java/android/" + gl11Filename);
gl11ExtStream.println("/* //device/java/android/" + gl11ExtFilename);
gl11ExtPackStream.println("/* //device/java/android/" +
gl11ExtPackFilename);
glImplStream.println("/* //device/java/android/" + glImplFilename);
cStream.println("/* //device/libs/android_runtime/" + cFilename);
copy("stubs/jsr239/GL10Header.java-if", gl10Stream);
copy("stubs/jsr239/GL10ExtHeader.java-if", gl10ExtStream);
copy("stubs/jsr239/GL11Header.java-if", gl11Stream);
copy("stubs/jsr239/GL11ExtHeader.java-if", gl11ExtStream);
copy("stubs/jsr239/GL11ExtensionPackHeader.java-if", gl11ExtPackStream);
copy("stubs/jsr239/GLImplHeader.java-impl", glImplStream);
copy("stubs/jsr239/GLCHeader.cpp", cStream);
emit(0, false, false,
emitter, spec10Reader, gl10Stream, glImplStream, cStream);
emit(0, true, false,
emitter, spec10ExtReader, gl10ExtStream, glImplStream, cStream);
emit(1, false, false,
emitter, spec11Reader, gl11Stream, glImplStream, cStream);
emit(1, true, false,
emitter, spec11ExtReader, gl11ExtStream, glImplStream, cStream);
emit(1, true, true,
emitter, spec11ExtPackReader, gl11ExtPackStream, glImplStream,
cStream);
emitter.emitNativeRegistration();
gl10Stream.println("}");
gl10ExtStream.println("}");
gl11Stream.println("}");
gl11ExtStream.println("}");
gl11ExtPackStream.println("}");
glImplStream.println("}");
}
}
@@ -0,0 +1,114 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class GenerateGLES {
static void copy(String filename, PrintStream out) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(filename));
String s;
while ((s = br.readLine()) != null) {
out.println(s);
}
}
private static void emit(GLESCodeEmitter emitter,
BufferedReader specReader,
PrintStream glStream,
PrintStream cStream) throws Exception {
String s = null;
while ((s = specReader.readLine()) != null) {
if (s.trim().startsWith("//")) {
continue;
}
CFunc cfunc = CFunc.parseCFunc(s);
String fname = cfunc.getName();
String stubRoot = "stubs/gles11/" + fname;
String javaPath = stubRoot + ".java";
File f = new File(javaPath);
if (f.exists()) {
System.out.println("Special-casing function " + fname);
copy(javaPath, glStream);
copy(stubRoot + ".cpp", cStream);
// Register native function names
// This should be improved to require fewer discrete files
String filename = stubRoot + ".nativeReg";
BufferedReader br =
new BufferedReader(new FileReader(filename));
String nfunc;
while ((nfunc = br.readLine()) != null) {
emitter.addNativeRegistration(nfunc);
}
} else {
emitter.emitCode(cfunc, s);
}
}
}
public static void main(String[] args) throws Exception {
int aidx = 0;
while ((aidx < args.length) && (args[aidx].charAt(0) == '-')) {
switch (args[aidx].charAt(1)) {
default:
System.err.println("Unknown flag: " + args[aidx]);
System.exit(1);
}
aidx++;
}
BufferedReader checksReader =
new BufferedReader(new FileReader("specs/gles11/checks.spec"));
ParameterChecker checker = new ParameterChecker(checksReader);
// Generate files
for(String suffix: new String[] {"GLES10", "GLES10Ext",
"GLES11", "GLES11Ext", "GLES20"})
{
BufferedReader spec11Reader =
new BufferedReader(new FileReader("specs/gles11/"
+ suffix + ".spec"));
String gl11Filename = "android/opengl/" + suffix + ".java";
String gl11cFilename = "android_opengl_" + suffix + ".cpp";
PrintStream gl11Stream =
new PrintStream(new FileOutputStream("out/" + gl11Filename));
PrintStream gl11cStream =
new PrintStream(new FileOutputStream("out/" + gl11cFilename));
gl11Stream.println("/*");
gl11cStream.println("/*");
copy("stubs/gles11/" + suffix + "Header.java-if", gl11Stream);
copy("stubs/gles11/" + suffix + "cHeader.cpp", gl11cStream);
GLESCodeEmitter emitter = new GLESCodeEmitter(
"android/opengl/" + suffix,
checker, gl11Stream, gl11cStream);
emit(emitter, spec11Reader, gl11Stream, gl11cStream);
emitter.emitNativeRegistration("register_android_opengl_jni_"
+ suffix);
gl11Stream.println("}");
gl11Stream.close();
gl11cStream.close();
}
}
}
+169
View File
@@ -0,0 +1,169 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.ArrayList;
import java.util.List;
public class JFunc {
String className = "com.google.android.gles_jni.GL11Impl";
CFunc cfunc;
JType ftype;
String fname;
List<String> argNames = new ArrayList<String>();
List<JType> argTypes = new ArrayList<JType>();
List<Integer> argCIndices = new ArrayList<Integer>();
boolean hasBufferArg = false;
boolean hasTypedBufferArg = false;
ArrayList<String> bufferArgNames = new ArrayList<String>();
public JFunc(CFunc cfunc) {
this.cfunc = cfunc;
}
public CFunc getCFunc() {
return cfunc;
}
public void setName(String fname) {
this.fname = fname;
}
public String getName() {
return fname;
}
public void setType(JType ftype) {
this.ftype = ftype;
}
public JType getType() {
return ftype;
}
public void setClassName(String className) {
this.className = className;
}
public String getClassName() {
return className;
}
public boolean hasBufferArg() {
return hasBufferArg;
}
public boolean hasTypedBufferArg() {
return hasTypedBufferArg;
}
public String getBufferArgName(int index) {
return bufferArgNames.get(index);
}
public void addArgument(String argName, JType argType, int cindex) {
argNames.add(argName);
argTypes.add(argType);
argCIndices.add(new Integer(cindex));
if (argType.isBuffer()) {
hasBufferArg = true;
bufferArgNames.add(argName);
}
if (argType.isTypedBuffer()) {
hasTypedBufferArg = true;
bufferArgNames.add(argName);
}
}
public int getNumArgs() {
return argNames.size();
}
public int getArgIndex(String name) {
int len = argNames.size();
for (int i = 0; i < len; i++) {
if (name.equals(argNames.get(i))) {
return i;
}
}
return -1;
}
public String getArgName(int index) {
return argNames.get(index);
}
public JType getArgType(int index) {
return argTypes.get(index);
}
public int getArgCIndex(int index) {
return argCIndices.get(index).intValue();
}
public static JFunc convert(CFunc cfunc, boolean useArray) {
try {
JFunc jfunc = new JFunc(cfunc);
jfunc.setName(cfunc.getName());
jfunc.setType(JType.convert(cfunc.getType(), false));
int numArgs = cfunc.getNumArgs();
int numOffsets = 0;
for (int i = 0; i < numArgs; i++) {
CType cArgType = cfunc.getArgType(i);
if (cArgType.isTypedPointer() && useArray) {
++numOffsets;
}
}
for (int i = 0; i < numArgs; i++) {
String cArgName = cfunc.getArgName(i);
CType cArgType = cfunc.getArgType(i);
jfunc.addArgument(cArgName, JType.convert(cArgType, useArray), i);
if (cArgType.isTypedPointer() && useArray) {
if (numOffsets > 1) {
jfunc.addArgument(cArgName + "Offset", new JType("int"), i);
} else {
jfunc.addArgument("offset", new JType("int"), i);
}
}
}
return jfunc;
} catch (RuntimeException e) {
System.err.println("Failed to convert function " + cfunc);
throw e;
}
}
@Override
public String toString() {
String s = "Function " + fname + " returns " + ftype + ": ";
for (int i = 0; i < argNames.size(); i++) {
if (i > 0) {
s += ", ";
}
s += argTypes.get(i) + " " + argNames.get(i);
}
return s;
}
}
+174
View File
@@ -0,0 +1,174 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.HashMap;
public class JType {
String baseType;
boolean isArray;
boolean isClass;
boolean isString;
static HashMap<CType,JType> typeMapping = new HashMap<CType,JType>();
static HashMap<CType,JType> arrayTypeMapping = new HashMap<CType,JType>();
static {
// Primitive types
typeMapping.put(new CType("GLbitfield"), new JType("int"));
typeMapping.put(new CType("GLboolean"), new JType("boolean"));
typeMapping.put(new CType("GLclampf"), new JType("float"));
typeMapping.put(new CType("GLclampx"), new JType("int"));
typeMapping.put(new CType("GLenum"), new JType("int"));
typeMapping.put(new CType("GLfloat"), new JType("float"));
typeMapping.put(new CType("GLfixed"), new JType("int"));
typeMapping.put(new CType("GLint"), new JType("int"));
typeMapping.put(new CType("GLintptr"), new JType("int"));
typeMapping.put(new CType("GLshort"), new JType("short"));
typeMapping.put(new CType("GLsizei"), new JType("int"));
typeMapping.put(new CType("GLsizeiptr"), new JType("int"));
typeMapping.put(new CType("GLubyte"), new JType("byte"));
typeMapping.put(new CType("GLuint"), new JType("int"));
typeMapping.put(new CType("void"), new JType("void"));
typeMapping.put(new CType("GLubyte", true, true), new JType("String", false, false));
typeMapping.put(new CType("char", false, true), new JType("byte"));
typeMapping.put(new CType("char", true, true), new JType("String", false, false));
typeMapping.put(new CType("int"), new JType("int"));
// Untyped pointers map to untyped Buffers
typeMapping.put(new CType("GLvoid", true, true),
new JType("java.nio.Buffer", true, false));
typeMapping.put(new CType("GLvoid", false, true),
new JType("java.nio.Buffer", true, false));
typeMapping.put(new CType("void", false, true),
new JType("java.nio.Buffer", true, false));
typeMapping.put(new CType("GLeglImageOES", false, false),
new JType("java.nio.Buffer", true, false));
// Typed pointers map to typed Buffers
typeMapping.put(new CType("GLboolean", false, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLenum", false, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLfixed", false, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLfixed", true, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLfloat", false, true),
new JType("java.nio.FloatBuffer", true, false));
typeMapping.put(new CType("GLfloat", true, true),
new JType("java.nio.FloatBuffer", true, false));
typeMapping.put(new CType("GLint", false, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLint", true, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLsizei", false, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLuint", false, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLuint", true, true),
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLshort", true, true),
new JType("java.nio.ShortBuffer", true, false));
// Typed pointers map to arrays + offsets
arrayTypeMapping.put(new CType("char", false, true),
new JType("byte", false, true));
arrayTypeMapping.put(new CType("GLboolean", false, true),
new JType("boolean", false, true));
arrayTypeMapping.put(new CType("GLenum", false, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLfixed", true, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLfixed", false, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLfloat", false, true), new JType("float", false, true));
arrayTypeMapping.put(new CType("GLfloat", true, true), new JType("float", false, true));
arrayTypeMapping.put(new CType("GLint", false, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLint", true, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLshort", true, true), new JType("short", false, true));
arrayTypeMapping.put(new CType("GLsizei", false, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLsizei", true, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLuint", false, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLuint", true, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLintptr"), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLsizeiptr"), new JType("int", false, true));
}
public JType() {
}
public JType(String primitiveTypeName) {
this.baseType = primitiveTypeName;
this.isClass = false;
this.isArray = false;
}
public JType(String primitiveTypeName, boolean isClass, boolean isArray) {
this.baseType = primitiveTypeName;
this.isClass = isClass;
this.isArray = isArray;
}
public String getBaseType() {
return baseType;
}
@Override
public String toString() {
return baseType + (isArray ? "[]" : "");
}
public boolean isArray() {
return isArray;
}
public boolean isClass() {
return isClass;
}
public boolean isString() {
return baseType.equals("String");
}
public boolean isPrimitive() {
return !isClass() && !isArray();
}
public boolean isVoid() {
return baseType.equals("void");
}
public boolean isBuffer() {
return baseType.indexOf("Buffer") != -1;
}
public boolean isTypedBuffer() {
return !baseType.equals("java.nio.Buffer") &&
(baseType.indexOf("Buffer") != -1);
}
public static JType convert(CType ctype, boolean useArray) {
JType javaType = null;
if (useArray) {
javaType = arrayTypeMapping.get(ctype);
}
if (javaType == null) {
javaType = typeMapping.get(ctype);
}
if (javaType == null) {
throw new RuntimeException("Unsupported C type: " + ctype);
}
return javaType;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.PrintStream;
/**
* Emits a Java interface and Java & C implementation for a C function.
*
* <p> The Java interface will have Buffer and array variants for functions that
* have a typed pointer argument. The array variant will convert a single "<type> *data"
* argument to a pair of arguments "<type>[] data, int offset".
*/
public class Jsr239CodeEmitter extends JniCodeEmitter implements CodeEmitter {
PrintStream mJava10InterfaceStream;
PrintStream mJava10ExtInterfaceStream;
PrintStream mJava11InterfaceStream;
PrintStream mJava11ExtInterfaceStream;
PrintStream mJava11ExtPackInterfaceStream;
PrintStream mJavaImplStream;
PrintStream mCStream;
PrintStream mJavaInterfaceStream;
/**
* @param java10InterfaceStream the PrintStream to which to emit the Java interface for GL 1.0 functions
* @param java10ExtInterfaceStream the PrintStream to which to emit the Java interface for GL 1.0 extension functions
* @param java11InterfaceStream the PrintStream to which to emit the Java interface for GL 1.1 functions
* @param java11ExtInterfaceStream the PrintStream to which to emit the Java interface for GL 1.1 Extension functions
* @param java11ExtPackInterfaceStream the PrintStream to which to emit the Java interface for GL 1.1 Extension Pack functions
* @param javaImplStream the PrintStream to which to emit the Java implementation
* @param cStream the PrintStream to which to emit the C implementation
*/
public Jsr239CodeEmitter(String classPathName,
ParameterChecker checker,
PrintStream java10InterfaceStream,
PrintStream java10ExtInterfaceStream,
PrintStream java11InterfaceStream,
PrintStream java11ExtInterfaceStream,
PrintStream java11ExtPackInterfaceStream,
PrintStream javaImplStream,
PrintStream cStream,
boolean useContextPointer) {
mClassPathName = classPathName;
mChecker = checker;
mJava10InterfaceStream = java10InterfaceStream;
mJava10ExtInterfaceStream = java10ExtInterfaceStream;
mJava11InterfaceStream = java11InterfaceStream;
mJava11ExtInterfaceStream = java11ExtInterfaceStream;
mJava11ExtPackInterfaceStream = java11ExtPackInterfaceStream;
mJavaImplStream = javaImplStream;
mCStream = cStream;
mUseContextPointer = useContextPointer;
}
public void setVersion(int version, boolean ext, boolean pack) {
if (version == 0) {
mJavaInterfaceStream = ext ? mJava10ExtInterfaceStream :
mJava10InterfaceStream;
} else if (version == 1) {
mJavaInterfaceStream = ext ?
(pack ? mJava11ExtPackInterfaceStream :
mJava11ExtInterfaceStream) :
mJava11InterfaceStream;
} else {
throw new RuntimeException("Bad version: " + version);
}
}
public void emitCode(CFunc cfunc, String original) {
emitCode(cfunc, original, mJavaInterfaceStream, mJavaImplStream, mCStream);
}
public void emitNativeRegistration() {
emitNativeRegistration("register_com_google_android_gles_jni_GLImpl", mCStream);
}
}
@@ -0,0 +1,43 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.BufferedReader;
import java.util.HashMap;
public class ParameterChecker {
HashMap<String,String[]> map = new HashMap<String,String[]>();
public ParameterChecker(BufferedReader reader) throws Exception {
String s;
while ((s = reader.readLine()) != null) {
String[] tokens = s.split("\\s");
map.put(tokens[0], tokens);
}
}
public String[] getChecks(String functionName) {
String[] checks = map.get(functionName);
if (checks == null &&
(functionName.endsWith("fv") ||
functionName.endsWith("xv") ||
functionName.endsWith("iv"))) {
functionName = functionName.substring(0, functionName.length() - 2);
checks = map.get(functionName);
}
return checks;
}
}
@@ -0,0 +1,26 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package android.opengl;
public class GLES10Ext {
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
@@ -0,0 +1,125 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass OOMEClass;
static jclass UOEClass;
static jclass IAEClass;
static jclass AIOOBEClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInitBuffer(JNIEnv *_env)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
nativeClassInitBuffer(_env);
jclass IAEClassLocal =
_env->FindClass("java/lang/IllegalArgumentException");
jclass OOMEClassLocal =
_env->FindClass("java/lang/OutOfMemoryError");
jclass UOEClassLocal =
_env->FindClass("java/lang/UnsupportedOperationException");
jclass AIOOBEClassLocal =
_env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
jint offset;
void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return (void *) (jint) pointer;
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
return (void *) ((char *) data + offset);
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
// --------------------------------------------------------------------------
@@ -0,0 +1,271 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package android.opengl;
import java.nio.Buffer;
public class GLES10 {
public static final int GL_ADD = 0x0104;
public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
public static final int GL_ALPHA = 0x1906;
public static final int GL_ALPHA_BITS = 0x0D55;
public static final int GL_ALPHA_TEST = 0x0BC0;
public static final int GL_ALWAYS = 0x0207;
public static final int GL_AMBIENT = 0x1200;
public static final int GL_AMBIENT_AND_DIFFUSE = 0x1602;
public static final int GL_AND = 0x1501;
public static final int GL_AND_INVERTED = 0x1504;
public static final int GL_AND_REVERSE = 0x1502;
public static final int GL_BACK = 0x0405;
public static final int GL_BLEND = 0x0BE2;
public static final int GL_BLUE_BITS = 0x0D54;
public static final int GL_BYTE = 0x1400;
public static final int GL_CCW = 0x0901;
public static final int GL_CLAMP_TO_EDGE = 0x812F;
public static final int GL_CLEAR = 0x1500;
public static final int GL_COLOR_ARRAY = 0x8076;
public static final int GL_COLOR_BUFFER_BIT = 0x4000;
public static final int GL_COLOR_LOGIC_OP = 0x0BF2;
public static final int GL_COLOR_MATERIAL = 0x0B57;
public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
public static final int GL_CONSTANT_ATTENUATION = 0x1207;
public static final int GL_COPY = 0x1503;
public static final int GL_COPY_INVERTED = 0x150C;
public static final int GL_CULL_FACE = 0x0B44;
public static final int GL_CW = 0x0900;
public static final int GL_DECAL = 0x2101;
public static final int GL_DECR = 0x1E03;
public static final int GL_DEPTH_BITS = 0x0D56;
public static final int GL_DEPTH_BUFFER_BIT = 0x0100;
public static final int GL_DEPTH_TEST = 0x0B71;
public static final int GL_DIFFUSE = 0x1201;
public static final int GL_DITHER = 0x0BD0;
public static final int GL_DONT_CARE = 0x1100;
public static final int GL_DST_ALPHA = 0x0304;
public static final int GL_DST_COLOR = 0x0306;
public static final int GL_EMISSION = 0x1600;
public static final int GL_EQUAL = 0x0202;
public static final int GL_EQUIV = 0x1509;
public static final int GL_EXP = 0x0800;
public static final int GL_EXP2 = 0x0801;
public static final int GL_EXTENSIONS = 0x1F03;
public static final int GL_FALSE = 0;
public static final int GL_FASTEST = 0x1101;
public static final int GL_FIXED = 0x140C;
public static final int GL_FLAT = 0x1D00;
public static final int GL_FLOAT = 0x1406;
public static final int GL_FOG = 0x0B60;
public static final int GL_FOG_COLOR = 0x0B66;
public static final int GL_FOG_DENSITY = 0x0B62;
public static final int GL_FOG_END = 0x0B64;
public static final int GL_FOG_HINT = 0x0C54;
public static final int GL_FOG_MODE = 0x0B65;
public static final int GL_FOG_START = 0x0B63;
public static final int GL_FRONT = 0x0404;
public static final int GL_FRONT_AND_BACK = 0x0408;
public static final int GL_GEQUAL = 0x0206;
public static final int GL_GREATER = 0x0204;
public static final int GL_GREEN_BITS = 0x0D53;
public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B;
public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A;
public static final int GL_INCR = 0x1E02;
public static final int GL_INVALID_ENUM = 0x0500;
public static final int GL_INVALID_OPERATION = 0x0502;
public static final int GL_INVALID_VALUE = 0x0501;
public static final int GL_INVERT = 0x150A;
public static final int GL_KEEP = 0x1E00;
public static final int GL_LEQUAL = 0x0203;
public static final int GL_LESS = 0x0201;
public static final int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
public static final int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
public static final int GL_LIGHT0 = 0x4000;
public static final int GL_LIGHT1 = 0x4001;
public static final int GL_LIGHT2 = 0x4002;
public static final int GL_LIGHT3 = 0x4003;
public static final int GL_LIGHT4 = 0x4004;
public static final int GL_LIGHT5 = 0x4005;
public static final int GL_LIGHT6 = 0x4006;
public static final int GL_LIGHT7 = 0x4007;
public static final int GL_LIGHTING = 0x0B50;
public static final int GL_LINE_LOOP = 0x0002;
public static final int GL_LINE_SMOOTH = 0x0B20;
public static final int GL_LINE_SMOOTH_HINT = 0x0C52;
public static final int GL_LINE_STRIP = 0x0003;
public static final int GL_LINEAR = 0x2601;
public static final int GL_LINEAR_ATTENUATION = 0x1208;
public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
public static final int GL_LINES = 0x0001;
public static final int GL_LUMINANCE = 0x1909;
public static final int GL_LUMINANCE_ALPHA = 0x190A;
public static final int GL_MAX_ELEMENTS_INDICES = 0x80E9;
public static final int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
public static final int GL_MAX_LIGHTS = 0x0D31;
public static final int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;
public static final int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;
public static final int GL_MAX_TEXTURE_SIZE = 0x0D33;
public static final int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;
public static final int GL_MAX_TEXTURE_UNITS = 0x84E2;
public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
public static final int GL_MODELVIEW = 0x1700;
public static final int GL_MODULATE = 0x2100;
public static final int GL_MULTISAMPLE = 0x809D;
public static final int GL_NAND = 0x150E;
public static final int GL_NEAREST = 0x2600;
public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
public static final int GL_NEVER = 0x0200;
public static final int GL_NICEST = 0x1102;
public static final int GL_NO_ERROR = 0;
public static final int GL_NOOP = 0x1505;
public static final int GL_NOR = 0x1508;
public static final int GL_NORMAL_ARRAY = 0x8075;
public static final int GL_NORMALIZE = 0x0BA1;
public static final int GL_NOTEQUAL = 0x0205;
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
public static final int GL_ONE = 1;
public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305;
public static final int GL_ONE_MINUS_DST_COLOR = 0x0307;
public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301;
public static final int GL_OR = 0x1507;
public static final int GL_OR_INVERTED = 0x150D;
public static final int GL_OR_REVERSE = 0x150B;
public static final int GL_OUT_OF_MEMORY = 0x0505;
public static final int GL_PACK_ALIGNMENT = 0x0D05;
public static final int GL_PALETTE4_R5_G6_B5_OES = 0x8B92;
public static final int GL_PALETTE4_RGB5_A1_OES = 0x8B94;
public static final int GL_PALETTE4_RGB8_OES = 0x8B90;
public static final int GL_PALETTE4_RGBA4_OES = 0x8B93;
public static final int GL_PALETTE4_RGBA8_OES = 0x8B91;
public static final int GL_PALETTE8_R5_G6_B5_OES = 0x8B97;
public static final int GL_PALETTE8_RGB5_A1_OES = 0x8B99;
public static final int GL_PALETTE8_RGB8_OES = 0x8B95;
public static final int GL_PALETTE8_RGBA4_OES = 0x8B98;
public static final int GL_PALETTE8_RGBA8_OES = 0x8B96;
public static final int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;
public static final int GL_POINT_SMOOTH = 0x0B10;
public static final int GL_POINT_SMOOTH_HINT = 0x0C51;
public static final int GL_POINTS = 0x0000;
public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
public static final int GL_POINT_SIZE = 0x0B11;
public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
public static final int GL_POLYGON_SMOOTH_HINT = 0x0C53;
public static final int GL_POSITION = 0x1203;
public static final int GL_PROJECTION = 0x1701;
public static final int GL_QUADRATIC_ATTENUATION = 0x1209;
public static final int GL_RED_BITS = 0x0D52;
public static final int GL_RENDERER = 0x1F01;
public static final int GL_REPEAT = 0x2901;
public static final int GL_REPLACE = 0x1E01;
public static final int GL_RESCALE_NORMAL = 0x803A;
public static final int GL_RGB = 0x1907;
public static final int GL_RGBA = 0x1908;
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
public static final int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
public static final int GL_SAMPLE_COVERAGE = 0x80A0;
public static final int GL_SCISSOR_TEST = 0x0C11;
public static final int GL_SET = 0x150F;
public static final int GL_SHININESS = 0x1601;
public static final int GL_SHORT = 0x1402;
public static final int GL_SMOOTH = 0x1D01;
public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
public static final int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
public static final int GL_SPECULAR = 0x1202;
public static final int GL_SPOT_CUTOFF = 0x1206;
public static final int GL_SPOT_DIRECTION = 0x1204;
public static final int GL_SPOT_EXPONENT = 0x1205;
public static final int GL_SRC_ALPHA = 0x0302;
public static final int GL_SRC_ALPHA_SATURATE = 0x0308;
public static final int GL_SRC_COLOR = 0x0300;
public static final int GL_STACK_OVERFLOW = 0x0503;
public static final int GL_STACK_UNDERFLOW = 0x0504;
public static final int GL_STENCIL_BITS = 0x0D57;
public static final int GL_STENCIL_BUFFER_BIT = 0x0400;
public static final int GL_STENCIL_TEST = 0x0B90;
public static final int GL_SUBPIXEL_BITS = 0x0D50;
public static final int GL_TEXTURE = 0x1702;
public static final int GL_TEXTURE_2D = 0x0DE1;
public static final int GL_TEXTURE_COORD_ARRAY = 0x8078;
public static final int GL_TEXTURE_ENV = 0x2300;
public static final int GL_TEXTURE_ENV_COLOR = 0x2201;
public static final int GL_TEXTURE_ENV_MODE = 0x2200;
public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
public static final int GL_TEXTURE_WRAP_S = 0x2802;
public static final int GL_TEXTURE_WRAP_T = 0x2803;
public static final int GL_TEXTURE0 = 0x84C0;
public static final int GL_TEXTURE1 = 0x84C1;
public static final int GL_TEXTURE2 = 0x84C2;
public static final int GL_TEXTURE3 = 0x84C3;
public static final int GL_TEXTURE4 = 0x84C4;
public static final int GL_TEXTURE5 = 0x84C5;
public static final int GL_TEXTURE6 = 0x84C6;
public static final int GL_TEXTURE7 = 0x84C7;
public static final int GL_TEXTURE8 = 0x84C8;
public static final int GL_TEXTURE9 = 0x84C9;
public static final int GL_TEXTURE10 = 0x84CA;
public static final int GL_TEXTURE11 = 0x84CB;
public static final int GL_TEXTURE12 = 0x84CC;
public static final int GL_TEXTURE13 = 0x84CD;
public static final int GL_TEXTURE14 = 0x84CE;
public static final int GL_TEXTURE15 = 0x84CF;
public static final int GL_TEXTURE16 = 0x84D0;
public static final int GL_TEXTURE17 = 0x84D1;
public static final int GL_TEXTURE18 = 0x84D2;
public static final int GL_TEXTURE19 = 0x84D3;
public static final int GL_TEXTURE20 = 0x84D4;
public static final int GL_TEXTURE21 = 0x84D5;
public static final int GL_TEXTURE22 = 0x84D6;
public static final int GL_TEXTURE23 = 0x84D7;
public static final int GL_TEXTURE24 = 0x84D8;
public static final int GL_TEXTURE25 = 0x84D9;
public static final int GL_TEXTURE26 = 0x84DA;
public static final int GL_TEXTURE27 = 0x84DB;
public static final int GL_TEXTURE28 = 0x84DC;
public static final int GL_TEXTURE29 = 0x84DD;
public static final int GL_TEXTURE30 = 0x84DE;
public static final int GL_TEXTURE31 = 0x84DF;
public static final int GL_TRIANGLE_FAN = 0x0006;
public static final int GL_TRIANGLE_STRIP = 0x0005;
public static final int GL_TRIANGLES = 0x0004;
public static final int GL_TRUE = 1;
public static final int GL_UNPACK_ALIGNMENT = 0x0CF5;
public static final int GL_UNSIGNED_BYTE = 0x1401;
public static final int GL_UNSIGNED_SHORT = 0x1403;
public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
public static final int GL_VENDOR = 0x1F00;
public static final int GL_VERSION = 0x1F02;
public static final int GL_VERTEX_ARRAY = 0x8074;
public static final int GL_XOR = 0x1506;
public static final int GL_ZERO = 0;
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
private static Buffer _colorPointer;
private static Buffer _normalPointer;
private static Buffer _texCoordPointer;
private static Buffer _vertexPointer;
@@ -0,0 +1,156 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
/* special calls implemented in Android's GLES wrapper used to more
* efficiently bound-check passed arrays */
extern "C" {
GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
}
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass OOMEClass;
static jclass UOEClass;
static jclass IAEClass;
static jclass AIOOBEClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInitBuffer(JNIEnv *_env)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
nativeClassInitBuffer(_env);
jclass IAEClassLocal =
_env->FindClass("java/lang/IllegalArgumentException");
jclass OOMEClassLocal =
_env->FindClass("java/lang/OutOfMemoryError");
jclass UOEClassLocal =
_env->FindClass("java/lang/UnsupportedOperationException");
jclass AIOOBEClassLocal =
_env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
jint offset;
void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return (void *) (jint) pointer;
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
return (void *) ((char *) data + offset);
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
static void *
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
char* buf = (char*) _env->GetDirectBufferAddress(buffer);
if (buf) {
jint position = _env->GetIntField(buffer, positionID);
jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
buf += position << elementSizeShift;
} else {
_env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
}
return (void*) buf;
}
static int
getNumCompressedTextureFormats() {
int numCompressedTextureFormats = 0;
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
return numCompressedTextureFormats;
}
// --------------------------------------------------------------------------
@@ -0,0 +1,138 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package android.opengl;
import java.nio.Buffer;
public class GLES11Ext {
public static final int GL_BLEND_EQUATION_RGB_OES = 0x8009;
public static final int GL_BLEND_EQUATION_ALPHA_OES = 0x883D;
public static final int GL_BLEND_DST_RGB_OES = 0x80C8;
public static final int GL_BLEND_SRC_RGB_OES = 0x80C9;
public static final int GL_BLEND_DST_ALPHA_OES = 0x80CA;
public static final int GL_BLEND_SRC_ALPHA_OES = 0x80CB;
public static final int GL_BLEND_EQUATION_OES = 0x8009;
public static final int GL_FUNC_ADD_OES = 0x8006;
public static final int GL_FUNC_SUBTRACT_OES = 0x800A;
public static final int GL_FUNC_REVERSE_SUBTRACT_OES = 0x800B;
public static final int GL_ETC1_RGB8_OES = 0x8D64;
public static final int GL_DEPTH_COMPONENT24_OES = 0x81A6;
public static final int GL_DEPTH_COMPONENT32_OES = 0x81A7;
public static final int GL_TEXTURE_CROP_RECT_OES = 0x8B9D;
public static final int GL_FIXED_OES = 0x140C;
public static final int GL_NONE_OES = 0;
public static final int GL_FRAMEBUFFER_OES = 0x8D40;
public static final int GL_RENDERBUFFER_OES = 0x8D41;
public static final int GL_RGBA4_OES = 0x8056;
public static final int GL_RGB5_A1_OES = 0x8057;
public static final int GL_RGB565_OES = 0x8D62;
public static final int GL_DEPTH_COMPONENT16_OES = 0x81A5;
public static final int GL_RENDERBUFFER_WIDTH_OES = 0x8D42;
public static final int GL_RENDERBUFFER_HEIGHT_OES = 0x8D43;
public static final int GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 0x8D44;
public static final int GL_RENDERBUFFER_RED_SIZE_OES = 0x8D50;
public static final int GL_RENDERBUFFER_GREEN_SIZE_OES = 0x8D51;
public static final int GL_RENDERBUFFER_BLUE_SIZE_OES = 0x8D52;
public static final int GL_RENDERBUFFER_ALPHA_SIZE_OES = 0x8D53;
public static final int GL_RENDERBUFFER_DEPTH_SIZE_OES = 0x8D54;
public static final int GL_RENDERBUFFER_STENCIL_SIZE_OES = 0x8D55;
public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 0x8CD0;
public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 0x8CD1;
public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 0x8CD2;
public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 0x8CD3;
public static final int GL_COLOR_ATTACHMENT0_OES = 0x8CE0;
public static final int GL_DEPTH_ATTACHMENT_OES = 0x8D00;
public static final int GL_STENCIL_ATTACHMENT_OES = 0x8D20;
public static final int GL_FRAMEBUFFER_COMPLETE_OES = 0x8CD5;
public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 0x8CD6;
public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 0x8CD7;
public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 0x8CD9;
public static final int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 0x8CDA;
public static final int GL_FRAMEBUFFER_UNSUPPORTED_OES = 0x8CDD;
public static final int GL_FRAMEBUFFER_BINDING_OES = 0x8CA6;
public static final int GL_RENDERBUFFER_BINDING_OES = 0x8CA7;
public static final int GL_MAX_RENDERBUFFER_SIZE_OES = 0x84E8;
public static final int GL_INVALID_FRAMEBUFFER_OPERATION_OES = 0x0506;
public static final int GL_WRITE_ONLY_OES = 0x88B9;
public static final int GL_BUFFER_ACCESS_OES = 0x88BB;
public static final int GL_BUFFER_MAPPED_OES = 0x88BC;
public static final int GL_BUFFER_MAP_POINTER_OES = 0x88BD;
public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D;
public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E;
public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F;
public static final int GL_MAX_VERTEX_UNITS_OES = 0x86A4;
public static final int GL_MAX_PALETTE_MATRICES_OES = 0x8842;
public static final int GL_MATRIX_PALETTE_OES = 0x8840;
public static final int GL_MATRIX_INDEX_ARRAY_OES = 0x8844;
public static final int GL_WEIGHT_ARRAY_OES = 0x86AD;
public static final int GL_CURRENT_PALETTE_MATRIX_OES = 0x8843;
public static final int GL_MATRIX_INDEX_ARRAY_SIZE_OES = 0x8846;
public static final int GL_MATRIX_INDEX_ARRAY_TYPE_OES = 0x8847;
public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 0x8848;
public static final int GL_MATRIX_INDEX_ARRAY_POINTER_OES = 0x8849;
public static final int GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 0x8B9E;
public static final int GL_WEIGHT_ARRAY_SIZE_OES = 0x86AB;
public static final int GL_WEIGHT_ARRAY_TYPE_OES = 0x86A9;
public static final int GL_WEIGHT_ARRAY_STRIDE_OES = 0x86AA;
public static final int GL_WEIGHT_ARRAY_POINTER_OES = 0x86AC;
public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 0x889E;
public static final int GL_DEPTH_STENCIL_OES = 0x84F9;
public static final int GL_UNSIGNED_INT_24_8_OES = 0x84FA;
public static final int GL_DEPTH24_STENCIL8_OES = 0x88F0;
public static final int GL_RGB8_OES = 0x8051;
public static final int GL_RGBA8_OES = 0x8058;
public static final int GL_STENCIL_INDEX1_OES = 0x8D46;
public static final int GL_STENCIL_INDEX4_OES = 0x8D47;
public static final int GL_STENCIL_INDEX8_OES = 0x8D48;
public static final int GL_INCR_WRAP_OES = 0x8507;
public static final int GL_DECR_WRAP_OES = 0x8508;
public static final int GL_NORMAL_MAP_OES = 0x8511;
public static final int GL_REFLECTION_MAP_OES = 0x8512;
public static final int GL_TEXTURE_CUBE_MAP_OES = 0x8513;
public static final int GL_TEXTURE_BINDING_CUBE_MAP_OES = 0x8514;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES = 0x8515;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES = 0x8516;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES = 0x8517;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES = 0x8518;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES = 0x8519;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES = 0x851A;
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES = 0x851C;
public static final int GL_TEXTURE_GEN_MODE_OES = 0x2500;
public static final int GL_TEXTURE_GEN_STR_OES = 0x8D60;
public static final int GL_MIRRORED_REPEAT_OES = 0x8370;
public static final int GL_3DC_X_AMD = 0x87F9;
public static final int GL_3DC_XY_AMD = 0x87FA;
public static final int GL_ATC_RGB_AMD = 0x8C92;
public static final int GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93;
public static final int GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE;
public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
public static final int GL_BGRA = 0x80E1;
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
private static final int GL_BYTE = GLES10.GL_BYTE;
private static final int GL_FIXED = GLES10.GL_FIXED;
private static final int GL_FLOAT = GLES10.GL_FLOAT;
private static final int GL_SHORT = GLES10.GL_SHORT;
private static Buffer _matrixIndexPointerOES;
@@ -0,0 +1,146 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
/* special calls implemented in Android's GLES wrapper used to more
* efficiently bound-check passed arrays */
extern "C" {
GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
}
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass OOMEClass;
static jclass UOEClass;
static jclass IAEClass;
static jclass AIOOBEClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInitBuffer(JNIEnv *_env)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
nativeClassInitBuffer(_env);
jclass IAEClassLocal =
_env->FindClass("java/lang/IllegalArgumentException");
jclass OOMEClassLocal =
_env->FindClass("java/lang/OutOfMemoryError");
jclass UOEClassLocal =
_env->FindClass("java/lang/UnsupportedOperationException");
jclass AIOOBEClassLocal =
_env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
jint offset;
void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return (void *) (jint) pointer;
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
return (void *) ((char *) data + offset);
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
static void *
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
char* buf = (char*) _env->GetDirectBufferAddress(buffer);
if (buf) {
jint position = _env->GetIntField(buffer, positionID);
jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
buf += position << elementSizeShift;
} else {
_env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
}
return (void*) buf;
}
// --------------------------------------------------------------------------
@@ -0,0 +1,152 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package android.opengl;
import java.nio.Buffer;
public class GLES11 extends GLES10 {
public static final int GL_ACTIVE_TEXTURE = 0x84E0;
public static final int GL_ADD_SIGNED = 0x8574;
public static final int GL_ALPHA_SCALE = 0x0D1C;
public static final int GL_ALPHA_TEST_FUNC = 0x0BC1;
public static final int GL_ALPHA_TEST_REF = 0x0BC2;
public static final int GL_ARRAY_BUFFER = 0x8892;
public static final int GL_ARRAY_BUFFER_BINDING = 0x8894;
public static final int GL_BLEND_DST = 0x0BE0;
public static final int GL_BLEND_SRC = 0x0BE1;
public static final int GL_BUFFER_ACCESS = 0x88BB;
public static final int GL_BUFFER_SIZE = 0x8764;
public static final int GL_BUFFER_USAGE = 0x8765;
public static final int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
public static final int GL_CLIP_PLANE0 = 0x3000;
public static final int GL_CLIP_PLANE1 = 0x3001;
public static final int GL_CLIP_PLANE2 = 0x3002;
public static final int GL_CLIP_PLANE3 = 0x3003;
public static final int GL_CLIP_PLANE4 = 0x3004;
public static final int GL_CLIP_PLANE5 = 0x3005;
public static final int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898;
public static final int GL_COLOR_ARRAY_POINTER = 0x8090;
public static final int GL_COLOR_ARRAY_SIZE = 0x8081;
public static final int GL_COLOR_ARRAY_STRIDE = 0x8083;
public static final int GL_COLOR_ARRAY_TYPE = 0x8082;
public static final int GL_COLOR_CLEAR_VALUE = 0x0C22;
public static final int GL_COLOR_WRITEMASK = 0x0C23;
public static final int GL_COMBINE = 0x8570;
public static final int GL_COMBINE_ALPHA = 0x8572;
public static final int GL_COMBINE_RGB = 0x8571;
public static final int GL_CONSTANT = 0x8576;
public static final int GL_COORD_REPLACE_OES = 0x8862;
public static final int GL_CULL_FACE_MODE = 0x0B45;
public static final int GL_CURRENT_COLOR = 0x0B00;
public static final int GL_CURRENT_NORMAL = 0x0B02;
public static final int GL_CURRENT_TEXTURE_COORDS = 0x0B03;
public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73;
public static final int GL_DEPTH_FUNC = 0x0B74;
public static final int GL_DEPTH_RANGE = 0x0B70;
public static final int GL_DEPTH_WRITEMASK = 0x0B72;
public static final int GL_DOT3_RGB = 0x86AE;
public static final int GL_DOT3_RGBA = 0x86AF;
public static final int GL_DYNAMIC_DRAW = 0x88E8;
public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
public static final int GL_FRONT_FACE = 0x0B46;
public static final int GL_GENERATE_MIPMAP = 0x8191;
public static final int GL_GENERATE_MIPMAP_HINT = 0x8192;
public static final int GL_INTERPOLATE = 0x8575;
public static final int GL_LINE_WIDTH = 0x0B21;
public static final int GL_LOGIC_OP_MODE = 0x0BF0;
public static final int GL_MATRIX_MODE = 0x0BA0;
public static final int GL_MAX_CLIP_PLANES = 0x0D32;
public static final int GL_MODELVIEW_MATRIX = 0x0BA6;
public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D;
public static final int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
public static final int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897;
public static final int GL_NORMAL_ARRAY_POINTER = 0x808F;
public static final int GL_NORMAL_ARRAY_STRIDE = 0x807F;
public static final int GL_NORMAL_ARRAY_TYPE = 0x807E;
public static final int GL_OPERAND0_ALPHA = 0x8598;
public static final int GL_OPERAND0_RGB = 0x8590;
public static final int GL_OPERAND1_ALPHA = 0x8599;
public static final int GL_OPERAND1_RGB = 0x8591;
public static final int GL_OPERAND2_ALPHA = 0x859A;
public static final int GL_OPERAND2_RGB = 0x8592;
public static final int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
public static final int GL_POINT_SIZE = 0x0B11;
public static final int GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 0x8B9F;
public static final int GL_POINT_SIZE_ARRAY_OES = 0x8B9C;
public static final int GL_POINT_SIZE_ARRAY_POINTER_OES = 0x898C;
public static final int GL_POINT_SIZE_ARRAY_STRIDE_OES = 0x898B;
public static final int GL_POINT_SIZE_ARRAY_TYPE_OES = 0x898A;
public static final int GL_POINT_SIZE_MAX = 0x8127;
public static final int GL_POINT_SIZE_MIN = 0x8126;
public static final int GL_POINT_SPRITE_OES = 0x8861;
public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038;
public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00;
public static final int GL_PREVIOUS = 0x8578;
public static final int GL_PRIMARY_COLOR = 0x8577;
public static final int GL_PROJECTION_MATRIX = 0x0BA7;
public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E;
public static final int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
public static final int GL_RGB_SCALE = 0x8573;
public static final int GL_SAMPLE_BUFFERS = 0x80A8;
public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
public static final int GL_SAMPLES = 0x80A9;
public static final int GL_SCISSOR_BOX = 0x0C10;
public static final int GL_SHADE_MODEL = 0x0B54;
public static final int GL_SRC0_ALPHA = 0x8588;
public static final int GL_SRC0_RGB = 0x8580;
public static final int GL_SRC1_ALPHA = 0x8589;
public static final int GL_SRC1_RGB = 0x8581;
public static final int GL_SRC2_ALPHA = 0x858A;
public static final int GL_SRC2_RGB = 0x8582;
public static final int GL_STATIC_DRAW = 0x88E4;
public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91;
public static final int GL_STENCIL_FAIL = 0x0B94;
public static final int GL_STENCIL_FUNC = 0x0B92;
public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
public static final int GL_STENCIL_REF = 0x0B97;
public static final int GL_STENCIL_VALUE_MASK = 0x0B93;
public static final int GL_STENCIL_WRITEMASK = 0x0B98;
public static final int GL_SUBTRACT = 0x84E7;
public static final int GL_TEXTURE_BINDING_2D = 0x8069;
public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A;
public static final int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092;
public static final int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088;
public static final int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A;
public static final int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089;
public static final int GL_TEXTURE_MATRIX = 0x0BA8;
public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F;
public static final int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
public static final int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896;
public static final int GL_VERTEX_ARRAY_POINTER = 0x808E;
public static final int GL_VERTEX_ARRAY_SIZE = 0x807A;
public static final int GL_VERTEX_ARRAY_STRIDE = 0x807C;
public static final int GL_VERTEX_ARRAY_TYPE = 0x807B;
public static final int GL_VIEWPORT = 0x0BA2;
public static final int GL_WRITE_ONLY = 0x88B9;
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
private static Buffer _pointSizePointerOES;
@@ -0,0 +1,145 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
/* special calls implemented in Android's GLES wrapper used to more
* efficiently bound-check passed arrays */
extern "C" {
GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
}
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass OOMEClass;
static jclass UOEClass;
static jclass IAEClass;
static jclass AIOOBEClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInitBuffer(JNIEnv *_env)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
nativeClassInitBuffer(_env);
jclass IAEClassLocal =
_env->FindClass("java/lang/IllegalArgumentException");
jclass OOMEClassLocal =
_env->FindClass("java/lang/OutOfMemoryError");
jclass UOEClassLocal =
_env->FindClass("java/lang/UnsupportedOperationException");
jclass AIOOBEClassLocal =
_env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
jint offset;
void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return (void *) (jint) pointer;
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
return (void *) ((char *) data + offset);
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
static void *
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
char* buf = (char*) _env->GetDirectBufferAddress(buffer);
if (buf) {
jint position = _env->GetIntField(buffer, positionID);
jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
buf += position << elementSizeShift;
} else {
_env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
}
return (void*) buf;
}
// --------------------------------------------------------------------------
@@ -0,0 +1,330 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package android.opengl;
/** OpenGL ES 2.0
*/
public class GLES20 {
public static final int GL_ACTIVE_TEXTURE = 0x84E0;
public static final int GL_DEPTH_BUFFER_BIT = 0x00000100;
public static final int GL_STENCIL_BUFFER_BIT = 0x00000400;
public static final int GL_COLOR_BUFFER_BIT = 0x00004000;
public static final int GL_FALSE = 0;
public static final int GL_TRUE = 1;
public static final int GL_POINTS = 0x0000;
public static final int GL_LINES = 0x0001;
public static final int GL_LINE_LOOP = 0x0002;
public static final int GL_LINE_STRIP = 0x0003;
public static final int GL_TRIANGLES = 0x0004;
public static final int GL_TRIANGLE_STRIP = 0x0005;
public static final int GL_TRIANGLE_FAN = 0x0006;
public static final int GL_ZERO = 0;
public static final int GL_ONE = 1;
public static final int GL_SRC_COLOR = 0x0300;
public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301;
public static final int GL_SRC_ALPHA = 0x0302;
public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
public static final int GL_DST_ALPHA = 0x0304;
public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305;
public static final int GL_DST_COLOR = 0x0306;
public static final int GL_ONE_MINUS_DST_COLOR = 0x0307;
public static final int GL_SRC_ALPHA_SATURATE = 0x0308;
public static final int GL_FUNC_ADD = 0x8006;
public static final int GL_BLEND_EQUATION = 0x8009;
public static final int GL_BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
public static final int GL_BLEND_EQUATION_ALPHA = 0x883D;
public static final int GL_FUNC_SUBTRACT = 0x800A;
public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
public static final int GL_BLEND_DST_RGB = 0x80C8;
public static final int GL_BLEND_SRC_RGB = 0x80C9;
public static final int GL_BLEND_DST_ALPHA = 0x80CA;
public static final int GL_BLEND_SRC_ALPHA = 0x80CB;
public static final int GL_CONSTANT_COLOR = 0x8001;
public static final int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
public static final int GL_CONSTANT_ALPHA = 0x8003;
public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
public static final int GL_BLEND_COLOR = 0x8005;
public static final int GL_ARRAY_BUFFER = 0x8892;
public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
public static final int GL_ARRAY_BUFFER_BINDING = 0x8894;
public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
public static final int GL_STREAM_DRAW = 0x88E0;
public static final int GL_STATIC_DRAW = 0x88E4;
public static final int GL_DYNAMIC_DRAW = 0x88E8;
public static final int GL_BUFFER_SIZE = 0x8764;
public static final int GL_BUFFER_USAGE = 0x8765;
public static final int GL_CURRENT_VERTEX_ATTRIB = 0x8626;
public static final int GL_FRONT = 0x0404;
public static final int GL_BACK = 0x0405;
public static final int GL_FRONT_AND_BACK = 0x0408;
public static final int GL_TEXTURE_2D = 0x0DE1;
public static final int GL_CULL_FACE = 0x0B44;
public static final int GL_BLEND = 0x0BE2;
public static final int GL_DITHER = 0x0BD0;
public static final int GL_STENCIL_TEST = 0x0B90;
public static final int GL_DEPTH_TEST = 0x0B71;
public static final int GL_SCISSOR_TEST = 0x0C11;
public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
public static final int GL_SAMPLE_COVERAGE = 0x80A0;
public static final int GL_NO_ERROR = 0;
public static final int GL_INVALID_ENUM = 0x0500;
public static final int GL_INVALID_VALUE = 0x0501;
public static final int GL_INVALID_OPERATION = 0x0502;
public static final int GL_OUT_OF_MEMORY = 0x0505;
public static final int GL_CW = 0x0900;
public static final int GL_CCW = 0x0901;
public static final int GL_LINE_WIDTH = 0x0B21;
public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
public static final int GL_CULL_FACE_MODE = 0x0B45;
public static final int GL_FRONT_FACE = 0x0B46;
public static final int GL_DEPTH_RANGE = 0x0B70;
public static final int GL_DEPTH_WRITEMASK = 0x0B72;
public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73;
public static final int GL_DEPTH_FUNC = 0x0B74;
public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91;
public static final int GL_STENCIL_FUNC = 0x0B92;
public static final int GL_STENCIL_FAIL = 0x0B94;
public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
public static final int GL_STENCIL_REF = 0x0B97;
public static final int GL_STENCIL_VALUE_MASK = 0x0B93;
public static final int GL_STENCIL_WRITEMASK = 0x0B98;
public static final int GL_STENCIL_BACK_FUNC = 0x8800;
public static final int GL_STENCIL_BACK_FAIL = 0x8801;
public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
public static final int GL_STENCIL_BACK_REF = 0x8CA3;
public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4;
public static final int GL_STENCIL_BACK_WRITEMASK = 0x8CA5;
public static final int GL_VIEWPORT = 0x0BA2;
public static final int GL_SCISSOR_BOX = 0x0C10;
public static final int GL_COLOR_CLEAR_VALUE = 0x0C22;
public static final int GL_COLOR_WRITEMASK = 0x0C23;
public static final int GL_UNPACK_ALIGNMENT = 0x0CF5;
public static final int GL_PACK_ALIGNMENT = 0x0D05;
public static final int GL_MAX_TEXTURE_SIZE = 0x0D33;
public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
public static final int GL_SUBPIXEL_BITS = 0x0D50;
public static final int GL_RED_BITS = 0x0D52;
public static final int GL_GREEN_BITS = 0x0D53;
public static final int GL_BLUE_BITS = 0x0D54;
public static final int GL_ALPHA_BITS = 0x0D55;
public static final int GL_DEPTH_BITS = 0x0D56;
public static final int GL_STENCIL_BITS = 0x0D57;
public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00;
public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038;
public static final int GL_TEXTURE_BINDING_2D = 0x8069;
public static final int GL_SAMPLE_BUFFERS = 0x80A8;
public static final int GL_SAMPLES = 0x80A9;
public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
public static final int GL_DONT_CARE = 0x1100;
public static final int GL_FASTEST = 0x1101;
public static final int GL_NICEST = 0x1102;
public static final int GL_GENERATE_MIPMAP_HINT = 0x8192;
public static final int GL_BYTE = 0x1400;
public static final int GL_UNSIGNED_BYTE = 0x1401;
public static final int GL_SHORT = 0x1402;
public static final int GL_UNSIGNED_SHORT = 0x1403;
public static final int GL_INT = 0x1404;
public static final int GL_UNSIGNED_INT = 0x1405;
public static final int GL_FLOAT = 0x1406;
public static final int GL_FIXED = 0x140C;
public static final int GL_DEPTH_COMPONENT = 0x1902;
public static final int GL_ALPHA = 0x1906;
public static final int GL_RGB = 0x1907;
public static final int GL_RGBA = 0x1908;
public static final int GL_LUMINANCE = 0x1909;
public static final int GL_LUMINANCE_ALPHA = 0x190A;
public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
public static final int GL_FRAGMENT_SHADER = 0x8B30;
public static final int GL_VERTEX_SHADER = 0x8B31;
public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869;
public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
public static final int GL_MAX_VARYING_VECTORS = 0x8DFC;
public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
public static final int GL_SHADER_TYPE = 0x8B4F;
public static final int GL_DELETE_STATUS = 0x8B80;
public static final int GL_LINK_STATUS = 0x8B82;
public static final int GL_VALIDATE_STATUS = 0x8B83;
public static final int GL_ATTACHED_SHADERS = 0x8B85;
public static final int GL_ACTIVE_UNIFORMS = 0x8B86;
public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87;
public static final int GL_ACTIVE_ATTRIBUTES = 0x8B89;
public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A;
public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
public static final int GL_CURRENT_PROGRAM = 0x8B8D;
public static final int GL_NEVER = 0x0200;
public static final int GL_LESS = 0x0201;
public static final int GL_EQUAL = 0x0202;
public static final int GL_LEQUAL = 0x0203;
public static final int GL_GREATER = 0x0204;
public static final int GL_NOTEQUAL = 0x0205;
public static final int GL_GEQUAL = 0x0206;
public static final int GL_ALWAYS = 0x0207;
public static final int GL_KEEP = 0x1E00;
public static final int GL_REPLACE = 0x1E01;
public static final int GL_INCR = 0x1E02;
public static final int GL_DECR = 0x1E03;
public static final int GL_INVERT = 0x150A;
public static final int GL_INCR_WRAP = 0x8507;
public static final int GL_DECR_WRAP = 0x8508;
public static final int GL_VENDOR = 0x1F00;
public static final int GL_RENDERER = 0x1F01;
public static final int GL_VERSION = 0x1F02;
public static final int GL_EXTENSIONS = 0x1F03;
public static final int GL_NEAREST = 0x2600;
public static final int GL_LINEAR = 0x2601;
public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
public static final int GL_TEXTURE_WRAP_S = 0x2802;
public static final int GL_TEXTURE_WRAP_T = 0x2803;
public static final int GL_TEXTURE = 0x1702;
public static final int GL_TEXTURE_CUBE_MAP = 0x8513;
public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
public static final int GL_TEXTURE0 = 0x84C0;
public static final int GL_TEXTURE1 = 0x84C1;
public static final int GL_TEXTURE2 = 0x84C2;
public static final int GL_TEXTURE3 = 0x84C3;
public static final int GL_TEXTURE4 = 0x84C4;
public static final int GL_TEXTURE5 = 0x84C5;
public static final int GL_TEXTURE6 = 0x84C6;
public static final int GL_TEXTURE7 = 0x84C7;
public static final int GL_TEXTURE8 = 0x84C8;
public static final int GL_TEXTURE9 = 0x84C9;
public static final int GL_TEXTURE10 = 0x84CA;
public static final int GL_TEXTURE11 = 0x84CB;
public static final int GL_TEXTURE12 = 0x84CC;
public static final int GL_TEXTURE13 = 0x84CD;
public static final int GL_TEXTURE14 = 0x84CE;
public static final int GL_TEXTURE15 = 0x84CF;
public static final int GL_TEXTURE16 = 0x84D0;
public static final int GL_TEXTURE17 = 0x84D1;
public static final int GL_TEXTURE18 = 0x84D2;
public static final int GL_TEXTURE19 = 0x84D3;
public static final int GL_TEXTURE20 = 0x84D4;
public static final int GL_TEXTURE21 = 0x84D5;
public static final int GL_TEXTURE22 = 0x84D6;
public static final int GL_TEXTURE23 = 0x84D7;
public static final int GL_TEXTURE24 = 0x84D8;
public static final int GL_TEXTURE25 = 0x84D9;
public static final int GL_TEXTURE26 = 0x84DA;
public static final int GL_TEXTURE27 = 0x84DB;
public static final int GL_TEXTURE28 = 0x84DC;
public static final int GL_TEXTURE29 = 0x84DD;
public static final int GL_TEXTURE30 = 0x84DE;
public static final int GL_TEXTURE31 = 0x84DF;
public static final int GL_REPEAT = 0x2901;
public static final int GL_CLAMP_TO_EDGE = 0x812F;
public static final int GL_MIRRORED_REPEAT = 0x8370;
public static final int GL_FLOAT_VEC2 = 0x8B50;
public static final int GL_FLOAT_VEC3 = 0x8B51;
public static final int GL_FLOAT_VEC4 = 0x8B52;
public static final int GL_INT_VEC2 = 0x8B53;
public static final int GL_INT_VEC3 = 0x8B54;
public static final int GL_INT_VEC4 = 0x8B55;
public static final int GL_BOOL = 0x8B56;
public static final int GL_BOOL_VEC2 = 0x8B57;
public static final int GL_BOOL_VEC3 = 0x8B58;
public static final int GL_BOOL_VEC4 = 0x8B59;
public static final int GL_FLOAT_MAT2 = 0x8B5A;
public static final int GL_FLOAT_MAT3 = 0x8B5B;
public static final int GL_FLOAT_MAT4 = 0x8B5C;
public static final int GL_SAMPLER_2D = 0x8B5E;
public static final int GL_SAMPLER_CUBE = 0x8B60;
public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
public static final int GL_COMPILE_STATUS = 0x8B81;
public static final int GL_INFO_LOG_LENGTH = 0x8B84;
public static final int GL_SHADER_SOURCE_LENGTH = 0x8B88;
public static final int GL_SHADER_COMPILER = 0x8DFA;
public static final int GL_SHADER_BINARY_FORMATS = 0x8DF8;
public static final int GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9;
public static final int GL_LOW_FLOAT = 0x8DF0;
public static final int GL_MEDIUM_FLOAT = 0x8DF1;
public static final int GL_HIGH_FLOAT = 0x8DF2;
public static final int GL_LOW_INT = 0x8DF3;
public static final int GL_MEDIUM_INT = 0x8DF4;
public static final int GL_HIGH_INT = 0x8DF5;
public static final int GL_FRAMEBUFFER = 0x8D40;
public static final int GL_RENDERBUFFER = 0x8D41;
public static final int GL_RGBA4 = 0x8056;
public static final int GL_RGB5_A1 = 0x8057;
public static final int GL_RGB565 = 0x8D62;
public static final int GL_DEPTH_COMPONENT16 = 0x81A5;
public static final int GL_STENCIL_INDEX = 0x1901;
public static final int GL_STENCIL_INDEX8 = 0x8D48;
public static final int GL_RENDERBUFFER_WIDTH = 0x8D42;
public static final int GL_RENDERBUFFER_HEIGHT = 0x8D43;
public static final int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
public static final int GL_RENDERBUFFER_RED_SIZE = 0x8D50;
public static final int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51;
public static final int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52;
public static final int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53;
public static final int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54;
public static final int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55;
public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
public static final int GL_COLOR_ATTACHMENT0 = 0x8CE0;
public static final int GL_DEPTH_ATTACHMENT = 0x8D00;
public static final int GL_STENCIL_ATTACHMENT = 0x8D20;
public static final int GL_NONE = 0;
public static final int GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
public static final int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
public static final int GL_FRAMEBUFFER_BINDING = 0x8CA6;
public static final int GL_RENDERBUFFER_BINDING = 0x8CA7;
public static final int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
@@ -0,0 +1,150 @@
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass OOMEClass;
static jclass UOEClass;
static jclass IAEClass;
static jclass AIOOBEClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInitBuffer(JNIEnv *_env)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
nativeClassInitBuffer(_env);
jclass IAEClassLocal =
_env->FindClass("java/lang/IllegalArgumentException");
jclass OOMEClassLocal =
_env->FindClass("java/lang/OutOfMemoryError");
jclass UOEClassLocal =
_env->FindClass("java/lang/UnsupportedOperationException");
jclass AIOOBEClassLocal =
_env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
jint offset;
void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return (void *) (jint) pointer;
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
return (void *) ((char *) data + offset);
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
static void *
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
char* buf = (char*) _env->GetDirectBufferAddress(buffer);
if (buf) {
jint position = _env->GetIntField(buffer, positionID);
jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
buf += position << elementSizeShift;
} else {
_env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
}
return (void*) buf;
}
static int
getNumCompressedTextureFormats() {
int numCompressedTextureFormats = 0;
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
return numCompressedTextureFormats;
}
static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
}
// --------------------------------------------------------------------------
@@ -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;
}
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// C function void glGetProgramInfoLog( GLuint program, GLsizei maxLength, GLsizei * length,
// GLchar * infoLog);
public static native String glGetProgramInfoLog(
int program
);
@@ -0,0 +1 @@
{"glGetProgramInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramInfoLog },
@@ -0,0 +1,27 @@
#include <string.h>
/* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
static
jstring
android_glGetShaderInfoLog (JNIEnv *_env, jobject _this, jint shader) {
GLint infoLen = 0;
jstring _result = 0;
char* buf = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
if (infoLen) {
char* buf = (char*) malloc(infoLen);
if (buf == 0) {
_env->ThrowNew(IAEClass, "out of memory");
goto exit;
}
glGetShaderInfoLog(shader, infoLen, NULL, buf);
_result = _env->NewStringUTF(buf);
} else {
_result = _env->NewStringUTF("");
}
exit:
if (buf) {
free(buf);
}
return _result;
}
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// C function void glGetShaderInfoLog( GLuint shader, GLsizei maxLength, GLsizei * length,
// GLchar * infoLog);
public static native String glGetShaderInfoLog(
int shader
);
@@ -0,0 +1 @@
{"glGetShaderInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetShaderInfoLog },
@@ -0,0 +1,11 @@
#include <string.h>
/* const GLubyte * glGetString ( GLenum name ) */
static
jstring
android_glGetString
(JNIEnv *_env, jobject _this, jint name) {
const char * chars = (const char *)glGetString((GLenum)name);
jstring output = _env->NewStringUTF(chars);
return output;
}
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// C function const GLubyte * glGetString ( GLenum name )
public static native String glGetString(
int name
);
@@ -0,0 +1 @@
{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
@@ -0,0 +1,17 @@
/* void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint * length ) */
static
void
android_glShaderSource
(JNIEnv *_env, jobject _this, jint shader, jstring string) {
if (!string) {
_env->ThrowNew(IAEClass, "string == null");
return;
}
const char* nativeString = _env->GetStringUTFChars(string, 0);
const char* strings[] = {nativeString};
glShaderSource(shader, 1, strings, 0);
_env->ReleaseStringUTFChars(string, nativeString);
}
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// C function void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint* length )
public static native void glShaderSource(
int shader,
String string
);
@@ -0,0 +1 @@
{"glShaderSource", "(ILjava/lang/String;)V", (void *) android_glShaderSource },
@@ -0,0 +1,22 @@
**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package javax.microedition.khronos.opengles;
public interface GL10Ext extends GL {
@@ -0,0 +1,259 @@
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package javax.microedition.khronos.opengles;
public interface GL10 extends GL {
int GL_ADD = 0x0104;
int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
int GL_ALPHA = 0x1906;
int GL_ALPHA_BITS = 0x0D55;
int GL_ALPHA_TEST = 0x0BC0;
int GL_ALWAYS = 0x0207;
int GL_AMBIENT = 0x1200;
int GL_AMBIENT_AND_DIFFUSE = 0x1602;
int GL_AND = 0x1501;
int GL_AND_INVERTED = 0x1504;
int GL_AND_REVERSE = 0x1502;
int GL_BACK = 0x0405;
int GL_BLEND = 0x0BE2;
int GL_BLUE_BITS = 0x0D54;
int GL_BYTE = 0x1400;
int GL_CCW = 0x0901;
int GL_CLAMP_TO_EDGE = 0x812F;
int GL_CLEAR = 0x1500;
int GL_COLOR_ARRAY = 0x8076;
int GL_COLOR_BUFFER_BIT = 0x4000;
int GL_COLOR_LOGIC_OP = 0x0BF2;
int GL_COLOR_MATERIAL = 0x0B57;
int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
int GL_CONSTANT_ATTENUATION = 0x1207;
int GL_COPY = 0x1503;
int GL_COPY_INVERTED = 0x150C;
int GL_CULL_FACE = 0x0B44;
int GL_CW = 0x0900;
int GL_DECAL = 0x2101;
int GL_DECR = 0x1E03;
int GL_DEPTH_BITS = 0x0D56;
int GL_DEPTH_BUFFER_BIT = 0x0100;
int GL_DEPTH_TEST = 0x0B71;
int GL_DIFFUSE = 0x1201;
int GL_DITHER = 0x0BD0;
int GL_DONT_CARE = 0x1100;
int GL_DST_ALPHA = 0x0304;
int GL_DST_COLOR = 0x0306;
int GL_EMISSION = 0x1600;
int GL_EQUAL = 0x0202;
int GL_EQUIV = 0x1509;
int GL_EXP = 0x0800;
int GL_EXP2 = 0x0801;
int GL_EXTENSIONS = 0x1F03;
int GL_FALSE = 0;
int GL_FASTEST = 0x1101;
int GL_FIXED = 0x140C;
int GL_FLAT = 0x1D00;
int GL_FLOAT = 0x1406;
int GL_FOG = 0x0B60;
int GL_FOG_COLOR = 0x0B66;
int GL_FOG_DENSITY = 0x0B62;
int GL_FOG_END = 0x0B64;
int GL_FOG_HINT = 0x0C54;
int GL_FOG_MODE = 0x0B65;
int GL_FOG_START = 0x0B63;
int GL_FRONT = 0x0404;
int GL_FRONT_AND_BACK = 0x0408;
int GL_GEQUAL = 0x0206;
int GL_GREATER = 0x0204;
int GL_GREEN_BITS = 0x0D53;
int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B;
int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A;
int GL_INCR = 0x1E02;
int GL_INVALID_ENUM = 0x0500;
int GL_INVALID_OPERATION = 0x0502;
int GL_INVALID_VALUE = 0x0501;
int GL_INVERT = 0x150A;
int GL_KEEP = 0x1E00;
int GL_LEQUAL = 0x0203;
int GL_LESS = 0x0201;
int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
int GL_LIGHT0 = 0x4000;
int GL_LIGHT1 = 0x4001;
int GL_LIGHT2 = 0x4002;
int GL_LIGHT3 = 0x4003;
int GL_LIGHT4 = 0x4004;
int GL_LIGHT5 = 0x4005;
int GL_LIGHT6 = 0x4006;
int GL_LIGHT7 = 0x4007;
int GL_LIGHTING = 0x0B50;
int GL_LINE_LOOP = 0x0002;
int GL_LINE_SMOOTH = 0x0B20;
int GL_LINE_SMOOTH_HINT = 0x0C52;
int GL_LINE_STRIP = 0x0003;
int GL_LINEAR = 0x2601;
int GL_LINEAR_ATTENUATION = 0x1208;
int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
int GL_LINES = 0x0001;
int GL_LUMINANCE = 0x1909;
int GL_LUMINANCE_ALPHA = 0x190A;
int GL_MAX_ELEMENTS_INDICES = 0x80E9;
int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
int GL_MAX_LIGHTS = 0x0D31;
int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;
int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;
int GL_MAX_TEXTURE_SIZE = 0x0D33;
int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;
int GL_MAX_TEXTURE_UNITS = 0x84E2;
int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
int GL_MODELVIEW = 0x1700;
int GL_MODULATE = 0x2100;
int GL_MULTISAMPLE = 0x809D;
int GL_NAND = 0x150E;
int GL_NEAREST = 0x2600;
int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
int GL_NEVER = 0x0200;
int GL_NICEST = 0x1102;
int GL_NO_ERROR = 0;
int GL_NOOP = 0x1505;
int GL_NOR = 0x1508;
int GL_NORMAL_ARRAY = 0x8075;
int GL_NORMALIZE = 0x0BA1;
int GL_NOTEQUAL = 0x0205;
int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
int GL_ONE = 1;
int GL_ONE_MINUS_DST_ALPHA = 0x0305;
int GL_ONE_MINUS_DST_COLOR = 0x0307;
int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
int GL_ONE_MINUS_SRC_COLOR = 0x0301;
int GL_OR = 0x1507;
int GL_OR_INVERTED = 0x150D;
int GL_OR_REVERSE = 0x150B;
int GL_OUT_OF_MEMORY = 0x0505;
int GL_PACK_ALIGNMENT = 0x0D05;
int GL_PALETTE4_R5_G6_B5_OES = 0x8B92;
int GL_PALETTE4_RGB5_A1_OES = 0x8B94;
int GL_PALETTE4_RGB8_OES = 0x8B90;
int GL_PALETTE4_RGBA4_OES = 0x8B93;
int GL_PALETTE4_RGBA8_OES = 0x8B91;
int GL_PALETTE8_R5_G6_B5_OES = 0x8B97;
int GL_PALETTE8_RGB5_A1_OES = 0x8B99;
int GL_PALETTE8_RGB8_OES = 0x8B95;
int GL_PALETTE8_RGBA4_OES = 0x8B98;
int GL_PALETTE8_RGBA8_OES = 0x8B96;
int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;
int GL_POINT_SMOOTH = 0x0B10;
int GL_POINT_SMOOTH_HINT = 0x0C51;
int GL_POINTS = 0x0000;
int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
int GL_POINT_SIZE = 0x0B11;
int GL_POLYGON_OFFSET_FILL = 0x8037;
int GL_POLYGON_SMOOTH_HINT = 0x0C53;
int GL_POSITION = 0x1203;
int GL_PROJECTION = 0x1701;
int GL_QUADRATIC_ATTENUATION = 0x1209;
int GL_RED_BITS = 0x0D52;
int GL_RENDERER = 0x1F01;
int GL_REPEAT = 0x2901;
int GL_REPLACE = 0x1E01;
int GL_RESCALE_NORMAL = 0x803A;
int GL_RGB = 0x1907;
int GL_RGBA = 0x1908;
int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
int GL_SAMPLE_COVERAGE = 0x80A0;
int GL_SCISSOR_TEST = 0x0C11;
int GL_SET = 0x150F;
int GL_SHININESS = 0x1601;
int GL_SHORT = 0x1402;
int GL_SMOOTH = 0x1D01;
int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
int GL_SPECULAR = 0x1202;
int GL_SPOT_CUTOFF = 0x1206;
int GL_SPOT_DIRECTION = 0x1204;
int GL_SPOT_EXPONENT = 0x1205;
int GL_SRC_ALPHA = 0x0302;
int GL_SRC_ALPHA_SATURATE = 0x0308;
int GL_SRC_COLOR = 0x0300;
int GL_STACK_OVERFLOW = 0x0503;
int GL_STACK_UNDERFLOW = 0x0504;
int GL_STENCIL_BITS = 0x0D57;
int GL_STENCIL_BUFFER_BIT = 0x0400;
int GL_STENCIL_TEST = 0x0B90;
int GL_SUBPIXEL_BITS = 0x0D50;
int GL_TEXTURE = 0x1702;
int GL_TEXTURE_2D = 0x0DE1;
int GL_TEXTURE_COORD_ARRAY = 0x8078;
int GL_TEXTURE_ENV = 0x2300;
int GL_TEXTURE_ENV_COLOR = 0x2201;
int GL_TEXTURE_ENV_MODE = 0x2200;
int GL_TEXTURE_MAG_FILTER = 0x2800;
int GL_TEXTURE_MIN_FILTER = 0x2801;
int GL_TEXTURE_WRAP_S = 0x2802;
int GL_TEXTURE_WRAP_T = 0x2803;
int GL_TEXTURE0 = 0x84C0;
int GL_TEXTURE1 = 0x84C1;
int GL_TEXTURE2 = 0x84C2;
int GL_TEXTURE3 = 0x84C3;
int GL_TEXTURE4 = 0x84C4;
int GL_TEXTURE5 = 0x84C5;
int GL_TEXTURE6 = 0x84C6;
int GL_TEXTURE7 = 0x84C7;
int GL_TEXTURE8 = 0x84C8;
int GL_TEXTURE9 = 0x84C9;
int GL_TEXTURE10 = 0x84CA;
int GL_TEXTURE11 = 0x84CB;
int GL_TEXTURE12 = 0x84CC;
int GL_TEXTURE13 = 0x84CD;
int GL_TEXTURE14 = 0x84CE;
int GL_TEXTURE15 = 0x84CF;
int GL_TEXTURE16 = 0x84D0;
int GL_TEXTURE17 = 0x84D1;
int GL_TEXTURE18 = 0x84D2;
int GL_TEXTURE19 = 0x84D3;
int GL_TEXTURE20 = 0x84D4;
int GL_TEXTURE21 = 0x84D5;
int GL_TEXTURE22 = 0x84D6;
int GL_TEXTURE23 = 0x84D7;
int GL_TEXTURE24 = 0x84D8;
int GL_TEXTURE25 = 0x84D9;
int GL_TEXTURE26 = 0x84DA;
int GL_TEXTURE27 = 0x84DB;
int GL_TEXTURE28 = 0x84DC;
int GL_TEXTURE29 = 0x84DD;
int GL_TEXTURE30 = 0x84DE;
int GL_TEXTURE31 = 0x84DF;
int GL_TRIANGLE_FAN = 0x0006;
int GL_TRIANGLE_STRIP = 0x0005;
int GL_TRIANGLES = 0x0004;
int GL_TRUE = 1;
int GL_UNPACK_ALIGNMENT = 0x0CF5;
int GL_UNSIGNED_BYTE = 0x1401;
int GL_UNSIGNED_SHORT = 0x1403;
int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
int GL_VENDOR = 0x1F00;
int GL_VERSION = 0x1F02;
int GL_VERTEX_ARRAY = 0x8074;
int GL_XOR = 0x1506;
int GL_ZERO = 0;
@@ -0,0 +1,40 @@
**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package javax.microedition.khronos.opengles;
public interface GL11Ext extends GL {
int GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 0x8B9E;
int GL_MATRIX_INDEX_ARRAY_OES = 0x8844;
int GL_MATRIX_INDEX_ARRAY_POINTER_OES = 0x8849;
int GL_MATRIX_INDEX_ARRAY_SIZE_OES = 0x8846;
int GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 0x8848;
int GL_MATRIX_INDEX_ARRAY_TYPE_OES = 0x8847;
int GL_MATRIX_PALETTE_OES = 0x8840;
int GL_MAX_PALETTE_MATRICES_OES = 0x8842;
int GL_MAX_VERTEX_UNITS_OES = 0x86A4;
int GL_TEXTURE_CROP_RECT_OES = 0x8B9D;
int GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 0x889E;
int GL_WEIGHT_ARRAY_OES = 0x86AD;
int GL_WEIGHT_ARRAY_POINTER_OES = 0x86AC;
int GL_WEIGHT_ARRAY_SIZE_OES = 0x86AB;
int GL_WEIGHT_ARRAY_STRIDE_OES = 0x86AA;
int GL_WEIGHT_ARRAY_TYPE_OES = 0x86A9;
void glTexParameterfv(int target, int pname, float[] param, int offset);
@@ -0,0 +1,108 @@
**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package javax.microedition.khronos.opengles;
public interface GL11ExtensionPack extends GL {
int GL_BLEND_DST_ALPHA = 0x80CA;
int GL_BLEND_DST_RGB = 0x80C8;
int GL_BLEND_EQUATION = 0x8009;
int GL_BLEND_EQUATION_ALPHA = 0x883D;
int GL_BLEND_EQUATION_RGB = 0x8009;
int GL_BLEND_SRC_ALPHA = 0x80CB;
int GL_BLEND_SRC_RGB = 0x80C9;
int GL_COLOR_ATTACHMENT0_OES = 0x8CE0;
int GL_COLOR_ATTACHMENT1_OES = 0x8CE1;
int GL_COLOR_ATTACHMENT2_OES = 0x8CE2;
int GL_COLOR_ATTACHMENT3_OES = 0x8CE3;
int GL_COLOR_ATTACHMENT4_OES = 0x8CE4;
int GL_COLOR_ATTACHMENT5_OES = 0x8CE5;
int GL_COLOR_ATTACHMENT6_OES = 0x8CE6;
int GL_COLOR_ATTACHMENT7_OES = 0x8CE7;
int GL_COLOR_ATTACHMENT8_OES = 0x8CE8;
int GL_COLOR_ATTACHMENT9_OES = 0x8CE9;
int GL_COLOR_ATTACHMENT10_OES = 0x8CEA;
int GL_COLOR_ATTACHMENT11_OES = 0x8CEB;
int GL_COLOR_ATTACHMENT12_OES = 0x8CEC;
int GL_COLOR_ATTACHMENT13_OES = 0x8CED;
int GL_COLOR_ATTACHMENT14_OES = 0x8CEE;
int GL_COLOR_ATTACHMENT15_OES = 0x8CEF;
int GL_DECR_WRAP = 0x8508;
int GL_DEPTH_ATTACHMENT_OES = 0x8D00;
int GL_DEPTH_COMPONENT = 0x1902;
int GL_DEPTH_COMPONENT16 = 0x81A5;
int GL_DEPTH_COMPONENT24 = 0x81A6;
int GL_DEPTH_COMPONENT32 = 0x81A7;
int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 0x8CD1;
int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 0x8CD0;
int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 0x8CD3;
int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 0x8CD2;
int GL_FRAMEBUFFER_BINDING_OES = 0x8CA6;
int GL_FRAMEBUFFER_COMPLETE_OES = 0x8CD5;
int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 0x8CD6;
int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 0x8CD9;
int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES = 0x8CDB;
int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 0x8CDA;
int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 0x8CD7;
int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES = 0x8CDC;
int GL_FRAMEBUFFER_OES = 0x8D40;
int GL_FRAMEBUFFER_UNSUPPORTED_OES = 0x8CDD;
int GL_FUNC_ADD = 0x8006;
int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
int GL_FUNC_SUBTRACT = 0x800A;
int GL_INCR_WRAP = 0x8507;
int GL_INVALID_FRAMEBUFFER_OPERATION_OES = 0x0506;
int GL_MAX_COLOR_ATTACHMENTS_OES = 0x8CDF;
int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
int GL_MAX_RENDERBUFFER_SIZE_OES = 0x84E8;
int GL_MIRRORED_REPEAT = 0x8370;
int GL_NORMAL_MAP = 0x8511;
int GL_REFLECTION_MAP = 0x8512;
int GL_RENDERBUFFER_ALPHA_SIZE_OES = 0x8D53;
int GL_RENDERBUFFER_BINDING_OES = 0x8CA7;
int GL_RENDERBUFFER_BLUE_SIZE_OES = 0x8D52;
int GL_RENDERBUFFER_DEPTH_SIZE_OES = 0x8D54;
int GL_RENDERBUFFER_GREEN_SIZE_OES = 0x8D51;
int GL_RENDERBUFFER_HEIGHT_OES = 0x8D43;
int GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 0x8D44;
int GL_RENDERBUFFER_OES = 0x8D41;
int GL_RENDERBUFFER_RED_SIZE_OES = 0x8D50;
int GL_RENDERBUFFER_STENCIL_SIZE_OES = 0x8D55;
int GL_RENDERBUFFER_WIDTH_OES = 0x8D42;
int GL_RGB5_A1 = 0x8057;
int GL_RGB565_OES = 0x8D62;
int GL_RGB8 = 0x8051;
int GL_RGBA4 = 0x8056;
int GL_RGBA8 = 0x8058;
int GL_STENCIL_ATTACHMENT_OES = 0x8D20;
int GL_STENCIL_INDEX = 0x1901;
int GL_STENCIL_INDEX1_OES = 0x8D46;
int GL_STENCIL_INDEX4_OES = 0x8D47;
int GL_STENCIL_INDEX8_OES = 0x8D48;
int GL_STR = -1;
int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
int GL_TEXTURE_CUBE_MAP = 0x8513;
int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
int GL_TEXTURE_GEN_MODE = 0x2500;
int GL_TEXTURE_GEN_STR = 0x8D60;
@@ -0,0 +1,145 @@
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package javax.microedition.khronos.opengles;
public interface GL11 extends GL10 {
int GL_ACTIVE_TEXTURE = 0x84E0;
int GL_ADD_SIGNED = 0x8574;
int GL_ALPHA_SCALE = 0x0D1C;
int GL_ALPHA_TEST_FUNC = 0x0BC1;
int GL_ALPHA_TEST_REF = 0x0BC2;
int GL_ARRAY_BUFFER = 0x8892;
int GL_ARRAY_BUFFER_BINDING = 0x8894;
int GL_BLEND_DST = 0x0BE0;
int GL_BLEND_SRC = 0x0BE1;
int GL_BUFFER_ACCESS = 0x88BB;
int GL_BUFFER_SIZE = 0x8764;
int GL_BUFFER_USAGE = 0x8765;
int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
int GL_CLIP_PLANE0 = 0x3000;
int GL_CLIP_PLANE1 = 0x3001;
int GL_CLIP_PLANE2 = 0x3002;
int GL_CLIP_PLANE3 = 0x3003;
int GL_CLIP_PLANE4 = 0x3004;
int GL_CLIP_PLANE5 = 0x3005;
int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898;
int GL_COLOR_ARRAY_POINTER = 0x8090;
int GL_COLOR_ARRAY_SIZE = 0x8081;
int GL_COLOR_ARRAY_STRIDE = 0x8083;
int GL_COLOR_ARRAY_TYPE = 0x8082;
int GL_COLOR_CLEAR_VALUE = 0x0C22;
int GL_COLOR_WRITEMASK = 0x0C23;
int GL_COMBINE = 0x8570;
int GL_COMBINE_ALPHA = 0x8572;
int GL_COMBINE_RGB = 0x8571;
int GL_CONSTANT = 0x8576;
int GL_COORD_REPLACE_OES = 0x8862;
int GL_CULL_FACE_MODE = 0x0B45;
int GL_CURRENT_COLOR = 0x0B00;
int GL_CURRENT_NORMAL = 0x0B02;
int GL_CURRENT_TEXTURE_COORDS = 0x0B03;
int GL_DEPTH_CLEAR_VALUE = 0x0B73;
int GL_DEPTH_FUNC = 0x0B74;
int GL_DEPTH_RANGE = 0x0B70;
int GL_DEPTH_WRITEMASK = 0x0B72;
int GL_DOT3_RGB = 0x86AE;
int GL_DOT3_RGBA = 0x86AF;
int GL_DYNAMIC_DRAW = 0x88E8;
int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
int GL_FRONT_FACE = 0x0B46;
int GL_GENERATE_MIPMAP = 0x8191;
int GL_GENERATE_MIPMAP_HINT = 0x8192;
int GL_INTERPOLATE = 0x8575;
int GL_LINE_WIDTH = 0x0B21;
int GL_LOGIC_OP_MODE = 0x0BF0;
int GL_MATRIX_MODE = 0x0BA0;
int GL_MAX_CLIP_PLANES = 0x0D32;
int GL_MODELVIEW_MATRIX = 0x0BA6;
int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D;
int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897;
int GL_NORMAL_ARRAY_POINTER = 0x808F;
int GL_NORMAL_ARRAY_STRIDE = 0x807F;
int GL_NORMAL_ARRAY_TYPE = 0x807E;
int GL_OPERAND0_ALPHA = 0x8598;
int GL_OPERAND0_RGB = 0x8590;
int GL_OPERAND1_ALPHA = 0x8599;
int GL_OPERAND1_RGB = 0x8591;
int GL_OPERAND2_ALPHA = 0x859A;
int GL_OPERAND2_RGB = 0x8592;
int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
int GL_POINT_SIZE = 0x0B11;
int GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 0x8B9F;
int GL_POINT_SIZE_ARRAY_OES = 0x8B9C;
int GL_POINT_SIZE_ARRAY_POINTER_OES = 0x898C;
int GL_POINT_SIZE_ARRAY_STRIDE_OES = 0x898B;
int GL_POINT_SIZE_ARRAY_TYPE_OES = 0x898A;
int GL_POINT_SIZE_MAX = 0x8127;
int GL_POINT_SIZE_MIN = 0x8126;
int GL_POINT_SPRITE_OES = 0x8861;
int GL_POLYGON_OFFSET_FACTOR = 0x8038;
int GL_POLYGON_OFFSET_UNITS = 0x2A00;
int GL_PREVIOUS = 0x8578;
int GL_PRIMARY_COLOR = 0x8577;
int GL_PROJECTION_MATRIX = 0x0BA7;
int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E;
int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
int GL_RGB_SCALE = 0x8573;
int GL_SAMPLE_BUFFERS = 0x80A8;
int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
int GL_SAMPLES = 0x80A9;
int GL_SCISSOR_BOX = 0x0C10;
int GL_SHADE_MODEL = 0x0B54;
int GL_SRC0_ALPHA = 0x8588;
int GL_SRC0_RGB = 0x8580;
int GL_SRC1_ALPHA = 0x8589;
int GL_SRC1_RGB = 0x8581;
int GL_SRC2_ALPHA = 0x858A;
int GL_SRC2_RGB = 0x8582;
int GL_STATIC_DRAW = 0x88E4;
int GL_STENCIL_CLEAR_VALUE = 0x0B91;
int GL_STENCIL_FAIL = 0x0B94;
int GL_STENCIL_FUNC = 0x0B92;
int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
int GL_STENCIL_REF = 0x0B97;
int GL_STENCIL_VALUE_MASK = 0x0B93;
int GL_STENCIL_WRITEMASK = 0x0B98;
int GL_SUBTRACT = 0x84E7;
int GL_TEXTURE_BINDING_2D = 0x8069;
int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A;
int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092;
int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088;
int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A;
int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089;
int GL_TEXTURE_MATRIX = 0x0BA8;
int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F;
int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896;
int GL_VERTEX_ARRAY_POINTER = 0x808E;
int GL_VERTEX_ARRAY_SIZE = 0x807A;
int GL_VERTEX_ARRAY_STRIDE = 0x807C;
int GL_VERTEX_ARRAY_TYPE = 0x807B;
int GL_VIEWPORT = 0x0BA2;
int GL_WRITE_ONLY = 0x88B9;
void glGetPointerv(int pname, java.nio.Buffer[] params);
@@ -0,0 +1,30 @@
// Copyright 2006 The Android Open Source Project
// All Rights Reserved.
// This source file is automatically generated
package com.google.android.gles_jni;
import java.nio.Buffer;
import javax.microedition.khronos.opengles.GL11;
import android.graphics.Canvas;
public class GL11Impl implements GL11 {
// Private accessors for native code
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
Buffer _colorPointer = null;
Buffer _normalPointer = null;
Buffer _texCoordPointer = null;
Buffer _vertexPointer = null;
public GL11Impl() {
}
@@ -0,0 +1,282 @@
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
// Work around differences between the generated name and the actual name.
#define glBlendEquation glBlendEquationOES
#define glBlendEquationSeparate glBlendEquationSeparateOES
#define glBlendFuncSeparate glBlendFuncSeparateOES
#define glGetTexGenfv glGetTexGenfvOES
#define glGetTexGeniv glGetTexGenivOES
#define glGetTexGenxv glGetTexGenxvOES
#define glTexGenf glTexGenfOES
#define glTexGenfv glTexGenfvOES
#define glTexGeni glTexGeniOES
#define glTexGeniv glTexGenivOES
#define glTexGenx glTexGenxOES
#define glTexGenxv glTexGenxvOES
/* special calls implemented in Android's GLES wrapper used to more
* efficiently bound-check passed arrays */
extern "C" {
GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
}
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass OOMEClass;
static jclass UOEClass;
static jclass IAEClass;
static jclass AIOOBEClass;
static jclass G11ImplClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jmethodID allowIndirectBuffersID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
static jfieldID haveCheckedExtensionsID;
static jfieldID have_OES_blend_equation_separateID;
static jfieldID have_OES_blend_subtractID;
static jfieldID have_OES_framebuffer_objectID;
static jfieldID have_OES_texture_cube_mapID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInitBuffer(JNIEnv *_env)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
"allowIndirectBuffers", "(Ljava/lang/String;)Z");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
nativeClassInitBuffer(_env);
jclass IAEClassLocal =
_env->FindClass("java/lang/IllegalArgumentException");
jclass OOMEClassLocal =
_env->FindClass("java/lang/OutOfMemoryError");
jclass UOEClassLocal =
_env->FindClass("java/lang/UnsupportedOperationException");
jclass AIOOBEClassLocal =
_env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
jint offset;
void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return (void *) (jint) pointer;
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
if (*array == NULL) {
return (void*) NULL;
}
offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
return (void *) ((char *) data + offset);
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
extern "C" {
extern char* __progname;
}
static bool
allowIndirectBuffers(JNIEnv *_env) {
static jint sIndirectBufferCompatability;
if (sIndirectBufferCompatability == 0) {
jobject appName = _env->NewStringUTF(::__progname);
sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
}
return sIndirectBufferCompatability == 2;
}
static void *
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
if (!buffer) {
return NULL;
}
void* buf = _env->GetDirectBufferAddress(buffer);
if (buf) {
jint position = _env->GetIntField(buffer, positionID);
jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
buf = ((char*) buf) + (position << elementSizeShift);
} else {
if (allowIndirectBuffers(_env)) {
jarray array = 0;
jint remaining;
buf = getPointer(_env, buffer, &array, &remaining);
if (array) {
releasePointer(_env, array, buf, 0);
}
} else {
_env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
}
}
return buf;
}
static int
getNumCompressedTextureFormats() {
int numCompressedTextureFormats = 0;
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
return numCompressedTextureFormats;
}
// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
// terminated by either 0 or space, while pExtension is terminated by 0.
static bool
extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
while (true) {
char a = *pExtensions++;
char b = *pExtension++;
bool aEnd = a == '\0' || a == ' ';
bool bEnd = b == '\0';
if ( aEnd || bEnd) {
return aEnd == bEnd;
}
if ( a != b ) {
return false;
}
}
}
static const GLubyte*
nextExtension(const GLubyte* pExtensions) {
while (true) {
char a = *pExtensions++;
if ( a == '\0') {
return pExtensions-1;
} else if ( a == ' ') {
return pExtensions;
}
}
}
static bool
checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
if (extensionEqual(pExtensions, pExtension)) {
return true;
}
}
return false;
}
static bool
supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
_env->SetBooleanField(impl, haveCheckedExtensionsID, true);
const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
_env->SetBooleanField(impl, have_OES_blend_equation_separateID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
_env->SetBooleanField(impl, have_OES_blend_subtractID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
_env->SetBooleanField(impl, have_OES_framebuffer_objectID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
_env->SetBooleanField(impl, have_OES_texture_cube_mapID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
}
return _env->GetBooleanField(impl, fieldId);
}
// --------------------------------------------------------------------------
@@ -0,0 +1,22 @@
/* //device/java/android/javax/microedition/khronos/opengles/GL.java
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package javax.microedition.khronos.opengles;
public interface GL {
}
@@ -0,0 +1,84 @@
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
package com.google.android.gles_jni;
import android.app.ActivityThread;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.os.Build;
import android.util.Log;
import java.nio.Buffer;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL10Ext;
import javax.microedition.khronos.opengles.GL11;
import javax.microedition.khronos.opengles.GL11Ext;
import javax.microedition.khronos.opengles.GL11ExtensionPack;
public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack {
// Private accessors for native code
native private static void _nativeClassInit();
static {
_nativeClassInit();
}
Buffer _colorPointer = null;
Buffer _normalPointer = null;
Buffer _texCoordPointer = null;
Buffer _vertexPointer = null;
Buffer _pointSizePointerOES = null;
Buffer _matrixIndexPointerOES = null;
Buffer _weightPointerOES = null;
private boolean haveCheckedExtensions;
private boolean have_OES_blend_equation_separate;
private boolean have_OES_blend_subtract;
private boolean have_OES_framebuffer_object;
private boolean have_OES_texture_cube_map;
public GLImpl() {
}
public void glGetPointerv(int pname, java.nio.Buffer[] params) {
throw new UnsupportedOperationException("glGetPointerv");
}
private static boolean allowIndirectBuffers(String appName) {
boolean result = false;
int version = 0;
IPackageManager pm = ActivityThread.getPackageManager();
try {
ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0);
if (applicationInfo != null) {
version = applicationInfo.targetSdkVersion;
}
} catch (android.os.RemoteException e) {
// ignore
}
Log.e("OpenGLES", String.format(
"Application %s (SDK target %d) called a GL11 Pointer method with an indirect Buffer.",
appName, version));
if (version <= Build.VERSION_CODES.CUPCAKE) {
result = true;
}
return result;
}
@@ -0,0 +1,11 @@
#include <string.h>
/* const GLubyte * glGetString ( GLenum name ) */
static
jstring
android_glGetString
(JNIEnv *_env, jobject _this, jint name) {
const char * chars = (const char *)glGetString((GLenum)name);
jstring output = _env->NewStringUTF(chars);
return output;
}
@@ -0,0 +1,4 @@
public String glGetString(
int name
);
@@ -0,0 +1,4 @@
public String glGetString(
int name
);
@@ -0,0 +1,16 @@
// C function const GLubyte * glGetString ( GLenum name )
public native String _glGetString(
int name
);
public String glGetString(
int name
) {
String returnValue;
returnValue = _glGetString(
name
);
return returnValue;
}
@@ -0,0 +1 @@
{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },