
Strict

Const D3DADAPTER_DEFAULT=0

Const D3DENUMRET_CANCEL=0
Const D3DENUMRET_OK=1

Const D3DSTATUS=$08760000
Const D3DHRESULT=$88760000

Const D3DERR_WRONGTEXTUREFORMAT=D3DHRESULT|2072
Const D3DERR_UNSUPPORTEDCOLOROPERATION=D3DHRESULT|2073
Const D3DERR_UNSUPPORTEDCOLORARG=D3DHRESULT|2074
Const D3DERR_UNSUPPORTEDALPHAOPERATION=D3DHRESULT|2075
Const D3DERR_UNSUPPORTEDALPHAARG=D3DHRESULT|2076
Const D3DERR_TOOMANYOPERATIONS=D3DHRESULT|2077
Const D3DERR_CONFLICTINGTEXTUREFILTER=D3DHRESULT|2078
Const D3DERR_UNSUPPORTEDFACTORVALUE=D3DHRESULT|2079
Const D3DERR_CONFLICTINGRENDERSTATE=D3DHRESULT|2081
Const D3DERR_UNSUPPORTEDTEXTUREFILTER=D3DHRESULT|2082
Const D3DERR_CONFLICTINGTEXTUREPALETTE=D3DHRESULT|2086
Const D3DERR_DRIVERINTERNALERROR=D3DHRESULT|2087
Const D3DERR_NOTFOUND=D3DHRESULT|2150
Const D3DERR_MOREDATA=D3DHRESULT|2151
Const D3DERR_DEVICELOST=D3DHRESULT|2152
Const D3DERR_DEVICENOTRESET=D3DHRESULT|2153
Const D3DERR_NOTAVAILABLE=D3DHRESULT|2154
Const D3DERR_OUTOFVIDEOMEMORY=D3DHRESULT|380
Const D3DERR_INVALIDDEVICE=D3DHRESULT|2155
Const D3DERR_INVALIDCALL=D3DHRESULT|2156
Const D3DERR_DRIVERINVALIDCALL=D3DHRESULT|2157
Const D3DERR_WASSTILLDRAWING=D3DHRESULT|540

Const D3D_OK=0
Const D3DOK_NOAUTOGEN=D3DSTATUS|2159

Const D3DLOCK_READONLY=$10
Const D3DLOCK_DISCARD=$2000
Const D3DLOCK_NOOVERWRITE=$1000
Const D3DLOCK_NOSYSLOCK=$800
Const D3DLOCK_DONOTWAIT=$4000
Const D3DLOCK_NO_DIRTY_UPDATE=$8000

Const D3DUSAGE_RENDERTARGET=$1
Const D3DUSAGE_DEPTHSTENCIL=$2
Const D3DUSAGE_DYNAMIC=$200
Const D3DUSAGE_AUTOGENMIPMAP=$400
Const D3DUSAGE_DMAP=$4000
Const D3DUSAGE_QUERY_LEGACYBUMPMAP=$8000
Const D3DUSAGE_QUERY_SRGBREAD=$10000
Const D3DUSAGE_QUERY_FILTER=$20000
Const D3DUSAGE_QUERY_SRGBWRITE=$40000
Const D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING=$80000
Const D3DUSAGE_QUERY_VERTEXTEXTURE=$100000
Const D3DUSAGE_WRITEONLY=$8
Const D3DUSAGE_SOFTWAREPROCESSING=$10
Const D3DUSAGE_DONOTCLIP=$20
Const D3DUSAGE_POINTS=$40
Const D3DUSAGE_RTPATCHES=$80
Const D3DUSAGE_NPATCHES=$100

'D3DTEXTUREADDRESS
Const D3DTADDRESS_WRAP=1
Const D3DTADDRESS_MIRROR=2
Const D3DTADDRESS_CLAMP=3
Const D3DTADDRESS_BORDER=4
Const D3DTADDRESS_MIRRORONCE=5

'D3DMATERIALCOLORSOURCE
Const D3DMCS_MATERIAL=0
Const D3DMCS_COLOR1=1
Const D3DMCS_COLOR2=2

'D3DBLEND
Const D3DBLEND_ZERO=1
Const D3DBLEND_ONE=2
Const D3DBLEND_SRCCOLOR=3
Const D3DBLEND_INVSRCCOLOR=4
Const D3DBLEND_SRCALPHA=5
Const D3DBLEND_INVSRCALPHA=6
Const D3DBLEND_DESTALPHA=7
Const D3DBLEND_INVDESTALPHA=8
Const D3DBLEND_DESTCOLOR=9
Const D3DBLEND_INVDESTCOLOR=10
Const D3DBLEND_SRCALPHASAT=11
Const D3DBLEND_BOTHSRCALPHA=12
Const D3DBLEND_BOTHINVSRCALPHA=13
Const D3DBLEND_BLENDFACTOR=14
Const D3DBLEND_INVBLENDFACTOR=15

'D3DTEXTUREOP
Const D3DTOP_DISABLE=1
Const D3DTOP_SELECTARG1=2
Const D3DTOP_SELECTARG2=3
Const D3DTOP_MODULATE=4
Const D3DTOP_MODULATE2X=5
Const D3DTOP_MODULATE4X=6
Const D3DTOP_ADD=7
Const D3DTOP_ADDSIGNED=8
Const D3DTOP_ADDSIGNED2X=9
Const D3DTOP_SUBTRACT=10
Const D3DTOP_ADDSMOOTH=11
Const D3DTOP_BLENDDIFFUSEALPHA=12
Const D3DTOP_BLENDTEXTUREALPHA=13
Const D3DTOP_BLENDFACTORALPHA=14
Const D3DTOP_BLENDTEXTUREALPHAPM=15
Const D3DTOP_BLENDCURRENTALPHA=16
Const D3DTOP_PREMODULATE=17
Const D3DTOP_MODULATEALPHA_ADDCOLOR=18
Const D3DTOP_MODULATECOLOR_ADDALPHA=19
Const D3DTOP_MODULATEINVALPHA_ADDCOLOR=20
Const D3DTOP_MODULATEINVCOLOR_ADDALPHA=21
Const D3DTOP_BUMPENVMAP=22
Const D3DTOP_BUMPENVMAPLUMINANCE=23
Const D3DTOP_DOTPRODUCT3=24
Const D3DTOP_MULTIPLYADD=25
Const D3DTOP_LERP=26

Const D3DTA_SELECTMASK=$f
Const D3DTA_DIFFUSE=$0
Const D3DTA_CURRENT=$1
Const D3DTA_TEXTURE=$2
Const D3DTA_TFACTOR=$3
Const D3DTA_SPECULAR=$4
Const D3DTA_TEMP=$5
Const D3DTA_CONSTANT=$6
Const D3DTA_COMPLEMENT=$10
Const D3DTA_ALPHAREPLICATE=$20

'D3DCULL
Const D3DCULL_NONE=1
Const D3DCULL_CW=2
Const D3DCULL_CCW=3

'D3DCMPFUNC
Const D3DCMP_NEVER=1
Const D3DCMP_LESS=2
Const D3DCMP_EQUAL=3
Const D3DCMP_LESSEQUAL=4
Const D3DCMP_GREATER=5
Const D3DCMP_NOTEQUAL=6
Const D3DCMP_GREATEREQUAL=7
Const D3DCMP_ALWAYS=8

'D3DSTENCILOP
Const D3DSTENCILOP_KEEP=1
Const D3DSTENCILOP_ZERO=2
Const D3DSTENCILOP_REPLACE=3
Const D3DSTENCILOP_INCRSAT=4
Const D3DSTENCILOP_DECRSAT=5
Const D3DSTENCILOP_INVERT=6
Const D3DSTENCILOP_INCR=7
Const D3DSTENCILOP_DECR=8

'D3DFORMAT
Const D3DFMT_UNKNOWN=0
Const D3DFMT_R8G8B8=20
Const D3DFMT_A8R8G8B8=21
Const D3DFMT_X8R8G8B8=22
Const D3DFMT_R5G6B5=23
Const D3DFMT_X1R5G5B5=24
Const D3DFMT_A1R5G5B5=25
Const D3DFMT_A4R4G4B4=26
Const D3DFMT_R3G3B2=27
Const D3DFMT_A8=28
Const D3DFMT_A8R3G3B2=29
Const D3DFMT_X4R4G4B4=30
Const D3DFMT_A2B10G10R10=31
Const D3DFMT_A8B8G8R8=32
Const D3DFMT_X8B8G8R8=33
Const D3DFMT_G16R16=34
Const D3DFMT_A2R10G10B10=35
Const D3DFMT_A16B16G16R16=36
Const D3DFMT_D16_LOCKABLE=70
Const D3DFMT_D32=71
Const D3DFMT_D15S1=73
Const D3DFMT_D24S8=75
Const D3DFMT_D24X8=77
Const D3DFMT_D24X4S4=79
Const D3DFMT_D16=80
Const D3DFMT_D32F_LOCKABLE=82
Const D3DFMT_D24FS8=83
Const D3DFMT_VERTEXDATA=100
Const D3DFMT_INDEX16=101
Const D3DFMT_INDEX32=102

'D3DDEVTYPE
Const D3DDEVTYPE_HAL=1
Const D3DDEVTYPE_REF=2
Const D3DDEVTYPE_SW=3

'D3DRESOURCETYPE
Const D3DRTYPE_SURFACE=1
Const D3DRTYPE_VOLUME=2
Const D3DRTYPE_TEXTURE=3
Const D3DRTYPE_VOLUMETEXTURE=4
Const D3DRTYPE_CUBETEXTURE=5
Const D3DRTYPE_VERTEXBUFFER=6
Const D3DRTYPE_INDEXBUFFER=7

'D3DMULTISAMPLE_TYPE
Const D3DMULTISAMPLE_NONE=0
Const D3DMULTISAMPLE_NONMASKABLE=1
Const D3DMULTISAMPLE_2_SAMPLES=2
Const D3DMULTISAMPLE_3_SAMPLES=3
Const D3DMULTISAMPLE_4_SAMPLES=4
Const D3DMULTISAMPLE_5_SAMPLES=5
Const D3DMULTISAMPLE_6_SAMPLES=6
Const D3DMULTISAMPLE_7_SAMPLES=7
Const D3DMULTISAMPLE_8_SAMPLES=8
Const D3DMULTISAMPLE_9_SAMPLES=9
Const D3DMULTISAMPLE_10_SAMPLES=10
Const D3DMULTISAMPLE_11_SAMPLES=11
Const D3DMULTISAMPLE_12_SAMPLES=12
Const D3DMULTISAMPLE_13_SAMPLES=13
Const D3DMULTISAMPLE_14_SAMPLES=14
Const D3DMULTISAMPLE_15_SAMPLES=15
Const D3DMULTISAMPLE_16_SAMPLES=16

'D3DSWAPEFFECT
Const D3DSWAPEFFECT_DISCARD=1
Const D3DSWAPEFFECT_FLIP=2
Const D3DSWAPEFFECT_COPY=3

'D3DPRESENT
Const D3DPRESENT_INTERVAL_DEFAULT=0
Const D3DPRESENT_INTERVAL_ONE=1
Const D3DPRESENT_INTERVAL_TWO=2
Const D3DPRESENT_INTERVAL_THREE=4
Const D3DPRESENT_INTERVAL_FOUR=8
Const D3DPRESENT_INTERVAL_IMMEDIATE=$80000000

'D3DPOOL
Const D3DPOOL_DEFAULT=0
Const D3DPOOL_MANAGED=1
Const D3DPOOL_SYSTEMMEM=2
Const D3DPOOL_SCRATCH=3

'D3DBACKBUFFER_TYPE
Const D3DBACKBUFFER_TYPE_MONO=0
Const D3DBACKBUFFER_TYPE_LEFT=1
Const D3DBACKBUFFER_TYPE_RIGHT=2

'D3DTEXTUREFILTERTYPE
Const D3DTEXF_NONE=0
Const D3DTEXF_POINT=1
Const D3DTEXF_LINEAR=2
Const D3DTEXF_ANISOTROPIC=3
Const D3DTEXF_PYRAMIDALQUAD=6
Const D3DTEXF_GAUSSIANQUAD=7

'D3DTRANSFORMSTATETYPE
Const D3DTS_VIEW=2
Const D3DTS_PROJECTION=3
Const D3DTS_TEXTURE0=16
Const D3DTS_TEXTURE1=17
Const D3DTS_TEXTURE2=18
Const D3DTS_TEXTURE3=19
Const D3DTS_TEXTURE4=20
Const D3DTS_TEXTURE5=21
Const D3DTS_TEXTURE6=22
Const D3DTS_TEXTURE7=23
Const D3DTS_WORLD=256
Const D3DTS_WORLD1=257
Const D3DTS_WORLD2=258
Const D3DTS_WORLD3=259
'D3DLIGHTTYPE
Const D3DLIGHT_POINT=1
Const D3DLIGHT_SPOT=2
Const D3DLIGHT_DIRECTIONAL=3

'D3DRENDERSTATETYPE
Const D3DRS_TEXTUREPERSPECTIVE=4	'dx7 only
Const D3DRS_ZENABLE=7
Const D3DRS_FILLMODE=8
Const D3DRS_SHADEMODE=9
Const D3DRS_ZWRITEENABLE=14
Const D3DRS_ALPHATESTENABLE=15
Const D3DRS_LASTPIXEL=16
Const D3DRS_SRCBLEND=19
Const D3DRS_DESTBLEND=20
Const D3DRS_CULLMODE=22
Const D3DRS_ZFUNC=23
Const D3DRS_ALPHAREF=24
Const D3DRS_ALPHAFUNC=25
Const D3DRS_DITHERENABLE=26
Const D3DRS_ALPHABLENDENABLE=27
Const D3DRS_FOGENABLE=28
Const D3DRS_SPECULARENABLE=29
Const D3DRS_FOGCOLOR=34
Const D3DRS_FOGTABLEMODE=35
Const D3DRS_FOGSTART=36
Const D3DRS_FOGEND=37
Const D3DRS_FOGDENSITY=38
Const D3DRS_RANGEFOGENABLE=48
Const D3DRS_STENCILENABLE=52
Const D3DRS_STENCILFAIL=53
Const D3DRS_STENCILZFAIL=54
Const D3DRS_STENCILPASS=55
Const D3DRS_STENCILFUNC=56
Const D3DRS_STENCILREF=57
Const D3DRS_STENCILMASK=58
Const D3DRS_STENCILWRITEMASK=59
Const D3DRS_TEXTUREFACTOR=60
Const D3DRS_WRAP0=128
Const D3DRS_WRAP1=129
Const D3DRS_WRAP2=130
Const D3DRS_WRAP3=131
Const D3DRS_WRAP4=132
Const D3DRS_WRAP5=133
Const D3DRS_WRAP6=134
Const D3DRS_WRAP7=135
Const D3DRS_CLIPPING=136
Const D3DRS_LIGHTING=137
Const D3DRS_AMBIENT=139
Const D3DRS_FOGVERTEXMODE=140
Const D3DRS_COLORVERTEX=141
Const D3DRS_LOCALVIEWER=142
Const D3DRS_NORMALIZENORMALS=143
Const D3DRS_DIFFUSEMATERIALSOURCE=145
Const D3DRS_SPECULARMATERIALSOURCE=146
Const D3DRS_AMBIENTMATERIALSOURCE=147
Const D3DRS_EMISSIVEMATERIALSOURCE=148
Const D3DRS_VERTEXBLEND=151
Const D3DRS_CLIPPLANEENABLE=152
Const D3DRS_POINTSIZE=154
Const D3DRS_POINTSIZE_MIN=155
Const D3DRS_POINTSPRITEENABLE=156
Const D3DRS_POINTSCALEENABLE=157
Const D3DRS_POINTSCALE_A=158
Const D3DRS_POINTSCALE_B=159
Const D3DRS_POINTSCALE_C=160
Const D3DRS_MULTISAMPLEANTIALIAS=161
Const D3DRS_MULTISAMPLEMASK=162
Const D3DRS_PATCHEDGESTYLE=163
Const D3DRS_DEBUGMONITORTOKEN=165
Const D3DRS_POINTSIZE_MAX=166
Const D3DRS_INDEXEDVERTEXBLENDENABLE=167
Const D3DRS_COLORWRITEENABLE=168
Const D3DRS_TWEENFACTOR=170
Const D3DRS_BLENDOP=171
Const D3DRS_POSITIONDEGREE=172
Const D3DRS_NORMALDEGREE=173
Const D3DRS_SCISSORTESTENABLE=174
Const D3DRS_SLOPESCALEDEPTHBIAS=175
Const D3DRS_ANTIALIASEDLINEENABLE=176
Const D3DRS_MINTESSELLATIONLEVEL=178
Const D3DRS_MAXTESSELLATIONLEVEL=179
Const D3DRS_ADAPTIVETESS_X=180
Const D3DRS_ADAPTIVETESS_Y=181
Const D3DRS_ADAPTIVETESS_Z=182
Const D3DRS_ADAPTIVETESS_W=183
Const D3DRS_ENABLEADAPTIVETESSELLATION=184
Const D3DRS_TWOSIDEDSTENCILMODE=185
Const D3DRS_CCW_STENCILFAIL=186
Const D3DRS_CCW_STENCILZFAIL=187
Const D3DRS_CCW_STENCILPASS=188
Const D3DRS_CCW_STENCILFUNC=189
Const D3DRS_COLORWRITEENABLE1=190
Const D3DRS_COLORWRITEENABLE2=191
Const D3DRS_COLORWRITEENABLE3=192
Const D3DRS_BLENDFACTOR=193
Const D3DRS_SRGBWRITEENABLE=194
Const D3DRS_DEPTHBIAS=195
Const D3DRS_WRAP8=198
Const D3DRS_WRAP9=199
Const D3DRS_WRAP10=200
Const D3DRS_WRAP11=201
Const D3DRS_WRAP12=202
Const D3DRS_WRAP13=203
Const D3DRS_WRAP14=204
Const D3DRS_WRAP15=205
Const D3DRS_SEPARATEALPHABLENDENABLE=206
Const D3DRS_SRCBLENDALPHA=207
Const D3DRS_DESTBLENDALPHA=208
Const D3DRS_BLENDOPALPHA=209

'D3DTEXTURESTAGESTATETYPE
Const D3DTSS_COLOROP=1
Const D3DTSS_COLORARG1=2
Const D3DTSS_COLORARG2=3
Const D3DTSS_ALPHAOP=4
Const D3DTSS_ALPHAARG1=5
Const D3DTSS_ALPHAARG2=6
Const D3DTSS_BUMPENVMAT00=7
Const D3DTSS_BUMPENVMAT01=8
Const D3DTSS_BUMPENVMAT10=9
Const D3DTSS_BUMPENVMAT11=10
Const D3DTSS_TEXCOORDINDEX=11
Const D3DTSS_ADDRESS=12	'dx7 only
Const D3DTSS_MAGFILTER=16 'dx7 only
Const D3DTSS_MINFILTER=17 'dx7 only
Const D3DTSS_MIPFILTER=18 'dx7 only
Const D3DTSS_BUMPENVLSCALE=22
Const D3DTSS_BUMPENVLOFFSET=23
Const D3DTSS_TEXTURETRANSFORMFLAGS=24
Const D3DTSS_COLORARG0=26
Const D3DTSS_ALPHAARG0=27
Const D3DTSS_RESULTARG=28
Const D3DTSS_CONSTANT=32

'D3DSAMPLERSTATETYPE
Const D3DSAMP_ADDRESSU=1
Const D3DSAMP_ADDRESSV=2
Const D3DSAMP_ADDRESSW=3
Const D3DSAMP_BORDERCOLOR=4
Const D3DSAMP_MAGFILTER=5
Const D3DSAMP_MINFILTER=6
Const D3DSAMP_MIPFILTER=7
Const D3DSAMP_MIPMAPLODBIAS=8
Const D3DSAMP_MAXMIPLEVEL=9
Const D3DSAMP_MAXANISOTROPY=10
Const D3DSAMP_SRGBTEXTURE=11
Const D3DSAMP_ELEMENTINDEX=12
Const D3DSAMP_DMAPOFFSET=13

'D3DSTATEBLOCKTYPE
Const D3DSBT_ALL=1
Const D3DSBT_PIXELSTATE=2
Const D3DSBT_VERTEXSTATE=3

'D3DPRIMITIVETYPE
Const D3DPT_POINTLIST=1
Const D3DPT_LINELIST=2
Const D3DPT_LINESTRIP=3
Const D3DPT_TRIANGLELIST=4
Const D3DPT_TRIANGLESTRIP=5
Const D3DPT_TRIANGLEFAN=6

'D3DDECLUSAGE
Const D3DDECLUSAGE_POSITION=0
Const D3DDECLUSAGE_BLENDWEIGHT=1
Const D3DDECLUSAGE_BLENDINDICES=2
Const D3DDECLUSAGE_NORMAL=3
Const D3DDECLUSAGE_PSIZE=4
Const D3DDECLUSAGE_TEXCOORD=5
Const D3DDECLUSAGE_TANGENT=6
Const D3DDECLUSAGE_BINORMAL=7
Const D3DDECLUSAGE_TESSFACTOR=8
Const D3DDECLUSAGE_POSITIONT=9
Const D3DDECLUSAGE_COLOR=10
Const D3DDECLUSAGE_FOG=11
Const D3DDECLUSAGE_DEPTH=12
Const D3DDECLUSAGE_SAMPLE=13

'D3DDECLMETHOD
Const D3DDECLMETHOD_DEFAULT=0
Const D3DDECLMETHOD_PARTIALU=1
Const D3DDECLMETHOD_PARTIALV=2
Const D3DDECLMETHOD_CROSSUV=3
Const D3DDECLMETHOD_UV=4
Const D3DDECLMETHOD_LOOKUP=5
Const D3DDECLMETHOD_LOOKUPPRESAMPLED=6

'D3DDECLTYPE
Const D3DDECLTYPE_FLOAT1=0
Const D3DDECLTYPE_FLOAT2=1
Const D3DDECLTYPE_FLOAT3=2
Const D3DDECLTYPE_FLOAT4=3
Const D3DDECLTYPE_D3DCOLOR=4
Const D3DDECLTYPE_UBYTE4=5
Const D3DDECLTYPE_SHORT2=6
Const D3DDECLTYPE_SHORT4=7
Const D3DDECLTYPE_UBYTE4N=8
Const D3DDECLTYPE_SHORT2N=9
Const D3DDECLTYPE_SHORT4N=10
Const D3DDECLTYPE_USHORT2N=11
Const D3DDECLTYPE_USHORT4N=12
Const D3DDECLTYPE_UDEC3=13
Const D3DDECLTYPE_DEC3N=14
Const D3DDECLTYPE_FLOAT16_2=15
Const D3DDECLTYPE_FLOAT16_4=16
Const D3DDECLTYPE_UNUSED=17

'D3DQUERYTYPE
Const D3DQUERYTYPE_VCACHE=4
Const D3DQUERYTYPE_RESOURCEMANAGER=5
Const D3DQUERYTYPE_VERTEXSTATS=6
Const D3DQUERYTYPE_EVENT=8
Const D3DQUERYTYPE_OCCLUSION=9

Const D3DISSUE_END=1
Const D3DISSUE_BEGIN=2

Const D3DGETDATA_FLUSH=1

Const D3DFVF_POSITION_MASK=$400e
Const D3DFVF_XYZ=$2
Const D3DFVF_XYZRHW=$4
Const D3DFVF_XYZB1=$6
Const D3DFVF_XYZB2=$8
Const D3DFVF_XYZB3=$a
Const D3DFVF_XYZB4=$c
Const D3DFVF_XYZB5=$e
Const D3DFVF_XYZW=$4002
Const D3DFVF_NORMAL=$10
Const D3DFVF_PSIZE=$20
Const D3DFVF_DIFFUSE=$40
Const D3DFVF_SPECULAR=$80
Const D3DFVF_TEXCOUNT_MASK=$f00
Const D3DFVF_TEXCOUNT_SHIFT=8
Const D3DFVF_TEX0=$000
Const D3DFVF_TEX1=$100
Const D3DFVF_TEX2=$200
Const D3DFVF_TEX3=$300
Const D3DFVF_TEX4=$400
Const D3DFVF_TEX5=$500
Const D3DFVF_TEX6=$600
Const D3DFVF_TEX7=$700
Const D3DFVF_TEX8=$800

Const D3DPRESENTFLAG_LOCKABLE_BACKBUFFER=1
Const D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL=2
Const D3DPRESENTFLAG_DEVICECLIP=4
Const D3DPRESENTFLAG_VIDEO=16

Const D3DCREATE_FPU_PRESERVE=$2
Const D3DCREATE_MULTITHREADED=$4
Const D3DCREATE_PUREDEVICE=$10
Const D3DCREATE_SOFTWARE_VERTEXPROCESSING=$20
Const D3DCREATE_HARDWARE_VERTEXPROCESSING=$40
Const D3DCREATE_MIXED_VERTEXPROCESSING=$80
Const D3DCREATE_DISABLE_DRIVER_MANAGEMENT=$100
Const D3DCREATE_ADAPTERGROUP_DEVICE=$200

Const D3DCLEAR_TARGET=$1
Const D3DCLEAR_ZBUFFER=$2
Const D3DCLEAR_STENCIL=$4

Const D3DCS_LEFT=$1
Const D3DCS_RIGHT=$2
Const D3DCS_TOP=$4
Const D3DCS_BOTTOM=$8
Const D3DCS_FRONT=$10
Const D3DCS_BACK=$20
Const D3DCS_PLANE0=$40
Const D3DCS_PLANE1=$80
Const D3DCS_PLANE2=$100
Const D3DCS_PLANE3=$200
Const D3DCS_PLANE4=$400
Const D3DCS_PLANE5=$800
Const D3DCS_ALL=$fff

Const D3DCLIPSTATUS_STATUS=$1
Const D3DCLIPSTATUS_EXTENTS2=$2
Const D3DCLIPSTATUS_EXTENTS3=$4

Const D3DSHADE_FLAT=1
Const D3DSHADE_GOURAUD=2
Const D3DSHADE_PHONG=3

Type D3DCLIPSTATUS
	Field dwFlags
	Field dwStatus
	Field minx,maxx
	Field miny,maxy
	Field minz,maxz
End Type

Type D3DMATRIX
	Field _11#,_12#,_13#,_14#
	Field _21#,_22#,_23#,_24#
	Field _31#,_32#,_33#,_34#
	Field _41#,_42#,_43#,_44#
End Type

Type D3DDISPLAYMODE
	Field Width,Height,RefreshRate,Format
End Type

Type D3DRASTER_STATUS
	Field InVBlank
	Field ScanLine
End Type

Type D3DPRESENT_PARAMETERS
	Field BackBufferWidth
	Field BackBufferHeight
	Field BackBufferFormat
	Field BackBufferCount

	Field MultiSampleType
	Field MultiSampleQuality

	Field SwapEffect
	Field hDeviceWindow
	Field Windowed
	Field EnableAutoDepthStencil
	Field AutoDepthStencilFormat
	Field Flags

	Field FullScreen_RefreshRateInHz
	Field PresentationInterval
End Type

Type D3DSURFACE_DESC
	Field Format
	Field Type_
	Field Usage
	Field Pool
	Field MultiSampleType
	Field MultiSampleQuality
	Field Width
	Field Height
End Type

Type D3DLOCKED_RECT
	Field Pitch
	Field pBits:Byte Ptr
End Type

Type D3DRECTPATCH_INFO
	Field StartVertexOffsetWidth
	Field StartVertexOffsetHeight
	Field Width
	Field Height
	Field Stride
	Field Basis
	Field Degree
End Type

Type D3DTRIPATCH_INFO
	Field StartVertexOffset
	Field NumVertices
	Field Basis
	Field Degree
End Type
