Jump to content
  • Advertisement

Stakhmich

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

119 Neutral

About Stakhmich

  • Rank
    Newbie
  1. Stakhmich

    Render one image to several window

    thank you for answer. I'm read your link and have question. If i create several swapchain, i create several rendertarget too? In this way my render will be: _renderTarget2D_window1.BeginDraw(); _renderTarget2D_window1.Clear(Color.Black); _renderTarget2D_window1.DrawBitmap(bitmap, new RectangleF(0, 0, 800, 600), 1f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear); _renderTarget2D_window1.EndDraw(); _swapChain_window1.Present(0, PresentFlags.None); _renderTarget2D_window2.BeginDraw(); _renderTarget2D_window2.Clear(Color.Black); _renderTarget2D_window2.DrawBitmap(bitmap, new RectangleF(0, 0, 600, 500), 1f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear); _renderTarget2D_window2.EndDraw(); _swapChain_window2.Present(0, PresentFlags.None); ?   That depends on what you want to achieve the swap chain itself should have created a pair of render target and depth target buffers in each swapchain to serve as the front and back buffers of that chain.   If you do more offline rendering you might need more targets but that depends on whether the stuff being rendered to that target is view, projection dependent on the final rendering.   hi. thank for answer. but i don't understand what you say. can you explain using code? i need draw image on several window. 
  2. Stakhmich

    Render one image to several window

    thank you for answer. I'm read your link and have question. If i create several swapchain, i create several rendertarget too? In this way my render will be: _renderTarget2D_window1.BeginDraw(); _renderTarget2D_window1.Clear(Color.Black); _renderTarget2D_window1.DrawBitmap(bitmap, new RectangleF(0, 0, 800, 600), 1f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear); _renderTarget2D_window1.EndDraw(); _swapChain_window1.Present(0, PresentFlags.None); _renderTarget2D_window2.BeginDraw(); _renderTarget2D_window2.Clear(Color.Black); _renderTarget2D_window2.DrawBitmap(bitmap, new RectangleF(0, 0, 600, 500), 1f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear); _renderTarget2D_window2.EndDraw(); _swapChain_window2.Present(0, PresentFlags.None); ?
  3. Hi.  I have a question. How i can draw a image on 2 or more windows, using directx11? The windows have different resolution.   How i do it for one window: 1) create swapchain var swapChainDescription = new SwapChainDescription() { BufferCount = 1, ModeDescription = new ModeDescription() { Width = this.WidthImage, Height = this.HeightImage, Format = Format.R8G8B8A8_UNorm, RefreshRate = new Rational(60, 1) }, IsWindowed = true, OutputHandle = handleWindow, SampleDescription = new SampleDescription(1, 0), SwapEffect = SwapEffect.Discard, Usage = Usage.RenderTargetOutput }; ?2) CreateWithSwapChain SharpDX.Direct3D11.Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.BgraSupport, featureLevels, swapChainDescription, out device, out _swapChain); 3) create render target using (SharpDX.Direct2D1.Factory d2dFactory = new SharpDX.Direct2D1.Factory()) using (Surface surface = Texture2D.FromSwapChain<Texture2D>(_swapChain, 0).QueryInterface<Surface>()) { _renderTarget2D = new RenderTarget(d2dFactory, surface, new RenderTargetProperties(new SharpDX.Direct2D1.PixelFormat(Format.Unknown, AlphaMode.Premultiplied))); } 4) render _renderTarget2D.BeginDraw(); _renderTarget2D.Clear(Color.Black); renderTarget2D.DrawBitmap(bitmap, new RectangleF(0, 0, 800, 600), 1f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear); _renderTarget2D.EndDraw();
  4. Stakhmich

    SharpDX createswapchain error (-2005270527)

    After week searching i found errors reason - winapi! i update my window 7 and it's ok! 
  5. Stakhmich

    SharpDX createswapchain error (-2005270527)

    Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.Debug, description, out device, out swapChain); DeviceCreationFlags.Debug - this is i creates a device that supports the debug layer. or no?
  6. Stakhmich

    SharpDX createswapchain error (-2005270527)

    ok. i will try. you are draw in other window using directx/sharpdx/slimdx?
  7. i try create device and swap chain, and draw some text in other window application. i try use sharpDX and slimDX. my code SwapChainDescription description = new SwapChainDescription(); ModeDescription mode = new ModeDescription(); SampleDescription sample = new SampleDescription(); mode.Width = 100; mode.Height = 100; mode.RefreshRate = new Rational(60, 1); mode.Format = Format.R8G8B8A8_UNorm; mode.Scaling = DisplayModeScaling.Unspecified; mode.ScanlineOrdering = DisplayModeScanlineOrdering.Unspecified; sample.Count = 1; sample.Quality = 0; description.ModeDescription = mode; description.SampleDescription = sample; description.BufferCount = 1; description.Flags = SwapChainFlags.None; description.IsWindowed = true; description.OutputHandle = handle; //here i put window handle from other window application description.SwapEffect = SwapEffect.Discard; description.Usage = Usage.RenderTargetOutput; Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.Debug, description, out device, out swapChain);  when i careate render form and put into description.OutputHandle = renderForm.Handle - work fine. how i can draw in other window?  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!