Switching applications

Hello there,

Quick description: I have created a small game system which contains a menu and a few games. Loop is handled by bash script and starts each application based on specified return code when pressing the game’s icon in the menu. So you click the icon, the code is delivered to the overridden AppDelegate::run() method and terminates with this value. My platform is GNU/Linux Debian 7.5.

Issue: When switching the applications(terminating menu and starting a game) i get a black screen between them. I think it is caused by OpenGL initialization. Is there are any option how to delegate the OpenGLView instance to the new app? Do you have any suggestions how to solve this problem?

PS: My last option is one binary, but it’s certainly the last option.

Thank You for any suggestions! :smile:

EDIT: I forgot to specify when the black screen appears(openGL background). It appears when starting application. Upon terminating it instantly closes and system background shows.

Ok I’ve been digging around in my free time and found this solution. In method bool GLView::initWithRect(…) located in cocos2d file CCGLView.cpp you have to manually add line glfwWindowHint(GLFW_VISIBLE,GL_FALSE); which will force the new created window to be hidden. Add this before glfwCreateWindow(…) line if you wish to hide the black screen upon loading your app. In some other method, when your first image is drawn (displayed) you can add glfwShowWindow(Director::getInstance()->getOpenGLView()->getWindow()); to display your application again :smile:.

It’s very useful on my Linux architecture while i have no window manager, the background is black also. I removed that by running feh to display some background images :wink:.