public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, Func <IMouseDevice> mouseDevice = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; KeyboardNavigation = keyboardNavigation; MouseDevice = mouseDevice; Platform = platform; RenderInterface = renderInterface; Scheduler = scheduler; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; }
public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, Func <IMouseDevice> mouseDevice = null, IRuntimePlatform platform = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { return(new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, keyboardNavigation: keyboardNavigation ?? KeyboardNavigation, mouseDevice: mouseDevice ?? MouseDevice, platform: platform ?? Platform, renderInterface: renderInterface ?? RenderInterface, scheduler: scheduler ?? Scheduler, standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, windowingPlatform: windowingPlatform ?? WindowingPlatform, windowImpl: windowImpl ?? WindowImpl)); }
public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IRuntimePlatform platform = null, IRenderer renderer = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { return(new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, layoutManager: layoutManager ?? LayoutManager, platform: platform ?? Platform, renderer: renderer ?? Renderer, renderInterface: renderInterface ?? RenderInterface, renderLoop: renderLoop ?? RenderLoop, scheduler: scheduler ?? Scheduler, standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, windowingPlatform: windowingPlatform ?? WindowingPlatform)); }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func <IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IRuntimePlatform platform = null, IRenderer renderer = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IScheduler scheduler = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func <Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; LayoutManager = layoutManager; Platform = platform; Renderer = renderer; RenderInterface = renderInterface; RenderLoop = renderLoop; Scheduler = scheduler; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowingPlatform = windowingPlatform; }
public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func<IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IRuntimePlatform platform = null, IRenderer renderer = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func<Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; FocusManager = focusManager; InputManager = inputManager; KeyboardDevice = keyboardDevice; LayoutManager = layoutManager; Platform = platform; Renderer = renderer; RenderInterface = renderInterface; RenderLoop = renderLoop; StandardCursorFactory = standardCursorFactory; Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; }
protected override void UpdateOverride(IRenderLoop renderLoop, IRenderContext context) { mKernel.Phase += 0.01f; mKernel.Execute(); context.Blit(mKernel.OutputMemory); }
public Renderer(IRenderRoot root, IRenderLoop renderLoop) { Contract.Requires<ArgumentNullException>(root != null); _root = root; _renderLoop = renderLoop; _renderLoop.Tick += OnRenderLoopTick; }
public Renderer(IRenderRoot root, IRenderLoop renderLoop) { Contract.Requires <ArgumentNullException>(root != null); _root = root; _renderLoop = renderLoop; _renderLoop.Tick += OnRenderLoopTick; }
public void Update(IRenderLoop renderLoop) { if (renderLoop == null) { throw new ArgumentNullException(nameof(renderLoop)); } UpdateOverride(renderLoop, mContext); }
public Grid(Camera camera, IRenderLoop renderLoop, LineRenderer gridRenderer) { _camera = camera; _renderLoop = renderLoop; _gridRenderer = gridRenderer; _gridGenerator = new GridGenerator(200, 1, _camera); _gridRenderer.SetData(_gridGenerator.GetVertices(), _gridGenerator.GetIndices()); _gridRenderer.LineWidth = RenderConstants.GRID_SIZE; Initialize(); }
void InitializeMonoMac() { if (s_monoMacInitialized) { return; } NSApplication.Init(); ThreadHelper.InitializeCocoaThreadingLocks(); App = NSApplication.SharedApplication; UpdateActivationPolicy(); s_renderLoop = new RenderLoop(); //TODO: use CVDisplayLink s_monoMacInitialized = true; }
/// <summary> /// Initializes a new instance of the <see cref="DeferredRenderer"/> class. /// </summary> /// <param name="root">The control to render.</param> /// <param name="renderLoop">The render loop.</param> /// <param name="sceneBuilder">The scene builder to use. Optional.</param> /// <param name="dispatcher">The dispatcher to use. Optional.</param> public DeferredRenderer( IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder sceneBuilder = null, IDispatcher dispatcher = null) { Contract.Requires <ArgumentNullException>(root != null); _dispatcher = dispatcher ?? Dispatcher.UIThread; _root = root; _sceneBuilder = sceneBuilder ?? new SceneBuilder(); Layers = new RenderLayers(); _renderLoop = renderLoop; }
public PlotSampleView() { renderLoop = AvaloniaLocator.Current.GetService <IRenderLoop>(); this.WhenActivated(disposables => { SafeViewModel(vm => { stopWatchRenderLoopTask = new StopWatchRenderLoopTask().DisposeWith(disposables); renderLoop.Add(stopWatchRenderLoopTask); Disposable.Create(() => renderLoop.Remove(stopWatchRenderLoopTask)).DisposeWith(disposables); this.WhenAnyValue(x => x.ViewModel.IsPlotEnable) .Subscribe(x => { if (x)// plot enable, start monitor ui update time { plotEnableDisposables = new CompositeDisposable().DisposeWith(disposables); this.WhenAnyValue(x => x.stopWatchRenderLoopTask.UiUpdateElapsedMilliseconds) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(_ => { #if DEBUG try { FpsBlock.Text = (1000 / vm.InvalidatePlotPostedElapsedMilliseconds).ToString("D2"); } catch (DivideByZeroException) { } catch (Exception) { throw; } #endif //Set MinPlotUpdateInterval higher if ui take long time to update vm.MinPlotUpdateIntervalMilliseconds = (int)( stopWatchRenderLoopTask.UiUpdateElapsedMilliseconds + (stopWatchRenderLoopTask.UiUpdateElapsedMilliseconds - vm.InvalidatePlotPostedElapsedMilliseconds) * 0.5); }) .DisposeWith(plotEnableDisposables); stopWatchRenderLoopTask.NeedsUpdate = true; } else { // plot disable, stop monitor ui update time stopWatchRenderLoopTask.NeedsUpdate = false; plotEnableDisposables?.Dispose(); } }).DisposeWith(disposables); }); }); InitializeComponent(); }
/// <summary> /// Initializes a new instance of the <see cref="DeferredRenderer"/> class. /// </summary> /// <param name="root">The control to render.</param> /// <param name="renderLoop">The render loop.</param> /// <param name="sceneBuilder">The scene builder to use. Optional.</param> /// <param name="dispatcher">The dispatcher to use. Optional.</param> /// <param name="rendererLock">Lock object used before trying to access render target</param> public DeferredRenderer( IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder?sceneBuilder = null, IDispatcher?dispatcher = null, IDeferredRendererLock?rendererLock = null) : base(true) { _dispatcher = dispatcher ?? Dispatcher.UIThread; _root = root ?? throw new ArgumentNullException(nameof(root)); _sceneBuilder = sceneBuilder ?? new SceneBuilder(); Layers = new RenderLayers(); _renderLoop = renderLoop; _lock = rendererLock ?? new ManagedDeferredRendererLock(); _updateSceneIfNeededDelegate = UpdateSceneIfNeeded; }
public void Update(IRenderLoop renderLoop) { UpdateOverride(renderLoop, mContext); foreach (var kernel in mHardwareQueue ?? new AcceleratedComputationKernel[0]) { kernel.Execute(); } if (mOutputKernel != null) { mOutputKernel.Execute(); mOutputKernel.Output.Read(mOutputTextureMemory.GetPointer(), 0, mOutputTextureMemory.Size); } }
/// <summary> /// Initializes a new instance of the <see cref="DeferredRenderer"/> class. /// </summary> /// <param name="root">The control to render.</param> /// <param name="renderLoop">The render loop.</param> /// <param name="sceneBuilder">The scene builder to use. Optional.</param> /// <param name="dispatcher">The dispatcher to use. Optional.</param> /// <param name="rendererLock">Lock object used before trying to access render target</param> public DeferredRenderer( IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder sceneBuilder = null, IDispatcher dispatcher = null, IDeferredRendererLock rendererLock = null) : base(true) { Contract.Requires <ArgumentNullException>(root != null); _dispatcher = dispatcher ?? Dispatcher.UIThread; _root = root; _sceneBuilder = sceneBuilder ?? new SceneBuilder(); Layers = new RenderLayers(); _renderLoop = renderLoop; _lock = rendererLock ?? new ManagedDeferredRendererLock(); _updateSceneIfNeededDelegate = UpdateSceneIfNeeded; }
public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop) { return(new Renderer(root, renderLoop)); }
protected virtual void UpdateOverride([NotNull] IRenderLoop renderLoop, [NotNull] IAcceleratedReactorContext context) { }
public IRenderer Create(IRenderRoot root, IRenderLoop renderLoop) => new ImmediateRenderer(root);
public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop) { return(_cb?.Invoke(root, renderLoop)); }
protected abstract void UpdateOverride([NotNull] IRenderLoop renderLoop, IRenderContext context);
/// <summary> /// Initializes a new instance of the <see cref="X11ImmediateRendererProxy"/> class. /// </summary> /// <param name="root">The root.</param> /// <param name="loop">The loop.</param> public X11ImmediateRendererProxy(IVisual root, IRenderLoop loop) { _loop = loop; _renderer = new ImmediateRenderer(root); }
public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop) { return new Renderer(root, renderLoop); }
public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop) { return(new ImmediateRenderer(root)); }
public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, IInputManager inputManager = null, Func<IKeyboardDevice> keyboardDevice = null, ILayoutManager layoutManager = null, IRuntimePlatform platform = null, IRenderer renderer = null, IPlatformRenderInterface renderInterface = null, IRenderLoop renderLoop = null, IStandardCursorFactory standardCursorFactory = null, IStyler styler = null, Func<Styles> theme = null, IPlatformThreadingInterface threadingInterface = null, IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { return new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, layoutManager: layoutManager ?? LayoutManager, platform: platform ?? Platform, renderer: renderer ?? Renderer, renderInterface: renderInterface ?? RenderInterface, renderLoop: renderLoop ?? RenderLoop, standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, windowImpl: windowImpl ?? WindowImpl, windowingPlatform: windowingPlatform ?? WindowingPlatform); }