/// <summary> /// Init the background texture at end of the frame. /// </summary> /// <returns>Yield return.</returns> private IEnumerator InitBackground() { // wait for end of frame to not interfere with rendering thread on mac yield return(new WaitForEndOfFrame()); Synchronizer sync = gameObject.GetComponent <Synchronizer>(); m_videoOverlayRendererHandler = TangoVideoOverlayAPI.VideoOverlayInitialize(sync.handler); if (m_videoOverlayRendererHandler == System.IntPtr.Zero) { DebugLogger.WriteToLog(DebugLogger.EDebugLevel.DEBUG_WARN, "Failed to initialize VideoOverlay"); } #if (UNITY_EDITOR || UNITY_STANDALONE_OSX) //issue plugin event to render right after rendering thread finished rendering Plugin.IssuePluginEvent(Plugin.PluginEvents.InitBackgroundEvent); #elif (UNITY_IPHONE || UNITY_ANDROID) GL.InvalidateState(); #else #error platform is not supported #endif }
/// <summary> /// Initialize the video overlay provider. /// </summary> public static void Init() { m_isInit = true; TangoVideoOverlayAPI.VideoOverlayInitialize(TangoApplication.Instance.Handle); }