Commit 266a5c04 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@18277 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a331201a
......@@ -758,6 +758,27 @@ const DrawMode& addDrawMode( const std::string & _name , bool _propertyBased)
//----------------------------------------------------------------------------
ACGDLLEXPORT
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties _properties)
{
const DrawMode& drawmode = addDrawMode( _name , true );
// Get the internal DrawMode
VecDrawModes::iterator modeIter, modeEnd( registeredDrawModes_.end() );
for( modeIter = registeredDrawModes_.begin(); modeIter != modeEnd; ++modeIter ) {
if( _name == modeIter->name() ) {
modeIter->properties() = _properties;
return drawmode;
}
}
return drawmode;
}
//----------------------------------------------------------------------------
const DrawMode& getDrawMode( const std::string & _name )
{
// check if mode exists
......
......@@ -613,11 +613,28 @@ 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.
*
The id of the draw mode is returned or if it does not exist, DrawMode::NONE is returned.
@param _name Name of the drawmode
@param _name Name of the DrawMode
@return Id of the draw mode or DrawModes::NONE
*/
ACGDLLEXPORT
......
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