Adding components to EAGLView in GLES project

Discussion in 'iOS Programming' started by tonyw, May 13, 2009.

  1. tonyw macrumors newbie

    Joined:
    May 13, 2009
    Location:
    york, uk
    #1
    hi,

    been playing about with open gl es project, as created by xcode New Project... now confused! From the program code, if I add simple components, such as UILabel, to the EAGLView *glView object via addSubview, then they do not appear. However, booting into the Interface Builder and double clicking the Window object brings up a view of type EAGLView. Dragging a UILable onto this results in the label appearing atop of the GL window at runtime.

    I'm wondering how to do the equivalent of Interface Builder drag n drop programatically? I thought I had it, but evidently not!

    any thoughts?

    thanks
    tony
     
  2. xsmasher macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #2
    I wonder if adding the objects in UIBuilder is making them subviews of the window, not the EAGLView? The draw methods for the EAGLView might lack the [super drawView] or [super drawRect:] calls that would caused subviews to be drawn.

    EITHER WAY, the docs warn you not to put UIviews on top of an EAGLView - performance goes into the crapper.
     
  3. tonyw thread starter macrumors newbie

    Joined:
    May 13, 2009
    Location:
    york, uk
    #3
    thanks xsmasher - good points. Presumably, it's perfectly reasonable to add UIViewControllers to the window after releasing the EAGLView and generally switch between the two as required?
     

Share This Page