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

Enable the ability to use Godot as a subview within an Android app #39855

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented Jun 26, 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.

@akien-mga
Copy link
Member

Thanks!

@bfelbo
Copy link

bfelbo commented Sep 11, 2020

This is amazing, thanks! 🙌

It would be incredible to also support this on iOS (see godotengine/godot-proposals#1473). Do you know what's needed to add support for iOS?

@m4gr3d
Copy link
Contributor Author

m4gr3d commented Sep 15, 2020

@bfelbo I'm not familiar with iOS so I can't speak on what's needed, but Godot's flexible architecture should also make that possible.
cc @naithar @godotengine/ios

@naithar
Copy link
Contributor

naithar commented Sep 15, 2020

Well, it's possible for iOS for sure, but would probably require lots of changes.
Currently Godot depends a lot on AppDelegate's methods. Probably switching to Notifications could help, but testing would be needed. Header files should be provided as well.
I'm also unsure if it's really needed. If iOS plugin PR gets merged bringing additional functionality will not be an issue.

@bfelbo
Copy link

bfelbo commented Sep 15, 2020

Thanks for the quick replies!

I definitely get why it could require a decent amount of work. I think though that it could unlock a lot of cool uses of Godot! Perhaps it makes sense to move the discussion to this proposal (same as linked above), which lists out some of the benefits? 😊

I'd also be happy to help in any way I can if that's of interest.

@madhawa-se

This comment was marked as off-topic.

@realkotob

This comment was marked as off-topic.

@m4gr3d

This comment was marked as outdated.

@2439905184

This comment was marked as off-topic.

@sijitg

This comment was marked as off-topic.

@ghost

This comment was marked as off-topic.

@Calinou
Copy link
Member

Calinou commented Jan 24, 2023

Please continue the discussion about documentation here: godotengine/godot-docs#4018

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.

9 participants