/// <summary> /// <para>Specify all six images of a cube map level.</para> /// <para>This method follows exactly the OpenGL conventions.</para> /// <para>Attention: Buffer's <see cref="TextureFormat"/> must match that of <see cref="InternalFormat"/>.</para> /// <para>This Texture instance must use <see cref="TextureSamplerType.Cubemap"/> or it has no effect</para> /// </summary> /// <param name="engine">Engine this texture is associated to.</param> /// <param name="level">Level to set the image for.</param> /// <param name="descriptor">Client-side buffer containing the images to set.</param> /// <param name="faceOffsets">Offsets in bytes into \p buffer for all six images. The offsets are specified in /// the following order: +x, -x, +y, -y, +z, -z</param> public void SetImage(Engine engine, int level, PixelBufferDescriptor descriptor, FaceOffsets faceOffsets) { ThrowExceptionIfDisposed(); if (null != descriptor.LinearImage) { throw new NotImplementedException(); } if (descriptor.Type == PixelDataType.Compressed) { throw new NotImplementedException(); } Native.Texture.SetImageCubemap(NativePtr, engine.NativePtr, level, descriptor.Buffer, descriptor.Buffer.Length, descriptor.Left, descriptor.Top, (byte)descriptor.Type, descriptor.Alignment, descriptor.Stride, (byte)descriptor.Format, faceOffsets.ToArray()); }
/// <summary> /// <para>Updates a sub-image of a 2D texture for a level.</para> /// <para>Attention: Buffer's <see cref="TextureFormat"/> must match that of <see cref="InternalFormat"/>.</para> /// <para>This Texture instance must use <see cref="TextureSamplerType.Texture2d"/> or /// <see cref="TextureSamplerType.External"/>. IF the later is specified and external textures are supported by /// the driver implementation, this method will have no effect, otherwise it will behave as if the texture was /// specified with <see cref="TextureSamplerType.Texture2d"/>.</para> /// </summary> /// <param name="engine">Engine this texture is associated to.</param> /// <param name="level">Level to set the image for.</param> /// <param name="xOffset">Left offset of the sub-region to update.</param> /// <param name="yOffset">Bottom offset of the sub-region to update.</param> /// <param name="width">Width of the sub-region to update.</param> /// <param name="height">Height of the sub-region to update.</param> /// <param name="descriptor">Client-side buffer containing the image to set.</param> public void SetImage(Engine engine, int level, int xOffset, int yOffset, int width, int height, PixelBufferDescriptor descriptor) { ThrowExceptionIfDisposed(); if (descriptor.Type == PixelDataType.Compressed) { throw new NotSupportedException(); } if (null != descriptor.LinearImage) { Native.Texture.SetImageLinear(NativePtr, engine.NativePtr, level, xOffset, yOffset, width, height, descriptor.LinearImage.NativePtr, descriptor.Left, descriptor.Top, (byte)descriptor.Type, descriptor.Alignment, descriptor.Stride, (byte)descriptor.Format); } else { Native.Texture.SetImage(NativePtr, engine.NativePtr, level, xOffset, yOffset, width, height, descriptor.Buffer, descriptor.Buffer.Length, descriptor.Left, descriptor.Top, (byte)descriptor.Type, descriptor.Alignment, descriptor.Stride, (byte)descriptor.Format); } }
/// <summary> /// <para>Updates a sub-image of a 3D texture or 2D texture array for a level.</para> /// <para>Attention: Buffer's <see cref="TextureFormat"/> must match that of <see cref="InternalFormat"/>.</para> /// <para>This Texture instance must use <see cref="TextureSamplerType.Texture3d"/> or /// <see cref="TextureSamplerType.External"/>.</para> /// </summary> /// <param name="engine">Engine this texture is associated to.</param> /// <param name="level">Level to set the image for.</param> /// <param name="xOffset">Left offset of the sub-region to update.</param> /// <param name="yOffset">Bottom offset of the sub-region to update.</param> /// <param name="zOffset">Depth offset of the sub-region to update.</param> /// <param name="width">Width of the sub-region to update.</param> /// <param name="height">Height of the sub-region to update.</param> /// <param name="descriptor">Client-side buffer containing the image to set.</param> public void SetImage(Engine engine, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, PixelBufferDescriptor descriptor) { ThrowExceptionIfDisposed(); if (descriptor.Type == PixelDataType.Compressed) { throw new NotSupportedException(); } else { throw new NotSupportedException(); } }
public void SetImage(Engine engine, int level, PixelBufferDescriptor buffer) { ThrowExceptionIfDisposed(); SetImage(engine, level, 0, 0, GetWidth(level), GetHeight(level), buffer); }