![]() |
![]() |
OpenGL Shading Language Tutorials |
Syntax Coloring in Visual Studio .NET
Adding Syntax Coloring for OGLSL to Visual Studio .NET is not that easy. The only way would be to create a component with OGLSL support. However, there is another way over the Visual Studio registry. It is possible to add extensions to the C++ definitions. After installing the registry hacks, Visual Studio treats the files like C++ files (but doesn't try to compile them).
Install the following to the registry: (.reg files available for download) [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Languages\File Extensions\.frag]
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Languages\File Extensions\.vert]
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"
Now Visual Studio uses same settings for ".frag" and ".vert" files like C++ programs. If you're using Visual Studio .NET 2002 you have to change 7.1 to 7. (both versions are included in download section).
Put "usertype.dat" to "...\Common7\IDE\" dirctory of Visual Studio .NET. Usertype contains all OGLSL keywords. You could also add other keywords like "gl_Color" etc.
Future work It would be possible to create a syntax checker with 3Dlabs Open Source compiler and add it to Visual Studio. That way you could check possible errors in your source code without actually starting an OpenGL context.
|
|
© 2003 by Martin Christen. All Rights Reserved. |