Which GLSL file extension does Xcode recognize?

Note. This question is specifically about Xcode. There are other questions about GLSL file extensions, for example: What is the correct file extension for GLSL shaders?

I use .glsl for GLSL code files, but I also tried: .glslv , .glslf, .vsh , .fsh , .vert and .frag - but I always need to manually go and set the file type to "OpenGL Shading Language Source" after create / add file to my project.

a) Is there an extension that Xcode automatically recognizes as a GLSL source?

or...

b) Is there a way to tell Xcode to associate the extension of my choice with the type of the GLSL source file?

+4
source share
1 answer

I have a reason to believe that the answer to your question is: None. I looked at the document type and exported the UTI declarations in Info.plist Xcode 4.5.1. It lists 4 extensions for flash shaders associated with the UTI org.khronos.glsl.fragment-shader: .fs, .fsh, .frag, .fragment. There are similar extensions for vertex shaders and geometric shaders. But if I add a file with any of these 4 fragment shader extensions to the project, Xcode simply classifies it as common source code.

I bet there is no answer to (b) either, but I cannot prove it.

+3
source

Source: https://habr.com/ru/post/1442406/


All Articles