コード例 #1
0
        /// <summary>
        /// Load texture data from a raw byte array (BGRA 32bit format)
        /// </summary>
        public override void SetData(byte[] data, int level = 0, PixelFormat format = PixelFormat.Rgba)
        {
            Debug.Assert(!isDisposed);

            lock (this)
            {
                formatToBeUploaded = format;
                levelToBeUploaded  = level;
                dataToBeUploaded   = data;
            }
        }
コード例 #2
0
        public void SetData(byte[] data, Rectangle bounds, int level = 0, PixelFormat format = PixelFormat.Rgba)
        {
            Debug.Assert(!isDisposed);

            lock (this)
            {
                if (dataToBeUploaded != null)
                {
                    FreeBuffer(dataToBeUploaded);
                }

                formatToBeUploaded = format;
                levelToBeUploaded  = level;
                boundsToBeUploaded = bounds;
                dataToBeUploaded   = data;

                IsTransparent = false;

                QueueForUpload();
            }
        }
コード例 #3
0
ファイル: TextureGl.cs プロジェクト: notperry1234567890/osu
        /// <summary>
        /// Load texture data from a raw IntPtr location (BGRA 32bit format)
        /// </summary>
        public void SetData(IntPtr dataPointer, int level = 0, PixelFormat format = 0)
        {
            Debug.Assert(!isDisposed);

            if (format == 0)
            {
                format = PixelFormat.Rgba;
            }

            byte[] data;
            if (dataPointer == IntPtr.Zero)
            {
                data = new byte[0];
            }
            else
            {
                data = ReserveBuffer(Width * Height * 4);
                Marshal.Copy(dataPointer, data, 0, data.Length);
            }

            SetData(data, level, format);
        }
コード例 #4
0
 /// <summary>
 /// Load texture data from a raw byte array (BGRA 32bit format)
 /// </summary>
 public override void SetData(byte[] data, int level = 0, PixelFormat format = PixelFormat.Rgba)
 {
     Debug.Assert(!isDisposed);
     SetData(data, new Rectangle(0, 0, width, height), level, format);
 }
コード例 #5
0
ファイル: TextureGl.cs プロジェクト: notperry1234567890/osu
 /// <summary>
 /// Load texture data from a raw byte array (BGRA 32bit format)
 /// </summary>
 public abstract void SetData(byte[] data, int level = 0, PixelFormat format = PixelFormat.Rgba);