public static GraphicsDevice CreateOutputTargetView(IFrameRenderableSurface surface) { var adapter = GetAdapter(); var proxy = new RenderToTargetViewDeviceProxy(adapter, surface.Size); return(new GraphicsDevice(proxy, surface.Size, adapter.Description)); }
//public SynchronizedGraphics(IFrameRenderableSurface surface) // : this(GraphicsDeviceFactory.CreateOutputTargetView(surface), surface) { //} SynchronizedGraphics(GraphicsDevice device, IFrameRenderableSurface surface) { Device = device; surface.Resized += OnResized; surface.Invalidated += OnInvalidated; this.surface = surface; synchronizer = new SynchronizationContext <SynchronizedGraphics, Size>(this); }
public SynchronizedGraphics(IFrameRenderableSurface surface) { Device = GraphicsDeviceFactory.CreateOutputTargetView(surface);//CreateOutputTextureDevice surface.Resized += OnResized; surface.Invalidated += OnInvalidated; this.surface = surface; synchronizer = new SynchronizationContext <SynchronizedGraphics, Size>(this); }
public GraphicsFrameWithSurface(GraphicsDevice device, IFrameRenderableSurface surface) : base(device) { this.surface = surface; surface.StartFrame(Graphics); }
public static RenderEngine Create(IFrameRenderableSurface surface, IInputManager inputManager, IContextState context, EngineNotificator notificator) { return(new RenderEngine(GraphicsDeviceFactory.CreateOutputTargetView(surface), surface, inputManager, context, notificator)); }