func (obj *Device) CreateAdditionalSwapChain(params PRESENT_PARAMETERS) (
	*SwapChain, PRESENT_PARAMETERS, Error,
) {
	var chain *SwapChain
	ret, _, _ := syscall.Syscall(
		obj.vtbl.CreateAdditionalSwapChain,
		3,
		uintptr(unsafe.Pointer(obj)),
		uintptr(unsafe.Pointer(&params)),
		uintptr(unsafe.Pointer(&chain)),
	)
	return chain, params, toErr(ret)
}
CreateAdditionalSwapChain creates an additional swap chain for rendering
multiple views.
package d3d9
import (
	"syscall"
	"unsafe"
)
type Device struct {
	vtbl *deviceVtbl
}
type deviceVtbl struct {
	QueryInterface uintptr
	AddRef         uintptr
	Release        uintptr
	TestCooperativeLevel        uintptr
	GetAvailableTextureMem      uintptr
	EvictManagedResources       uintptr
	GetDirect3D                 uintptr
	GetDeviceCaps               uintptr
	GetDisplayMode              uintptr
	GetCreationParameters       uintptr
	SetCursorProperties         uintptr
	SetCursorPosition           uintptr
	ShowCursor                  uintptr
	CreateAdditionalSwapChain   uintptr
	GetSwapChain                uintptr
	GetNumberOfSwapChains       uintptr
	Reset                       uintptr
	Present                     uintptr
	GetBackBuffer               uintptr
	GetRasterStatus             uintptr
	SetDialogBoxMode            uintptr
	SetGammaRamp                uintptr
	GetGammaRamp                uintptr
	CreateTexture               uintptr
	CreateVolumeTexture         uintptr
	CreateCubeTexture           uintptr
	CreateVertexBuffer          uintptr
	CreateIndexBuffer           uintptr
	CreateRenderTarget          uintptr
	CreateDepthStencilSurface   uintptr
	UpdateSurface               uintptr
	UpdateTexture               uintptr
	GetRenderTargetData         uintptr
	GetFrontBufferData          uintptr
	StretchRect                 uintptr
	ColorFill                   uintptr
	CreateOffscreenPlainSurface uintptr
	SetRenderTarget             uintptr
	GetRenderTarget             uintptr
	SetDepthStencilSurface      uintptr
	GetDepthStencilSurface      uintptr
	BeginScene                  uintptr
	EndScene                    uintptr
	Clear                       uintptr
	SetTransform                uintptr
	GetTransform                uintptr
	MultiplyTransform           uintptr
	SetViewport                 uintptr
	GetViewport                 uintptr
	SetMaterial                 uintptr
	GetMaterial                 uintptr
	SetLight                    uintptr
	GetLight                    uintptr
	LightEnable                 uintptr
	GetLightEnable              uintptr
	SetClipPlane                uintptr
	GetClipPlane                uintptr
	SetRenderState              uintptr
	GetRenderState              uintptr
	CreateStateBlock            uintptr
	BeginStateBlock             uintptr
	EndStateBlock               uintptr
	SetClipStatus               uintptr
	GetClipStatus               uintptr
	GetTexture                  uintptr
	SetTexture                  uintptr
	GetTextureStageState        uintptr
	SetTextureStageState        uintptr
	GetSamplerState             uintptr
	SetSamplerState             uintptr
	ValidateDevice              uintptr
	SetPaletteEntries           uintptr
	GetPaletteEntries           uintptr
	SetCurrentTexturePalette    uintptr
	GetCurrentTexturePalette    uintptr
	SetScissorRect              uintptr
	GetScissorRect              uintptr
	SetSoftwareVertexProcessing uintptr
	GetSoftwareVertexProcessing uintptr
	SetNPatchMode               uintptr
	GetNPatchMode               uintptr
	DrawPrimitive               uintptr
	DrawIndexedPrimitive        uintptr
	DrawPrimitiveUP             uintptr
	DrawIndexedPrimitiveUP      uintptr
	ProcessVertices             uintptr
	CreateVertexDeclaration     uintptr
	SetVertexDeclaration        uintptr
	GetVertexDeclaration        uintptr
	SetFVF                      uintptr
	GetFVF                      uintptr
	CreateVertexShader          uintptr
	SetVertexShader             uintptr
	GetVertexShader             uintptr
	SetVertexShaderConstantF    uintptr
	GetVertexShaderConstantF    uintptr
	SetVertexShaderConstantI    uintptr
	GetVertexShaderConstantI    uintptr
	SetVertexShaderConstantB    uintptr
	GetVertexShaderConstantB    uintptr
	SetStreamSource             uintptr
	GetStreamSource             uintptr
	SetStreamSourceFreq         uintptr
	GetStreamSourceFreq         uintptr
	SetIndices                  uintptr
	GetIndices                  uintptr
	CreatePixelShader           uintptr
	SetPixelShader              uintptr
	GetPixelShader              uintptr
	SetPixelShaderConstantF     uintptr
	GetPixelShaderConstantF     uintptr
	SetPixelShaderConstantI     uintptr
	GetPixelShaderConstantI     uintptr
	SetPixelShaderConstantB     uintptr
	GetPixelShaderConstantB     uintptr
	DrawRectPatch               uintptr
	DrawTriPatch                uintptr
	DeletePatch                 uintptr
	CreateQuery                 uintptr
}
func (obj *Device) AddRef() uint32 {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.AddRef,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint32(ret)
}
func (obj *Device) Release() uint32 {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.Release,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint32(ret)
}
func (obj *Device) TestCooperativeLevel() Error {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.TestCooperativeLevel,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return toErr(ret)
}
func (obj *Device) GetAvailableTextureMem() uint {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetAvailableTextureMem,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint(ret)
}
func (obj *Device) EvictManagedResources() Error {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.EvictManagedResources,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return toErr(ret)
}
func (obj *Device) GetDirect3D() (d3d *Direct3D, err Error) {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetDirect3D,
		2,
		uintptr(unsafe.Pointer(obj)),
		uintptr(unsafe.Pointer(&d3d)),
		0,
	)
	err = toErr(ret)
	return
}
func (obj *Device) GetDeviceCaps() (CAPS, Error) {
	var caps CAPS
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetDeviceCaps,
		2,
		uintptr(unsafe.Pointer(obj)),
		uintptr(unsafe.Pointer(&caps)),
		0,
	)
	return caps, toErr(ret)
}
func (obj *Device) GetDisplayMode(swapChain uint) (DISPLAYMODE, Error) {
	var mode DISPLAYMODE
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetDisplayMode,
		3,
		uintptr(unsafe.Pointer(obj)),
		uintptr(swapChain),
		uintptr(unsafe.Pointer(&mode)),
	)
	return mode, toErr(ret)
}
func (obj *Device) GetCreationParameters() (DEVICE_CREATION_PARAMETERS, Error) {
	var params DEVICE_CREATION_PARAMETERS
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetCreationParameters,
		2,
		uintptr(unsafe.Pointer(obj)),
		uintptr(unsafe.Pointer(&params)),
		0,
	)
	return params, toErr(ret)
}
func (obj *Device) SetCursorProperties(
	xHotSpot uint,
	yHotSpot uint,
	cursorBitmap *Surface,
) Error {
	ret, _, _ := syscall.Syscall6(
		obj.vtbl.SetCursorProperties,
		4,
		uintptr(unsafe.Pointer(obj)),
		uintptr(xHotSpot),
		uintptr(yHotSpot),
		uintptr(unsafe.Pointer(cursorBitmap)),
		0,
		0,
	)
	return toErr(ret)
}
func (obj *Device) SetCursorPosition(x int, y int, flags uint32) {
	syscall.Syscall6(
		obj.vtbl.SetCursorPosition,
		4,
		uintptr(unsafe.Pointer(obj)),
		uintptr(x),
		uintptr(y),
		uintptr(flags),
		0,
		0,
	)
}
func (obj *Device) ShowCursor(show bool) bool {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.ShowCursor,
		2,
		uintptr(unsafe.Pointer(obj)),
		uintptrBool(show),
		0,
	)
	return ret != 0
}