Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PrepareARenderTarget_AndListenToEvents()

void Terraria.GameContent.ARenderTargetContentByRequest.PrepareARenderTarget_AndListenToEvents ( ref RenderTarget2D target,
GraphicsDevice device,
int neededWidth,
int neededHeight,
RenderTargetUsage usage )
inlineprotectedinherited

Definition at line 38 of file ARenderTargetContentByRequest.cs.

39 {
40 if (target == null || target.IsDisposed || target.Width != neededWidth || target.Height != neededHeight)
41 {
42 if (target != null)
43 {
44 target.ContentLost -= target_ContentLost;
45 target.Disposing -= target_Disposing;
46 }
47 target = new RenderTarget2D(device, neededWidth, neededHeight, mipMap: false, device.PresentationParameters.BackBufferFormat, DepthFormat.None, 0, usage);
48 target.ContentLost += target_ContentLost;
49 target.Disposing += target_Disposing;
50 }
51 }

References Microsoft.Xna.Framework.Graphics.PresentationParameters.BackBufferFormat, Microsoft.Xna.Framework.Graphics.GraphicsDevice.PresentationParameters, Terraria.GameContent.ARenderTargetContentByRequest.target_ContentLost(), and Terraria.GameContent.ARenderTargetContentByRequest.target_Disposing().

Referenced by Terraria.GameContent.AnOutlinedDrawRenderTargetContent.HandleUseReqest(), Terraria.GameContent.PlayerQueenSlimeMountTextureContent.HandleUseReqest(), Terraria.GameContent.PlayerRainbowWingsTextureContent.HandleUseReqest(), and Terraria.GameContent.PlayerTitaniumStormBuffTextureContent.HandleUseReqest().