diff --git a/include/osg/Geometry b/include/osg/Geometry index 2e3152476..ae51a9b82 100644 --- a/include/osg/Geometry +++ b/include/osg/Geometry @@ -164,10 +164,7 @@ class OSG_EXPORT Geometry : public Drawable void setNormalArray(Array* array) { _normalData.array = array; if (!_normalData.array.valid()) _normalData.binding=BIND_OFF; computeFastPathsUsed(); dirtyDisplayList(); } Array* getNormalArray() { return _normalData.array.get(); } const Array* getNormalArray() const { return _normalData.array.get(); } - - Array* getNormalArrayEx() { return _normalData.array.get(); } - const Array* getNormalArrayEx() const { return _normalData.array.get(); } - + void setNormalIndices(IndexArray* array) { _normalData.indices = array; computeFastPathsUsed(); dirtyDisplayList(); } IndexArray* getNormalIndices() { return _normalData.indices.get(); } const IndexArray* getNormalIndices() const { return _normalData.indices.get(); } diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index ad3884c73..dca8fc345 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -292,8 +292,34 @@ public: osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _dataToCompile(dataToCompile), _changeAutoUnRef(changeAutoUnRef), _valueAutoUnRef(valueAutoUnRef), - _changeAnisotropy(changeAnisotropy), _valueAnisotropy(valueAnisotropy) + _changeAnisotropy(changeAnisotropy), _valueAnisotropy(valueAnisotropy), + _useDisplayLists(true), + _useVertexBufferObjects(false) { +#if __APPLE__ + _useDisplayLists = false; + _useVertexBufferObjects = false; +#endif + + static const char* str = getenv("OSG_DATABASE_PAGER_GEOMETRY"); + if (str) + { + if (strcmp(str,"DisplayList")==0 || strcmp(str,"DL")==0) + { + _useDisplayLists = true; + _useVertexBufferObjects = false; + } + else if (strcmp(str,"VBO")==0) + { + _useDisplayLists = true; + _useVertexBufferObjects = true; + } + else if (strcmp(str,"VertexArrays")==0 || strcmp(str,"VA")==0 ) + { + _useDisplayLists = false; + _useVertexBufferObjects = false; + } + } } virtual void apply(osg::Node& node) @@ -345,8 +371,8 @@ public: { apply(drawable->getStateSet()); - // drawable->setUseDisplayList(false); - // drawable->setUseVertexBufferObjects(true); + drawable->setUseDisplayList(_useDisplayLists); + drawable->setUseVertexBufferObjects(_useVertexBufferObjects); if (drawable->getUseDisplayList() || drawable->getUseVertexBufferObjects()) { @@ -360,6 +386,8 @@ public: bool _valueAutoUnRef; bool _changeAnisotropy; float _valueAnisotropy; + bool _useDisplayLists; + bool _useVertexBufferObjects; }; diff --git a/src/osgGA/DriveManipulator.cpp b/src/osgGA/DriveManipulator.cpp index e0a8e49be..924c2ea82 100644 --- a/src/osgGA/DriveManipulator.cpp +++ b/src/osgGA/DriveManipulator.cpp @@ -12,7 +12,7 @@ */ #if defined(_MSC_VER) - #pragma warning( disable : 4786 ) + #pragma warning( disable : 4786 ) #endif #include @@ -361,13 +361,15 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) } #ifdef KEYBOARD_PITCH else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Up || - ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Up) + ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Up || + ea.getKey()=='9') { _pitchUpKeyPressed = true; return true; } else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Down || - ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Down) + ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Down || + ea.getKey()=='6') { _pitchDownKeyPressed = true; return true; @@ -380,13 +382,15 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) { #ifdef KEYBOARD_PITCH if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Up || - ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Up) + ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Up || + ea.getKey()=='9') { _pitchUpKeyPressed = false; return true; } else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Down || - ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Down) + ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Down || + ea.getKey()=='6') { _pitchDownKeyPressed = false; return true;