您的位置:首页 > 编程语言

visual studio 中显示cg,hlsl语法高亮

2010-07-24 21:06 337 查看
这个对提升编程效率和感觉挺有帮助的,share下,hope it can help!
最开始是在gamedev上看到的,摘;录如下:
----------------------------
You have to download the CG Toolkit from the nVidia site. 
Then in the folder /NVIDIA Corporation/Cg/msdev_syntax_highlighting/ its gonna be a file called usertype.dat then you will have to do this..

1. Copy the usertype.dat file to
32位: /Microsoft Visual Studio 8/Common7/IDE
64位下是\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\这里

2. Open up the registry editor and go to the following location -
32位: HKLM/SOFTWARE/Microsoft/VisualStudio/8.0/Languages/File Extensions
64位:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Languages\File Extensions

3. Copy the default value from the .cpp key.
4. Create a new key under the File Extensions with the name of .cg(.fx 或者其他什么名字)
5. Paste the value you just copied into the default value.
6. Restart Visual Studio and your shaders should now have syntax highlighting.
-----------------------------
后面部分不修改注册表也可以的,在tool->option->text editor->file extention添加fx,hlsl,cg解释为c++语法高亮就可以了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息