Log in or register to post comments

The first rendered frame I saw when launching ImageTargets

December 16, 2010 - 3:59am #2

Here is what I've done:
1.Launch ImageTargets
2.focus a trackble, say the build-in chips image
3.close ImageTargets (press back button on my HTC desire)
4.Lanch ImageTargets again, but not focusing on chips image this time

And the first frame i saw is the last frame it captured(including the teapot) at step 3.
It's like a "ghost frame" and it's not supposed to appear, am I right?
How can it be??How to prevent ImageTarget from rendering that frame?:confused:

Re: The first rendered frame I saw when launching ImageTargets

December 16, 2010 - 7:01am #1

Ah, this looks like a bug, thanks for the report.

If you'd like a quick fix, you can delay rendering for a few frames by adding a counter and a check in the render method. This isn't ideal, but shouldn't be too expensive.

In ImageTargets.cpp, add a global frameCount variable:

int frameCount;

Initialize it in onQCARInitializedNative:

JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_onQCARInitializedNative(JNIEnv *, jobject)
{
    ...
    
    frameCount = 0;
}

Then check it in the renderFrame method, skipping rendering for the first few frames:

JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv *, jobject)
{
    if (frameCount < 5)
    {
        frameCount++;
        return;
    }
    
    ...
}

Not the prettiest fix, but hopefully this can hold you over while we look into the bug. Thanks!

- Kim

Log in or register to post comments