Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] Enable the ability to use Godot as a subview within an Android app #39558

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented Jun 15, 2020

This PR addresses Godot Proposal #1064, and provides to advanced users and clients of the Godot Android library the ability to embed Godot as a subview within an Android app.

Typical use-cases include:

  • map-like applications where the screen real-estate is split between a graphic view where the map is rendered, and a platform native view providing users with platform UI components
  • AR applications
  • shopping applications using 3D generated models
  • etc...

This feature should significantly improves Godot's use-cases within the Android developer ecosystem. At the moment, Android apps that require custom graphics beyond what the platfrom can offer have limited and non-appealing options:

  • Either write raw opengl from scratch: this represents a huge learning curve for most Android developers as opengl is a not an area that most are familiar with, and Android does not provide the tooling to make that process easier.
  • Either use a user-friendly game engine: as mentioned in the proposal, most game engines (Godot up to version 3.2.2, Unity, etc...) take over the entire screen display preventing developers from mixing a custom graphics view with a platform native view, and forcing them to either develop the entire app using the game engine, or give up on the functionality that the custom graphics view would provide.

This feature will enable developers to use Godot, an easy to use and user-friendly game engine, for their custom graphics needs without requiring a full rewrite or re-architecture of their Android applications.

Note:

  • Only one Godot subview is supported within an Activity at a time.
  • I performed simple build and run tests using a regular 3D Godot Android project and VR Godot Android project and things seem to work as expected. More thorough testing is needed to ensure that there's no performance degradation or hidden subtle bugs.
  • Targets Godot v3.2.3 for initial release.

Backport for PR #39855

@m4gr3d m4gr3d changed the title [WIP] [3.2] Enable the ability to use Godot as a subview within an Android app [3.2] Enable the ability to use Godot as a subview within an Android app Jun 26, 2020
@m4gr3d
Copy link
Contributor Author

m4gr3d commented Jun 26, 2020

@akien-mga Now that 3.2.2.stable is out(!), this is ready to be merged and tested for 3.2.3.

@akien-mga akien-mga merged commit 28c0088 into godotengine:3.2 Jun 26, 2020
@akien-mga
Copy link
Member

Thanks!

@m4gr3d m4gr3d deleted the godot_fragment_3_2 branch June 27, 2020 17:52
@akien-mga
Copy link
Member

As we discussed yesterday, since Godot 3.2.3 is planned as a bugfix release to solve some regressions in 3.2.2, and this new features need some more testing for us to be confident about it, we'll temporarily revert it (and keep it separate in a feature branch), and merge again after 3.2.3 has been released.

@akien-mga
Copy link
Member

Reverted with 0246a1a.

The https://github.com/godotengine/godot/tree/3.2-android-subview branch has this commit re-applied on top of the current 3.2, so we can get testing and further changes there and eventually merge into 3.2 for 3.2.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants