This coming Monday I’ll be giving a presentation at 360iDev titled “All You Wanted To Know About Mixing OpenGL with UIKit (And More)”. It’s an extended version of my talk at this year’s GDC iPhone Summit. It’s going to be 1h 20min long instead of just half an hour.
The main difference is that I’m going to go in detail about each of the different cases of mixing OpenGL and UIKit, and what better way to do that than with a live demo. I’ll be switching back and forth between Keynote and XCode and going over the details, which is where a lot of the tricky parts are.
Here is the source code for the demo. That way you can look at it now and come to the session prepared with more questions, or ready to discuss what works and what doesn’t work for you. I love to have interactive sessions, so definitely come ready to ask questions.
If you’re not coming to 360iDev… shame on you! It’s the best iPhone conference around. You’ll be missing not just my session, but tons of other great talks, and the iPhone Game Jam (sponsored by TouchArcade this year). If you can’t make it this time, make a note on your calendar for next time!
- Demo source code. Released under the MIT license.
Awesome presentation the other day Noel. The sample code is really helpful. I’m looking forward to playing with non-fullscreen OpenGL views.
Great stuff. I am currently working with UIKit but hesitated to mixed them up with OpneGL stuff, however your presentation made it encouraging for me to move ahead. Thanks.
Hi Noel, it’s been 3 years now and I only just bumped to your presentation!
great presentation which led me here to checkout the source code sample.
When trying to build I get this Error in
Line 42 RenderUtils.m
Error:
variable length array of non-POD element type ‘::LineVertex’
Any idea how I could fix this?
thanks
I did this “LineVertex pts[1000];// [2 + dtHistory.GetCount()*2];” and it works. Have fun 🙂
There’s a better solution, we need to allocate memory from the heap instead of stack, so:
LineVertex* pts = new LineVertex[2 + dtHistory.GetCount()*2]; // LineVertex pts[2 + dtHistory.GetCount()*2];
and
delete[] pts; // at the end of DrawFPS function
solves this one.
Apparently the non-constant array declaration only worked with gcc and an older version of Xcode.
I definitely don’t recommend allocating memory from the heap on something that gets called every frame (heck, I don’t recommend heap allocations in general 🙂 )
The best way to fix it for this demo is just to set LineVertex pts[200] since that’s the size of the frame time history.
Makes sense if you know maximum number of elements in pts array. In my case I didn’t.
Hi Noel,
Thanks for the great example. Any chance you could update this for ios 8?
cheers