Пример #1
0
        internal PixelBuffer(PixelBufferType type, int width, int height, bool mipmap, PixelFormat format, PixelBufferOption option, InternalOption option2)
        {
            int errorCode = PsmPixelBuffer.Create(type, width, height, mipmap, format, option, option2, 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);
        }
Пример #2
0
        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();
        }
Пример #3
0
        internal PixelBuffer(PixelBuffer buffer)
        {
            int errorCode = PsmPixelBuffer.AddRef(buffer.handle);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
            this.handle = buffer.handle;
            this.type   = buffer.type;
            this.option = buffer.option;
            this.format = buffer.format;
            this.width  = buffer.width;
            this.height = buffer.height;
            this.level  = buffer.level;
        }
Пример #4
0
 protected virtual void Dispose(bool disposing)
 {
     PsmPixelBuffer.Delete(this.handle);
     this.handle = 0;
 }