This weekend I worked on porting ofGraphics and ofTexture to openGL ES, which is used on the iPhone. The biggest difference I have encountered so far is that you don’t have glBeginShape and glEndShape. Instead you use glVertexPointer and glDrawArrays. I can draw simple shapes and I can *almost* print a texture using ofTexture, but I have never worked directly with openGL, so it is slow going, but I am learning tons. Here-is-the-openGL-ES-documentation.
It would be pretty trivial to make an Objective-C shell app like SimpleApp that is a subclass of UIView, just like in the OpenGL Application template in the iPhone SDK. You have functions like touchesBegan, touchesMoved, and touchesEnded, and within them you can use plain C++ code, so it won’t be too much of a jump for OF users.
Anyone interested in helping out with this at the OF Knitting Circle at Eyebeam on Wednesday?
wherever I was building display lists I instantiated one of these and added the vertices or whatever into it like I was before, calling draw on it insteand if glCallList( LIST_ID ) like I was before.
There is also code there that I lifted from MESA to do gluOrtho2D and that sort of thing, have to make sure that is legal before I release.
havent had too much experience (a little though) developing stuff in obj-c or for the iphone. Very interested in taking a crack at it though. I’ll be at the knitting circle
I’m interested too and can try to help - I know andrew was working on this a few weeks ago, not sure how far he got with his research but i did see some random colored pixels – zach
Is anyone still hacking away at porting OF to the iPhone?
I’m working on setting up a glut-like context for doing multi-touch opengles based sketches for the iPhone. If anyone has any code in progress, I’d love to swap code to see what’s happening
I would also appreciate an update on this, as I am getting into iPhone developing and having OF for use on there would be a dream come true. (Now I just have to learn Objective C…)
there is an svn there and an empty example. there is also a google mailing list for that, but it’s not really active yet.
the second, which is essentially a working in of iphone specific stuff into the OF codebase, ie #define TARGET_IPHONE, is done by damian frey. I don’t know if that’s up online now, but I know that damian’s had good luck compiling some libraries (freeType) for iphone, but some other libraries (freeImage) aren’t done yet (and could likely be replaced with apple / qt specific stuff). the plus side of this approach is that the majority of the OF code stays the same (and certain things, like ofGraphics, are opengles-ified), while the MF is essentially a rewrite.
man, love to see what comes from this knitting circle thing. I’m typing this from my new iPod touch, by the way. Does anyone know of any iPhone apps (see 2nd gen, inb4 jailbreak) that can compile C/C++?