Skip to content

Create an Android build#459

Draft
tophyr wants to merge 35 commits intoDescentDevelopers:mainfrom
tophyr:android
Draft

Create an Android build#459
tophyr wants to merge 35 commits intoDescentDevelopers:mainfrom
tophyr:android

Conversation

@tophyr
Copy link
Contributor

@tophyr tophyr commented Jun 24, 2024

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

Adds Android as a supported platform. Uses Gradle to perform the build overall.

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

@Lgt2x
Copy link
Member

Lgt2x commented Jun 24, 2024

Just a suggestion... You can add the __LINUX__ define for android platforms instead of adding it to every check

@tophyr
Copy link
Contributor Author

tophyr commented Jun 24, 2024

Just a suggestion... You can add the __LINUX__ define for android platforms instead of adding it to every check

SDL specifically undefines __LINUX__ when ANDROID is defined, unfortunately.

@tophyr tophyr marked this pull request as ready for review June 26, 2024 22:29
@tophyr tophyr force-pushed the android branch 3 times, most recently from 40bc996 to 142c739 Compare July 13, 2024 04:12
@tophyr
Copy link
Contributor Author

tophyr commented Jul 13, 2024

Ready for review.

Includes #493, #492, #469, and #465 as dependencies (see merge commit at base). Those PRs should be reviewed and merged prior to this one; marking this PR as a draft until then.

@tophyr tophyr marked this pull request as draft July 13, 2024 04:22
@tophyr tophyr force-pushed the android branch 2 times, most recently from bf7e6eb to 18169e5 Compare July 13, 2024 04:57
@tophyr tophyr requested a review from Lgt2x July 13, 2024 04:57
@Jayman2000 Jayman2000 mentioned this pull request Jul 17, 2024
13 tasks
@tophyr tophyr force-pushed the android branch 3 times, most recently from a5dc732 to 3d4601e Compare December 30, 2024 07:50
@tophyr tophyr marked this pull request as ready for review December 30, 2024 07:51
@tophyr tophyr mentioned this pull request Dec 30, 2024
13 tasks
@tophyr tophyr requested a review from pzychotic December 30, 2024 07:53
@tophyr
Copy link
Contributor Author

tophyr commented Dec 30, 2024

@Lgt2x this is finally ready! The game builds, has a mechanism to easily (and legally) put gamedata on the device, and will start up a level.

There's still a fair bit of work to do in order get the game playable, but at this point I think it's stable enough to start relying on build signals from GitHub CI.

Do note that this now PR includes the ExternalProject change from #465.

@tophyr tophyr force-pushed the android branch 5 times, most recently from 5165157 to fa99fa4 Compare December 31, 2024 18:35
@tophyr tophyr marked this pull request as draft April 13, 2025 05:21
tophyr added 12 commits January 13, 2026 02:40
# Conflicts:
#	.github/workflows/build.yml
#	CMakeLists.txt
#	renderer/HardwareOpenGL.cpp
#	renderer/shaders/fragment.glsl
Using the ExternalProject module didn't give the simplicity I was hoping for, and caused other problems with the Android build, so moving away from it in favor of just presets and specifically-separate host and target builds.

This reverts commit 0ef140d.

# Conflicts:
#	.github/workflows/build.yml
Using the ExternalProject module didn't give the simplicity I was hoping for, and caused other problems with the Android build, so moving away from it in favor of just presets and specifically-separate host and target builds.

In order to use HogMaker in cross-compile builds, configure and build the project for the host first (using `--target HogMaker` if you want to build just HogMaker) and then specify the HogMaker tool binary path with `-DHOGMAKER_PATH=`.

This reverts commit 0ef140d.

# Conflicts:
#	.github/workflows/build.yml
SDL EventFilters were *always* the incorrect way to handle input, but now in SDL3 are even more incorrect as they run on the thread that accepts the input, not the thread that's intended to handle it. (This is a significant difference on Android and iOS.)

The fix is surprisingly simple: Just poll for input in the OS defer handler. This is already called at the start of every type of every frame, so it is the perfect place to grab input.
We're going to start handling SDL touch events ourselves, so we don't want fake mouse events getting in the way.
Process and track touchscreen events.
Text entry on Android and iOS devices is accomplished by displaying an "Input Method Editor", or IME (soft keyboard), over the running application. The UI model is such that the application is supposed to adjust its graphical layout so that the text-entry field is repositioned to fit above the newly-displayed keyboard. This change adds support for discovering what the IME's insets are, and adjusting the top-level window to be displayed within the area not covered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants