Calrification about an example

In Programming Interactivity there’s a code example for drawing two circles:…-wing-in-2d

Unfortunately I’ve been unable to get this example working. This being the case i think i’m not understanding the instructions correctly. Any clarification on the following points would be much appreciated.

For instance this sentence:

For example, to draw two circles to the screen, you would simply add the following methods to the draw() method of a program:

There follows two method definitions. It’s not clear to me whether its being suggested that these methods should be defined defined somewhere else (eg. simpleGraphics.cpp?) and then be called from within the draw() method of my program (in testApp.cpp) or whether the definitions actually belong inside the draw() method.

Further along there’s this sentence:

The .h header file for the class would look like so:

Am I correct in assuming that this file would be called simpleGraphics.h? When i try it this way, Xcode grumbles:

“error: ofAddons.h: No such file or directory”

Is there something else i need to do to get xcode to see addons/ofAddons.h?

I’m not sure the reasoning behind changing the testApp name in that example, but I assume that “simpleGraphics.cpp” is replacing “testApp.cpp”… I think the easiest way to go about it is:

a) duplicate the empty example
b) add the code from simpleGraphics.h to testApp.h
c) add the code from simpleGraphics.cpp to testApp.cpp (ie, from setup to setup, etc)

see if that compiles…

alternatively, remove testApp.h and testApp.cpp from the project, and throw in simpleGraphics.cpp and simpleGraphics.h and see if they compile. if they include “ofAddons.h” comment out that line. should also work.

I hope that helps!

take care,

Thanks again! steps a - c got the example working correctly (which seems to be written in an unnecessarily confusing way).