Hi!
The High Level Shader Language (HLSL) is a proprietary shading language developed by Microsoft for use with the Microsoft Direct3D API. [from wikipedia]
I was recently creating few shaders in it and used C++ syntax, as it is very similar. But today I've spent two hours defining separate syntax for HLSL. I think it's 95% complete now, so I attach it below. I think after some more development it could be included in core of Notepad++ just like c++ and other languages. What do you think about it?
Hi!
The High Level Shader Language (HLSL) is a proprietary shading language developed by Microsoft for use with the Microsoft Direct3D API. [from wikipedia]
I was recently creating few shaders in it and used C++ syntax, as it is very similar. But today I've spent two hours defining separate syntax for HLSL. I think it's 95% complete now, so I attach it below. I think after some more development it could be included in core of Notepad++ just like c++ and other languages. What do you think about it?
----- here comes the xml:
<UserLang name="HLSL" ext="fx">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="yes" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">"00"00</Keywords>
<Keywords name="Folder+">{</Keywords>
<Keywords name="Folder-">}; }</Keywords>
<Keywords name="Operators">( ) : ; { } + =</Keywords>
<Keywords name="Comment"> 1/* 2*/ 0//</Keywords>
<Keywords name="Words1">break continue if else switch return for while do typedef namespace true false compile</Keywords>
<Keywords name="Words2">BlendState const void struct static extern register volatile inline target nointerpolation shared uniform row_major column_major snorm unorm bool bool1 bool2 bool3 bool4 int int1 int2 int3 int4 uint uint1 uint2 uint3 uint4 half half1 half2 half3 half4 float float1 float2 float3 float4 double double1 double2 double3 double4 matrix bool1x1 bool1x2 bool1x3 bool1x4 bool2x1 bool2x2 bool2x3 bool2x4 bool3x1 bool3x2 bool3x3 bool3x4 bool4x1 bool4x2 bool4x3 bool4x4 int1x1 int1x2 int1x3 int1x4 int2x1 int2x2 int2x3 int2x4 int3x1 int3x2 int3x3 int3x4 int4x1 int4x2 int4x3 int4x4 uint1x1 uint1x2 uint1x3 uint1x4 uint2x1 uint2x2 uint2x3 uint2x4 uint3x1 uint3x2 uint3x3 uint3x4 uint4x1 uint4x2 uint4x3 uint4x4 half1x1 half1x2 half1x3 half1x4 half2x1 half2x2 half2x3 half2x4 half3x1 half3x2 half3x3 half3x4 half4x1 half4x2 half4x3 half4x4 float1x1 float1x2 float1x3 float1x4 float2x1 float2x2 float2x3 float2x4 float3x1 float3x2 float3x3 float3x4 float4x1 float4x2 float4x3 float4x4 double1x1 double1x2 double1x3 double1x4 double2x1 double2x2 double2x3 double2x4 double3x1 double3x2 double3x3 double3x4 double4x1 double4x2 double4x3 double4x4 texture Texture texture1D Texture1D Texture1DArray texture2D Texture2D Texture2DArray Texture2DMS Texture2DMSArray texture3D Texture3D textureCUBE TextureCube sampler sampler1D sampler2D sampler3D samplerCUBE sampler_state cbuffer technique technique10 VertexShader PixelShader pass string</Keywords>
<Keywords name="Words3">auto case catch char class const_cast default delete dynamic_cast enum explicit friend goto long mutable new operator private protected public reinterpret_cast short signed sizeof static_cast template this throw try typename union unsigned using virtual</Keywords>
<Keywords name="Words4"></Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="0000A0" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="C0C0C0" bgColor="FFFFFF" fontName="" fontStyle="2" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="Comic Sans MS" fontStyle="0" fontSize="8" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="Comic Sans MS" fontStyle="0" fontSize="8" />
<WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
Put the snippet inside your userDefineLang.xml file.
I know this is an easy question but I'm new to NotePad++. How do you integrate this into the app?
-tom