Skip to content

ebiten: add an API to run on a UI thread #3385

@hajimehoshi

Description

@hajimehoshi

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

I propose to have an API to run a given function on a main (UI) thread:

// RunOnUIThread runs the function f on the UI thread.
func RunOnUIThread(f func())

Why is this needed?

We want a safe area to access native APIs. Ebitengine runs its application on the main (UI) thread, but once RunGame starts, there is no way to run something from the thread.

An actual use case is to modify a native window, for example. See also #3381 (comment)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions