我有一个问题,那是什么?
E/EGL_emulation: tid 3912: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
我应该怎么做才能解决该错误?
public class Main extends AppCompatActivity {
public TextView score;
public ImageView alergator1;
public ImageView alergator2;
public FrameLayout frame;
public int scoreINT;
public float frameHigh;
public float frameWidh;
public float alergator1X;
public float alergator1Y;
public float alergator2X;
public float alergator2Y;
public ImageView miscare;
public int x;
private Handler handler = new Handler();
private static Timer timer = new Timer();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
score = (TextView) findViewById(R.id.Score);
alergator1 = (ImageView) findViewById(R.id.runner);
alergator2 = (ImageView) findViewById(R.id.runner2);
frame = (FrameLayout) findViewById(R.id.Frame);
frame.post(new Runnable() {
@Override
public void run() {
frameHigh = frame.getHeight();
frameWidh = frame.getWidth();
}
});
alergator1.post(new Runnable() {
@Override
public void run() {
alergator1X = frameWidh / 2;
alergator1.setX(alergator1X);
alergator1Y = frameHigh - 250;
alergator1.setY(alergator1Y);
}
});
alergator2.post(new Runnable() {
@Override
public void run() {
alergator2X = frameWidh / 2;
alergator2.setX(alergator2X);
alergator2Y = frameHigh - 250;
alergator2.setY(alergator2Y);
}
});
timer.schedule(new TimerTask() {
@Override
public void run() {
handler.post(new Runnable() {
@Override
public void run() {
x++;
if (x % 2 == 0) {
alergator1.setVisibility(View.INVISIBLE);
alergator2.setVisibility(View.VISIBLE);
} else {
alergator2.setVisibility(View.INVISIBLE);
alergator1.setVisibility(View.VISIBLE);
}
}
});
}
}, 0, 900);
这就是代码,应用程序运行正确,但我想知道发生了什么。也许我的代码比较乱,但我是初学者。
EGL 的意思模拟图形库。 Android 移动设备操作系统使用 EGL 进行 3D 图形渲染。
从 wiki 获取更多关于 EGL 的知识:https://en.wikipedia.org/wiki/EGL_(API)
When it says EGL_BAD_MATCH, your Emulated Graphics Library is which you/system selected is bad. There are two EGL modes as shown in below pic.
.
Solution: 哪个模式出现问题,只需更改为其他模式,就可以解决。请注意,在软件模拟模式下运行可能比在硬件模拟模式下设置的运行速度慢得多。在某些情况下,会抛出错误(已显示)但应用程序运行正常。如果是这种情况,您可能希望忽略错误并享受卓越的图形模拟。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)