aui-framework / aui-framework/aui

Android port creates a separate rendering thread

Open
#696 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
598
Forks
44
Avg merge
17h 56m
Merged PRs (30d)
3

Description

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 #695 #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.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Android port description and compare SDL's SurfaceView/ANativeWindow/EGL flow with the current GLSurfaceView-based rendering thread. Review the command-queue work referenced in #695 and #476, then determine which of the two proposed threading approaches should be implemented. Done means the Android rendering and processing model is selected and the port is updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cpp
Domain
mobile-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.