glsl syntax highlight and auto completion

Started by
3 comments, last by Vilem Otte 9 years, 10 months ago

Yes that's right the never ending story...

I've gone through a lot now tested different editors, tools, plugins and there's always something not the way I wanted. I think most people here know what I mean.

So recently I began searching for another solution (again). I came across a pretty nice solution in a forum post from like ages.

The main idea is to let your c-compiler think that .glsl files are to be parsed as header files. Not overwhelmingly new so far. But then you can go ahead an write another include file that defines all the glsl names and symbols and you are basically done, fore the c-compiler does the rest.

I took a liking to it and spend a night long crawling the glsl reference pages copy pasting function definitions and so on. Ill gladly share the result with you: https://github.com/Wh0p/Wh0psGarbageDump

You are free to test and improve this yourself! (However, I am totally new to all this git stuff and might need some time to figure this out)

Just have a look at the example on the bottom, how it looks in Visual Studio...

Still there are some drawbacks, you have to write a preprocessor that resolves or stripps the "#include" directives from the .glsl file.

The syntax for uniform buffer is somewhat broke.

Sooo, tell me if you like/hate/ignore it, or even have a better solution to this. Personally I think I have found a solution I can be happy with (for the time being).

cFc8dz6.png?1

Advertisement
Looks good. Will try it out.

Keep it up! I'd love to see this fleshed out.

Seems interesting (especially the intellisense part), any plans to add MSVC comments for intellisense (that <summary>, <param> etc.)?

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

Seems interesting (especially the intellisense part), any plans to add MSVC comments for intellisense (that <summary>, <param> etc.)?

yeah, thought about that too. Slowly but gradually i might integrate this too. Doing this manually would be a pain, though.


Doing this manually would be a pain, though.

True, also for allowing F.e. include in your glsl file (if you F.e. preprocess it in your "shader loader"), you can just exclude glsl files from build. You will still get all the intellisense magic and syntax (if you have it correctly set up).

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

This topic is closed to new replies.

Advertisement