32

From the excerpt:

The OpenGL Shading Language (GLSL) is the standard programming language for shaders in OpenGL.

While is officially derived from C, it reserves many C++ keywords and otherwise has many significant differences. Also, it has a completely different use.

Among others, the one and only proper prototype for main there is:

void main()

As it is its own, independent language, can we enable proper syntax-highlighting for it please?

lang-c should work well enough.

8
  • 7
    BTW: Many GLSL-questions are mis-tagged C and/or C++ as well / instead. Probably also due to the missing syntax-highlighting. Aug 7, 2014 at 13:48
  • 8
    You can add <!-- language: lang-c --> above a code block instead of mis-tagging it
    – RobEarl
    Aug 8, 2014 at 9:00
  • 1
    @RobEarl: I know that workaround, but thanks for mentioning that here for others. (I used it in my question). Aug 8, 2014 at 12:46
  • 1
    The first step would be to add GLSL to the prettifier then beg them to actually take your patch, then come back and beg SO to pull it and use it. I submitted a patch for unityscript but so far action from the devs.
    – gman
    Aug 19, 2014 at 1:09
  • @gman: Using lang-c is a good start. Not sure anything better is needed. Aug 19, 2014 at 1:30
  • 1
    might be nice to highlight GLSL builtins. vec4, mat4, uniform, attribute, precision etc. The lang-c one highights float. It would be weird to see uniform float foo; highlighted but not uniform vec4 bar; and beside. It would literally take less than 30 minutes to add glsl support. Just clone the c one and add the keywords. In other words, don't be lazy when the right thing is so easy.
    – gman
    Aug 19, 2014 at 2:05
  • @gman The problem with that is then you have this almost-an-exact-clone of something else that takes up a bunch of extra characters in the JavaScript file that gets served to every visitor. Even if it's extremely easy to do, Stack Exchange might not be interested in increasing the file's size for a tag that has less than 3,000 questions under its belt.
    – animuson StaffMod
    Aug 20, 2014 at 0:22
  • @animuson Is it possible to do on a per-site basis then? There are sites where that programming language is a lot more common (relatively, of course. absolutely SO will always lead the question count). Feb 15, 2019 at 13:54

1 Answer 1

2

I've gone ahead and set the code language to lang-c for now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .