Added State::computeSecondaryColorSupported() & computeFogCoordSupported().

Updated NEWS.
This commit is contained in:
Robert Osfield 2002-11-13 11:09:55 +00:00
parent b6838c703e
commit bd7762a73e
3 changed files with 67 additions and 22 deletions

52
NEWS
View File

@ -4,39 +4,51 @@ OSG News (most significant items from ChangeLog)
11th November 2002 - OpenSceneGraph-0.9.2.tar.gz 11th November 2002 - OpenSceneGraph-0.9.2.tar.gz
>>> New shape primitive support, and new AC3D and GEO loaders, >>> New AC3D and GEO loaders, new Shape primitives, improved OpenFlight support. .
Geometry has been extended to all per primtive bindings and From Geoff Michel, AC3D .wc and Carbon Graphics GEO .geo loaders.
Support for multi-texturing added to OpenFlight loader.
LOD has been revamped to allow independent min and max ranges for
each LOD child, bringing it inline with the OpenFlight style LOD
representation.
Switch has been revamped to allow independent switching on or off of
each Switch child, bringing it inline with the OpenFlight style Switch
representation.
New osg::Shape geometry primitives added which allow the specification
of geometry in a form that can accelerate collision detection, and as
a way of specifying the geometry to tessellate. Shapes include
Sphere, Oriented Box, Cone, Cylinder, Grid, TriangleMesh, ConvexHull
and CompositeShape which allows the storage of a hierarchy of shapes.
Geometry has been extended to all per primitive bindings and
per primitive set bindings of attributes, and indexing of attributes per primitive set bindings of attributes, and indexing of attributes
with the same or different index lists for each attribute list. with the same or different index lists for each attribute list.
From Macro Jez, new cubemap helper classes. From Macro Jez, new cubemap helper classes.
New osg::Shape geometry primitives added which allow the specification
of geometry in a form that can accelerate collision detection, and as
a way of specifiying the geometry to tesselate. Shapes include
Shere, Orintatble Box, Cone, Cylinder, Grid, TriangleMesh, ConvexHull
and CompositeShape which allows the storage of a heirachy of shapes.
From Geoff Michel, AC3D .wc and Carbon Graphics GEO .geo loaders.
Support added for handling different extensions on different graphics Support added for handling different extensions on different graphics
contexts. contexts.
Draw and Sort callbacks added to osg::RenderStage. Draw and Sort callbacks added to osg::RenderStage.
Support for multitexturing added to OpenFlight loader.
LOD has been revamped to allow independat min and max ranges for
each LOD child, bringing it inline with the OpenFlight style LOD
representation.
Switch has been revamped to allow independat switching on or off of
each Switch child, bringing it inline with the OpenFlight style Switch
representation.
Added PolygonStipple class. Added PolygonStipple class.
Further refinement of class names and method calls:
Renamed classes :
Primitive -> PrimitiveSet
Renamed methods :
Geometry::addPrimitive(..) -> addPrimitiveSet(..)
Drawable::drawImmediateMode(..) -> drawImplementation(..) const
Drawable::DrawCallback::drawImmediateMode(..) -> drawImplementation(..) const
30th August 2002 - OpenSceneGraph-0.9.1.tar.gz 30th August 2002 - OpenSceneGraph-0.9.1.tar.gz
>>> Support added for 1D & 3D textures, texture env combiners, secondary color and fog coords, DOFTransform and Sequence nodes. Inventor/VRML and LWO2 loaders added and the a port HP-UX! >>> Support added for 1D & 3D textures, texture env combiners, secondary color and fog coords, DOFTransform and Sequence nodes. Inventor/VRML and LWO2 loaders added and the a port HP-UX!

View File

@ -326,6 +326,9 @@ class SG_EXPORT State : public Referenced
_colorArray._dirty = true; _colorArray._dirty = true;
} }
inline bool isSecondaryColorSupported() const { return _isSecondColorSupportResolved?_isSecondColorSupported:computeSecondaryColorSupported(); }
/** wrapper around glEnableClientState(GL_SECONDARY_COLOR_ARRAY);glSecondayColorPointer(..); /** wrapper around glEnableClientState(GL_SECONDARY_COLOR_ARRAY);glSecondayColorPointer(..);
* note, only updates values that change.*/ * note, only updates values that change.*/
void setSecondaryColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ); void setSecondaryColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
@ -338,7 +341,7 @@ class SG_EXPORT State : public Referenced
{ {
_secondaryColorArray._enabled = false; _secondaryColorArray._enabled = false;
_secondaryColorArray._dirty = false; _secondaryColorArray._dirty = false;
glDisableClientState(GL_SECONDARY_COLOR_ARRAY); if (isSecondaryColorSupported()) glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
} }
} }
@ -383,6 +386,8 @@ class SG_EXPORT State : public Referenced
} }
inline bool isFogCoordSupported() const { return _isFogCoordSupportResolved?_isFogCoordSupported:computeFogCoordSupported(); }
/** wrapper around glEnableClientState(GL_FOG_COORDINATE_ARRAY);glFogCoordPointer(..); /** wrapper around glEnableClientState(GL_FOG_COORDINATE_ARRAY);glFogCoordPointer(..);
* note, only updates values that change.*/ * note, only updates values that change.*/
void setFogCoordPointer( GLenum type, GLsizei stride, const GLvoid *ptr ); void setFogCoordPointer( GLenum type, GLsizei stride, const GLvoid *ptr );
@ -395,7 +400,7 @@ class SG_EXPORT State : public Referenced
{ {
_fogArray._enabled = false; _fogArray._enabled = false;
_fogArray._dirty = false; _fogArray._dirty = false;
glDisableClientState(GL_FOG_COORDINATE_ARRAY); if (isFogCoordSupported()) glDisableClientState(GL_FOG_COORDINATE_ARRAY);
} }
} }
@ -692,6 +697,14 @@ class SG_EXPORT State : public Referenced
bool getLastAppliedMode(const ModeMap& modeMap,StateAttribute::GLMode mode) const; bool getLastAppliedMode(const ModeMap& modeMap,StateAttribute::GLMode mode) const;
const StateAttribute* getLastAppliedAttribute(const AttributeMap& attributeMap,StateAttribute::Type type) const; const StateAttribute* getLastAppliedAttribute(const AttributeMap& attributeMap,StateAttribute::Type type) const;
mutable bool _isSecondColorSupportResolved;
mutable bool _isSecondColorSupported;
bool computeSecondaryColorSupported() const;
mutable bool _isFogCoordSupportResolved;
mutable bool _isFogCoordSupported;
bool computeFogCoordSupported() const;
}; };
inline void State::pushModeList(ModeMap& modeMap,const StateSet::ModeList& modeList) inline void State::pushModeList(ModeMap& modeMap,const StateSet::ModeList& modeList)

View File

@ -16,6 +16,12 @@ State::State()
_currentActiveTextureUnit=0; _currentActiveTextureUnit=0;
_currentClientActiveTextureUnit=0; _currentClientActiveTextureUnit=0;
_isSecondColorSupportResolved = false;
_isSecondColorSupported = false;
_isFogCoordSupportResolved = false;
_isFogCoordSupported = false;
} }
State::~State() State::~State()
@ -512,3 +518,17 @@ void State::setSecondaryColorPointer( GLint size, GLenum type,
_secondaryColorArray._dirty = false; _secondaryColorArray._dirty = false;
} }
} }
bool State::computeSecondaryColorSupported() const
{
_isSecondColorSupportResolved = true;
_isSecondColorSupported = osg::isGLExtensionSupported("GL_EXT_secondary_color");;
return _isSecondColorSupported;
}
bool State::computeFogCoordSupported() const
{
_isFogCoordSupportResolved = true;
_isFogCoordSupported = osg::isGLExtensionSupported("GL_EXT_fog_coord");
return _isFogCoordSupported;
}