Author Topic: Language support for GLSL, Cg & HLSL?  (Read 4653 times)

Ian Ameline

  • Community Member
  • Posts: 70
  • Hero Points: 7
Language support for GLSL, Cg & HLSL?
« on: May 22, 2008, 12:53:07 am »
Subject line says it all -- any love for us graphics hackers?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Language support for GLSL, Cg & HLSL?
« Reply #1 on: May 22, 2008, 12:37:41 pm »
I was using this for color coding (see attached vlx) for HLSL and GLSL for some homebrew projects, but I never setup tagging or any SlickEdit-y features to go with it.  They may be out of date, I have not updated it recently.  You can also check out Dennis' most excellent blog entry on adding language support in SlickEdit (http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit/).

Ian Ameline

  • Community Member
  • Posts: 70
  • Hero Points: 7
Re: Language support for GLSL, Cg & HLSL?
« Reply #2 on: May 22, 2008, 04:04:21 pm »
I guess I'm less interested in color coding than good indenting and tags/references for the built-in functions of the language.


Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Language support for GLSL, Cg & HLSL?
« Reply #3 on: May 23, 2008, 01:05:47 pm »
For indenting, you can re-use support functions from C++, both GLSL and HLSL are close relatives of the C syntax.  The indent parsers and smartpaste should work correctly for most cases.  I've included a basic support module for GLSL (using SlickEdit 2008) as an example, you'll need to load the module (Macro > Load Module...) and you will also need to load the previously attached lexer definitions to get the color coding too.

Context Tagging would require a lot more work, and there would need to write a tagdoc for the built-in functions and globals, as there is no standard library to parse (from what I remember anyway).  Can't really re-use the C++ context tagging parser there, as there are enough differences in the languages that would just confuse it.