0
我学习的OpenGL Android上。我已经写在GlSurfaceView在布局XML声明的应用程序(片段...)GlSurfaceView渲染器不会被调用
<FrameLayout
android:id="@+id/framelay"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.nelsondev.myha3ogl.M3View
android:id="@+id/m3SurfView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
...并在其构造的渲染器设置:
public M3View(Context context, AttributeSet attrs) {
super(context, attrs);
renderer = new M3Renderer(context);
setRenderer(renderer);
}
当活动收到onResume/onPause它正确调用GlSurfaceView方法。 但是渲染器从未开始!在断点onSurfaceCreated()和渲染等方法永远不会被击中,并没有什么渲染。我怎么知道这里发生了什么?
其实,我只是检查,我想我的回答你刚才的问题是错误的,实际上,启动()被调用的GLSurfaceView时首先布局(即当你调用`的setContentView(framelay)`或`的setContentView(R.layout.graphics)`与GLSurfaceView为/ framelay的孩子在文件graphics.xml),而不是当'setRenderer`被称为 – 2011-12-14 14:01:18