
#define    LIGHT_POINT          1
#define    LIGHT_SPOT           2
#define    LIGHT_DIRECTIONAL    3

#define CLEAR_TARGET            1
#define CLEAR_ZBUFFER           2
#define CLEAR_STENCIL           4


#define    SHADE_FLAT               1
#define    SHADE_GOURAUD            2
#define    SHADE_PHONG              3

#define    FILL_POINT               1
#define    FILL_WIREFRAME           2
#define    FILL_SOLID               3

#define    BLEND_ZERO               1
#define    BLEND_ONE                2
#define    BLEND_SRCCOLOR           3
#define    BLEND_INVSRCCOLOR        4
#define    BLEND_SRCALPHA           5
#define    BLEND_INVSRCALPHA        6
#define    BLEND_DESTALPHA          7
#define    BLEND_INVDESTALPHA       8
#define    BLEND_DESTCOLOR          9
#define    BLEND_INVDESTCOLOR       10
#define    BLEND_SRCALPHASAT        11
#define    BLEND_BOTHSRCALPHA       12
#define    BLEND_BOTHINVSRCALPHA    13
#define    BLEND_BLENDFACTOR        14
#define    BLEND_INVBLENDFACTOR     15

#define    BLENDOP_ADD              1
#define    BLENDOP_SUBTRACT         2
#define    BLENDOP_REVSUBTRACT      3
#define    BLENDOP_MIN              4
#define    BLENDOP_MAX              5

#define    TADDRESS_WRAP            1
#define    TADDRESS_MIRROR          2
#define    TADDRESS_CLAMP           3
#define    TADDRESS_BORDER          4
#define    TADDRESS_MIRRORONCE      5

#define    CULL_NONE                1
#define    CULL_CW                  2
#define    CULL_CCW                 3

#define    CMP_NEVER                1
#define    CMP_LESS                 2
#define    CMP_EQUAL                3
#define    CMP_LESSEQUAL            4
#define    CMP_GREATER              5
#define    CMP_NOTEQUAL             6
#define    CMP_GREATEREQUAL         7
#define    CMP_ALWAYS               8

#define    STENCILOP_KEEP           1
#define    STENCILOP_ZERO           2
#define    STENCILOP_REPLACE        3
#define    STENCILOP_INCRSAT        4
#define    STENCILOP_DECRSAT        5
#define    STENCILOP_INVERT         6
#define    STENCILOP_INCR           7
#define    STENCILOP_DECR           8

#define    FOG_NONE                 0
#define    FOG_EXP                  1
#define    FOG_EXP2                 2
#define    FOG_LINEAR               3

#define    ZB_FALSE                 0
#define    ZB_TRUE                  1
#define    ZB_USEW                  2

#define    PT_POINTLIST             1
#define    PT_LINELIST              2
#define    PT_LINESTRIP             3
#define    PT_TRIANGLELIST          4
#define    PT_TRIANGLESTRIP         5
#define    PT_TRIANGLEFAN           6

#define    TS_TEXTURE0      16
#define    TS_TEXTURE1      17
#define    TS_TEXTURE2      18
#define    TS_TEXTURE3      19
#define    TS_TEXTURE4      20
#define    TS_TEXTURE5      21
#define    TS_TEXTURE6      22
#define    TS_TEXTURE7      23


#define    RS_ZENABLE                    7
#define    RS_FILLMODE                   8
#define    RS_SHADEMODE                  9
#define    RS_ZWRITEENABLE               14
#define    RS_ALPHATESTENABLE            15
#define    RS_LASTPIXEL                  16
#define    RS_SRCBLEND                   19
#define    RS_DESTBLEND                  20
#define    RS_CULLMODE                   22
#define    RS_ZFUNC                      23
#define    RS_ALPHAREF                   24
#define    RS_ALPHAFUNC                  25
#define    RS_DITHERENABLE               26
#define    RS_ALPHABLENDENABLE           27
#define    RS_FOGENABLE                  28
#define    RS_SPECULARENABLE             29
#define    RS_FOGCOLOR                   34
#define    RS_FOGTABLEMODE               35
#define    RS_FOGSTART                   36
#define    RS_FOGEND                     37
#define    RS_FOGDENSITY                 38
#define    RS_RANGEFOGENABLE             48
#define    RS_STENCILENABLE              52
#define    RS_STENCILFAIL                53
#define    RS_STENCILZFAIL               54
#define    RS_STENCILPASS                55
#define    RS_STENCILFUNC                56
#define    RS_STENCILREF                 57
#define    RS_STENCILMASK                58
#define    RS_STENCILWRITEMASK           59
#define    RS_TEXTUREFACTOR              60
#define    RS_WRAP0                      128
#define    RS_WRAP1                      129
#define    RS_WRAP2                      130
#define    RS_WRAP3                      131
#define    RS_WRAP4                      132
#define    RS_WRAP5                      133
#define    RS_WRAP6                      134
#define    RS_WRAP7                      135
#define    RS_CLIPPING                   136
#define    RS_LIGHTING                   137
#define    RS_AMBIENT                    139
#define    RS_FOGVERTEXMODE              140
#define    RS_COLORVERTEX                141
#define    RS_LOCALVIEWER                142
#define    RS_NORMALIZENORMALS           143
#define    RS_DIFFUSEMATERIALSOURCE      145
#define    RS_SPECULARMATERIALSOURCE     146
#define    RS_AMBIENTMATERIALSOURCE      147
#define    RS_EMISSIVEMATERIALSOURCE     148
#define    RS_VERTEXBLEND                151
#define    RS_CLIPPLANEENABLE            152
#define    RS_POINTSIZE                  154
#define    RS_POINTSIZE_MIN              155
#define    RS_POINTSPRITEENABLE          156
#define    RS_POINTSCALEENABLE           157
#define    RS_POINTSCALE_A               158
#define    RS_POINTSCALE_B               159
#define    RS_POINTSCALE_C               160
#define    RS_MULTISAMPLEANTIALIAS       161
#define    RS_MULTISAMPLEMASK            162
#define    RS_PATCHEDGESTYLE             163
#define    RS_DEBUGMONITORTOKEN          165
#define    RS_POINTSIZE_MAX              166
#define    RS_INDEXEDVERTEXBLENDENABLE   167
#define    RS_COLORWRITEENABLE           168
#define    RS_TWEENFACTOR                170
#define    RS_BLENDOP                    171
#define    RS_POSITIONDEGREE             172
#define    RS_NORMALDEGREE               173
#define    RS_SCISSORTESTENABLE          174
#define    RS_SLOPESCALEDEPTHBIAS        175
#define    RS_ANTIALIASEDLINEENABLE      176
#define    RS_MINTESSELLATIONLEVEL       178
#define    RS_MAXTESSELLATIONLEVEL       179
#define    RS_ADAPTIVETESS_X             180
#define    RS_ADAPTIVETESS_Y             181
#define    RS_ADAPTIVETESS_Z             182
#define    RS_ADAPTIVETESS_W             183
#define    RS_ENABLEADAPTIVETESSELLATION  184
#define    RS_TWOSIDEDSTENCILMODE        185
#define    RS_CCW_STENCILFAIL            186
#define    RS_CCW_STENCILZFAIL           187
#define    RS_CCW_STENCILPASS            188
#define    RS_CCW_STENCILFUNC            189
#define    RS_COLORWRITEENABLE1          190
#define    RS_COLORWRITEENABLE2          191
#define    RS_COLORWRITEENABLE3          192
#define    RS_BLENDFACTOR                193
#define    RS_SRGBWRITEENABLE            194
#define    RS_DEPTHBIAS                  195
#define    RS_WRAP8                      198
#define    RS_WRAP9                      199
#define    RS_WRAP10                     200
#define    RS_WRAP11                     201
#define    RS_WRAP12                     202
#define    RS_WRAP13                     203
#define    RS_WRAP14                     204
#define    RS_WRAP15                     205
#define    RS_SEPARATEALPHABLENDENABLE   206
#define    RS_SRCBLENDALPHA              207
#define    RS_DESTBLENDALPHA             208
#define    RS_BLENDOPALPHA               209

#define MAX_SIMULTANEOUS_RENDERTARGETS 4

#define    MCS_MATERIAL          0
#define    MCS_COLOR1            1
#define    MCS_COLOR2            2

#define RENDERSTATE_WRAPBIAS                 128

#define WRAP_U   1
#define WRAP_V   2
#define WRAP_W   4

#define WRAPCOORD_0   1
#define WRAPCOORD_1   2
#define WRAPCOORD_2   4
#define WRAPCOORD_3   8

#define COLORWRITEENABLE_RED     1
#define COLORWRITEENABLE_GREEN   2
#define COLORWRITEENABLE_BLUE    4
#define COLORWRITEENABLE_ALPHA   8

#define    TSS_COLOROP          1
#define    TSS_COLORARG1        2
#define    TSS_COLORARG2        3
#define    TSS_ALPHAOP          4
#define    TSS_ALPHAARG1        5
#define    TSS_ALPHAARG2        6
#define    TSS_BUMPENVMAT00     7
#define    TSS_BUMPENVMAT01     8
#define    TSS_BUMPENVMAT10     9
#define    TSS_BUMPENVMAT11    10
#define    TSS_TEXCOORDINDEX   11
#define    TSS_BUMPENVLSCALE   22
#define    TSS_BUMPENVLOFFSET  23
#define    TSS_TEXTURETRANSFORMFLAGS  24
#define    TSS_COLORARG0       26
#define    TSS_ALPHAARG0       27
#define    TSS_RESULTARG       28
#define    TSS_CONSTANT        32


#define    SAMP_ADDRESSU        1
#define    SAMP_ADDRESSV        2
#define    SAMP_ADDRESSW        3
#define    SAMP_BORDERCOLOR     4
#define    SAMP_MAGFILTER       5
#define    SAMP_MINFILTER       6
#define    SAMP_MIPFILTER       7
#define    SAMP_MIPMAPLODBIAS   8
#define    SAMP_MAXMIPLEVEL     9
#define    SAMP_MAXANISOTROPY   10
#define    SAMP_SRGBTEXTURE     11
#define    SAMP_ELEMENTINDEX    12
#define    SAMP_DMAPOFFSET      13

#define DMAPSAMPLER 256

#define VERTEXTEXTURESAMPLER0 257
#define VERTEXTEXTURESAMPLER1 258
#define VERTEXTEXTURESAMPLER2 259
#define VERTEXTEXTURESAMPLER3 260

#define TSS_TCI_PASSTHRU                             0
#define TSS_TCI_CAMERASPACENORMAL                    65536
#define TSS_TCI_CAMERASPACEPOSITION                  131072
#define TSS_TCI_CAMERASPACEREFLECTIONVECTOR          196608
#define TSS_TCI_SPHEREMAP                            262144

#define    TOP_DISABLE              1
#define    TOP_SELECTARG1           2
#define    TOP_SELECTARG2           3

#define    TOP_MODULATE             4
#define    TOP_MODULATE2X           5
#define    TOP_MODULATE4X           6

#define    TOP_ADD                  7
#define    TOP_ADDSIGNED            8
#define    TOP_ADDSIGNED2X          9
#define    TOP_SUBTRACT             10
#define    TOP_ADDSMOOTH            11

#define    TOP_BLENDDIFFUSEALPHA    12
#define    TOP_BLENDTEXTUREALPHA    13
#define    TOP_BLENDFACTORALPHA     14

#define    TOP_BLENDTEXTUREALPHAPM  15
#define    TOP_BLENDCURRENTALPHA    16

#define    TOP_PREMODULATE            17
#define    TOP_MODULATEALPHA_ADDCOLOR 18
#define    TOP_MODULATECOLOR_ADDALPHA 19
#define    TOP_MODULATEINVALPHA_ADDCOLOR 20
#define    TOP_MODULATEINVCOLOR_ADDALPHA 21

#define    TOP_BUMPENVMAP           22
#define    TOP_BUMPENVMAPLUMINANCE  23

#define    TOP_DOTPRODUCT3          24

#define    TOP_MULTIPLYADD          25
#define    TOP_LERP                 26


#define TA_SELECTMASK        15
#define TA_DIFFUSE           0
#define TA_CURRENT           1
#define TA_TEXTURE           2
#define TA_TFACTOR           3
#define TA_SPECULAR          4
#define TA_TEMP              5
#define TA_CONSTANT          6
#define TA_COMPLEMENT        16
#define TA_ALPHAREPLICATE    32
#define TA_REPTILE           64

#define TA_INVDIFFUSE           16
#define TA_INVCURRENT           17
#define TA_INVTEXTURE           18
#define TA_INVTFACTOR           19
#define TA_INVSPECULAR          20
#define TA_INVTEMP              21
#define TA_INVCONSTANT          22

#define TA_DIFFUSEALPHA 32
#define TA_CURRENTALPHA 33
#define TA_TEXTUREALPHA 34
#define TA_TFACTORALPHA 35
#define TA_SPECULARALPHA 36
#define TA_TEMPALPHA 37
#define TA_CONSTANTALPHA 38

#define    TEXF_NONE            0
#define    TEXF_POINT           1
#define    TEXF_LINEAR          2
#define    TEXF_ANISOTROPIC     3
#define    TEXF_PYRAMIDALQUAD   6
#define    TEXF_GAUSSIANQUAD    7



#define    TTFF_DISABLE         0
#define    TTFF_COUNT1          1
#define    TTFF_COUNT2          2
#define    TTFF_COUNT3          3
#define    TTFF_COUNT4          4
#define    TTFF_PROJECTED       256
#define    TTFF_COUNT2PROJECTED 258
#define    TTFF_COUNT3PROJECTED 259
#define    TTFF_COUNT4PROJECTED 260

