Author Topic: Add support for GLSL files in Code::Blocks  (Read 5810 times)

Offline cdavalillo

  • Multiple posting newcomer
  • *
  • Posts: 20
Add support for GLSL files in Code::Blocks
« on: August 17, 2021, 12:52:02 pm »
Hello to all the Code::Blocks development team

I'm a happy user of Code::Blocks that program some applications for scientific data visualization in OpenGL.

Code::Blocks has amazing support of all OpenGL related technologies (SDL, GLUT, GLFW, etc.) but it lacks support for the shader's development. As you know shader's files like GLSL files are just simple text files with some simple format mimicking c programing language syntax. Every time that I'm going to write a shader file I have to go outside of Code::Blocks open a text editor and write the shader code. Could you the Code::Blocks development team add some support for editing GLSL files and other shader related files? That functionality would be easy to add and very helpful.

Well, thank you for the development of Code::Blocks....

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Add support for GLSL files in Code::Blocks
« Reply #1 on: August 17, 2021, 01:09:34 pm »
If it is just a text file then you can add it to the project (File -> New -> Empty file), it will appear in the Others branch of the project. Or you can copy it inside the project folder and add it to the project.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Add support for GLSL files in Code::Blocks
« Reply #2 on: August 17, 2021, 02:18:31 pm »
Why do you need to go outside of C::B for editing text files?
We have highlighting support for GLSL files.
What else do you need?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cdavalillo

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Add support for GLSL files in Code::Blocks
« Reply #3 on: August 18, 2021, 01:49:48 am »
Why do you need to go outside of C::B for editing text files?
We have highlighting support for GLSL files.
What else do you need?

oBFusCATed where is that functionality? I only see the empty file functionality as Miguel Gimenez said. I would like to see a GLSL icon file as I do see of a cpp file.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Add support for GLSL files in Code::Blocks
« Reply #4 on: August 18, 2021, 10:49:24 am »
Edit -> Highlight mode -> OpenGL Shading Language.
If you create a file with extension matching any of these three: *.vert,*.frag,*.glsl
It will be highlighted.
If you use different extension you could add it in Settings -> Editor -> Syntax highlighting -> OpenGL Shading Language -> File masks

I don't think we need to add a file template for shader source files.
If you feel the need for this you could copy the C templates, modify it and them post a patch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]