让VS2005编辑器支持着色器语法高亮

1. 创建或编辑usertype.dat文件(此文件在VS安装目录下的Common7\IDE下面,比如我的就在D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\usertype.dat),添加如下的关键字列表,每个单词占一行,如果你想添加你自己的关键字,也可以按照这种方式添加在usertype.dat文件中
2. 在vs中打开Tools->Options...->TextEditor->File Extension
填写你想使用的着色器文件扩展名,如fx, hlsl, vs, ps等等,然后Editor选择Microsoft Visual C++
3. 重新启动VS2005

关键字列表:

__global__

__host__

__device__

__constant__

__shared__

gridDim

blockIdx

blockDim

threadIdx

int1

uint1

int2

uint2

int3

uint3

int4

uint4

float1

float2

float3

float4

char1

char2

char3

char4

uchar1

uchar2

uchar3

uchar4

short1

short2

short3

short4

dim1

dim2

dim3

dim4

min

umin

fminf

fmin

max

umax

fmaxf

fmax

abs

fabsf

fabs

sinf

sin

cosf

cos

sqrtf

sqrt

expf

exp

logf

log

int2float

float2int

asm

asm_fragment

BINORMAL

BLENDINDICES0

BLENDWEIGHT0

bool

COLOR0

COLOR1

COLOR2

COLOR3

column_major

compile

compile_fragment

const

discard

decl1

do

double

else

extern

false

float

float2

float3

float3x3

float3x4

float4

float4x4

float4x3

for

half

half2

half3

half4

if

in

inline

inout

int

int2

int3

int4

matrix

out

pass1

pixelfragment

return

register

row_major

sampler

sampler1D

sampler2D

sampler3D

samplerCUBE

sampler_state

shared

stateblock

stateblock_state

static

string

struct

TANGENT

technique

texture

texture1D

texture2D

texture3D

textureCUBE

TEXCOORD0

TEXCOORD1

TEXCOORD2

TEXCOORD3

TEXCOORD4

TEXCOORD5

TEXCOORD6

TEXCOORD7

true

typedef

uniform

vector

vertexfragment

void

volatile

VPOS

while

你可能感兴趣的:(编辑器)