4

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've been using .glsl for GLSL code files but I've also tried these: .glslv, .glslf, .vsh, .fsh, .vert, and .frag - but I always have to manually go and set the file type to "OpenGL Shading Language Source" after creating/adding the file to my project.

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

or...

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

Community
  • 1
  • 1
jhabbott
  • 16,761
  • 8
  • 56
  • 91

1 Answers1

3

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

I'd bet that the answer to (b) is also No, but I can't prove it.

JWWalker
  • 21,318
  • 5
  • 54
  • 72