Aiv.Fast2D.Texture.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( byte bitmap, int mipMap ) : void
bitmap byte
mipMap int
Результат void
        public void Update(byte[] bitmap, int mipMap = 0)
        {
            this.Bind();
            if (mipMap == 0)
                this.bitmap = bitmap;
            #if !__MOBILE__
            GL.TexImage2D<byte>(TextureTarget.Texture2D, mipMap, PixelInternalFormat.Rgba8, this.width / (int)Math.Pow(2, mipMap), this.height / (int)Math.Pow(2, mipMap), 0, PixelFormat.Rgba, PixelType.UnsignedByte, this.bitmap);
            #else
            GL.TexImage2D(TextureTarget.Texture2D, mipMap, PixelInternalFormat.Rgba, this.width / (int)Math.Pow(2, mipMap), this.height / (int)Math.Pow(2, mipMap), 0, OpenTK.Graphics.ES30.PixelFormat.Rgba, PixelType.UnsignedByte, this.bitmap);
            #endif
        }

Same methods

Texture::Update ( int mipMap ) : void

Usage Example

Пример #1
0
 public void Draw()
 {
     if (Width <= 0 || Height <= 0)
     {
         return;
     }
     if (lastRedrawInfo.Item1 != Fill || lastRedrawInfo.Item2 != Width ||
         lastRedrawInfo.Item3 != Height || lastRedrawInfo.Item4 != Color) // redraw
     {
         if (Fill)
         {
             Utils.FillRectangle(cachedTexture, Vector2.Zero, new Vector2(cachedTexture.Width, cachedTexture.Height), Color);
         }
         else
         {
             // top
             Utils.DrawLinearLine(cachedTexture, Vector2.Zero, Color, Width, false);
             // bottom
             Utils.DrawLinearLine(cachedTexture, new Vector2(0, cachedTexture.Height - 1), Color, Width, false);
             // left
             Utils.DrawLinearLine(cachedTexture, Vector2.Zero, Color, Height, true);
             // right
             Utils.DrawLinearLine(cachedTexture, new Vector2(cachedTexture.Width - 1, 0), Color, Height, true);
         }
         lastRedrawInfo = Tuple.Create(Fill, Width, Height, Color);
         cachedTexture.Update();
     }
     DrawTexture(cachedTexture);
 }
All Usage Examples Of Aiv.Fast2D.Texture::Update