Commit f9cac0d9 authored by Jan Möbius's avatar Jan Möbius
Browse files

Convenience function to add property based drawmodes. refs #1895

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18275 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cf70236a
......@@ -756,6 +756,18 @@ const DrawMode& addDrawMode( const std::string & _name , bool _propertyBased)
return registeredDrawModes_[ registeredDrawModes_.size() - 1 ].id();
}
//----------------------------------------------------------------------------
ACGDLLEXPORT
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties _properties)
{
const DrawMode& drawmode = addDrawMode( _name , true );
getDrawMode(_name).setDrawModeProperties(_properties);
return drawmode;
}
//----------------------------------------------------------------------------
......
......@@ -613,6 +613,22 @@ namespace DrawModes {
ACGDLLEXPORT
const DrawMode& addDrawMode( const std::string & _name, bool _propertyBased = false);
/** \brief Add a custom property based DrawMode.
*
* The id of the new draw mode is returned. If it already exists, the id of the existing one
* is returned.
*
* \note If the DrawMode already exists, the properties will be applied to the existing mode!!
*
* Property based draw modes consist of various flags, which define which primitives and
* additional information are send to the gpu.
*
* @param _name Name of the draw mode to add
* @param _properties Properties of the drawmode
* @return Id of the new draw mode
*/
ACGDLLEXPORT
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties _properties);
/** \brief Get a custom DrawMode.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment