/// <summary>Initializes StereoKit window, default resources, systems, /// etc.</summary> /// <param name="settings">The configuration settings for StereoKit. /// This defines how StereoKit starts up and behaves, so it contains /// things like app name, assets folder, display mode, etc. The /// default settings are meant to be good for most, but you may want /// to modify at least a few of these eventually!</param> /// <returns>Returns true if all systems are successfully /// initialized!</returns> public static bool Initialize(SKSettings settings) { if (!NativeLib.Load()) { global::System.Diagnostics.Debug.WriteLine("[SK error] Failed to load StereoKitC!"); Console.WriteLine("[SK error] Failed to load StereoKitC!"); return(false); } IsInitialized = InitializeCall(settings); return(IsInitialized); }
private static bool InitializeCall(SKSettings settings) { // Prep console for colored debug logs Log.SetupConsole(); // DllImport finds the function at the beginning of the function // call, so this needs to be in a separate function from // NativeLib.LoadDll bool result = NativeAPI.sk_init(settings) > 0; Settings = settings; // Get system information if (result) { _system = NativeAPI.sk_system_info(); Default.Initialize(); _steppers = new Steppers(); } return(result); }
/// <summary>Initializes StereoKit window, default resources, systems, /// etc.</summary> /// <param name="settings">The configuration settings for StereoKit. /// This defines how StereoKit starts up and behaves, so it contains /// things like app name, assets folder, display mode, etc. The /// default settings are meant to be good for most, but you may want /// to modify at least a few of these eventually!</param> /// <returns>Returns true if all systems are successfully /// initialized!</returns> public static bool Initialize(SKSettings settings) { IsInitialized = InitializeCall(settings); return(IsInitialized); }
[DllImport(dll, CharSet = cSet, CallingConvention = call)] public static extern int sk_init(SKSettings settings);