android - 关闭 Activity 会导致 monogame 的表面缓冲区错误
问题描述
我有一个单人游戏,我要从中启动一项活动以登录。游戏运行良好。当我启动该活动时,它也运行良好,并且游戏循环似乎被阻止了。当我完成()活动或执行 OnBackPressed()时,真正的问题出现了。我得到表面缓冲区错误,屏幕变黑但游戏循环恢复。如果我尝试在模拟器中关闭主机 GPU,则应用程序将在关闭活动时崩溃。
When activity opens:
[EGL_emulation] tid 18496: eglSurfaceAttrib(1210): error 0x3009 (EGL_BAD_MATCH)
[OpenGLRenderer] Failed to set EGL_SWAP_BEHAVIOR on surface 0x81448da0, error=EGL_BAD_MATCH
When back pressed in activity or calling Finish():
[EGL_emulation] eglMakeCurrent: 0xa4805a80: ver 2 0 (tinfo 0x82aff0b0)
[EGL_emulation] tid 18496: eglSurfaceAttrib(1210): error 0x3009 (EGL_BAD_MATCH)
[OpenGLRenderer] Failed to set EGL_SWAP_BEHAVIOR on surface 0x81456b00, error=EGL_BAD_MATCH
[EGL_emulation] eglMakeCurrent: 0xa4805a80: ver 2 0 (tinfo 0x82aff0b0)
[Surface] getSlotFromBufferLocked: unknown buffer: 0x0
[EGL_emulation] tid 18458: swapBuffers(531): error 0x300d (EGL_BAD_SURFACE)
[IInputConnectionWrapper] finishComposingText on inactive InputConnection
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
Without using host gpu it crashes with:
[Surface] getSlotFromBufferLocked: unknown buffer: 0x7a697320
解决方案
不幸的是,我最终不得不在 monogame 中创建自己的软键盘,因此不再启动任何 android 活动。
推荐阅读
- c# - SystemEvents.TimeChanged 未触发(已更新!)
- c++ - 二进制“=”:未找到采用“_Ty”类型的左侧操作数的运算符(或没有可接受的转换)
- xcode - macOS 泄漏命令未在 memgraph 上保存回溯
- batch-file - 如果在批处理文件中,我应该如何使用空格
- vim - 如何从谷歌 colab 的插入模式恢复正常模式
- azure - 使用 API 管理服务及其 API 的 ARM 模板进行部署时出现问题
- php - 如何使用 Jquery 拆分两个数组并传递给 ajax?
- javascript - 我应该如何使用 Gatsby.js 生成缩略图和全尺寸图像
- django - 带有 Postgresql 的 Django:在本地机器上创建的重复对象和远程服务器上的三重对象
- postgresql - Postgres 归档没有按预期运行,有人有什么建议吗?