Open kylemcdonald opened 11 years ago
Minor change to automatically choose the correct window type rather than forcing ofAppGlutWindow
:
#define ofStart(appName, width, height, windowMode) \
int main() {\
ofSetupOpenGL(width, height, windowMode);\
ofRunApp(new appName());\
}
yeah that's great - nice and simple. makes it a lot easier to share only a single file.
I know the broad use of testApp
has been discussed before, but perhaps this tiny test example would better be called testApp
and all of the normal examples could be called ofApp
? Just thinking of ways to reduce the usage of testApp
to more appropriate locations. Perhaps testApp
needs to be removed completely? On a related note, it seems that project generator should spit out class names that reflect the project folder name for the main class ... (rather than testApp
).
btw it was #744 (turns out @timscaffidi already mentioned a similar idea about project generation scripts outputting class names to match the folder names over in that thread).
Also @kylemcdonald your example suggests that it might be time to do a global find / replace
ofSetupOpenGL(1024, 768, OF_WINDOW);
➡ ofSetupOpenGL(1280, 720, OF_WINDOW);
in all the examples. It's time to go HD! :)
Nice minimal project template, @kylemcdonald . This combined with @elliotwoods idea on the dev list of an IDE-less oF environment could be a great productivity boost for prototyping or "sketches" of ideas. Nice ofStart macro too.
Thanks for picking this up, Kyle! great to see the resonance, too. The usage of Minimal Working Examples is an established and useful tradition in programming troubleshooting, so if we supply this out of the box it could help in diagnosing problems and raising the quality of bug reports (especially because you can drop it directly into comments or gists without having to pay attention to cpp/h files).
Maybe as a name, minimalApp
would be even more appropriate than testApp
.
I'm not so sure about the ofStart
macro - I guess the real question is if we really want to hide as much details (like main functions) as possible behind "magic" replacement macros. In the context of people trying to learn C++ on the whole, does this not make it more difficult to "release them into the wild once they're grown up"?
my current starting point for prototyping new ideas with OF looks like this:
that's a single-file project contained entirely in a
main.cpp
. i like it because it means i don't have to answer questions like "should this go in the header or not" when i'm only prototyping a small idea.@bilderbuchi just suggested that it might be helpful to have a minimal example like this in the
examples
folder to show people how they might construct a single-file example for reporting bugs or suggesting features (for example like https://github.com/openframeworks/openFrameworks/issues/1674#issuecomment-11756116). i think that could be really cool, and i'd be glad to add this if other people are also interested. so this issue is more to gauge interest.p.s.: as an aside, it would be cool if we had a macro like this:
and
ofMain.h
includedofAppGlutWindow.h
, then a minimal single-file example would look like:this idea is from cinder, which uses: