Log in or register to post comments

renderFrameQCAR not being called

July 28, 2011 - 11:08am #1

Hello I am trying to create a QualcommAR openframeworks addon.

I'm trying to adapt the FrameMakers example.
Everything seems to work fine but the renderFrameQCAR method is not called and I get this log message:
INFO: UIView does not conform to UIGLViewProtocol

the console look like this:

2011-07-28 18:32:40.788 qcARTest[4865:707] QCAR OpenGL flag: 1
2011-07-28 18:32:40.792 qcARTest[4865:707] QualcommAR onCreate()
2011-07-28 18:32:40.795 qcARTest[4865:707] New status: 1
2011-07-28 18:32:40.799 qcARTest[4865:707] initApplication
2011-07-28 18:32:40.868 qcARTest[4865:707] New status: 2
2011-07-28 18:32:40.873 qcARTest[4865:6203] initQCAR
2011-07-28 18:32:40.889 qcARTest[4865:6203] INFO: QCAR SDK version 1.0.3
2011-07-28 18:32:40.886 qcARTest[4865:707] QualcommAR onResume()
2011-07-28 18:32:40.972 qcARTest[4865:707] INFO: UIView has CAEAGLLayer class
2011-07-28 18:32:40.996 qcARTest[4865:707] INFO: UIView does not conform to UIGLViewProtocol
2011-07-28 18:32:41.238 qcARTest[4865:6203] QCAR::init percent: 100
2011-07-28 18:32:41.247 qcARTest[4865:707] New status: 3
2011-07-28 18:32:41.250 qcARTest[4865:707] New status: 4
2011-07-28 18:32:41.255 qcARTest[4865:6207] loadTracker
2011-07-28 18:32:41.260 qcARTest[4865:6207] INFO: Tracker starts loading

2011-07-28 18:32:41.301 qcARTest[4865:6207] INFO: Found config.xml

2011-07-28 18:32:41.322 qcARTest[4865:6207] INFO: Found config.xml

2011-07-28 18:32:41.336 qcARTest[4865:6207] INFO: Tracker finished loading (no errors)

2011-07-28 18:32:41.346 qcARTest[4865:707] New status: 5
2011-07-28 18:32:41.348 qcARTest[4865:707] New status: 7
2011-07-28 18:32:41.350 qcARTest[4865:707] startCamera
2011-07-28 18:32:41.352 qcARTest[4865:707] configureVideoBackground

But if I am not missing anything i do actually implement the protocol.

I have a header that looks something like this:

class ofxQualcommAR;

@interface QualcommAR : UIView <UIGLViewProtocol> {
	
@public
	
	// OpenGL projection matrix
    QCAR::Matrix44F projectionMatrix;
    
    struct tagARData {
        CGRect screenRect;
        NSMutableArray* textures;   // Textures
        int QCARFlags;              // QCAR initialisation flags
        status appStatus;           // Current app status
    } ARData;
	
}
- (void)renderFrameQCAR;    // Render frame method called by QCAR
- (void)onCreate;
- (void)onDestroy;
- (void)onResume;
- (void)onPause;

@end

And I have a .mm class where I implement the renderFrameQCAR method. The class looks pretty much the same as the EAGLView.mm in the FrameMarkers example but using OpenGL 1.1 and omitting all the context creation as openframeworks already has its own EAGLView and the context is already created.

So the idea is to create a UIView with all the AR rendering and then add this view to the openframeworks view that is already created.

Can anyone help me find out why the renderFrameQCAR method is not being called? AM I not implementing correctly the UIGLViewProtocol protocol? Am I missing something on the implementation of the class?

Any help will be much appreciated.

Thanks a lot and congrats for this great API.

/roger

p.s. I attach the classes in case it helps.

renderFrameQCAR not being called

January 28, 2013 - 1:19am #8

Glad you sorted the problem, and thanks for posting!

N

renderFrameQCAR not being called

January 25, 2013 - 9:43am #7

 

Just solved the issue in iOS calling:     [[QCARutils getInstancedestroyAR];

the full method is here: 

- (IBAction)backToPreviousController:(id)sender {

    [self removeMoviePlayerView];

    EAGLView* arView = [self getARView];

    for (int i = 0; i < NUM_VIDEO_TARGETS; ++i) {

        VideoPlayerHelper* player = [arView getVideoPlayerHelper:i];

 

        // If the video is playing, pause it and store the index of the player

        // so playback can be resumed

        if (PLAYING == [player getStatus]) {

            [player pause];

        }

 

        // Store the current video playback time for use when resuming (even if

        // the player is currently paused)

        videoPlaybackTime[i] = [player getCurrentPosition];

 

        // Unload the video

        if (NO == [player unload]) {

            NSLog(@"Failed to unload media");

        }

    }

    // do the same as when the view has dissappeared

    [self viewDidDisappear:NO];

    [[QCARutils getInstance]setAppStatusAPPSTATUS_CAMERA_STOPPED];

    [[QCARutils getInstancedestroyAR];

    [self.navigationController popViewControllerAnimated:YES];

}

 

Hope this helps, for anyone else. 

Thanks!

renderFrameQCAR not being called

January 25, 2013 - 9:37am #6

Sorry but I didn't understand how you solved the issue, I'm still gettin this after restarting the viewcontroller for third time:

Could not find a UIView with CAEAGLLayer layer class that responds to selector renderFrameQCAR

How do you setUp correctly or unload correctly the ViewController in order to start correctly QCar::Resume()???

regards,

Re: renderFrameQCAR not being called

August 18, 2011 - 3:14am #5

Here you have the addon if anyone is interested: https://github.com/rogerpala/ofxQualcommAR

Thanks Sam! ;)

/r

Re: renderFrameQCAR not being called

August 8, 2011 - 3:27am #4

Note: this issue has been resolved by ensuring the app's view hierarchy is set up completely before calling QCAR::onResume() (at which point QCAR attempts to locate the app's view conforming to UIGLViewProtocol).

Thanks,
Sam.

Re: renderFrameQCAR not being called

August 1, 2011 - 5:43am #3

Hello Roger,

Could you please check your private messages? - You should have received one from me with a follow-up to your question. If you have not received a message, please let me know.

Many thanks,
Sam.

Re: renderFrameQCAR not being called

August 1, 2011 - 4:55am #2

any input on this?

Note that if I call renderFrameQCAR manually every frame it works!
I have some coordinate problems with the video but it shows the video and it tracks the markers properly.

Don't think it's very efficient though.

Is there any other reason I can get the "UIView does not conform to UIGLViewProtocol" log message?

I would appreciate any help.
thanks!

/r

Log in or register to post comments