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

integrate game-activity #10794

Merged
merged 24 commits into from Apr 22, 2022
Merged

integrate game-activity #10794

merged 24 commits into from Apr 22, 2022

Conversation

bofeng-song
Copy link
Contributor

No description provided.

@bofeng-song bofeng-song requested a review from minggo April 18, 2022 05:47
@github-actions
Copy link

Interface Check Report

This pull request does not change any public interfaces !

@bofeng-song bofeng-song reopened this Apr 19, 2022
@bofeng-song bofeng-song reopened this Apr 19, 2022
@bofeng-song bofeng-song reopened this Apr 19, 2022
androidPlatform->setAndroidApp(app);
platform->init();
platform->loop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for us to use 'run' as the main entry, and run the loop inside. 'app' can also be passed in via argc and argv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry is the same as other platforms, whether it is also considered to be placed in the template layer. What if the developer wants to extend the interface of the platform?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry is the same as other platforms, whether it is also considered to be placed in the template layer. What if the developer wants to extend the interface of the platform?

Can not move to template layer. cocos_main will trigger renderer initialize. The old code call cocos_main after ANativeWindow is being set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for us to use 'run' as the main entry, and run the loop inside. 'app' can also be passed in via argc and argv

argc's type is const char **, is it a good way to do this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was char argv before, but it is const char argv in IOS. So I changed it to const char** uniformly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to change it to template function ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very good, because the design of this function is to keep the same parameters passed in as main, and it can be used to parse the command line in the platform.
Can also pass in multiple parameters


void handleAppCommand(int32_t cmd) {
switch (cmd) {
case APP_CMD_SAVE_STATE:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these commands issued? I don't seem to see
One more question, does HarmonyOS also support GameActivity?
I remember HarmonyOS was very similar to Android before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APP_CMD_SAVE_STATE is the app lifecycle`s cmd, we just leave this code here.
HarmonyOS doesn't support GameActivity, It's package name doesn't support.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it

@minggo minggo merged commit ef7d80f into cocos:v3.6.0 Apr 22, 2022
@minggo
Copy link
Contributor

minggo commented Apr 22, 2022

Please add a documentation describe how to upgrade old project.

@minggo minggo mentioned this pull request Apr 22, 2022
dogodo-cc added a commit to dogodo-cc/cocos-engine that referenced this pull request Apr 26, 2022
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.

None yet

4 participants