public void SetTexture(int slot, IPlatformTexture2D texture) { if (textures[slot] != texture) { textures[slot] = (PlatformTexture2D)texture; texturesDirtyMask |= 1 << slot; } }
public static void SetData <T>( this IPlatformTexture2D texture, int level, int x, int y, int width, int height, T[] data, int startIndex) where T : unmanaged { fixed(T *p = &data[startIndex]) { texture.SetData(level, x, y, width, height, new IntPtr(p)); } }
public override void Dispose() { MemoryUsed = 0; if (platformTexture != null) { var platformTextureCopy = platformTexture; Window.Current.InvokeOnRendering(() => { platformTextureCopy.Dispose(); }); platformTexture = null; } base.Dispose(); }
private void EnsurePlatformTexture(Format format, int width, int height, bool mipmaps) { if (platformTexture == null || platformTexture.Format != format || platformTexture.Width != width || platformTexture.Height != height || platformTexture.LevelCount > 1 != mipmaps ) { if (platformTexture != null) { platformTexture.Dispose(); } platformTexture = PlatformRenderer.Context.CreateTexture2D(format, width, height, mipmaps, textureParams); PlatformRenderer.RebindTexture(this); } }
public static void SetData(this IPlatformTexture2D texture, int level, IntPtr data) { GraphicsUtility.CalculateMipLevelSize(level, texture.Width, texture.Height, out var levelWidth, out var levelHeight); texture.SetData(level, 0, 0, levelWidth, levelHeight, data); }
public static void SetData <T>( this IPlatformTexture2D texture, int level, int x, int y, int width, int height, T[] data) where T : unmanaged { SetData(texture, level, x, y, width, height, data, 0); }
public static void SetData <T>( this IPlatformTexture2D texture, int level, int x, int y, int width, int height, T data) where T : unmanaged { texture.SetData(level, x, y, width, height, new IntPtr(&data)); }
public static void SetData <T>( this IPlatformTexture2D texture, int level, T[] data, int startIndex) where T : unmanaged { GraphicsUtility.CalculateMipLevelSize(level, texture.Width, texture.Height, out var levelWidth, out var levelHeight); SetData(texture, level, 0, 0, levelWidth, levelHeight, data, startIndex); }
public static void SetData <T>( this IPlatformTexture2D texture, int level, T[] data) where T : unmanaged { SetData(texture, level, data, 0); }
public static void SetData <T>( this IPlatformTexture2D texture, int level, T data) where T : unmanaged { SetData(texture, level, new IntPtr(&data)); }