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

Method _setupTexture

Engine/source/postFx/postEffect.cpp:1132–1182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130}
1131
1132void PostEffect::_setupTexture( U32 stage, GFXTexHandle &inputTex, const RectI *inTexViewport )
1133{
1134 const String &texFilename = getTexture( stage );
1135
1136 GFXTexHandle theTex;
1137 NamedTexTarget *namedTarget = NULL;
1138
1139 RectI viewport = GFX->getViewport();
1140
1141 if ( texFilename.compare( "$inTex", 0, String::NoCase ) == 0 )
1142 {
1143 theTex = inputTex;
1144
1145 if ( inTexViewport )
1146 {
1147 viewport = *inTexViewport;
1148 }
1149 else if ( theTex )
1150 {
1151 viewport.set( 0, 0, theTex->getWidth(), theTex->getHeight() );
1152 }
1153 }
1154 else if ( texFilename.compare( "$backBuffer", 0, String::NoCase ) == 0 )
1155 {
1156 theTex = PFXMGR->getBackBufferTex();
1157
1158 // Always use the GFX viewport when reading from the backbuffer
1159 }
1160 else if ( texFilename.isNotEmpty() && texFilename[0] == '#' )
1161 {
1162 namedTarget = NamedTexTarget::find( texFilename.c_str() + 1 );
1163 if ( namedTarget )
1164 {
1165 theTex = namedTarget->getTexture( 0 );
1166 viewport = namedTarget->getViewport();
1167 }
1168 }
1169 else
1170 {
1171 theTex = mTexture[ stage ];
1172 if ( theTex )
1173 viewport.set( 0, 0, theTex->getWidth(), theTex->getHeight() );
1174 }
1175
1176 mActiveTextures[ stage ] = theTex;
1177 mActiveNamedTarget[ stage ] = namedTarget;
1178 mActiveTextureViewport[ stage ] = viewport;
1179
1180 if ( theTex.isValid() )
1181 GFX->setTexture( stage, theTex );
1182}
1183
1184void PostEffect::_setupCubemapTexture(U32 stage, GFXCubemapHandle &inputTex)
1185{

Callers

nothing calls this directly

Calls 11

getBackBufferTexMethod · 0.80
findFunction · 0.50
compareMethod · 0.45
setMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
isNotEmptyMethod · 0.45
c_strMethod · 0.45
getTextureMethod · 0.45
isValidMethod · 0.45
setTextureMethod · 0.45

Tested by

no test coverage detected