onSessionEnd method

void onSessionEnd()

Implementation

void onSessionEnd() {
  inputSourcesMap.forEach(( controller, inputSource ) {
    controller.disconnect( inputSource );
  } );

  inputSourcesMap.clear();

  _currentDepthNear = null;
  _currentDepthFar = null;

  // restore framebuffer/rendering state

  state.bindXRFramebuffer( null );
  renderer.setRenderTarget( renderer.getRenderTarget() );

  if ( glFramebuffer ) gl.deleteFramebuffer( glFramebuffer );
  if ( glMultisampledFramebuffer ) gl.deleteFramebuffer( glMultisampledFramebuffer );
  if ( glColorRenderbuffer ) gl.deleteRenderbuffer( glColorRenderbuffer );
  if ( glDepthRenderbuffer ) gl.deleteRenderbuffer( glDepthRenderbuffer );
  glFramebuffer = null;
  glMultisampledFramebuffer = null;
  glColorRenderbuffer = null;
  glDepthRenderbuffer = null;
  glBaseLayer = null;
  glProjLayer = null;
  glBinding = null;
  session = null;

  animation.stop();

  isPresenting = false;
  dispatchEvent(Event(type: 'sessionend'));
}