/// <summary> /// Read a texture as compressed texture. /// </summary> /// <param name="target">A <see cref="glTextureProxyTarget"/> specifying the texture target.</param> /// <param name="level">The level-of-detail to be read.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.PIXEL_PACK_BUFFER"/>.</param> public static void GetCompressedTexImage(glTextureProxyTarget target, int level, long offset) { if (IntPtr.Size == 4 && ((long)offset >> 32) != 0) { throw new ArgumentOutOfRangeException("offset", PlatformErrorString); } _GetCompressedTexImage(target, level, (IntPtr)offset); }
/// <summary> /// Read a texture as compressed texture. /// </summary> /// <param name="target">A <see cref="glTextureProxyTarget"/> specifying the texture target.</param> /// <param name="level">The level-of-detail to be read.</param> /// <param name="img">Pointer to the buffer for the returning data.</param> public static void GetCompressedTexImage(glTextureProxyTarget target, int level, byte[] img) { GCHandle hImg = GCHandle.Alloc(img, GCHandleType.Pinned); try { _GetCompressedTexImage(target, level, hImg.AddrOfPinnedObject()); } finally { hImg.Free(); } }
/// <summary> /// Read a texture as compressed texture. /// </summary> /// <param name="target">A <see cref="glTextureProxyTarget"/> specifying the texture target.</param> /// <param name="level">The level-of-detail to be read.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.PIXEL_PACK_BUFFER"/>.</param> public static void GetCompressedTexImage(glTextureProxyTarget target, int level, int offset) { _GetCompressedTexImage(target, level, (IntPtr)offset); }