From 36409f85976a14adc2db7cce5d64551768665033 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Sep 2008 10:21:44 +0000 Subject: [PATCH] Added .vert and .frag to list of accepted extension in the GLSL plugin --- src/osgDB/Registry.cpp | 4 ++++ src/osgPlugins/glsl/ReaderWriterGLSL.cpp | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 231bc48bc..60c7592aa 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -220,6 +220,10 @@ Registry::Registry() addFileExtensionAlias("dcm", "dicom"); addFileExtensionAlias("dic", "dicom"); + addFileExtensionAlias("gl", "glsl"); + addFileExtensionAlias("vert", "glsl"); + addFileExtensionAlias("frag", "glsl"); + #if defined(DARWIN_QUICKTIME) addFileExtensionAlias("jpg", "qt"); addFileExtensionAlias("jpe", "qt"); diff --git a/src/osgPlugins/glsl/ReaderWriterGLSL.cpp b/src/osgPlugins/glsl/ReaderWriterGLSL.cpp index cdbb81461..359ae85b7 100644 --- a/src/osgPlugins/glsl/ReaderWriterGLSL.cpp +++ b/src/osgPlugins/glsl/ReaderWriterGLSL.cpp @@ -14,14 +14,12 @@ class ReaderWriterGLSL : public osgDB::ReaderWriter ReaderWriterGLSL() { supportsExtension("gl","OpenGL Shader Language format"); + supportsExtension("frag","OpenGL Shader Language format"); + supportsExtension("vert","OpenGL Shader Language format"); supportsExtension("glsl","OpenGL Shader Language format"); } virtual const char* className() const { return "GLSL Shader Reader"; } - virtual bool acceptsExtension(const std::string& extension) const - { - return osgDB::equalCaseInsensitive(extension,"glsl") || osgDB::equalCaseInsensitive(extension,"gl"); - } virtual ReadResult readShader(std::istream& fin,const Options* options) const {