Start a new topic

unable to set renderbuffer storage from drawable

If I adjust the iOS native example to present a view controller on successful target recognition like: 

- (void)baseTracker:(nonnull WTBaseTracker *)baseTracker didRecognizedTarget:(nonnull WTImageTarget *)recognizedTarget
{
  NSLog(@"recognized target '%@'", [recognizedTarget name]);
  _isTracking = YES;
  
  [self presentViewController:[UIViewController new] animated:YES completion:^{
    sleep(3);
    [self dismissViewControllerAnimated:YES completion:nil];
  }];
}

  I get the following error message: "unable to set renderbuffer storage from drawable".

My example is kind of artificial but the same error occurs with a real view controller.

Do you have any hint for me? Thank you very much for any help.


Hi Andreas,


in the Wikitude example the '-stop' method is called in the viewDidDisappear method:

 

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];

    [self.wikitudeSDK stop];
    
    [self.renderer stopRenderLoop];
    [self.renderer teardownRendering];
    
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

 

I tried viewWillDisappear instead of viewDidDisappear but it doesn't help.

Hi Ole,

can you make sure that the `-stop` method of our SDK is called when the new view controller is presented?!


Best regards,

Andreas

Hi Andreas,


yes, I checked that, but I extended the minimal example to be sure:

 

- (void)baseTracker:(nonnull WTBaseTracker *)baseTracker didRecognizedTarget:(nonnull WTImageTarget *)recognizedTarget
{
    NSLog(@"recognized target '%@'", [recognizedTarget name]);
    _isTracking = YES;
    
    NSLog(@"is main thread: '%@'", [NSThread isMainThread] ? @"yes" : @"no");
    
    dispatch_async(dispatch_get_main_queue(), ^(void){
        sleep(3);
        
        [self presentViewController:[UIViewController new] animated:YES completion:^{
            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
                sleep(3);
                
                dispatch_async(dispatch_get_main_queue(), ^(void){
                    [self dismissViewControllerAnimated:YES completion:nil];
                });
            });
        }];
    });
}

 

The problem stays the same. Some time after the error message ("unable to set renderbuffer storage from drawable") is logged the debugger hangs on this call:


#0 0x000000010085bf14 in wikitude::sdk_foundation::impl::CameraService::newPlatformCameraFrameAvailable(wikitude::sdk_foundation::impl::FrameInfo) ()


Do you have any other idea?

Thank you for your help!

Hi Ole,

Did you check on which thread didRecognizedTarget is called? If its not the main thread, you should put your view controller code in a dispatch_async(dispatch_get_main_queue,... block.


Best regards,

Andreas

Login or Signup to post a comment