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

◆ CreateRenderTarget()

void Microsoft.Xna.Framework.Graphics.RenderTarget2D.CreateRenderTarget ( GraphicsDevice graphicsDevice,
int width,
int height,
[MarshalAs(UnmanagedType.U1)] bool mipMap,
SurfaceFormat preferredFormat,
DepthFormat preferredDepthFormat,
int preferredMultiSampleCount,
RenderTargetUsage usage )
inlinepackage

Definition at line 99 of file RenderTarget2D.cs.

100 {
101 if (graphicsDevice == null)
102 {
103 throw new ArgumentNullException("graphicsDevice", FrameworkResources.DeviceCannotBeNullOnResourceCreate);
104 }
105 graphicsDevice.Adapter.QueryFormat(isBackBuffer: false, graphicsDevice._deviceType, graphicsDevice._graphicsProfile, preferredFormat, preferredDepthFormat, preferredMultiSampleCount, out var selectedFormat, out var selectedDepthFormat, out var selectedMultiSampleCount);
106 Texture2D.ValidateCreationParameters(graphicsDevice._profileCapabilities, width, height, selectedFormat, mipMap);
107 (helper = new RenderTargetHelper(this, width, height, selectedFormat, selectedDepthFormat, selectedMultiSampleCount, usage, graphicsDevice._profileCapabilities)).CreateSurfaces(graphicsDevice);
108 CreateTexture(graphicsDevice, width, height, mipMap, 1u, (_D3DPOOL)0, selectedFormat);
110 }
unsafe void CreateTexture(GraphicsDevice graphicsDevice, int width, int height, [MarshalAs(UnmanagedType.U1)] bool mipMap, uint usage, _D3DPOOL pool, SurfaceFormat format)
Definition Texture2D.cs:609

References Microsoft.Xna.Framework.Graphics.GraphicsDevice._deviceType, Microsoft.Xna.Framework.Graphics.GraphicsDevice._graphicsProfile, Microsoft.Xna.Framework.Graphics.GraphicsDevice._profileCapabilities, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Adapter, Microsoft.Xna.Framework.Graphics.Texture2D.CreateTexture(), Microsoft.Xna.Framework.FrameworkResources.DeviceCannotBeNullOnResourceCreate, Microsoft.Xna.Framework.Graphics.RenderTarget2D.helper, Microsoft.Xna.Framework.Graphics.GraphicsAdapter.QueryFormat(), Microsoft.Xna.Framework.Graphics.Texture.renderTargetContentsDirty, and Microsoft.Xna.Framework.Graphics.Texture2D.ValidateCreationParameters().

Referenced by Microsoft.Xna.Framework.Graphics.RenderTarget2D.RenderTarget2D(), Microsoft.Xna.Framework.Graphics.RenderTarget2D.RenderTarget2D(), and Microsoft.Xna.Framework.Graphics.RenderTarget2D.RenderTarget2D().