安卓/的OpenGL-ES 2.0:setDebugFlags没有做什么吗? [英] Android/OpenGL-ES 2.0: setDebugFlags doesn't do anything?

查看:362
本文介绍了安卓/的OpenGL-ES 2.0:setDebugFlags没有做什么吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想利用setDebugFlags推荐这里扫描OpenGL的错误:

I'm trying to utilize setDebugFlags as recommended here to scan for opengl errors:

http://developer.android.com/resources/articles/glsurfaceview.html

我把它放在我的surfaceview的构造函数:

I put it in my surfaceview's constructor:

public MySurfaceView(Context context, AttributeSet attrs) {
    super(context, attrs);
    setEGLContextClientVersion(2);
    setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS);
    _renderer = new MyRenderer(getContext());
    setRenderer(_renderer);
    setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
}

不过,跑我没有看到详细的logcat什么时候,无论是在我的会话过滤器或所有消息。没有OpenGL调用,无OpenGL的错误。

Yet when running I don't see anything in verbose logcat, either under my session filter or all messages. No opengl calls, no opengl errors.

我手动检查错误在每一帧的末尾,我有一个错误,但我不知道它是从哪里还没有到来。我失去了一些东西明显得到setDebugFlags工作?

I'm manually checking for error at the end of each frame and I do have an error, but I don't know where it is coming from yet. Am I missing something obvious to get setDebugFlags to work?

推荐答案

这是由于这样的包装作品。请参阅<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.2_r1.1/android/opengl/GLSurfaceView.java#GLSurfaceView.EglHelper.createSurface%28android.view.SurfaceHolder%29"相对=nofollow> EglHelper的createSurface 的方法,这就是 mDebugFlags 使用的唯一的地方。它包装 GL10 实例,并将其返回。但是,由于您使用的是ES 2.0,则必须使用静态函数调用 GLES20 ,不能包裹是做的方式。

This is due to the way the wrapper works. See the EglHelper's createSurface method, which is the only place where mDebugFlags is used. It wraps the GL10 instance and returns it. However, since you're using ES 2.0, you must use static function calls to GLES20, that cannot be wrapped the way it is done.

还是的更好,即使你只使用GLES通过调用 GL10 实例方法,设置调试标志将<一href="http://stackoverflow.com/questions/9969163/classcaseexception-on-gl11extensionpack-rendering-to-texture-on-opengl-android/9981109#9981109">$p$pvent您使用的扩展接口。 GL11 似乎是<一个href="http://$c$c.google.com/p/android/issues/detail?id=5183&q=setdebugflags&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars"相对=nofollow>在这方面完全不支持。这个bug现在已经2岁多,所以更好地实施自己的东西; JOGL 似乎有一个不错的层次,但是,我没有的真正的看着它,所以我不能肯定。

Still better, even if you used only GLES by calling into GL10 instance methods, setting debug flags will prevent you from using the extension interfaces. GL11 seems to be totally unsupported in this regard. This bug is now over 2 years old, so better implement something yourself; JOGL seems to have a nice hierarchy, however, I didn't really look at it, so I cannot be sure.

这篇关于安卓/的OpenGL-ES 2.0:setDebugFlags没有做什么吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆