SharpDX 2D Window Resize

0

i want render resize

CODE

mSwapChainDesc = new dx.SwapChainDescription()
{
    BufferCount = 1,
    IsWindowed = true,
    OutputHandle = Target.Handle,
    SwapEffect = dx.SwapEffect.Discard,
    Usage = dx.Usage.RenderTargetOutput | dx.Usage.ShaderInput,
    Flags = dx.SwapChainFlags.None,
    ModeDescription = new dx.ModeDescription(Target.ClientSize.Width, Target.ClientSize.Height, dx.Rational.Empty, dx.Format.B8G8R8A8_UNorm),
    SampleDescription = new dx.SampleDescription(1, 0)
};

d3.Device.CreateWithSwapChain(d3d.DriverType.Hardware, d3.DeviceCreationFlags.BgraSupport, mSwapChainDesc, out mD3Device, out mSwapChain);
mSurface = dx.Surface.FromSwapChain(mSwapChain, 0);

Factory = new d2.Factory();
DWFactory = new dWrite.Factory();
mDevice = new d2.DeviceContext(mSurface);

mRenderCallback = new dWin.RenderLoop.RenderCallback(Render);

Tryied

mSwapChain.ResizeBuffers(
    mSwapChain.Description.BufferCount, 
    renderSize.Value.Width, 
    renderSize.Value.Height, 
    mSwapChain.Description.ModeDescription.Format, 
    mSwapChain.Description.Flags);

Error

HRESULT: [0x887A0001], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_INVALID_CALL/InvalidCall]

c#
sharpdx
asked on Stack Overflow Mar 19, 2016 by 최진용 • edited Mar 19, 2016 by Red

1 Answer

0

check the remarks here on the MSDN.

if that doesn't help I thought there was a flag or something you needed to be able to use the resize method. which would explain your hresult

HRESULT: 0x887A0001 : The application provided invalid parameter data; this must be debugged and fixed before the application is released.,

DXGI_ERROR Codes.

I think the surface is tripping you up. release it before you call resize.

answered on Stack Overflow Mar 20, 2016 by RadioSpace

User contributions licensed under CC BY-SA 3.0