Exemplo n.º 1
0
        public HTMLTextureRenderer(ILogger logger)
        {
            Logger = logger;

            var settings = new CefBrowserSettings();

            settings.DeveloperToolsDisabled = true;
            // TODO: Needs to be disabled or WebGL won't work at all.
            settings.AcceleratedCompositingEnabled      = false;
            settings.FileAccessFromFileUrlsAllowed      = true;
            settings.UniversalAccessFromFileUrlsAllowed = true;
            //settings.PluginsDisabled = true;

            using (var windowInfo = new CefWindowInfo())
            {
                windowInfo.TransparentPainting = true;
                windowInfo.SetAsOffScreen(IntPtr.Zero);

                FWebClient = new WebClient(this);
                CefBrowser.Create(windowInfo, FWebClient, DEFAULT_URL, settings);
            }

            FTextureResource = new DXResource <EX9.Texture, CefBrowser>(
                FBrowser,
                CreateTexture,
                UpdateTexture,
                DestroyTexture
                );
        }