Multiple Cinder UIView(s) iOS app

Hello,

Is it possible to add multiple CinderViewCocoaTouch(s) to an iOS application. I’ve taken a look at the NativeControls sample and it has an example on how to add the “main” ci::app:: window as a subview (UIBarButtonItem in that example). Is it possible to create new cinder UIView(s) and if so how would I go about doing that.

I’m basically trying to create a UICollectionView list of cinder windows/views that do their own separate “clipped” drawing.

Tried doing something like this:

CinderViewCocoaTouch* anotherView = [[CinderViewCocoaTouch alloc]
    initWithFrame: CGRectMake (0.0f, 0.0f, 100.0f, 100.0f)
    app: (AppCocoaTouch*) app::AppBase::get()
    renderer: app::AppBase::get()->getDefaultRenderer()
    sharedRenderer: nullptr
];

But that didn’t work. I might be missing more setup for the view to actually work, any help or hint on where to look would be much appreciated.

Thank You

1 Like

Short story is: probably though, you’d have to dig into understanding all the communication that is necessary between CinderViewCocoaTouch and ci::app functionality. Nothing crazy there, but there is a lot of back and forth for events, etc.

Though do you really want, or need, to have multiple opengl views in your application? This is not usually the most efficient or convenient way to do things, as they each have their own context, are expensive to create and resize, and a number of other reasons.