IDXGIDevice1 dxgiDevice = device.QueryInterface(IDXGIDevice1.class);
IDXGIFactory1 dxgiFactory= dxgiDevice.GetParent(IDXGIAdapter1.class)
.GetParent(IDXGIFactory1.class);
final IDXGISwapChain swapChain = dxgiFactory.CreateSwapChain(dxgiDevice, DXGI.SwapChainDescription(frame));
dxgiDevice.Release();
dxgiFactory.Release();
ID3D11Texture2D backBuffer = swapChain.GetBuffer(0, ID3D11Texture2D.class);
final ID3D11RenderTargetView rtView = device.CreateRenderTargetView(backBuffer, null);
backBuffer.Release();