Ejemplo n.º 1
0
    // wvr.h
    public override WVR_InitError Init(WVR_AppType eType)
    {
        if (WaveVR.EnableSimulator)
        {
            try
            {
                wifi_ip_state = EditorPrefs.GetString("wifi_ip_state");
                bool tPreview = EditorPrefs.GetBool("EnablePreviewImage");
                saveLog     = EditorPrefs.GetBool("DllTraceLogToFile");
                saveImage   = EditorPrefs.GetBool("OutputImagesToFile");
                connectType = EditorPrefs.GetInt("ConnectType");
                string ipaddr = wifi_ip_state;

                enablePreview = tPreview && (connectType == 1);
                //WaveVR_Utils.SIM_ConnectType type = WaveVR_Utils.SIM_ConnectType.SIM_ConnectType_USB;
                System.IntPtr ptrIPaddr = Marshal.StringToHGlobalAnsi(ipaddr);
                WVR_SetPrintCallback_S(PrintLog);
                SIM_InitError error = WVR_Init_S(connectType, ptrIPaddr, enablePreview, saveLog, saveImage);
                Log.d(LOG_TAG, "WaveVR() WVR_Init_S = " + error);

                if (error != 0)
                {
                    return(WVR_InitError.WVR_InitError_NotInitialized);
                }
            }
            catch (Exception e)
            {
                Log.e(LOG_TAG, "WaveVR() initialize simulator failed, exception: " + e);
                return(WVR_InitError.WVR_InitError_NotInitialized);
            }
        }
        return(WVR_InitError.WVR_InitError_None);
    }
Ejemplo n.º 2
0
    // wvr.h
    public override WVR_InitError Init(WVR_AppType eType)
    {
        if (WaveVR.EnableSimulator)
        {
            try
            {
                wifi_ip_state = EditorPrefs.GetString("wifi_ip_state");
                bool tPreview = EditorPrefs.GetBool("EnablePreviewImage");
                saveLog     = EditorPrefs.GetBool("DllTraceLogToFile");
                saveImage   = EditorPrefs.GetBool("OutputImagesToFile");
                connectType = EditorPrefs.GetInt("ConnectType");
                string ipaddr = wifi_ip_state;

                enablePreview = tPreview && (connectType == 1);
                //WaveVR_Utils.SIM_ConnectType type = WaveVR_Utils.SIM_ConnectType.SIM_ConnectType_USB;
                System.IntPtr ptrIPaddr = Marshal.StringToHGlobalAnsi(ipaddr);
                WVR_SetPrintCallback_S(PrintLog);
                SIM_InitError error = WVR_Init_S(connectType, ptrIPaddr, enablePreview, saveLog, saveImage);
                Log.d(LOG_TAG, "WaveVR() WVR_Init_S = " + error);

                if (error != 0)
                {
                    return(WVR_InitError.WVR_InitError_NotInitialized);
                }
            }
            catch (Exception e)
            {
                Log.e(LOG_TAG, "WaveVR() initialize simulator failed, exception: " + e);
                return(WVR_InitError.WVR_InitError_NotInitialized);
            }

            if (!EditorPrefs.HasKey("UpdateFrequency"))
            {
                mFPS = 0;                 // Based on target FPS
            }
            else
            {
                mFPS = EditorPrefs.GetInt("UpdateFrequency");
            }

            long startTime = getCurrentTimeMillis();
            Debug.Log("copyTextureSupport: " + SystemInfo.copyTextureSupport);
            Debug.Log("deviceModel: " + SystemInfo.deviceModel);
            Debug.Log("deviceName: " + SystemInfo.deviceName);
            Debug.Log("deviceUniqueIdentifier: " + SystemInfo.deviceUniqueIdentifier);
            Debug.Log("graphicsDeviceID: " + SystemInfo.graphicsDeviceID);
            Debug.Log("graphicsDeviceName: " + SystemInfo.graphicsDeviceName);
            Debug.Log("graphicsDeviceType: " + SystemInfo.graphicsDeviceType);
            Debug.Log("graphicsDeviceVendor: " + SystemInfo.graphicsDeviceVendor);
            Debug.Log("graphicsDeviceVendorID: " + SystemInfo.graphicsDeviceVendorID);
            Debug.Log("graphicsDeviceVersion: " + SystemInfo.graphicsDeviceVersion);
            Debug.Log(WaveVR_Render.Instance.acturalStereoRenderingPath);

            WaveVR_Render.Instance.afterRenderEye += SendRenderTexturePtr;
        }
        return(WVR_InitError.WVR_InitError_None);
    }