From svn/trunk merged support for passing the GL_VENDOR string into the #pragma(tic) shader compositions defines

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15089 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-08-10 19:56:53 +00:00
parent 96d247aa7e
commit 697128a11d

View File

@ -19,6 +19,7 @@
#include <osg/ApplicationUsage> #include <osg/ApplicationUsage>
#include <sstream> #include <sstream>
#include <algorithm>
#ifndef GL_MAX_TEXTURE_COORDS #ifndef GL_MAX_TEXTURE_COORDS
#define GL_MAX_TEXTURE_COORDS 0x8871 #define GL_MAX_TEXTURE_COORDS 0x8871
@ -954,6 +955,17 @@ void State::initializeExtensionProcs()
{ {
if (_extensionProcsInitialized) return; 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 = ["<<str_vendor<<"]"<<std::endl;
_defineMap.map[str_vendor].defineVec.push_back(osg::StateSet::DefinePair("1",osg::StateAttribute::ON));
_defineMap.map[str_vendor].changed = true;
_defineMap.changed = true;
}
_glExtensions = new GLExtensions(_contextID); _glExtensions = new GLExtensions(_contextID);
GLExtensions::Set(_contextID, _glExtensions.get()); GLExtensions::Set(_contextID, _glExtensions.get());