سؤال

I'm writing an OpenGL app which draws trails/strokes by not clearing the frame buffer from frame to frame (it just lets everything accumulate on top of itself, which is what I want).

The app has a Settings screen. You access it by tapping a button. After you're done with the settings, it returns to the graphics.

Here's the problem: I can't figure out how to transition from the settings back to the graphics without losing what was in the frame buffer. The app is sort of a painting toy. You'd like to be able to paint, go to the settings, and then return to what you were doing without the screen clearing and deleting your work!

If I used a NavigationController all of this would be taken care of (I've tried it -- works perfectly!)

Problem is, I don't want the ugly, bulky nav bar thing on the top of my screen. But, you have to take the nav bar if you want the nav controller.

Any ideas?

هل كانت مفيدة؟

المحلول

Your solution is simple. Hide the navigation bar.

navController.navigationBar.hidden = YES;

See here:

UINavigationController without navigation bar?

نصائح أخرى

Before you leave to go to the settings, save what's in the framebuffer with glReadPixels. When you return, load that data into a texture and draw it on the screen.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top