func (obj *Direct3D) GetAdapterModeCount(adapter uint, format FORMAT) uint {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetAdapterModeCount,
		3,
		uintptr(unsafe.Pointer(obj)),
		uintptr(adapter),
		uintptr(format),
	)
	return uint(ret)
}
GetAdapterModeCount returns the number of display modes available on this
adapter.
package d3d9
import (
	"errors"
	"syscall"
	"unsafe"
)
var (
	dll             = syscall.NewLazyDLL("d3d9.dll")
	direct3DCreate9 = dll.NewProc("Direct3DCreate9")
)
func Create(version uint) (*Direct3D, error) {
	obj, _, _ := direct3DCreate9.Call(uintptr(version))
	if obj == 0 {
		return nil, errors.New("Direct3DCreate9 returned nil")
	}
	return (*Direct3D)(unsafe.Pointer(obj)), nil
}
type Direct3D struct {
	vtbl *direct3DVtbl
}
type direct3DVtbl struct {
	QueryInterface uintptr
	AddRef         uintptr
	Release        uintptr
	RegisterSoftwareDevice      uintptr
	GetAdapterCount             uintptr
	GetAdapterIdentifier        uintptr
	GetAdapterModeCount         uintptr
	EnumAdapterModes            uintptr
	GetAdapterDisplayMode       uintptr
	CheckDeviceType             uintptr
	CheckDeviceFormat           uintptr
	CheckDeviceMultiSampleType  uintptr
	CheckDepthStencilMatch      uintptr
	CheckDeviceFormatConversion uintptr
	GetDeviceCaps               uintptr
	GetAdapterMonitor           uintptr
	CreateDevice                uintptr
}
func (obj *Direct3D) AddRef() uint32 {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.AddRef,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint32(ret)
}
func (obj *Direct3D) Release() uint32 {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.Release,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint32(ret)
}
func (obj *Direct3D) RegisterSoftwareDevice(initFunc uintptr) Error {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.RegisterSoftwareDevice,
		2,
		uintptr(unsafe.Pointer(obj)),
		initFunc,
		0,
	)
	return toErr(ret)
}
func (obj *Direct3D) GetAdapterCount() uint {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.GetAdapterCount,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint(ret)
}
func (obj *Direct3D) GetAdapterIdentifier(
	adapter uint,
	flags uint32,
) (id ADAPTER_IDENTIFIER, err Error) {
	ret, _, _ := syscall.Syscall6(
		obj.vtbl.GetAdapterIdentifier,
		4,
		uintptr(unsafe.Pointer(obj)),
		uintptr(adapter),
		uintptr(flags),
		uintptr(unsafe.Pointer(&id)),
		0,
		0,
	)
	err = toErr(ret)
	return
}