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

Method _setupTexture

Engine/source/postFx/postEffect.cpp:908–958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908void PostEffect::_setupTexture( U32 stage, GFXTexHandle &inputTex, const RectI *inTexViewport )
909{
910 const String &texFilename = mTexFilename[ stage ];
911
912 GFXTexHandle theTex;
913 NamedTexTarget *namedTarget = NULL;
914
915 RectI viewport = GFX->getViewport();
916
917 if ( texFilename.compare( "$inTex", 0, String::NoCase ) == 0 )
918 {
919 theTex = inputTex;
920
921 if ( inTexViewport )
922 {
923 viewport = *inTexViewport;
924 }
925 else if ( theTex )
926 {
927 viewport.set( 0, 0, theTex->getWidth(), theTex->getHeight() );
928 }
929 }
930 else if ( texFilename.compare( "$backBuffer", 0, String::NoCase ) == 0 )
931 {
932 theTex = PFXMGR->getBackBufferTex();
933
934 // Always use the GFX viewport when reading from the backbuffer
935 }
936 else if ( texFilename.isNotEmpty() && texFilename[0] == '#' )
937 {
938 namedTarget = NamedTexTarget::find( texFilename.c_str() + 1 );
939 if ( namedTarget )
940 {
941 theTex = namedTarget->getTexture( 0 );
942 viewport = namedTarget->getViewport();
943 }
944 }
945 else
946 {
947 theTex = mTextures[ stage ];
948 if ( theTex )
949 viewport.set( 0, 0, theTex->getWidth(), theTex->getHeight() );
950 }
951
952 mActiveTextures[ stage ] = theTex;
953 mActiveNamedTarget[ stage ] = namedTarget;
954 mActiveTextureViewport[ stage ] = viewport;
955
956 if ( theTex.isValid() )
957 GFX->setTexture( stage, theTex );
958}
959
960void PostEffect::_setupTransforms()
961{

Callers

nothing calls this directly

Calls 11

findFunction · 0.85
getBackBufferTexMethod · 0.80
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