当我设置模板大小 > 时,setEGLConfigChooser 使应用程序崩溃0
这是当前的代码
import android.os.Bundle;
import android.app.Activity;
import android.opengl.GLSurfaceView;
public class OpenglstencilActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GLSurfaceView view = new GLSurfaceView(this);
view.setEGLConfigChooser(8, 8, 8, 8, 16, 4);
view.setRenderer(new OpenGLRenderer());
setContentView(view);
}
}
,我更新了清单,以包含
如果我将模板大小从 4 更改为 0,则应用程序将加载。 0 以外的任何值都会出现非法参数异常。我需要设置模板大小,因为我正在尝试使用模板缓冲区。
有什么想法吗?
this is the current code
import android.os.Bundle;
import android.app.Activity;
import android.opengl.GLSurfaceView;
public class OpenglstencilActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GLSurfaceView view = new GLSurfaceView(this);
view.setEGLConfigChooser(8, 8, 8, 8, 16, 4);
view.setRenderer(new OpenGLRenderer());
setContentView(view);
}
}
and i updated the manifest to include
if i change the stencilsize from 4 to 0 then the app will load. any value other than 0 and i get an illegal argument exception. i need the stencil size set as im trying to use the stencil buffer.
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 Android 模拟器,则没有任何 EGL 配置适合启用模板。
所以在模拟器上使用模板并不走运。
如果您使用的是设备,那么情况就不同了,这个答案将是错误的。
If you are using the Android emulator, none of the EGL configurations are suitable to enable stencil.
So no luck for using stencil on the emulator.
If you are using a device, then it is a different matter and this answer would be wrong.