Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: cdavalillo on August 17, 2021, 12:52:02 pm

Title: Add support for GLSL files in Code::Blocks
Post by: cdavalillo 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....
Title: Re: Add support for GLSL files in Code::Blocks
Post by: Miguel Gimenez 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.
Title: Re: Add support for GLSL files in Code::Blocks
Post by: oBFusCATed 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?
Title: Re: Add support for GLSL files in Code::Blocks
Post by: cdavalillo 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.

Title: Re: Add support for GLSL files in Code::Blocks
Post by: oBFusCATed 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.