/// <summary> /// Disables the base peripheral. /// invoked by Unity Engine /// </summary> public override void OnDisable() { IntPtr tempPtr = Marshal.StringToHGlobalAnsi("OnDisable"); Composer.DpnuSetIntValue(tempPtr, 1); base.OnDisable(); }
void OnDisable() { IntPtr tempPtr = Marshal.StringToHGlobalAnsi("OnDisable"); Composer.DpnuSetIntValue(tempPtr, 1); Camera.onPreRender -= CameraPreRender; Camera.onPreCull -= CameraPreCull; }
/// <summary> /// invoked by Unity Engine /// disable this camera. /// </summary> public override void OnDisable() { IntPtr tempPtr = Marshal.StringToHGlobalAnsi("OnDisable"); Composer.DpnuSetIntValue(tempPtr, 1); base.OnDisable(); if (_instance == this) { _instance = null; } }
void OnEnable() { #if UNITY_ANDROID && !UNITY_EDITOR IntPtr tempPtr = Marshal.StringToHGlobalAnsi(PROPERTY_ISVR9); bVR9 = Composer.DpnuGetIntValue(tempPtr, 0) == 0? false: true; IntPtr tempPtrQcom = Marshal.StringToHGlobalAnsi(PROPERTY_ISQCOM); bQCOM = Composer.DpnuGetIntValue(tempPtrQcom, 0) == 0? false: true; Debug.Log("DpnDevice Init bVR9 " + bVR9 + " bQCOM " + bQCOM); #endif ConfigEngine.Init(); if (!bVR9) { _buffers.Init (DpnManager.eyeTextureDepth , DpnManager.eyeTextureFormat , DpnManager.DeviceInfo.resolution_x , DpnManager.DeviceInfo.resolution_y); #if UNITY_ANDROID && !UNITY_EDITOR #else IntPtr[] buf_ptr = new IntPtr[(int)dpncEYE.NUM] { _buffers.GetEyeTexturePtr(dpncEYE.LEFT) , _buffers.GetEyeTexturePtr(dpncEYE.RIGHT) }; Composer.SetTextures(buf_ptr[0], dpncEYE.LEFT); Composer.SetTextures(buf_ptr[1], dpncEYE.RIGHT); #endif } // #if !UNITY_ANDROID string pcScreenOutput = "pcScreenOutput"; #if UNITY_EDITOR IntPtr OutputPtr = Marshal.StringToHGlobalAnsi(pcScreenOutput); Composer.DpnuSetIntValue(OutputPtr, (int)dpncOutputMode.NONE); Marshal.FreeHGlobal(OutputPtr); #else IntPtr OutputPtr = Marshal.StringToHGlobalAnsi(pcScreenOutput); Composer.DpnuSetIntValue(OutputPtr, (int)DpnManager.pcScreenOutputMode); Marshal.FreeHGlobal(OutputPtr); #endif #endif Camera.onPreRender += CameraPreRender; Camera.onPreCull += CameraPreCull; if (DpnManager.DPVRPointer) { gameObject.AddComponent <DpnPointerManager>(); } //cameras StartCoroutine(CallbackCoroutine()); }
void SetSrcBlendFactor(int value) { #if UNITY_ANDROID && !UNITY_EDITOR if (!DpnDevice.bVR9) { if (blendSrcFactor == value) { return; } blendSrcFactor = value; IntPtr tempPtr = Marshal.StringToHGlobalAnsi("blend_srcfactor"); Composer.DpnuSetIntValue(tempPtr, value); } #endif }