internal Texture(PixelBufferType type, byte[] fileImage, bool mipmap, PixelFormat format) { int errorCode = PsmTexture.FromImage(type, fileImage, mipmap, format, out this.handle); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } PsmPixelBuffer.GetInfo(this.handle, out this.type, out this.width, out this.height, out this.level, out this.format, out this.option); this.state = new TextureState(); }
/// <summary>Creates a copy of the texture</summary> /// <param name="texture">Textures</param> /// <remarks>Creates a copy of the texture. The 2 textures will then share unmanaged resources. When Dispose() is called for all copies, the shared unmanaged resources will be freed.</remarks> internal Texture(Texture texture) : base(texture) { this.state = texture.state; }
/// <summary>Creates a texture</summary> /// <param name="type">Texture type</param> /// <param name="width">Texture width</param> /// <param name="height">Texture height</param> /// <param name="mipmap">Existence/Lack of mipmap</param> /// <param name="format">Pixel format</param> /// <param name="option">Pixel buffer creation option</param> internal Texture(PixelBufferType type, int width, int height, bool mipmap, PixelFormat format, PixelBufferOption option, InternalOption option2) : base(type, width, height, mipmap, format, option, option2) { this.state = new TextureState(); }