Skip to content

Android port creates a separate rendering thread #696

@Alex2772

Description

@Alex2772

All work on AUI's android port is being done in Graphics Thread (the dedicated opengl thread created by GLSurfaceView).

SDL

SDL on Android does not use GLSurfaceView.
It creates a plain SurfaceView (or a TextureView in newer builds) and
obtains an ANativeWindow from that surface. SDL then creates an EGL
context directly on that native window and performs all OpenGL ES calls
through EGL.

So the rendering pipeline is:

Java  →  SurfaceView  →  ANativeWindow  →  SDL (EGL)  →  OpenGL ES

GLSurfaceView is an Android helper that already sets up an EGL
context for you; SDL bypasses it and manages the EGL context itself,
giving it full control over the rendering thread and the event loop.

Further steps

  • solution 1: android is the only platform where rendering is being done in separate thread. We can use SDL's solution to use a single thread only.
  • solution 2: we can move all aui's processing to UI thread in exception to rendering. All OpenGL stuff will be done in Graphics Thread, like android wants. To implement this we can use command queue from GPU Batching #695 GPU batching #476 .

While (2) is more perfect from engineering point of view and AUI will probably deal with it fine, but I don't want to complicate people's lives by incorporating multithreading in their application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions