Tweaks for better OSX paging support, 6 and 9 keys for control drive manipulator

up and down looking, and removed redundent API from osg::Geometry.
This commit is contained in:
Robert Osfield
2005-07-07 14:14:38 +00:00
parent facb0e2638
commit 0d8e38f9ee
3 changed files with 41 additions and 12 deletions

View File

@@ -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(); }

View File

@@ -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;
};

View File

@@ -12,7 +12,7 @@
*/
#if defined(_MSC_VER)
#pragma warning( disable : 4786 )
#pragma warning( disable : 4786 )
#endif
#include <osgGA/DriveManipulator>
@@ -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;