From aff6e112ec17392c758a2ca47a253dadf4e95e9c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 10 Aug 2015 17:42:05 +0000 Subject: [PATCH] Added support for injecting GL_VENDOR strings into GLSL shaders via the new #pragma(tic) shader composition git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15078 16af8721-9629-0410-8352-f15c8da7e697 --- include/osg/State | 3 ++- src/osg/State.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/osg/State b/include/osg/State index f5992dd7a..549098677 100644 --- a/include/osg/State +++ b/include/osg/State @@ -1592,7 +1592,8 @@ class OSG_EXPORT State : public Referenced { typedef std::vector DefineVec; - DefineStack() {} + DefineStack(): + changed(false) {} void print(std::ostream& fout) const; diff --git a/src/osg/State.cpp b/src/osg/State.cpp index 27329136f..771673742 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -19,6 +19,7 @@ #include #include +#include #ifndef GL_MAX_TEXTURE_COORDS #define GL_MAX_TEXTURE_COORDS 0x8871 @@ -953,6 +954,18 @@ void State::setInterleavedArrays( GLenum format, GLsizei stride, const GLvoid* p void State::initializeExtensionProcs() { if (_extensionProcsInitialized) return; + + + const char* vendor = (const char*) glGetString( GL_VENDOR ); + if (vendor) + { + std::string str_vendor(vendor); + std::replace(str_vendor.begin(), str_vendor.end(), ' ', '_'); + OSG_INFO<<"GL_VENDOR = ["<