MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / addArrayBinding

Method addArrayBinding

OgreMain/src/OgreRootLayout.cpp:455–478  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

453 }
454 //-------------------------------------------------------------------------
455 void RootLayout::addArrayBinding( DescBindingTypes::DescBindingTypes bindingType,
456 ArrayDesc arrayDesc )
457 {
458 OGRE_ASSERT_LOW( bindingType != DescBindingTypes::ParamBuffer );
459 OGRE_ASSERT_LOW( arrayDesc.arraySize > 0u );
460
461 if( !mArrayRanges[bindingType].empty() )
462 {
463 const ArrayDesc lastElem = ArrayDesc::fromKey( mArrayRanges[bindingType].back() );
464 if( arrayDesc.bindingIdx <= lastElem.bindingIdx )
465 {
466 OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Elements must be added in order",
467 "RootLayout::addArrayBinding" );
468 }
469
470 if( lastElem.bindingIdx + lastElem.arraySize > arrayDesc.bindingIdx )
471 {
472 OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Elements must not overlap",
473 "RootLayout::addArrayBinding" );
474 }
475 }
476
477 mArrayRanges[bindingType].push_back( arrayDesc.toKey() );
478 }
479 //-------------------------------------------------------------------------
480 void RootLayout::copyFrom( const RootLayout &other, bool bIncludeArrayBindings )
481 {

Callers 2

setupRootLayoutMethod · 0.80
gatherArrayedDescsMethod · 0.80

Calls 4

toKeyMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected