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

[iOS] life cycle: resize() is called before create() #3850

Closed
burakkurkcu opened this issue Feb 17, 2016 · 3 comments
Closed

[iOS] life cycle: resize() is called before create() #3850

burakkurkcu opened this issue Feb 17, 2016 · 3 comments
Labels

Comments

@burakkurkcu
Copy link
Contributor

This could be relative to #3789 but after upgrading from 1.7.2 to 1.9.1 on iOS, after application start, resize() is called before create() which causes initialization errors due to Gdx.app is null.

So it seems now the life cycle is:
Application start -> resize() -> create() -> ...

Instead of:
Application start -> create() -> resize() -> ...

@Darkyenus
Copy link
Contributor

#3709 fixes this

@manuelbua
Copy link
Contributor

I can confirm this behavior: it looks like we receive a resize call before reaching the draw method that invokes create and resize in the correct order.

I can see this quite hacky way to create the application is untested, i'm not sure what's involved and why this is needed to occur right during drawing operations, anyone know more?

@Darkyenus
Copy link
Contributor

From my research and understanding: iOS logically decouples update() and render(), where only render() can access (by default) GL context. In libGDX however, all ApplicationListener methods can use OpenGL calls, so these calls have to happen when libGDX's GL context is active. It can be forced to be active (which is used for pause/resume, IIRC) but I am not quite sure what are the rules for this.

iOS backend would deserve a cleanup IMO, but it seems that no one from core contributors currently has time to go over iOS related PRs, so it maybe now isn't the right time to do that. In my projects I'm using somewhat modified version of this backend and I'm considering cleaning it up myself, implementing missing features (accelerometer, compass, etc.) and releasing it separately, with a hope that it will get merged back into libGDX some time in the future when it is complete and tested. Would anyone be interested in using or testing it?

@Tom-Ski Tom-Ski closed this as completed Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants