Jump to content
  • Advertisement
Sign in to follow this  
PfhorSlayer

Cg syntax highlighting for VS .NET 2003?

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know how to enable syntax highlighting for Visual Studio .NET 2003 for .cg files? The Cg SDK includes a reg file and a .dat file that work for VS6, but they don't seem to do anything for VS .NET 2003. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
1. Open up regedit, and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Languages\File Extensions
2. Create a new key, and give it the name .cg
3. Select the .cpp key, and copy the value of the Default entry
4. Drop the value into the default entry of your newly created key

That should enable syntax highlighting and intellisence for .cg files. I'm not sure how to add the custom keywords for the cg language to the list of words to highlight. Maybe someone else can fill in that detail.

Share this post


Link to post
Share on other sites
I'm pretty sure you can add custom keywords by placing a .dat file in your VC.NET install Common7\IDE directory.

From what I've seen, it just needs to be a line-feed delimited list of keywords. However, I've no idea how it associates those keywords with your file extension.. and I couldn't dig anything up on a preliminary google search.

Share this post


Link to post
Share on other sites
Alright, I got it all working with one problem: putting the usertype.dat file in so that I get the new Cg keywords also makes them keywords in .cpp files :(

I think I'll just edit the .dat file so that it doesn't have all the extranious stuff in it.

Thanks, guys!

Share this post


Link to post
Share on other sites
Instead of mapping to the GUID for .cpp in the registry try using .fx instead since it has pretty much all of the keywords for .cg as it is.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!