amerkoleci / Vortice.Windows

.NET bindings for Direct3D12, Direct3D11, WIC, Direct2D1, XInput, XAudio, X3DAudio, DXC, Direct3D9 and DirectInput.
MIT License
1.01k stars 73 forks source link

How should use `ID2D1RenderTarget.DrawBitmap` #331

Closed qwerty1874 closed 2 years ago

qwerty1874 commented 2 years ago

I have done:

using var wicFactory = new IWICImagingFactory();
using IWICBitmapDecoder decoder = wicFactory.CreateDecoderFromFileName(bitmapPath);
using IWICBitmapFrameDecode frame = decoder.GetFrame(0);
{
     ID2D1Bitmap bitmap = new ID2D1Bitmap(frame.NativePointer);
}

But this is wrong.

One more small question: How to disable vsync in the windowed mode

SwapChainFullscreenDescription fullscreenDescription = new SwapChainFullscreenDescription
{
     Windowed = true,
     RefreshRate = new Rational(0, 1)
};

This approach also looks wrong.

amerkoleci commented 2 years ago

Please use https://github.com/amerkoleci/Vortice.Windows/discussions for those types of questions