Instead of ofRunApp

Instead of using

ofRunApp( new testApp());

I want to use the following code snippet to invoke a program. Is it the right sequence? To test, I am using the “moviePlayerExample”. It plays the sound, but doesn’t show the video. Can anyone please help me with the appropriate sequence of functions that I need to call?

testApp TA;
TA.setup();
while(1)
{
TA.update();
TA.draw();
}

hi mehoque,
OF was structures to make coding interactive applications with relative ease, and most of all: to avoid doing function callbacks, endless polling of render loops, etc (just like the typical Win32 API program structure). In other words: it saves you from doing most of these boilerplate coding manually. Calling “ofRunApp( new testApp());” from main.cpp is probably the easiest way to initialize ur app, and get things running. I dont see any good reason to do most of the work from main.cpp. I hope this helps…

Thanks for your reply. I understand the advantage of using ofRunApp.

I just would like to use some basic functionalities of openframeworks in an existing program and calling testApp() manually seems like an easier approach.

Do you or anyone else know how to do that?

which functionality do you need? drawing could be a problem, as there is some work which is done via ofRunApp() (switching video buffers and setting up proper scaling and coordinate system), which you would need to do yourself.