MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setShaderMacro

Method setShaderMacro

Engine/source/postFx/postEffect.cpp:1908–1930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1906}
1907
1908void PostEffect::setShaderMacro( const String &name, const String &value )
1909{
1910 // Check to see if we already have this macro.
1911 Vector<GFXShaderMacro>::iterator iter = mShaderMacros.begin();
1912 for ( ; iter != mShaderMacros.end(); iter++ )
1913 {
1914 if ( iter->name == name )
1915 {
1916 if ( iter->value != value )
1917 {
1918 iter->value = value;
1919 mUpdateShader = true;
1920 }
1921 return;
1922 }
1923 }
1924
1925 // Add a new macro.
1926 mShaderMacros.increment();
1927 mShaderMacros.last().name = name;
1928 mShaderMacros.last().value = value;
1929 mUpdateShader = true;
1930}
1931
1932bool PostEffect::removeShaderMacro( const String &name )
1933{

Callers 2

postEffect.cppFile · 0.80
renderMethod · 0.80

Calls 4

incrementMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected