Пример #1
0
        public void link(PluginManager pluginManager)
        {
            Root.getSingleton().addArchiveFactory(rocketFilesystemArchiveFactory);

            if (FileInterface == null)
            {
                FileInterface = new VirtualFileSystemFileInterface();
            }

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

            CommonResourceGroup = rendererResources.addResourceGroup("Common");
            CommonResourceGroup.addResource("__RmlViewerFilesystem__", RocketFilesystemArchive.ArchiveName, false);
            CommonResourceGroup.addResource(GetType().AssemblyQualifiedName, "EmbeddedScalableResource", true);
            var shaders = rendererResources.addResourceGroup("Shaders");

            shaders.addResource(this.GetType().AssemblyQualifiedName, "EmbeddedResource", false);
            var shared = rendererResources.addResourceGroup("Shared");

            shared.addResource("__LibRocketCommonResourcesFilesystem__", CommonResourcesArchiveFactory.Name, false);
            resources.initializeResources();

            Root.getSingleton().Disposed += OgreRoot_Disposed;

            OgreWindow ogreWindow = pluginManager.RendererPlugin.PrimaryWindow as OgreWindow;

            systemInterface = new ManagedSystemInterface();
            renderInterface = new RenderInterfaceOgre3D((int)ogreWindow.OgreRenderTarget.getWidth(), (int)ogreWindow.OgreRenderTarget.getHeight());
            renderInterface.PixelsPerInch = pixelsPerInch;
            renderInterface.PixelScale    = ScaleHelper.ScaleFactor;

            renderSystemListener = new RocketRenderSystemListener();
            Root.getSingleton().getRenderSystem().addListener(renderSystemListener);

            Core.SetSystemInterface(systemInterface);
            Core.SetRenderInterface(renderInterface);

            Core.Initialise();
            Controls.Initialise();
        }
 public IntPtr create(ManagedSystemInterface obj)
 {
     handle = GCHandle.Alloc(obj);
     return(ManagedSystemInterface_Create(etDelegate, logDelegate, GCHandle.ToIntPtr(handle)));
 }