By jok_rodz
on Tue, 03/26/2013 - 07:34
Hi,
How to call a function only once within the renderframe class in videoplayback.cpp
because it is always rendering so i what i want for example
for(int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++) { ... //i want to call the function only once //for eg. savemarkertodevice() ... }
Calling a function once within endless loop
Hi, do you want to call your function "at the first frame" (i.e. only the first time the renderFrame function is called), or do you want to call it at a specific point in time (for instance after the first 1000 frames... ?)
Calling a function once within endless loop
I just want to call it one time if its marker been recognize. so that i can save the its video in device.
because the app will be slow if always saving it. because i logged it and always saving many times because of rendering its frame
Calling a function once within endless loop
Ok, to do that, you could use an std::vector (see http://www.cplusplus.com/reference/vector/vector/ ) and create a global variable in VideoPlayback.cpp, that contains the name of the targets, something like:
Calling a function once within endless loop
Calling a function once within endless loop
No, Name found means that the name is already in the list (i.e. it means "found in the list of names"), so it means that it was already there;
Calling a function once within endless loop
there is an error when i declare this
std::vector<std::string> detectedTargetNames;
Calling a function once within endless loop
Add:
#include <string>
Calling a function once within endless loop
Thanks sir. :)