Пример #1
0
    /// <summary>
    /// Creates a new <see cref="AnimatedComputeShaderPanel"/> instance.
    /// </summary>
    public unsafe AnimatedComputeShaderPanel()
    {
        this.swapChainManager = new SwapChainManager <AnimatedComputeShaderPanel>(this);

        this.Loaded                  += AnimatedComputeShaderPanel_Loaded;
        this.Unloaded                += AnimatedComputeShaderPanel_Unloaded;
        this.SizeChanged             += AnimatedComputeShaderPanel_SizeChanged;
        this.CompositionScaleChanged += AnimatedComputeShaderPanel_CompositionScaleChanged;
    }
Пример #2
0
        public Renderer(SwapChainManager swapChainManager)
        {
            fps = 0;

            CurrentBuffer = 0;

            this.SwapChainManager = swapChainManager;

            //this.Window = window;

            //this.SwapChainManager = new SwapChainManager(device: Device, window: window);

            LastRender = DateTime.Now;
        }
Пример #3
0
        public void SetWindow(CoreWindow window)
        {
            window.Closed            += Window_Closed;
            window.SizeChanged       += Window_SizeChanged;
            window.VisibilityChanged += Window_VisibilityChanged;

            var displayInfo = DisplayInformation.GetForCurrentView();

            displayInfo.OrientationChanged += DisplayInfo_OrientationChanged;
            displayInfo.DpiChanged         += DisplayInfo_DpiChanged;
            DisplayInformation.DisplayContentsInvalidated += DisplayInformation_DisplayContentsInvalidated;

            window.ResizeStarted += Window_ResizeStarted;

            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

            SwapChainManager swapChainManager = new SwapChainManager(window, new Microsoft.Graphics.Canvas.CanvasDevice());

            MainCore = new MainCore(swapChainManager);
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SDL2UltravioletContext"/> class.
        /// </summary>
        /// <param name="host">The object that is hosting the Ultraviolet context.</param>
        /// <param name="configuration">The Ultraviolet Framework configuration settings for this context.</param>
        public unsafe SDL2UltravioletContext(IUltravioletHost host, SDL2UltravioletConfiguration configuration)
            : base(host, configuration)
        {
            Contract.Require(configuration, nameof(configuration));

            if (!InitSDL(configuration))
            {
                throw new SDL2Exception();
            }

            this.onWindowDrawing = (context, time, window) =>
                                   ((SDL2UltravioletContext)context).OnWindowDrawing(time, window);
            this.onWindowDrawn = (context, time, window) =>
                                 ((SDL2UltravioletContext)context).OnWindowDrawn(time, window);

            eventFilter    = new SDL_EventFilter(SDLEventFilter);
            eventFilterPtr = Marshal.GetFunctionPointerForDelegate(eventFilter);
            SDL_SetEventFilter(eventFilterPtr, IntPtr.Zero);

            LoadSubsystemAssemblies(configuration);
            this.swapChainManager = IsRunningInServiceMode ? new DummySwapChainManager(this) : SwapChainManager.Create();

            this.platform = InitializePlatformSubsystem(configuration);
            this.graphics = InitializeGraphicsSubsystem(configuration);

            if (!this.platform.IsPrimaryWindowInitialized)
            {
                throw new InvalidOperationException(UltravioletStrings.PrimaryWindowMustBeInitialized);
            }

            this.audio   = InitializeAudioSubsystem(configuration);
            this.input   = InitializeInputSubsystem();
            this.content = InitializeContentSubsystem();
            this.ui      = InitializeUISubsystem(configuration);

            PumpEvents();

            InitializeContext();
            InitializeViewProvider(configuration);
            InitializePlugins(configuration);
        }
Пример #5
0
 public MainCore(SwapChainManager swapChainManager)
 {
     Storage  = new StorageCore();
     Renderer = new Renderer(swapChainManager);
     Logic    = new LogicCore(Storage);
 }