is this calling the class? How would I go about even finding this out, is there a logical way of checking documentation on OF website? I don’t really know the workflow of “backwards engineering.” I feel like a total newbie at this. ugg. trying to make it through Joshua Nobles book and ended up going back through the basics. I feel like I might need even more basics than this book.
I’m asking this because I am going on to the second example of drawing simple shapes and am Getting an error, there is no code examples for main.cpp so I made my own. I seem to be getting all sorts of errors, here is what I have so far:
simpleGraphics.h:
#pragma mark once
#include "ofMain.h"//include oFs ofMain class, linked here
class simpleGraphics : public ofBaseApp{
public:
void setup();
void update();
void draw();
ofColor fillColor;
}
main.cpp:
#include "ofMain.h"
int main(){
// ofAppGlutWindow window;
ofSetupOpenGL(300,368, OF_WINDOW); //experiment with sizes
// <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp(new simpleGraphics);
}
makes an instance of the HelloWorldApp, it really should be:
ofRunApp(new HelloWorldApp());
which makes it much clearer.
Your main() method needs to look like this:
ofAppGlutWindow window; // this is important
ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // this is important
ofRunApp( new app()); // this is important
I’m not sure O’Reilly didn’t put main.cpp in the code downloads, I’ll get that update b/c it’s annoying. The best thing to do generally speaking, is to work from a previously set up project or one of the generators (which one you use will depend on your OS, check here http://www.openframeworks.cc/setup/) because getting a new project configured is a pain.
@Lukasz, cold enough there in Grand Rapids for ya (I’m from MI too)?!
Joshua’s right, there are many great examples that are included in oF that can get you up and running in minutes that cover a range of topics from graphics, video, sound, etc. …minus compilation errors, whoohoo!
Another page I recommend, after playing around with their examples (have fun first!), is this link: http://wiki.openframeworks.cc/index.php?title=Image-processing
Very important to understand how oF stores the pixel data of an image; before trying this code, I suggest to scroll down this page to see the very pretty diagrams which make you say, “Ahhh, I get it, cooL!”.
@Joshua - I’m not aware of the books out there for oF and mainly rely on the web/oF forums to get my documentation/sample code (outside of the existing oF examples), so I’ll have to check it out, thanx!
For future reference the code for Programming Interactivity is going to have a home here: https://github.com/joshuajnoble/Programming-Interactivity-Code which might make it a little easier to work with. As soon as I get some time I’ll add projects for CodeBlocks (win/lin) + XCode.