public RocketRenderQueueListener(Context context, RenderInterfaceOgre3D renderInterface)
        {
            this.context         = context;
            this.renderInterface = renderInterface;
            Vector2i dimensions = context.Dimensions;

            renderDimensions = new IntSize2(dimensions.X, dimensions.Y);
        }
Exemplo n.º 2
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(int width, int height, RenderInterfaceOgre3D obj)
 {
     return(RenderInterfaceOgre3D_Create(width, height, queueBackgroundImageLoad, GCHandle.ToIntPtr(gcHandle)));
 }
 public CallbackHandler(RenderInterfaceOgre3D renderInterface)
 {
     gcHandle = GCHandle.Alloc(renderInterface);
 }