Search code examples
iosopengl-escocos2d-iphoneuikitcore-graphics

ios - Combining OpenGL and UIKit CoreGraphics perfomance


I almost finished the core of my game, which I develop with Cocos2D and now I'm in stage of implementing the UI.

Implementing the UI I want via code or even via Spritebuilder is a big pain.

I'm thinking about using Cocos2D only for game view and implement everything else with AutoLayout. My problem is that I don't understand the basics of how CoreGraphics (which I bet UIKit is based on) works.

My question is will there be any perfomance drop if I will use UIKit for menus and pause screen and Cocos2D for rendering the game itself. It is important for me, because my game is very high load in terms of perfomance.


Solution

  • No, there is no noticeable performance drop when you use UI components over a OpenGLES or Metal layer. Until iOS 4 or 5, there was a big drop in FPS if you combine both. It use to drop to half in older versions. However, Apple has fixed this issue long ago.

    Source: I am the developer of the app named Iyan 3d which uses this combination heavily. And the FPS in OpenGLES or Even Metal is independent of the UI complexity.

    enter image description here