glGetShaderInfoLog returns empty string (android)

℡╲_俬逩灬. 提交于 2019-11-29 06:55:46

You're suffering from a bug. I worked around by using the old GL ES 2.0 bindings to get a functioning glGetShaderInfoLog. Like this:

import com.badlogic.gdx.backends.android.AndroidGL20;
...
AndroidGL20 gl2 = new AndroidGL20();
Log.e(TAG, gl2.glGetShaderInfoLog(shader));

I still use the standard GLES20 wrapper library for everything else, so this was simple to drop into my codebase. The two wrappers apparently can coexist without any problems.

Just incase anyone does find this question as they have encountered the same problem, the only way I have found to "get around it" is to compile the shader with another App (such as Rendermonkey). Not ideal, but it got me further in my project!

I had the same problem.

  1. Make sure you have the following in ApplicationManufest.xml:

    <uses-feature android:glEsVersion="0x00020000" android:required="true" />

  2. Call this after initializing a GLSurfaceView

glSurfaceView.SetEGLContextClientVersion(2);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!