Exemple #1
0
        void AppStartup(object sender, StartupEventArgs args)
        {
            APILoader.Initialize();

            MainWindow = new Main();
            MainWindow.Show();
        }
Exemple #2
0
        /// <summary>
        /// Loads the API for the given extension, using the base API.
        /// </summary>
        /// <param name="baseAPI">The base API instance.</param>
        /// <typeparam name="TExtension">The extension type.</typeparam>
        /// <returns>The extension.</returns>
        /// <exception cref="ExtensionNotSupportedException">Thrown if the API doesn't support the extension.</exception>
        public static TExtension LoadExtension <TExtension>(IAPIExtension baseAPI)
            where TExtension : ExtensionBase
        {
            var extensionMetadata = GetAPIExtensionMetadata <TExtension>();

            if (!baseAPI.IsExtensionPresent(extensionMetadata.ExtensionName))
            {
                throw new ExtensionNotSupportedException(extensionMetadata.ExtensionName);
            }

            return(APILoader.Load <TExtension>(baseAPI.NameContainer));
        }
Exemple #3
0
        /// <summary>
        /// Loads the API for the given extension, using the base API.
        /// </summary>
        /// <param name="device">The device of the context.</param>
        /// <param name="baseAPI">The base API instance.</param>
        /// <typeparam name="TContextExtension">The extension type.</typeparam>
        /// <returns>The extension.</returns>
        /// <exception cref="ExtensionNotSupportedException">Thrown if the API doesn't support the extension.</exception>
        internal static unsafe TContextExtension LoadContextExtension <TContextExtension>(Device *device, IContextExtensions baseAPI)
            where TContextExtension : ContextExtensionBase
        {
            var extensionMetadata = GetAPIExtensionMetadata <TContextExtension>();

            if (!baseAPI.IsExtensionPresent(device, extensionMetadata.ExtensionName))
            {
                throw new ExtensionNotSupportedException(extensionMetadata.ExtensionName);
            }

            return(APILoader.Load <TContextExtension, OpenALLibraryNameContainer>());
        }
Exemple #4
0
        public static void Load()
        {
            var type = APILoader.Load(typeof(FAR), "FerramAerospaceResearch", "FerramAerospaceResearch.FARAPI", new Version(0, 15));

            IsAvailable = (type != null);
            if (IsAvailable)
            {
                calculateVesselAeroForces = type.GetMethod(
                    "CalculateVesselAeroForces",
                    BindingFlags.Public | BindingFlags.Static, null,
                    new Type[] {
                    typeof(Vessel),
                    typeof(Vector3).MakeByRefType(),
                    typeof(Vector3).MakeByRefType(),
                    typeof(Vector3),
                    typeof(double)
                }, null);
            }
        }
Exemple #5
0
 public static void Load()
 {
     IsAvailable = APILoader.Load(typeof(RemoteTech), "RemoteTech", "RemoteTech.API.API", new Version(1, 8));
 }
Exemple #6
0
 /// <summary>
 /// Gets an instance of the API.
 /// </summary>
 /// <returns>The instance.</returns>
 public static GLFW GetAPI()
 {
     return(APILoader.Load <GLFW>(new GLFWLibraryNameContainer()));
 }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     apiloader = GameObject.Find("APILoader").GetComponent <APILoader>();
     finished  = false;
 }
Exemple #8
0
 /// <summary>
 /// Gets an instance of the API.
 /// </summary>
 /// <returns>The instance.</returns>
 public static ALContext GetAPI()
 {
     return(APILoader.Load <ALContext>(new OpenALLibraryNameContainer()));
 }
 // Use this for initialization
 void Start()
 {
     apiloader = GameObject.Find("APILoader").GetComponent<APILoader>();
     finished = false;
 }
Exemple #10
0
 public static void Load()
 {
     IsAvailable = APILoader.Load(typeof(AGX), "AGExt", "ActionGroupsExtended.AGExtExternal");
 }
Exemple #11
0
 public static void Load()
 {
     IsAvailable = APILoader.Load(typeof(FAR), "FerramAerospaceResearch", "FerramAerospaceResearch.FARAPI", new Version(0, 15));
 }
Exemple #12
0
 public static void Load()
 {
     IsAvailable = (APILoader.Load(typeof(API), "LiDAR", "LiDAR.API", new Version(1, 0)) != null);
 }