public override bool GetRenderProps(ref WVR_RenderProps_t props)
 {
     return(WVR_GetRenderProps_Android(ref props));
 }
 public static extern bool WVR_GetRenderProps_Android(ref WVR_RenderProps_t props);
Esempio n. 3
0
    void Awake()
    {
        Log.d(LOG_TAG, "Awake()+");
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Log.w(LOG_TAG, "Render already Awaked");
        }
        synchronizer = new RenderThreadSynchronizer();

        if (globalOrigin >= 0 && globalOrigin <= 3)
        {
            _origin = (WVR_PoseOriginModel)globalOrigin;
            Log.d(LOG_TAG, "Has global tracking space " + _origin);
        }

#if UNITY_EDITOR
        if (!Application.isEditor)
#endif
        {
            if (WaveVR_Init.Instance == null || WaveVR.Instance == null)
            {
                Log.e(LOG_TAG, "Fail to initialize");
            }

            // This command can make sure native's render code are initialized in render thread.
            InitializeGraphic(synchronizer);

            // Setup render values
            uint w = 0, h = 0;
            Interop.WVR_GetRenderTargetSize(ref w, ref h);
            sceneWidth  = (float)w;
            sceneHeight = (float)h;

            projRawL = new float[4] {
                0.0f, 0.0f, 0.0f, 0.0f
            };
            projRawR = new float[4] {
                0.0f, 0.0f, 0.0f, 0.0f
            };

            WVR_RenderProps_t props = new WVR_RenderProps_t();
            Interop.WVR_GetRenderProps(ref props);
            targetFPS = (int)props.refreshRate;

            OnIpdChanged(null);
        }

        // May call eglMakeCurrent inside TextureManager()

        textureManager = new TextureManager();

        WaveVR_Utils.IssueEngineEvent(WaveVR_Utils.EngineEventID.HMD_INITIAILZED);

        Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        Application.targetFrameRate = targetFPS;
        Log.d(LOG_TAG, "Awake()-");
    }
 public static extern bool WVR_GetRenderProps_HVR(ref WVR_RenderProps_t props);
 public override bool GetRenderProps(ref WVR_RenderProps_t props)
 {
     Log.i("WVR_HVR", "GetRenderProps()");
     return(WVR_GetRenderProps_HVR(ref props));
 }
Esempio n. 6
0
    void Awake()
    {
        Log.d(LOG_TAG, "Awake()+");
        Log.d(LOG_TAG, "Version of the runtime: " + Application.unityVersion);
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Log.w(LOG_TAG, "Render already Awaked");
        }

        QualitySettings.SetQualityLevel(QualitySettings.GetQualityLevel(), true);
        synchronizer = new RenderThreadSynchronizer();

        if (globalOrigin >= 0 && globalOrigin <= 3)
        {
            _origin = (WVR_PoseOriginModel)globalOrigin;
            Log.d(LOG_TAG, "Has global tracking space " + _origin);
        }

        if (WaveVR_Init.Instance == null || WaveVR.Instance == null)
        {
            Log.e(LOG_TAG, "Fail to initialize");
        }
#if UNITY_EDITOR
        if (!Application.isEditor)
#endif
        {
            // This command can make sure native's render code are initialized in render thread.
            qSColorSpace = QualitySettings.activeColorSpace;
            // InitializeGraphic(synchronizer);

            // Setup render values
            uint w = 0, h = 0;
            Interop.WVR_GetRenderTargetSize(ref w, ref h);
            sceneWidth  = (float)w;
            sceneHeight = (float)h;

            projRawL = new float[4] {
                0.0f, 0.0f, 0.0f, 0.0f
            };
            projRawR = new float[4] {
                0.0f, 0.0f, 0.0f, 0.0f
            };

            WVR_RenderProps_t props = new WVR_RenderProps_t();
            Interop.WVR_GetRenderProps(ref props);
            targetFPS = (int)props.refreshRate;

            OnIpdChanged(null);
        }

        // May call eglMakeCurrent inside TextureManager()
        // First time, we delay InitializeGraphic and construct TextureManager to render loop and skip 16 frame for Unity 2018 version.
        // Otherwise, keep the original flow.
        if (isInitializeGraphic && textureManager == null)
        {
            textureManager = new TextureManager();
        }

        WaveVR_Utils.IssueEngineEvent(WaveVR_Utils.EngineEventID.HMD_INITIAILZED);

        Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        Application.targetFrameRate = targetFPS;
        Log.d(LOG_TAG, "Awake()-");
    }