app/internal/d3d11: only use passed in ID3D11Device in NewBackend

We're about to enable drawing into foreign Direct3D contexts. In
preparation, NewBackend should only need a device handle.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-03-04 19:51:05 +01:00
parent 932465d891
commit c3dde562df
2 changed files with 49 additions and 32 deletions
+12
View File
@@ -924,6 +924,18 @@ func (d *_ID3D11Device) GetFeatureLevel() int {
return int(lvl)
}
func (d *_ID3D11Device) GetImmediateContext() *_ID3D11DeviceContext {
var ctx *_ID3D11DeviceContext
syscall.Syscall(
d.vtbl.GetImmediateContext,
2,
uintptr(unsafe.Pointer(d)),
uintptr(unsafe.Pointer(&ctx)),
0,
)
return ctx
}
func (s *_IDXGISwapChain) GetDesc() (_DXGI_SWAP_CHAIN_DESC, error) {
var desc _DXGI_SWAP_CHAIN_DESC
r, _, _ := syscall.Syscall(