Hi mgrin,
if you also want to render from Java (with OpenGL), this should be possible provided that you follow the rendering logic implemented in the ImageTargets sample, and in particular:
- in your Renderer.onSurfaceChanged(), be sure to call the native function _updateRendering() (which will call the configureVideoBackground() function)
- in your Renderer.onDrawFrame(), be sure to call the native function _renderFrame() in CPP, in which function you will call the following:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Get the state from QCAR and mark the beginning of a rendering section
QCAR::State state = QCAR::Renderer::getInstance().begin();
// Explicitly render the Video Background
QCAR::Renderer::getInstance().drawVideoBackground();
// Call back to your Java code to do Java-OpenGL rendering
// ...
//Then call end
QCAR::Renderer::getInstance().end();
Also, the configureVideoBackground() native function should also be called when you start your camera (see ImageTargets.java)
#netpcvnn can you please send me the exemple, it would not work with me.
i'm using Cloud Reco and the targets get scanned successuly. but with a black backgound ( No camera preview)
please help