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

ASPagerNode + GLKViewController (GLKit) #53

Closed
stephenkopylov opened this issue Apr 21, 2017 · 4 comments
Closed

ASPagerNode + GLKViewController (GLKit) #53

stephenkopylov opened this issue Apr 21, 2017 · 4 comments

Comments

@stephenkopylov
Copy link
Contributor

stephenkopylov commented Apr 21, 2017

Congratulations, comrades! We're now not ASDK, but Texture =)

So, I've found a problem with implementing such a simple functionality like PageController with GLKViewControllers inside.

Just try the sample below, and you will find that classic UIPageViewController with some GLKViewControllers works well, but ASPagerNode - nope:

https://github.com/stephenkopylov/TextureOpenGLTest

The problem starts when you try to scroll pages back from last - in some cases it just stops render OGL part, in some others - starts to freeze as hell.

simulator screen shot 21 apr 2017 5 14 55 pm

Thank you and hope we'll find the root of problem (my app's release is on the next week and this is the last major issue that I have).

@nguyenhuy
Copy link
Member

nguyenhuy commented Apr 21, 2017

Hi, a brief debugging session shows that it's not safe to clear contents of an GLKView's layer (aka CAEAGLLayer) (here). There are 2 options I can think of:

  • Instead of subclassing a GLKViewController, subclass ASViewController. Then provide the VC with a custom ASDisplayNode that directly wraps a GLKView and suppresses all clearContents calls.
  • Submit a PR that does something similar to this but for GLKView. I'm not 100% confident that other maintainers will be ok with this change though. Worth a try nevertheless :P Also, please try to not link GLKit as a (strong) dependency.

Sorry for the hassle and good luck with the release! Feel free to drop a line into our Slack/appnouncement channel when you pull the trigger :)

@stephenkopylov
Copy link
Contributor Author

stephenkopylov commented Apr 21, 2017

@nguyenhuy
Thank you so much!
Turning off clearContents for views based on CAEAGLLayer (OpenGL-layer) works like a charm

PR created: #54

Also, please try to not link GLKit as a (strong) dependency.

Damn! :D

@nguyenhuy
Copy link
Member

haha, good call on grabbing the layer class instead!

@stephenkopylov
Copy link
Contributor Author

I also updated sample app to anyone can be sure that the fix is working well:
https://github.com/stephenkopylov/TextureOpenGLTest

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

No branches or pull requests

2 participants