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

◆ CreateTexture()

unsafe void Microsoft.Xna.Framework.Graphics.TextureCube.CreateTexture ( GraphicsDevice graphicsDevice,
int size,
[MarshalAs(UnmanagedType.U1)] bool mipMap,
uint usage,
_D3DPOOL pool,
SurfaceFormat format )
inlineprotected

Definition at line 336 of file TextureCube.cs.

337 {
338 if (graphicsDevice == null)
339 {
340 throw new ArgumentNullException("graphicsDevice", FrameworkResources.DeviceCannotBeNullOnResourceCreate);
341 }
342 ValidateCreationParameters(graphicsDevice._profileCapabilities, size, format);
343 int num = ((!mipMap) ? 1 : 0);
344 fixed (IDirect3DCubeTexture9** ptr = &pComPtr)
345 {
346 int num2 = *(int*)graphicsDevice.pComPtr + 100;
347 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, uint, uint, _D3DFORMAT, _D3DPOOL, IDirect3DCubeTexture9**, void**, int>)(int)(*(uint*)num2))((nint)graphicsDevice.pComPtr, (uint)size, (uint)num, usage, _003CModule_003E.ConvertXnaFormatToWindows(format), pool, ptr, null);
348 if (num3 < 0)
349 {
350 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
351 }
352 isDisposed = false;
353 _parent = graphicsDevice;
354 SurfaceFormat? format2 = format;
355 InitializeDescription(format2);
356 graphicsDevice.Resources.AddTrackedObject(this, pComPtr, (uint)pool, _internalHandle, ref _internalHandle);
357 }
358 }
static void ValidateCreationParameters(ProfileCapabilities profile, int size, SurfaceFormat format)
unsafe void InitializeDescription(SurfaceFormat? format)
unsafe IDirect3DCubeTexture9 * pComPtr

References Microsoft.Xna.Framework.Graphics.GraphicsResource._internalHandle, Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.GraphicsDevice._profileCapabilities, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.AddTrackedObject(), Microsoft.Xna.Framework.FrameworkResources.DeviceCannotBeNullOnResourceCreate, System.format, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.TextureCube.InitializeDescription(), Microsoft.Xna.Framework.Graphics.GraphicsResource.isDisposed, Microsoft.Xna.Framework.Graphics.GraphicsDevice.pComPtr, Microsoft.Xna.Framework.Graphics.TextureCube.pComPtr, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources, and Microsoft.Xna.Framework.Graphics.TextureCube.ValidateCreationParameters().

Referenced by Microsoft.Xna.Framework.Graphics.TextureCube.TextureCube(), Microsoft.Xna.Framework.Graphics.RenderTargetCube.CreateRenderTarget(), and Microsoft.Xna.Framework.Graphics.RenderTargetCube.RecreateAndPopulateObject().