Rem ***** Included Source File *****
rem General purpose constants used by the DX11 plugin.
#constant true                                                                                            1
#constant false                                                                                           0
#constant nullptr                                                                                         0

rem Math constants
#constant MATH_PI                                                                                         3.14159265359
#constant MATH_TWOPI                                                                                      6.28318530718
#constant MATH_HALFPI                                                                                     1.570796326795
#constant MATH_E                                                                                          2.71828182846


rem Image formats
#constant DXGI_FORMAT_UNKNOWN                                                                             0
#constant DXGI_FORMAT_R32G32B32A32_TYPELESS                                                               1
#constant DXGI_FORMAT_R32G32B32A32_FLOAT                                                                  2
#constant DXGI_FORMAT_R32G32B32A32_UINT                                                                   3
#constant DXGI_FORMAT_R32G32B32A32_SINT                                                                   4
#constant DXGI_FORMAT_R32G32B32_TYPELESS                                                                  5
#constant DXGI_FORMAT_R32G32B32_FLOAT                                                                     6
#constant DXGI_FORMAT_R32G32B32_UINT                                                                      7
#constant DXGI_FORMAT_R32G32B32_SINT                                                                      8
#constant DXGI_FORMAT_R16G16B16A16_TYPELESS                                                               9
#constant DXGI_FORMAT_R16G16B16A16_FLOAT                                                                  10
#constant DXGI_FORMAT_R16G16B16A16_UNORM                                                                  11
#constant DXGI_FORMAT_R16G16B16A16_UINT                                                                   12
#constant DXGI_FORMAT_R16G16B16A16_SNORM                                                                  13
#constant DXGI_FORMAT_R16G16B16A16_SINT                                                                   14
#constant DXGI_FORMAT_R32G32_TYPELESS                                                                     15
#constant DXGI_FORMAT_R32G32_FLOAT                                                                        16
#constant DXGI_FORMAT_R32G32_UINT                                                                         17
#constant DXGI_FORMAT_R32G32_SINT                                                                         18
#constant DXGI_FORMAT_R32G8X24_TYPELESS                                                                   19
#constant DXGI_FORMAT_D32_FLOAT_S8X24_UINT                                                                20
#constant DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS                                                            21
#constant DXGI_FORMAT_X32_TYPELESS_G8X24_UINT                                                             22
#constant DXGI_FORMAT_R10G10B10A2_TYPELESS                                                                23
#constant DXGI_FORMAT_R10G10B10A2_UNORM                                                                   24
#constant DXGI_FORMAT_R10G10B10A2_UINT                                                                    25
#constant DXGI_FORMAT_R11G11B10_FLOAT                                                                     26
#constant DXGI_FORMAT_R8G8B8A8_TYPELESS                                                                   27
#constant DXGI_FORMAT_R8G8B8A8_UNORM                                                                      28
#constant DXGI_FORMAT_R8G8B8A8_UNORM_SRGB                                                                 29
#constant DXGI_FORMAT_R8G8B8A8_UINT                                                                       30
#constant DXGI_FORMAT_R8G8B8A8_SNORM                                                                      31
#constant DXGI_FORMAT_R8G8B8A8_SINT                                                                       32
#constant DXGI_FORMAT_R16G16_TYPELESS                                                                     33
#constant DXGI_FORMAT_R16G16_FLOAT                                                                        34
#constant DXGI_FORMAT_R16G16_UNORM                                                                        35
#constant DXGI_FORMAT_R16G16_UINT                                                                         36
#constant DXGI_FORMAT_R16G16_SNORM                                                                        37
#constant DXGI_FORMAT_R16G16_SINT                                                                         38
#constant DXGI_FORMAT_R32_TYPELESS                                                                        39
#constant DXGI_FORMAT_D32_FLOAT                                                                           40
#constant DXGI_FORMAT_R32_FLOAT                                                                           41
#constant DXGI_FORMAT_R32_UINT                                                                            42
#constant DXGI_FORMAT_R32_SINT                                                                            43
#constant DXGI_FORMAT_R24G8_TYPELESS                                                                      44
#constant DXGI_FORMAT_D24_UNORM_S8_UINT                                                                   45
#constant DXGI_FORMAT_R24_UNORM_X8_TYPELESS                                                               46
#constant DXGI_FORMAT_X24_TYPELESS_G8_UINT                                                                47
#constant DXGI_FORMAT_R8G8_TYPELESS                                                                       48
#constant DXGI_FORMAT_R8G8_UNORM                                                                          49
#constant DXGI_FORMAT_R8G8_UINT                                                                           50
#constant DXGI_FORMAT_R8G8_SNORM                                                                          51
#constant DXGI_FORMAT_R8G8_SINT                                                                           52
#constant DXGI_FORMAT_R16_TYPELESS                                                                        53
#constant DXGI_FORMAT_R16_FLOAT                                                                           54
#constant DXGI_FORMAT_D16_UNORM                                                                           55
#constant DXGI_FORMAT_R16_UNORM                                                                           56
#constant DXGI_FORMAT_R16_UINT                                                                            57
#constant DXGI_FORMAT_R16_SNORM                                                                           58
#constant DXGI_FORMAT_R16_SINT                                                                            59
#constant DXGI_FORMAT_R8_TYPELESS                                                                         60
#constant DXGI_FORMAT_R8_UNORM                                                                            61
#constant DXGI_FORMAT_R8_UINT                                                                             62
#constant DXGI_FORMAT_R8_SNORM                                                                            63
#constant DXGI_FORMAT_R8_SINT                                                                             64
#constant DXGI_FORMAT_A8_UNORM                                                                            65
#constant DXGI_FORMAT_R1_UNORM                                                                            66
#constant DXGI_FORMAT_R9G9B9E5_SHAREDEXP                                                                  67
#constant DXGI_FORMAT_R8G8_B8G8_UNORM                                                                     68
#constant DXGI_FORMAT_G8R8_G8B8_UNORM                                                                     69
#constant DXGI_FORMAT_BC1_TYPELESS                                                                        70
#constant DXGI_FORMAT_BC1_UNORM                                                                           71
#constant DXGI_FORMAT_BC1_UNORM_SRGB                                                                      72
#constant DXGI_FORMAT_BC2_TYPELESS                                                                        73
#constant DXGI_FORMAT_BC2_UNORM                                                                           74
#constant DXGI_FORMAT_BC2_UNORM_SRGB                                                                      75
#constant DXGI_FORMAT_BC3_TYPELESS                                                                        76
#constant DXGI_FORMAT_BC3_UNORM                                                                           77
#constant DXGI_FORMAT_BC3_UNORM_SRGB                                                                      78
#constant DXGI_FORMAT_BC4_TYPELESS                                                                        79
#constant DXGI_FORMAT_BC4_UNORM                                                                           80
#constant DXGI_FORMAT_BC4_SNORM                                                                           81
#constant DXGI_FORMAT_BC5_TYPELESS                                                                        82
#constant DXGI_FORMAT_BC5_UNORM                                                                           83
#constant DXGI_FORMAT_BC5_SNORM                                                                           84
#constant DXGI_FORMAT_B5G6R5_UNORM                                                                        85
#constant DXGI_FORMAT_B5G5R5A1_UNORM                                                                      86
#constant DXGI_FORMAT_B8G8R8A8_UNORM                                                                      87
#constant DXGI_FORMAT_B8G8R8X8_UNORM                                                                      88
#constant DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM                                                          89
#constant DXGI_FORMAT_B8G8R8A8_TYPELESS                                                                   90
#constant DXGI_FORMAT_B8G8R8A8_UNORM_SRGB                                                                 91
#constant DXGI_FORMAT_B8G8R8X8_TYPELESS                                                                   92
#constant DXGI_FORMAT_B8G8R8X8_UNORM_SRGB                                                                 93
#constant DXGI_FORMAT_BC6H_TYPELESS                                                                       94
#constant DXGI_FORMAT_BC6H_UF16                                                                           95
#constant DXGI_FORMAT_BC6H_SF16                                                                           96
#constant DXGI_FORMAT_BC7_TYPELESS                                                                        97
#constant DXGI_FORMAT_BC7_UNORM                                                                           98
#constant DXGI_FORMAT_BC7_UNORM_SRGB                                                                      99
#constant DXGI_FORMAT_AYUV                                                                                100
#constant DXGI_FORMAT_Y410                                                                                101
#constant DXGI_FORMAT_Y416                                                                                102
#constant DXGI_FORMAT_NV12                                                                                103
#constant DXGI_FORMAT_P010                                                                                104
#constant DXGI_FORMAT_P016                                                                                105
#constant DXGI_FORMAT_420_OPAQUE                                                                          106
#constant DXGI_FORMAT_YUY2                                                                                107
#constant DXGI_FORMAT_Y210                                                                                108
#constant DXGI_FORMAT_Y216                                                                                109
#constant DXGI_FORMAT_NV11                                                                                110
#constant DXGI_FORMAT_AI44                                                                                111
#constant DXGI_FORMAT_IA44                                                                                112
#constant DXGI_FORMAT_P8                                                                                  113
#constant DXGI_FORMAT_A8P8                                                                                114
#constant DXGI_FORMAT_B4G4R4A4_UNORM                                                                      115

rem Mesh sorting modes
#constant DX11_SORTMODE_OPAQUE                                                                            0
#constant DX11_SORTMODE_TRANSPARENT_FULL                                                                  1
#constant DX11_SORTMODE_TRANSPARENT_CHEAP                                                                 2


rem Keycodes
#constant DIK_ESCAPE          0x01
#constant DIK_1               0x02
#constant DIK_2               0x03
#constant DIK_3               0x04
#constant DIK_4               0x05
#constant DIK_5               0x06
#constant DIK_6               0x07
#constant DIK_7               0x08
#constant DIK_8               0x09
#constant DIK_9               0x0A
#constant DIK_0               0x0B
#constant DIK_MINUS           0x0C
#constant DIK_EQUALS          0x0D
#constant DIK_BACK            0x0E
#constant DIK_TAB             0x0F
#constant DIK_Q               0x10
#constant DIK_W               0x11
#constant DIK_E               0x12
#constant DIK_R               0x13
#constant DIK_T               0x14
#constant DIK_Y               0x15
#constant DIK_U               0x16
#constant DIK_I               0x17
#constant DIK_O               0x18
#constant DIK_P               0x19
#constant DIK_LBRACKET        0x1A
#constant DIK_RBRACKET        0x1B
#constant DIK_RETURN          0x1C
#constant DIK_LCONTROL        0x1D
#constant DIK_A               0x1E
#constant DIK_S               0x1F
#constant DIK_D               0x20
#constant DIK_F               0x21
#constant DIK_G               0x22
#constant DIK_H               0x23
#constant DIK_J               0x24
#constant DIK_K               0x25
#constant DIK_L               0x26
#constant DIK_SEMICOLON       0x27
#constant DIK_APOSTROPHE      0x28
#constant DIK_GRAVE           0x29
#constant DIK_LSHIFT          0x2A
#constant DIK_BACKSLASH       0x2B
#constant DIK_Z               0x2C
#constant DIK_X               0x2D
#constant DIK_C               0x2E
#constant DIK_V               0x2F
#constant DIK_B               0x30
#constant DIK_N               0x31
#constant DIK_M               0x32
#constant DIK_COMMA           0x33
#constant DIK_PERIOD          0x34
#constant DIK_SLASH           0x35
#constant DIK_RSHIFT          0x36
#constant DIK_MULTIPLY        0x37
#constant DIK_LMENU           0x38
#constant DIK_SPACE           0x39
#constant DIK_CAPITAL         0x3A
#constant DIK_F1              0x3B
#constant DIK_F2              0x3C
#constant DIK_F3              0x3D
#constant DIK_F4              0x3E
#constant DIK_F5              0x3F
#constant DIK_F6              0x40
#constant DIK_F7              0x41
#constant DIK_F8              0x42
#constant DIK_F9              0x43
#constant DIK_F10             0x44
#constant DIK_NUMLOCK         0x45
#constant DIK_SCROLL          0x46
#constant DIK_NUMPAD7         0x47
#constant DIK_NUMPAD8         0x48
#constant DIK_NUMPAD9         0x49
#constant DIK_SUBTRACT        0x4A
#constant DIK_NUMPAD4         0x4B
#constant DIK_NUMPAD5         0x4C
#constant DIK_NUMPAD6         0x4D
#constant DIK_ADD             0x4E
#constant DIK_NUMPAD1         0x4F
#constant DIK_NUMPAD2         0x50
#constant DIK_NUMPAD3         0x51
#constant DIK_NUMPAD0         0x52
#constant DIK_DECIMAL         0x53
#constant DIK_OEM_102         0x56
#constant DIK_F11             0x57
#constant DIK_F12             0x58
#constant DIK_F13             0x64
#constant DIK_F14             0x65
#constant DIK_F15             0x66
#constant DIK_KANA            0x70
#constant DIK_ABNT_C1         0x73
#constant DIK_CONVERT         0x79
#constant DIK_NOCONVERT       0x7B
#constant DIK_YEN             0x7D
#constant DIK_ABNT_C2         0x7E
#constant DIK_NUMPADEQUALS    0x8D
#constant DIK_PREVTRACK       0x90
#constant DIK_AT              0x91
#constant DIK_COLON           0x92
#constant DIK_UNDERLINE       0x93
#constant DIK_KANJI           0x94
#constant DIK_STOP            0x95
#constant DIK_AX              0x96
#constant DIK_UNLABELED       0x97
#constant DIK_NEXTTRACK       0x99
#constant DIK_NUMPADENTER     0x9C
#constant DIK_RCONTROL        0x9D
#constant DIK_MUTE            0xA0
#constant DIK_CALCULATOR      0xA1
#constant DIK_PLAYPAUSE       0xA2
#constant DIK_MEDIASTOP       0xA4
#constant DIK_VOLUMEDOWN      0xAE
#constant DIK_VOLUMEUP        0xB0
#constant DIK_WEBHOME         0xB2
#constant DIK_NUMPADCOMMA     0xB3
#constant DIK_DIVIDE          0xB5
#constant DIK_SYSRQ           0xB7
#constant DIK_RMENU           0xB8
#constant DIK_PAUSE           0xC5
#constant DIK_HOME            0xC7
#constant DIK_UP              0xC8
#constant DIK_PRIOR           0xC9
#constant DIK_LEFT            0xCB
#constant DIK_RIGHT           0xCD
#constant DIK_END             0xCF
#constant DIK_DOWN            0xD0
#constant DIK_NEXT            0xD1
#constant DIK_INSERT          0xD2
#constant DIK_DELETE          0xD3
#constant DIK_LWIN            0xDB
#constant DIK_RWIN            0xDC
#constant DIK_APPS            0xDD
#constant DIK_POWER           0xDE
#constant DIK_SLEEP           0xDF
#constant DIK_WAKE            0xE3
#constant DIK_WEBSEARCH       0xE5
#constant DIK_WEBFAVORITES    0xE6
#constant DIK_WEBREFRESH      0xE7
#constant DIK_WEBSTOP         0xE8
#constant DIK_WEBFORWARD      0xE9
#constant DIK_WEBBACK         0xEA
#constant DIK_MYCOMPUTER      0xEB
#constant DIK_MAIL            0xEC
#constant DIK_MEDIASELECT     0xED

rem Mouse buttons
#constant MBTN_LEFT           0
#constant MBTN_RIGHT          1
#constant MBTN_MIDDLE         2
#constant MBTH_MIDDLE2        3

rem Character capture actions
#constant CCA_ACCEPT          0
#constant CCA_IGNORE          1
#constant CCA_TERMINATE       2


rem Blend factors
#constant D3D11_BLEND_ZERO              1
#constant D3D11_BLEND_ONE               2
#constant D3D11_BLEND_SRC_COLOR         3
#constant D3D11_BLEND_INV_SRC_COLOR     4
#constant D3D11_BLEND_SRC_ALPHA         5
#constant D3D11_BLEND_INV_SRC_ALPHA     6
#constant D3D11_BLEND_DEST_ALPHA        7
#constant D3D11_BLEND_INV_DEST_ALPHA    8
#constant D3D11_BLEND_DEST_COLOR        9
#constant D3D11_BLEND_INV_DEST_COLOR    10
#constant D3D11_BLEND_SRC_ALPHA_SAT     11
#constant D3D11_BLEND_BLEND_FACTOR      14
#constant D3D11_BLEND_INV_BLEND_FACTOR  15
#constant D3D11_BLEND_SRC1_COLOR        16
#constant D3D11_BLEND_INV_SRC1_COLOR    17
#constant D3D11_BLEND_SRC1_ALPHA        18
#constant D3D11_BLEND_INV_SRC1_ALPHA    19

rem Blend operations
#constant D3D11_BLEND_OP_ADD            1
#constant D3D11_BLEND_OP_SUBTRACT       2
#constant D3D11_BLEND_OP_REV_SUBTRACT   3
#constant D3D11_BLEND_OP_MIN            4
#constant D3D11_BLEND_OP_MAX            5

rem Colour write enable flags
#constant D3D11_COLOR_WRITE_ENABLE_RED          1
#constant D3D11_COLOR_WRITE_ENABLE_GREEN        2
#constant D3D11_COLOR_WRITE_ENABLE_BLUE         4
#constant D3D11_COLOR_WRITE_ENABLE_ALPHA        8
#constant D3D11_COLOR_WRITE_ENABLE_ALL          15

rem Texture addressing modes
#constant D3D11_TEXTURE_ADDRESS_WRAP            1
#constant D3D11_TEXTURE_ADDRESS_MIRROR          2
#constant D3D11_TEXTURE_ADDRESS_CLAMP           3
#constant D3D11_TEXTURE_ADDRESS_BORDER          4
#constant D3D11_TEXTURE_ADDRESS_MIRRORONCE      5


rem Fill modes
#constant D3D11_FILL_WIREFRAME                  2
#constant D3D11_FILL_SOLID                      3

rem Cull modes
#constant D3D11_CULL_NONE                       1
#constant D3D11_CULL_FRONT                      2
#constant D3D11_CULL_BACK                       3

rem Depth write masks
#constant D3D11_DEPTH_WRITE_MASK_DISABLED       0
#constant D3D11_DEPTH_WRITE_MASK_ENABLED        1

rem Depth test functions
#constant D3D11_COMPARISON_NEVER                1
#constant D3D11_COMPARISON_LESS                 2
#constant D3D11_COMPARISON_EQUAL                3
#constant D3D11_COMPARISON_LESS_EQUAL           4
#constant D3D11_COMPARISON_GREATER              5
#constant D3D11_COMPARISON_NOT_EQUAL            6
#constant D3D11_COMPARISON_GREATER_EQUAL        7
#constant D3D11_COMPARISON_ALWAYS               8


rem Primitive topologies
#constant TOPOLOGY_POINTLIST                    1
#constant TOPOLOGY_LINELIST                     2
#constant TOPOLOGY_LINESTRIP                    3
#constant TOPOLOGY_TRIANGLELIST                 4
#constant TOPOLOGY_TRIANGLESTRIP                5
#constant TOPOLOGY_LINELIST_ADJ                 10
#constant TOPOLOGY_LINESTRIP_ADJ                11
#constant TOPOLOGY_TRIANGLELIST_ADJ             12
#constant TOPOLOGY_TRIANGLESTRIP_ADJ            13
rem These need to be used when working with the hull shader; by manually tweaking the index buffer, 
rem information about adjacent vertices can be made available to the hull shader in this fashion.
#constant TOPOLOGY_1_CONTROL_POINT_PATCHLIST    33
#constant TOPOLOGY_2_CONTROL_POINT_PATCHLIST    34
#constant TOPOLOGY_3_CONTROL_POINT_PATCHLIST    35
#constant TOPOLOGY_4_CONTROL_POINT_PATCHLIST    36
#constant TOPOLOGY_5_CONTROL_POINT_PATCHLIST    37
#constant TOPOLOGY_6_CONTROL_POINT_PATCHLIST    38
#constant TOPOLOGY_7_CONTROL_POINT_PATCHLIST    39
#constant TOPOLOGY_8_CONTROL_POINT_PATCHLIST    40
#constant TOPOLOGY_9_CONTROL_POINT_PATCHLIST    41
#constant TOPOLOGY_10_CONTROL_POINT_PATCHLIST   42
#constant TOPOLOGY_11_CONTROL_POINT_PATCHLIST   43
#constant TOPOLOGY_12_CONTROL_POINT_PATCHLIST   44
#constant TOPOLOGY_13_CONTROL_POINT_PATCHLIST   45
#constant TOPOLOGY_14_CONTROL_POINT_PATCHLIST   46
#constant TOPOLOGY_15_CONTROL_POINT_PATCHLIST   47
#constant TOPOLOGY_16_CONTROL_POINT_PATCHLIST   48
#constant TOPOLOGY_17_CONTROL_POINT_PATCHLIST   49
#constant TOPOLOGY_18_CONTROL_POINT_PATCHLIST   50
#constant TOPOLOGY_19_CONTROL_POINT_PATCHLIST   51
#constant TOPOLOGY_20_CONTROL_POINT_PATCHLIST   52
#constant TOPOLOGY_21_CONTROL_POINT_PATCHLIST   53
#constant TOPOLOGY_22_CONTROL_POINT_PATCHLIST   54
#constant TOPOLOGY_23_CONTROL_POINT_PATCHLIST   55
#constant TOPOLOGY_24_CONTROL_POINT_PATCHLIST   56
#constant TOPOLOGY_25_CONTROL_POINT_PATCHLIST   57
#constant TOPOLOGY_26_CONTROL_POINT_PATCHLIST   58
#constant TOPOLOGY_27_CONTROL_POINT_PATCHLIST   59
#constant TOPOLOGY_28_CONTROL_POINT_PATCHLIST   60
#constant TOPOLOGY_29_CONTROL_POINT_PATCHLIST   61
#constant TOPOLOGY_30_CONTROL_POINT_PATCHLIST   62
#constant TOPOLOGY_31_CONTROL_POINT_PATCHLIST   63
#constant TOPOLOGY_32_CONTROL_POINT_PATCHLIST   64

rem Access modes
#constant ACCESSMODE_DEFAULT                    0
#constant ACCESSMODE_DIRECT_CPUWRITABLE         1
#constant ACCESSMODE_GPUWRITABLE                2

rem DirectX versions
#constant DXVERSION_10_0                        40960
#constant DXVERSION_10_1                        41216
#constant DXVERSION_11_0                        45056


rem This can be used as a macro to ensure that this constants file is indeed included.
rem Problems will arise if it isn't and any of these constants are used, which thanks to DBPro's dynamic variables
rem will make all of them resolve to 0, which will obviously be the wrong values in 99% of the cases.
#constant INCLUDEGUARD                          ______tmpVal = 0 <> 
#constant DX11_CONSTANTS                        1


rem Convenience functions
function GetDXVersionName(version as dword)
    select version
        case DXVERSION_10_0
            exitfunction "10.0"
        endcase
        
        case DXVERSION_10_1
            exitfunction "10.1"
        endcase
        
        case DXVERSION_11_0
            exitfunction "11.0"
        endcase
    endselect
endfunction "UNKNOWN"

