Ejemplo n.º 1
0
        public AtlasPluginManager(StandaloneController standaloneController)
        {
            requiredAssemblyVersion              = standaloneController.GetType().Assembly.GetName().Version;
            this.standaloneController            = standaloneController;
            standaloneController.SceneLoaded    += standaloneController_SceneLoaded;
            standaloneController.SceneUnloading += standaloneController_SceneUnloading;

            additionalSearchPath = FolderFinder.ExecutableFolder;

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(FindArtworkPluginAssembly);

            managePluginInstructions = new ManagePluginInstructions(MedicalConfig.PluginConfig.PluginsFolder);

            resourceManager = PluginManager.Instance.createLiveResourceManager("Plugins");
        }
Ejemplo n.º 2
0
        public void link(PluginManager pluginManager)
        {
            Log.Info("Initializing MyGUI");

            resources = pluginManager.createLiveResourceManager("MyGUI");
            var rendererResources = resources.getSubsystemResource("Ogre");

            CommonResourceGroup = rendererResources.addResourceGroup("Common");
            CommonResourceGroup.addResource(GetType().AssemblyQualifiedName, "EmbeddedScalableResource", true);
            resources.initializeResources();

            sceneManager = Root.getSingleton().createSceneManager(SceneType.ST_GENERIC, "MyGUIScene");
            ogreWindow   = pluginManager.RendererPlugin.PrimaryWindow as OgreWindow;

            //Create camera and viewport
            camera = sceneManager.createCamera("MyGUICamera");
            vp     = ogreWindow.OgreRenderTarget.addViewport(camera, ViewportZIndex, 0.0f, 0.0f, 1.0f, 1.0f);
            vp.setBackgroundColor(new Color(1.0f, 0.0f, 1.0f, 0.0f));
            vp.setClearEveryFrame(false);
            vp.clear();

            //Create Ogre Platform
            ogrePlatform = new OgrePlatform();
            ogrePlatform.initialize(vp.getActualWidth(), vp.getActualHeight(), CommonResourceGroup.FullName, LogFile);

            //Create log
            managedLogListener = new ManagedMyGUILogListener();

            renderListener = new MyGUIRenderListener(vp, sceneManager, ogrePlatform.RenderManager);
            if (ogreWindow.OSWindow != null)
            {
                ogreWindow.OSWindow.Resized += OSWindow_Resized;
            }

            gui             = new Gui();
            gui.ScaleFactor = ScaleHelper.ScaleFactor;
            gui.initialize("");

            //Load config files
            if (BeforeMainResourcesLoaded != null)
            {
                BeforeMainResourcesLoaded.Invoke(this);
            }

            ResourceManager resourceManager = ResourceManager.Instance;

            if (!String.IsNullOrEmpty(OSTheme))
            {
                resourceManager.load(OSTheme);
            }
            resourceManager.load(MainTheme);
            resourceManager.load(PointerFile);
            resourceManager.load(LayerFile);
            resourceManager.load(MessageBoxTheme);

            var platformProvider = pluginManager.GlobalScope.ServiceProvider.GetRequiredService <OgrePlatformProvider>();

            platformProvider.OgrePlatform = ogrePlatform;

            Log.Info("Finished initializing MyGUI");
        }