Hlms::setProperty vs. _setProperty

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


jwwalker
Goblin
Posts: 268
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 19

Hlms::setProperty vs. _setProperty

Post by jwwalker »

The docs for HlmsListener::preparePassHash say this is "to allow the listener to add/remove properties", and suggests Hlms::setProperty. The only public version of Hlms::setProperty is a static method that takes a parameter of type HlmsPropertyVec&, and I don't see where I am going to get that parameter. Should I instead use Hlms::_setProperty?

User avatar
Crystal Hammer
Orc
Posts: 405
Joined: Sat Jun 23, 2007 5:16 pm
x 115

Re: Hlms::setProperty vs. _setProperty

Post by Crystal Hammer »

I think so, this is done in:

Code: Select all

    uint32 AtmosphereNpr::preparePassHash( Hlms *hlms, size_t constBufferSlot )
    {
        hlms->_setProperty( HlmsBaseProp::Fog, 1 );
        hlms->_setProperty( "atmosky_npr", int32( constBufferSlot ) );
        return 1u;
    }

(it's not a real HlmsListener though).