【问题标题】:Closing Activity causes surface buffer errors with monogame关闭 Activity 会导致单一游戏的表面缓冲区错误
【发布时间】:2018-12-01 21:40:57
【问题描述】:

我有一个单人游戏,我要从中启动一项活动以登录。游戏运行良好。当我启动该活动时,它也运行良好,并且游戏循环似乎被阻止了。真正的问题出现在我 Finish() 活动或执行 OnBackPressed() 时。我得到表面缓冲区错误,屏幕变黑但游戏循环恢复。如果我尝试在模拟器中关闭 Host GPU,则应用会在关闭 Activity 时崩溃。

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

【问题讨论】:

  • 在完成activity之前,你应该检查UI activity是否需要暂停。不要直接关闭Host GPU。

标签: android xamarin.android monogame


【解决方案1】:

不幸的是,我最终不得不在 monogame 中创建自己的软键盘,因此不再启动任何 android 活动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-26
    • 2016-07-27
    • 2013-02-17
    • 2021-10-12
    相关资源
    最近更新 更多