I have been using my own file templates for openFrameworks for a while now, but since I found out about this in China and was messing around with it on a train between Shanghai and Hangzhou I totally forgot about it. Recently people in class have been asking about creating classes in OF, so I’m taking this as an opportunity to fix some things I have been meaning to correct in my file templates and put them up for people to share/use.
These templates are file templates, if you’re looking for Project Templates Memo Akten has a great post on how to install his XCode project templates for both desktop and iphone. You can check that out here:
To install these templates, you first need to create the following folder:
(Your Hard Disk)>>Library>>Application Support>>Developer>>Shared>>XCode>>File Templates
(Your Hard Disk)>>Developer>>Library>>XCode>>File Templates
This is a great place to look at the built in templates (this is how I figured out how to create these templates), but you shouldn’t modify these or depend on them because I believe they get changed when you update XCode.
The next step is to download the zip I’m including below and copy the files into your File templates folder (specified above).
Now if you go into XCode, open a project, right click on the SRC folder and select “Add>New File…” you’ll be presented with a dialog. You should see the category “User Templates” on the left, and under that “openFrameworks”. Click on “openFrameworks” and select “basicClass”. Hit “next”, name your class, and click “finish”.
You now should have a new OF/C++ class ready to go with the basic setup(), update() and draw() functions, header includes, definitions, etc.
Enjoy!
Files for Download:
openFrameworks File Templates


