Converting from GLSurfaceView to TextureView (via GLTextureView)

前端 未结 4 1783
感情败类
感情败类 2020-11-30 21:49

When Android 4.0 (Ice Cream Sandwich) was released, a new view was introduced into the sdk. This View is the TextureView. In the documentation, it says that the TextureView

4条回答
  •  鱼传尺愫
    2020-11-30 22:31

    Thanks Mr. Goodale's and Mr. Davies for answers!

    I have some extra about conversion GLSurfaceView to GLTextureView. The first is about render mode. As described there just remove the requestRender() call in onSurfaceTextureUpdated.

    The second is about
    mGLESVersion = SystemProperties.getInt("ro.opengles.version", ConfigurationInfo.GL_ES_VERSION_UNDEFINED); Just use link, but you need Context to do context.getClassLoader(); You can call reflection version of getInt from init() and save result in static field sGLESVersion = getInt(getContext(), "ro.opengles.version",ConfigurationInfo.GL_ES_VERSION_UNDEFINED);

    And the last easiest change is about EGLLogWrapper.getErrorString(error); Just copy getErrorString from EGLLogWrapper sources.

    See the final version of my conversion GLSurfaceView to GLTextureView on GitHub Gist

提交回复
热议问题