Skip to content

Commit

Permalink
at least the shader programs compile without errors...
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawrence D'Oliveiro committed Jul 20, 2012
1 parent fffe099 commit 4a5b32c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions jni/gl_useful.c
@@ -1,6 +1,7 @@
/*
Useful OpenGL stuff. This provides an alternative to the broken
android.opengl.GLES20.glGetShaderInfoLog routine.
android.opengl.GLES20.glGetShaderInfoLog routine on older Android
versions.
Copyright 2012 by Lawrence D'Oliveiro <ldo@geek-central.gen.nz>.
Expand Down Expand Up @@ -31,10 +32,10 @@ static jstring get_shader_info_log
jobject this,
jint shader_id
)
/* needed because android.opengl.GLES20.glGetShaderInfoLog doesn't return anything.
The bug appears to be that glGetShaderiv of GL_INFO_LOG_LENGTH returns 0,
according to this bug report <http://code.google.com/p/android/issues/detail?id=9953>,
so I must avoid using that. */
/* needed because android.opengl.GLES20.glGetShaderInfoLog doesn't return anything,
at least on Android 2.2. The bug appears to be that glGetShaderiv of GL_INFO_LOG_LENGTH
returns 0, according to this bug report
<http://code.google.com/p/android/issues/detail?id=9953>, so I must avoid using that. */
{
const size_t msgmax = 4096; /* should be plenty big enough */
char * const msg = calloc(1, msgmax);
Expand Down
3 changes: 2 additions & 1 deletion src/GLUseful.java
Expand Up @@ -71,7 +71,8 @@ public class GLUseful
(
int ShaderID
);
/* needed because android.opengl.GLES20.glGetShaderInfoLog doesn't return anything */
/* needed because android.opengl.GLES20.glGetShaderInfoLog doesn't return anything,
at least on Android 2.2. */

/*
Shader programs
Expand Down
2 changes: 2 additions & 0 deletions src/GeomBuilder.java
Expand Up @@ -354,6 +354,8 @@ private static class UniformInfo
/* vertex shader: */
VS.toString(),
/* fragment shader: */
"precision mediump float;\n"
+
"varying vec4 front_color, back_color;\n"
+
"\n"
Expand Down

0 comments on commit 4a5b32c

Please sign in to comment.