Exemple #1
0
        public PvrTexture(PvrHeader header, byte[] data)
        {
            Validate();

            var dataPtr = NativeHelper.PinObject(data);

            _pointer = PVRTexLib_CreateTexture(header.GetAddress(), dataPtr.AddrOfPinnedObject());
            NativeHelper.FreePinnedObject(dataPtr);
        }
Exemple #2
0
        public static PvrTexture Create(byte[] data, uint width, uint height, uint depth, PixelFormat format, ChannelType channelType, ColorSpace colorSpace)
        {
            var attributes = new PvrCreateParams
            {
                pixelFormat     = format,
                width           = width,
                height          = height,
                depth           = depth,
                numMipMaps      = 1,
                numArrayMembers = 1,
                numFaces        = 1,
                colorSpace      = colorSpace,
                channelType     = channelType,
                preMultiplied   = false
            };
            var header = new PvrHeader(attributes);

            return(new PvrTexture(header, data));
        }