Mixing OpenGL ES and UIKit

Discussion in 'iOS Programming' started by moopf, Oct 2, 2008.

  1. moopf macrumors member

    Joined:
    Aug 28, 2008
    Location:
    United Kingdom
    #1
    For my next app I'm going to be using OpenGL ES for the graphics as I really need the performance boost that this gives. However, I've been playing around and found that it's completely possible to layer UIKit stuff on top of this (UIImageViews etc.) but I have read that this can lead to instability.

    Is it best to avoid the UIKit stuff completely if I'm using OpenGL ES? My reason for doing this was to leverage some of the existing functionality in UIButton, UILabel and possibly other things for the surrounding interface to the game.

    I'd be interested in opinions.
     
  2. SqueegyX macrumors regular

    Joined:
    Mar 24, 2008
    #2
    When I tried this, my framerate tanked. I wanted to have UIKit buttons on top of my OpenGL view, but it seriously hurt performance. While it seemed plenty stable, it was just slow.

    I wrote up some OpenGL to display those buttons instead and got my wicked speed back. It just means its harder to detect touches and whatnot.
     
  3. moopf thread starter macrumors member

    Joined:
    Aug 28, 2008
    Location:
    United Kingdom
    #3
    Ah, thanks the kind of thing I was wondering about. That's good to know.
     
  4. hkk macrumors newbie

    Joined:
    Oct 27, 2006
    #4
    I am mixing both and haven't noticed performance problems. Make sure that you set every layer to opaque and I think you should be fine. If you want your toolbars to be transparent, then performance is certainly going to suffer.
     

Share This Page