1

Note II (4.1.2): https://i.stack.imgur.com/mmVNf.png

Nexus 7 (4.3): https://i.stack.imgur.com/R9c8p.png

Code used: http://developer.android.com/training/graphics/opengl/index.html

As far as I can tell, both the phone and the version of Android should support OpenGL 2.0.

Also, I tried running the app after toggling the various GPU settings in the dev panel but they made no difference so I restored it to default. If anyone is wondering, no "layout boundary" is shown for the square or triangle.

I also tried switching up the background color to see if it was just drawing one over the other, but that did nothing.

keaukraine
  • 5,315
  • 29
  • 54
  • In my case there is any no problems using opengl es 2.0 and, now my apps are still in services without complaints of that. All these are using NDK c++ with opengl es 2.0 though. However because all platforms have different specs, sometimes I had to change my shader codes for some devices' artifacts. In your case it is not opengl supporting problem It may be just setting problem. So just go over the context or the manifest file – Sung Dec 13 '13 at 11:12
  • This example has a lot of mistakes, see discussion http://stackoverflow.com/questions/11925647/is-googles-android-opengl-tutorial-teaching-incorrect-linear-algebra – Paha Dec 16 '13 at 08:24

2 Answers2

0

I ended up continuing development on my Nexus7, and when I got further I flashed it to my Note II and it worked again! If you want, you can play with my code here: stable commit, code for that commit.

Set this as community wiki, so if someone tracks down the original problem, feel free to add it here.

Reddit /r/gamedev thread

0

In general, the way to debug this is with glGetError(). Here's the method I use, which has helped me debug OpenGL. It checks if any errors have occurred, and throws an exception so you can debug. You can just copy-paste it somewhere and then call it in between draw calls to figure out what's causing problems.

Note: Instead of my hacky "DEBUGGING" flag below, you can also check whether Eclipse compiled the app in debug mode:

/** This method will check for any OpenGL errors that have occurred since the last time you called it.
 * If it finds one, it will cause the program to crash immediately and output a stacktrace.
 * To debug OpenGL, call this in between your OpenGL functions to zero in on where the error is.
 * @param operationDescription Note to yourself about what you were doing, to be printed if there's an error
 */
static final void checkGlError(String operationDescription){

    if(Main.DEBUGGING){//only do the program-crashing thing in debug mode. In release mode, try to ride through errors. Replace my boolean with yours.
        int errorCode;
        while ((errorCode = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
            String error;
            switch(errorCode) {
                case GLES20.GL_INVALID_OPERATION:      error="INVALID_OPERATION";      break;
                case GLES20.GL_INVALID_ENUM:           error="INVALID_ENUM";           break;
                case GLES20.GL_INVALID_VALUE:          error="INVALID_VALUE";          break;
                case GLES20.GL_OUT_OF_MEMORY:          error="OUT_OF_MEMORY";          break;
                case GLES20.GL_INVALID_FRAMEBUFFER_OPERATION:  error="INVALID_FRAMEBUFFER_OPERATION";  break;
                default: error="Unknown error code";
            }
            Log.e("checkGlError", operationDescription + ": glError " + error);
            throw new RuntimeException(operationDescription + ": glError " + error);
        }
    }
}
Community
  • 1
  • 1
Luke
  • 5,329
  • 2
  • 29
  • 34