private static void ConfigureGraphicsContext(Application application, Window window) { GraphicsContext graphicsContext = new DX11GraphicsContext(); graphicsContext.DefaultUploaderSize = 16 * 1024 * 1024; graphicsContext.CreateDevice(); SwapChainDescription swapChainDescription = new SwapChainDescription() { SurfaceInfo = window.SurfaceInfo, Width = window.Width, Height = window.Height, ColorTargetFormat = PixelFormat.R8G8B8A8_UNorm, ColorTargetFlags = TextureFlags.RenderTarget | TextureFlags.ShaderResource, DepthStencilTargetFormat = PixelFormat.D24_UNorm_S8_UInt, DepthStencilTargetFlags = TextureFlags.DepthStencil, SampleCount = TextureSampleCount.None, IsWindowed = true, RefreshRate = 60 }; var swapChain = graphicsContext.CreateSwapChain(swapChainDescription); swapChain.VerticalSync = true; var graphicsPresenter = application.Container.Resolve <GraphicsPresenter>(); var firstDisplay = new Display(window, swapChain); graphicsPresenter.AddDisplay("DefaultDisplay", firstDisplay); application.Container.RegisterInstance(graphicsContext); }
private static void ConfigureGraphicsContext(MyApplication application) { GraphicsContext graphicsContext = new DX11GraphicsContext(); graphicsContext.CreateDevice(); application.Container.RegisterInstance(graphicsContext); }
private void LoadEvergineControl() { var application = ((App)Application.Current).WaveApplication; this.interactionService = application.Container.Resolve <InteractionService>(); var graphicsPresenter = application.Container.Resolve <GraphicsPresenter>(); dX11GraphicsContext = application.Container.Resolve <DX11GraphicsContext>(); surface = new WPFSurface(0, 0) { SurfaceUpdatedAction = SurfaceUpdated }; display = new Display(surface, (FrameBuffer)null); WaveContainer.Content = surface.NativeControl; surface.NativeControl.MouseDown += NativeControlMouseDown; graphicsPresenter.AddDisplay("DefaultDisplay", display); }