(*
 * Copyright (c) 2015 - 2024 Dr. Yuriy Kotsarenko. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the License.
 *)

type
  // Pointer to @link(TPixelFormat).
  PPixelFormat = ^TPixelFormat;

  // Defines how individual pixels and their colors are encoded in images and textures. The order of letters
  // in the constants defines the order of the  encoded components; @bold(R) stands for Red, @bold(G) for
  // Green, @bold(B) for Blue, @bold(A) for Alpha, @bold(L) for Luminance and @bold(X) for Not Used (or
  // discarded); @bold(F) at the end means floating-point format.
  TPixelFormat = (
    // Unknown pixel format. It is usually returned when no valid pixel format is available. In some cases,
    // it can be specified to indicate that the format should be selected by default or automatically. @br @br
    Unknown,

    // Unsigned Normalized formats.

    // 8-bit unsigned normalized format with red channel only.
    R8,

    // 16-bit format with 8-bit unsigned normalized red and green channels.
    RG8,

    // 32-bit format with 8-bit unsigned normalized red, green, blue and alpha channels.
    RGBA8,

    // 8-bit unsigned normalized format with red channel only.
    R16,

    // 32-bit format with 8-bit unsigned normalized red and green channels.
    RG16,

    // 64-bit ARGB pixel format with each channel having 16 bits.
    RGBA16,

    // Signed Normalized formats.

    // 8-bit signed normalized format with red channel only.
    R8S,

    // 16-bit format with 8-bit signed normalized red and green channels.
    RG8S,

    // 32-bit format with 8-bit signed normalized red, green, blue and alpha channels.
    RGBA8S,

    // 16-bit signed normalized format with red channel only.
    R16S,

    // 32-bit format with 16-bit signed normalized red and green channels.
    RG16S,

    // 64-bit format with 16-bit signed normalized red, green, blue and alpha channels.
    RGBA16S,

    // Unsigned formats.

    // 8-bit format with 8-bit unsigned integer red channel.
    R8U,

    // 16-bit format with 8-bit unsigned integer red and green channels.
    RG8U,

    // 32-bit format with 8-bit unsigned integer red and green channels.
    RGBA8U,

    // 16-bit format with 16-bit unsigned integer red channel.
    R16U,

    // 32-bit format with 16-bit unsigned integer red and green channels.
    RG16U,

    // 64-bit format with 16-bit unsigned integer red and green channels.
    RGBA16U,

    // 32-bit format with 32-bit unsigned integer red channel.
    R32U,

    // 64-bit format with 32-bit unsigned integer red and green channels.
    RG32U,

    // 128-bit format with 32-bit unsigned integer red and green channels.
    RGBA32U,

    // Signed formats.

    // 8-bit format with 8-bit signed integer red channel.
    R8I,

    // 16-bit format with 8-bit signed integer red and green channels.
    RG8I,

    // 32-bit format with 8-bit signed integer red and green channels.
    RGBA8I,

    // 16-bit format with 16-bit signed integer red channel.
    R16I,

    // 32-bit format with 16-bit signed integer red and green channels.
    RG16I,

    // 64-bit format with 16-bit signed integer red and green channels.
    RGBA16I,

    // 32-bit format with 32-bit signed integer red channel.
    R32I,

    // 64-bit format with 32-bit signed integer red and green channels.
    RG32I,

    // 128-bit format with 16-bit unsigned integer red and green channels.
    RGBA32I,

    // Floating-point formats.

    // 16-bit floating-point pixel format, which has only one component.
    R16F,

    // 32-bit floating-point pixel format containing two components with 16 bits each.
    RG16F,

    // 64-bit floating-point ARGB pixel format with each component having 16 bits.
    RGBA16F,

    // 32-bit floating-point pixel format, which has only one component.
    R32F,

    // 64-bit floating-point pixel format containing two components with 32 bits each.
    RG32F,

    // 128-bit floating-point ARGB pixel format with each component having 32 bits.
    RGBA32F,

    // Specialized floating-point formats.

    // 32-bit format with 11-bit unsigned floating-point red and green channels, and 10-bit blue channel.
    RG11B10F,

    // 32-bit format with 9-bit floating-point red, green and blue channels with shared 5-bit exponent.
    RGB9E5F,

    // Specialized color formats.

    // 32-bit format with 10-bit unsigned normalized red, green and blue channels, and 2-bit alpha-channel.
    RGB10A2,

    // 32-bit format with 10-bit unsigned integer red, green and blue channels, and 2-bit alpha-channel.
    RGB10A2U,

    // 32-bit format with 8-bit unsigned normalized red, green and blue channels (8 bits unused).
    RGBX8,

    // 32-bit format with 8-bit unsigned normalized red, green, blue and alpha channels with sRGB curve.
    RGBA8_SRGB,

    // 32-bit format with 8-bit unsigned normalized blue, green, red and alpha channels.
    BGRA8,

    // 32-bit format with 8-bit unsigned normalized blue, green and red channels (8 bits unused).
    BGRX8,

    // 32-bit format with 8-bit unsigned normalized blue, green, red and alpha channels with sRGB curve.
    BGRA8_SRGB,

    // 32-bit format with 10-bit unsigned normalized blue, green and red channels, and 2-bit alpha-channel.
    BGR10A2,

    // 32-bit format with 10-bit unsigned normalized blue, green and red channels (2 bits unused).
    BGR10X2,

    // 16-bit format with 4-bit unsigned normalized blue, green, red and alpha channels.
    BGRA4,

    // 16-bit format with 4-bit unsigned normalized blue, green and red channels (4 bits unused).
    BGRX4,

    // 16-bit format with 5-bit unsigned normalized blue and red, and 6 bits for green channels.
    B5G6R5,

    // 16-bit format with 5-bit unsigned normalized blue, green and red, 1 bit for alpha channels.
    BGR5A1,

    // 16-bit format with 5-bit unsigned normalized blue, green and red channels (1 bit unused).
    BGR5X1,

    // Storage formats (not hardware accelerated).

    // 24-bit format with 8-bit unsigned normalized red, green and blue channels.
    RGB8,

    // 24-bit format with 8-bit unsigned normalized blue, green and red channels.
    BGR8,

    // Luminance and alpha formats that might require channel swizzling in shader.

    // 8-bit alpha-channel pixel format.
    A8,

    // 8-bit luminance pixel format.
    L8,

    // 16-bit luminance pixel format.
    L16,

    // 8-bit luminance/alpha pixel format with 4 bits per channel.
    LA4,

    // 16-bit luminance/alpha pixel format with 8 bits per channel.
    LA8,

    // Legacy pallette formats.

    // 8-bit palette indexed format.
    I8,

    // Compressed formats.

    // Compressed format with red channel only.
    R_BC,

    // Compressed format with red and green channels.
    RG_BC,

    // Compressed format with red, green and blue channels.
    RGB_BC,

    // Compressed format with red, green, blue and alpha channels.
    RGBA_BC,

    // Compressed format with red, green and blue channels with sRGB curve.
    RGB_BC_SRGB,

    // Compressed format with red, green and blue channels with sRGB curve, and an alpha-channel.
    RGBA_BC_SRGB,

    // Depth/stencil formats.

    // Depth/stencil format with 16-bit (unsigned normalized) depth values and no storage for stencil.
    D16,

    // Depth/stencil format with 24-bit (unsigned normalized) depth values and 8 bits for stencil.
    D24S8,

    // Depth/stencil format with 32-bit (floating-point) depth values and no storage for stencil.
    D32F,

    // Depth/stencil format with 32-bit (floating-point) depth values and 8 bits for stencil.
    D32S8F);

  // Defines how alpha-channel should be handled in the loaded image.
  TAlphaFormatRequest = (
    // Alpha-channel can be handled either way. @br @br
    DontCare,

    // Alpha-channel in the image should not be premultiplied. Under normal circumstances, this is the
    // recommended approach as it preserves RGB color information in its original form. However, when using
    // mipmapping for images that have alpha-channel, @italic(Premultiplied) gives more accurate
    // results. @br @br
    NonPremultiplied,

    // Alpha-channel in the image should be premultiplied. Under normal circumstances, this is not
    // recommended as the image would lose information after RGB components are premultiplied by alpha (and
    // for smaller alpha values, less information is preserved). However, when using mipmapping for images
    // that have alpha-channel, this gives more accurate results.
    Premultiplied);

  // Type of graphics technology used in application.
  TDeviceTechnology = (
    // The technology has not yet been established. @br @br
    Unknown,

    // Microsoft Direct3D technology. @br @br
    Direct3D,

    // OpenGL by Khronos Group. @br @br
    OpenGL,

    // OpenGL ES by Khronos Group. @br @br
    OpenGL_ES,

    // Vulkan API by Khronos Group. @br @br
    Vulkan,

    // Metal API by Apple. @br @br
    Metal,

    // WebGL by Khronos Group.
    WebGL,

    // Software rasterizer. @br @br
    Software,

    // Private proprietary technology.
    Proprietary);

  // Type of OS platform the application is running on.
  TDevicePlatform = (
    // The platform could not be properly identified. @br @br
    Unknown,

    // Microsoft Windows platform. @br @br
    Windows,

    // Linux platform. @br @br
    Linux,

    // Generic Unix platform. @br @br
    Unix,

    // Apple OS X platform. @br @br
    OSX,

    // Apple iOS platform. @br @br
    iOS,

    // Google Android platform.
    Android);

  // A single bit for device memory barrier command.
  TDeviceBarrierBit = (
    // Shader data sourced from buffers after the barrier will reflect data written by shaders prior
    // to the barrier.
    ShaderBuffer,

    // Texture fetches from shaders, including fetches from typed buffers, after the barrier will reflect
    // data written by shaders prior to the barrier.
    TextureFetch,

    // Memory accesses using shader image load, store, and atomic built-in functions issued after the
    // barrier will reflect data written by shaders prior to the barrier. Additionally, image stores and
    // atomics issued after the barrier will not execute until all memory accesses (e.g., loads, stores,
    // texture fetches, vertex fetches) initiated prior to the barrier complete.
    ShaderImageAccess,

    // Writes to a texture by calling Update and Copy functions, and reads via Retrieve after the barrier
    // will reflect data written by shaders prior to the barrier. Additionally, texture writes from these
    // commands issued after the barrier will not execute until all shader writes initiated prior to the
    // barrier complete.
    TextureUpdate,

    // Buffer reads or writes bu calling Update and Copy functions after the barrier will reflect data
    // written by shaders prior to the barrier. Additionally, writes via these commands issued after the
    // barrier will wait on the completion of any shader writes to the same memory initiated prior
    // to the barrier.
    BufferUpdate,

    // Reads and writes to drawable textures after the barrier will reflect data written by shaders prior
    // to the barrier. Additionally, framebuffer writes issued after the barrier will wait on the
    // completion of all shader writes issued prior to the barrier.
    Drawables,

    // Accesses to atomic counters after the barrier will reflect writes prior to the barrier.
    AtomicCounter,

    // Accesses to structured buffers after the barrier will reflect writes prior to the barrier.
    Structured);

  // Cummulative bits for device memory barrier command.
  TDeviceBarrierBits = set of TDeviceBarrierBit;

  // Type of triangle face that should have operation applied to.
  TTriangleFace = (
    // Neither back nor front faces should be processed. @br @br
    None,

    // Back faces should be processed. @br @br
    Back,

    // Front faces should be processed. @br @br
    Front,

    // Both back and front faces should be processed.
    Both);

  // Function that defines how depth/stencil operands should be compared.
  TComparisonFunc = (
    // Comparison is always true. @br @br
    Always,

    // Comparison results true when source is less than destination. @br @br
    Less,

    // Comparison results true when source is less than or equal to destination. @br @br
    LessEqual,

    // Comparison results true when source is greater than destination. @br @br
    Greater,

    // Comparison results true when source is greater than or equal to destination. @br @br
    GreaterEqual,

    // Comparison results true when source equals to destination. @br @br
    Equal,

    // Comparison results true when source is not equal to destination. @br @br
    NotEqual,

    // Comparison is always false.
    Never);

  // Operation that should be performed on stencil value.
  TStencilOp = (
    // Preserve destination value. @br @br
    Keep,

    // Set destination value to zero. @br @br
    Zero,

    // Replace destination value with the source one. @br @br
    Replace,

    // Invert the destination value. @br @br
    Invert,

    // Increment the destination value by the source one and clamp, if necessary. @br @br
    Increment,

    // Decrement the destination value by the source one and clamp, if necessary. @br @br
    Decrement,

    // Increment the destination value by the source one with wrap-around. @br @br
    IncrementWarp,

    // Decrement the destination value by the source one with wrap-around. @br @br
    DecrementWarp);

  // Factor that determines how alpha-blending operand is considered.
  TBlendFactor = (
    // Blending factor is a constant that equals to one. @br @br
    One,

    // Blending factor is a constant that equals to zero. @br @br
    Zero,

    // Source color is used as a blending factor. @br @br
    SourceColor,

    // One minus source color is used as a blending factor. @br @br
    InvSourceColor,

    // Source alpha value is used as a blending factor. @br @br
    SourceAlpha,

    // One minus source alpha value is used as a blending factor. @br @br
    InvSourceAlpha,

    // Destination color is used as a blending factor. @br @br
    DestColor,

    // One minus destination color is used as a blending factor. @br @br
    InvDestColor,

    // Destination alpha value is used as a blending factor. @br @br
    DestAlpha,

    // One minus destination alpha value is used as a blending factor. @br @br
    InvDestAlpha,

    // Blending factor is calculated as min(SrcAlpha, InvDestAlpha). @br @br
    SourceAlphaSat,

    // Blending factor is a user-defined color constant. @br @br
    ConstantColor,

    // Blending factor is one minus user-defined color constant. @br @br
    InvConstantColor,

    // Blending factor is an alpha value from user-defined color constant. @br @br
    ConstantAlpha,

    // Blending factor is one minus alpha value from user-defined color constant. @br @br
    InvConstantAlpha,

    // Source color (from 2nd pixel shader output) is used as a blending factor. @br @br
    SourceColor1,

    // One minus source color (from 2nd pixel shader output) is used as a blending factor. @br @br
    InvSourceColor1,

    // Source alpha value (from 2nd pixel shader output) is used as a blending factor. @br @br
    SourceAlpha1,

    // One minus source alpha (from 2nd pixel shader output) value is used as a blending factor.
    InvSourceAlpha1);

  // Operation that should be performed between two blending operands.
  TBlendOp = (
    // Add source and destination values. @br @br
    Add,

    // Subtract source value from destination value. @br @br
    Subtract,

    // Subtract destination value from source value. @br @br
    InvSubtract,

    // Calculate minimum between source and destination values. @br @br
    Minimum,

    // Calculate maximum between source and destination values. @br @br
    Maximum);

  // Type of data that a generic buffer contains.
  TBufferDataType = (
    // Vertex information is stored in the buffer (Vertex Buffer).
    Vertex,

    // Index information is stored in the buffer (Index Buffer).
    Index,

    // Shader constant information is stored in the buffer (Constant Buffer).
    Constant,

    // Read-only shader buffer contained typed information (TBO / Buffer).
    Typed,

    // Read-only shader buffer contained typed information (TBO / RWBuffer).
    RWTyped,

    // Read-only shader buffer containing structured information (SSBO / StructuredBuffer).
    Structured,

    // Read/write shader buffer containing structured information (SSBO / RWStructuredBuffer).
    RWStructured);

  // Type of access that is performed with mesh buffer.
  TBufferAccessType = (
    // The contents of buffer are updated occasionally. @br @br
    Default,

    // The contents of buffer are defined during construction and typically remain unchanged. @br @br
    Static,

    // The contents of buffer are changed very frequently.
    Dynamic,

    /// The contents of the buffer are used by GPU exclusively.
    Compute,

    /// The buffer is used for asynchronous transfers from GPU back to CPU.
    Staging);

  // Format in which a single value of the given element is represented.
  TElementFormat = (
    // Undefined element format (@link(TVertexElement.Count) will define number of actual bytes). @br @br
    Undefined = 0,

    // 32-bit floating-point format. @br @br
    Float,

    // 16-bit floating-point format. @br @br
    HalfFloat,

    // 64-bit floating-point format. @br @br
    Double,

    // 32-bit signed integer format. @br @br
    Int,

    // 32-bit unsigned integer format. @br @br
    UnsignedInt,

    // 16-bit signed integer format. @br @br
    Short,

    // 16-bit unsigned integer format. @br @br
    UnsignedShort,

    // 8-bit signed integer format. @br @br
    Byte,

    // 8-bit unsigned integer format. @br @br
    UnsignedByte,

    // For internal use (to make 16-bit enumeration).
    ElementFormatEnum = 65535);

  // Rendering primitive topology.
  TPrimitiveTopology = (
    // Unknown (undefined) topology. @br @br
    Unknown,

    // Points or point lists. @br @br
    Points,

    // Lines or line lists. @br @br
    Lines,

    // Line strips. @br @br
    LineStrip,

    // Triangles or triangle lists. @br @br
    Triangles,

    // Triangle strips. @br @br
    TriangleStrip,

    // Lines or line lists with adjacency information. @br @br
    LinesAdjacency,

    // Line strips with adjacency information. @br @br
    LineStripAdjacency,

    // Triangles or triangle lists with adjacency information. @br @br
    TrianglesAdjacency,

    // Triangle strips with adjacency information.
    TriangleStripAdjacency,

    // Tessellation patches.
    Patches);

  // Type of shader in graphics rendering pipeline.
  TShaderType = (
    // Undefined or unknown shader. @br @br
    Undefined,

    // Fragment (pixel) shader. @br @br
    Fragment,

    // Vertex shader. @br @br
    Vertex,

    // Geometry shader. @br @br
    Geometry,

    // Compute shader.
    Compute,

    // Hull shader.
    Hull,

    // Domain shader.
    Domain);

  // Type that characterizes shader element.
  TShaderElement = (
    // Undefined element type. @br @br
    Undefined,

    // Element is a texture. @br @br
    Texture,

    // Element is a constant buffer (uniform buffer object).
    ConstantBuffer,

    // Element is a typed buffer (TBO / Buffer). Shares channels with textures.
    TypedBuffer,

    // Element is a typed buffer (TBO / RWBuffer). Shares channels with textures.
    // For writing under OpenGL, this is bound as ImageBuffer (not TBO).
    // For writing under Direct3D, this is bound as an Unordered Access View (UAV).
    RWTypedBuffer,

    // Element is a compute shader buffer (SSBO / StructuredBuffer).
    StructuredBuffer,

    // Element is a compute shader buffer (SSBO / RWStructuredBuffer).
    RWStructuredBuffer);

  // Compute program texture access type.
  TComputeTextureAccess = (
    // Texture will be read from, no writes allowed.
    Read,

    // Texture will only be written to, no reads allowed.
    Write,

    // Texture will be read from and written to.
    ReadWrite);

  // Filtering mode that defines how colors are sampled from the texture.
  TTextureFilter = (
    // No filtering is performed (applies only to mipmap filter, in which case it gets disabled). @br @br
    None,

    // Nearest integer sample filtering. @br @br
    Nearest,

    // Linear interpolation filtering. @br @br
    Linear,

    // Linear anisotropic filtering.
    Anisotropic);

  // Addressing mode that defines how texture coordinates outside of [0, 1] range are treated.
  TTextureAddress = (
    // Texture coordinates are wrapped; that is, only fractional part is considered. @br @br
    Wrap,

    // Texture coordinates are clamped to stay within [0, 1] range. @br @br
    Clamp,

    // Texture coordinates are mirrored in each odd cycle (e.g. from 1 to 2, from 3 to 4 and so on). @br @br
    Mirror,

    // Texture coordinates are mirrored for one cycle and then clamped. @br @br
    MirrorOnce,

    // When texture coordinates are outside of [0, 1] range, a separate border color will be used instead.
    Border);

  // Type of texture that defines how it is composed.
  TTextureType = (
    // Standard 2D texture surface. @br @br
    Surface,

    // Cube Map consisting of 6 individual 2D faces. @br @br
    CubeMap,

    // Layered 3D volume texture.
    Volume);

  // Blending effect that defines how primitives are rendered on drawing surface.
  TBlendingEffect = (
    // Undefined blending effect: canvas does not change blending parameters configured in the device context
    // and uses whatever configuration is currently active. @br @br
    Undefined = 0,

    // "Normal" blending effect: Cd = (Cs * As) + (Cd * (1 - As). @br @br
    Normal,

    // "Shadow drawing" effect: Cd = Cd * (1 - As). @br @br
    Shadow,

    // Additive blending effect: Cd = (Cs * As) + Cd. @br @br
    Add,

    // Subtractive blending effect: Cd = (Cs * As) - Cd. @br @br
    Subtract,

    // Multiplication blending effect: Cd = Cs * Cd. @br @br
    Multiply,

    // Inverse multiplication effect: Cd = (1 - Cs) * Cd. @br @br
    InverseMultiply,

    // Source color blending effect: Cd = (Cs * Cs) + (Cd * (1 - Cs)). @br @br
    SourceColor,

    // Source color additive blending effect: Cd = (Cs * Cs) + Cd. @br @br
    SourceColorAdd,

    // Alpha-blending disabled, drawing is just a copy operation.
    Copy = 254,

    // Custom alpha-blending as set up through device directly.
    Custom = 255);

  // Attributes that change the rendering behavior of the canvas.
  TCanvasAttribute = (
    // Transform 2D coordinates as 3D vectors (with Z = 0) by the appropriate 4x4 matrix as if drawing to an
    // arbitrary plane in 3D. @br @br
    Projected,

    // Preprocess the texture by using its alpha-channel as a signed distance field. @br @br
    SDF,

    // Include outline when rendering signed distance field (requires "SDF" to be set).
    Outline,

    // Sample texture using bicubic interpolation for higher-quality results.
    Cubic,

    // Adjusts texture color using YCH instead of RGB (only works for textures).
    ColorAdjust,

    // Applies 3x3 world transformation matrix to non-holographic primitives.
    Transform);

  // Pointer to @link(TCanvasAttributes).
  PCanvasAttributes = ^TCanvasAttributes;

  // One or more attributes that define canvas behavior.
  TCanvasAttributes = set of TCanvasAttribute;

  // Pointer to @link(TSuperSampleSDF).
  PSuperSampleSDF = ^TSuperSampleSDF;

  // Type of super-sampling used for rendering Signed Distance Field (SDF).
  TSuperSampleSDF = (
    // Non-supersampled rendering (for low-performance systems). Note that if outline is enabled, its color
    // will be calculated using simplified scheme, where luma is calculated as usual, chroma is calculated
    // in a simple fashion and hue is not affected. @br @br
    NoSuperSample,

    // 4x super-sampled rendering. @br @br
    SuperSample4x,

    // 16x super-sampled rendering.
    SuperSample16x);

  // Pointer to @link(TCanvasContextState).
  PCanvasContextState = ^TCanvasContextState;

  // One of possible defined context states that can be pre-configured by the canvas.
  TCanvasContextState = (
    // Geometric shapes and images rendered in a flat 2D scene. @br @br
    FlatScene,

    // Text rendered in a flat 2D scene. @br @br
    FlatText,

    // Geometric shapes, images and text rendered in a 3D surface projection.
    Projected,

    // Undefined context state.
    Undefined = 255);

  // Weight of the font, or letter "thickness".
  TFontWeight = (
    // Letters should appear as thin as technically possible. @br @br
    Thin,

    // Letters should appear very thin. @br @br
    ExtraLight,

    // Letters should appear even thinner. @br @br
    Light,

    // Letters should have slightly lighter thickness. @br @br
    SemiLight,

    // Letters should appear normal (default thickness). @br @br
    Normal,

    // Letters should have medium thicness, which is slightly above than normal. @br @br
    Medium,

    // Letters should appear semi-bold. @br @br
    SemiBold,

    // Letters should appear as bold. @br @br
    Bold,

    // Letters should appear as extra thick. @br @br
    ExtraBold,

    // Letters should appear very thick. @br @br
    Heavy,

    // Letters should appear as thick as technically possible.
    ExtraHeavy);

  // Relative width of the font.
  TFontStretch = (
    // Ultra-condensed width. @br @br
    UltraCondensed,

    // Extra-condensed width. @br @br
    ExtraCondensed,

    // Condensed width. @br @br
    Condensed,

    // Semi-condensed width. @br @br
    SemiCondensed,

    // Normal width. @br @br
    Normal,

    // Semi-expanded width. @br @br
    SemiExpanded,

    // Expanded width. @br @br
    Expanded,

    // Extra-expanded width. @br @br
    ExtraExpanded,

    // Ultra-expanded width.
    UltraExpanded);

  // Font slant styles.
  TFontSlant = (
    // Upright font. @br @br
    None,

    // Slanted font in a roman style. @br @br
    Oblique,

    // Slanted in an italic style.
    Italic);

  // Border that will be used around the text letters.
  TFontBorder = (
    // No border will appear around letters. @br @br
    None,

    // A light border will appear around letters. @br @br
    Normal,

    // A semi-heavy border will appear around letters. @br @br
    SemiHeavy,

    // A heavy border will appear around letters.
    Heavy);

  // Text alignment when drawing with certain functions.
  TTextAlignment = (
    // Text should be aligned to the beginning (either top or left depending on context). @br @br
    Start,

    // Text should be centered in the middle. @br @br
    Middle,

    // Text should be aligned to the end (either bottom or right depending on context).
    Ending);

  // Font attribute bits that define some visual characteristics such as underline and strikeout.
  TFontAttribute = (
    // Font with underlined text.
    Underline,

    // Font with strike-out text.
    StrikeOut);

  // Font attribute flags that define some visual characteristics.
  TFontAttributes = set of TFontAttribute;

  // Format to be used as target for color dithering.
  TColorDitheringFormat = (
    // Red, green and blue channels have 8 bits each (16M colors).
    RGB8,

    // Red, green and blue channels have 6 bits each (256K colors).
    RGB6,

    // Red and blue channels have 5 bits each, while green channel has 6 bits (64K colors).
    R5G6B5,

    // Red, green and blue channels have 4 bits each (4K colors).
    RGB4,

    // Red and green channels have 3 bits each, while blue channel has 2 bits (256 colors).
    RG3B2);

  // Lighting technique.
  TTechniqueLighting = (
    // Traditional Phong lighting.
    Phong,

    // Minnaert lighting.
    Minnaert,

    // Cook-Torrance lighting.
    CookTorrance,

    // Oren-Nayer lighting.
    OrenNayer);

  // Shadow rendering technique.
  TTechniqueShadows = (
    // No shadows are rendered or used.
    None,

    // Exponential Shadow Maps (ESM) using a single depth component.
    ESM,

    // Exponential Shadow Maps (ESM) using two depth components for positive and negative parts.
    ESM_Warp,

    // Exponential Variance Shadow Maps (EVSM) using four depth components.
    EVSM);

  // Determines the choice of pixel formats for the container.
  TTextureFidelity = (
    // Use lowest quality texture formats, which may reduce GPU memory consumption and potentially improve
    // performance slightly at expense of visual quality.
    Low,

    // Use standard quality texture formats suitable for most common usage scenarios.
    Medium,

    // High quality texture formats, producing accurate and exceptionally looking images.
    High,

    // Excessively high quality texture formats, typically useful for generating images to be printed,
    // screenshots and presentations. This may increase GPU memory consumption and impact performance.
    Extreme);

  // Defines type of rendering pass that is currently being performed.
  TTextureCabinetPass = (
    // Main color scene pass.
    Color,

    // Order-independent transparency (OIT) post-pass.
    Glassy,

    // Depth (and normals) pre-pass.
    Depth);

  // Filter type that defienes how textures are processed.
  TTextureCabinetFilterType = (
    // Ambient occlusion computation.
    Occlusion,

    // Bloom (glare) effect processing.
    Bloom,

    // Order-independent transparency (OIT) composition.
    Glassy,

    // Spatial fog effects for order-independent transparency (OIT) composition.
    GlassyFog);

  // 3D scene rendering specialization attributes.
  TTextureCabinetAttribute = (
    // Screen-Space Ambient Occlusion technique.
    AmbientOcclusion,

    // Downscales SSAO texture to enable 4x faster performance on low and mid-end GPUs.
    AmbientOcclusionDownscale,

    // Bloom (glare) technique.
    Bloom,

    // Bloom is rendered at half of resolution to accomodate for higher display scales.
    BloomDownscale,

    // Bloom is applied using cubic interpolation for higher quality look.
    BloomCubic,

    // Linear depths are provided for techniques such as spatial fog or water.
    LinearDepths,

    // Accurate order-independent transparency (OIT) single-pass technique.
    Glassy,

    // Approximate order-independent transparency (OIT) single-pass technique.
    GlassyFast,

    // Add to order-independent transparency (OIT) technique support for spatial fog effects.
    GlassyFog,

    // Frosted Glass effect added to order-independent transparency (OIT) techniques.
    GlassyFrosted);

  // Cumulative rendering attributes that affect how scene is being processed.
  TTextureCabinetAttributes = set of TTextureCabinetAttribute;

  // Texture type used in the rendering scene.
  TTextureCabinetType = (
    // Depth buffer of the scene.
    Depth = 0,

    // Texture containing information about screen-space normals.
    Normals = 1,

    // High dynamic range color accumulation buffer.
    ColorHDR = 4,

    // Color buffer of the scene (non-MSAA).
    Color = 5,

    // Linear depths for spatial fog and water (MSAA).
    LinearDepths = 11,

    // Color accumulation buffer.
    GlassyColor = 12,

    // Count accumulation buffer.
    GlassyCounts = 13,

    // Auxiliary texture used for compositioning.
    GlassyComposite = 14);

  // One or more cumulative rendering attributes for the 3D scene.
  TSceneAttribute = (
    // Instancing technique will be used during rendering.
    Instancing,

    // Vertex normals will be processed and taken into account.
    Normals,

    // Vertex colors will be processed and taken into account.
    Coloring,

    // Cubic interpolation will be used for texture mapping.
    TexturingCubic,

    // Cubic interpolation will be used for shadow mapping.
    ShadowsCubic,

    // Perform adjustments for Order-Independent Transparency (OIT) rendering.
    Glassy,

    // The whole scene is rendered in a single pass with ambient occlusion.
    SinglePass,

    // Attributes specific to depth/normals scene.

    // Generate output for depth pre-pass, which at minimum includes normals.
    // Note: it is possible to do depth pre-pass without normals by excluding this attribute.
    DepthPrePass,

    // Produce linear depths as part of depth pre-pass for spatial fog or water effects.
    // Note: this requires @link(DepthPrePass) flag to be enabled and thus always includes normals.
    LinearDepths,

    // Reserved attribute.
    Reserved0,

    // Reserved attribute.
    Reserved1,

    // Reserved attribute.
    Reserved2,

    // Status attributes.

    // Scene is a modeling scene, which means it supports textures and materials.
    Modeling);

  // Rendering attributes that define what type of resources are used and how rendering is performed.
  TSceneAttributes = set of TSceneAttribute;

  // Type of texture used by the 3D scene.
  TSceneTextureType = (
    // Albedo texture.
    Albedo,

    // Normal Map texture.
    NormalMap,

    // Displacement Map texture for Parallax Mapping technique.
    ParallaxMap);

  // Type of sampler used by the scene.
  TSceneSamplerType = (
    // Albedo sampler.
    Albedo,

    // Normal Map sampler.
    NormalMap,

    // Displacement Map sampler for Parallax Mapping technique.
    ParallaxMap,

    // Shadow Map sampler.
    ShadowMap);

  // Light culling mode for clustered shading.
  TClustersCullingMode = (
    // High-quality mode supporting up to 1024 simultaneous lights per cluster.
    Quality,

    // Performance mode supporting up to 4 simultaneous lights per cluster.
    Performance);

  // Texture type used by a selection highlight technique.
  TSelectionHighlightTextureType = (
    /// Texture that contains the selection highlight, to be rendered on top of the scene.
    Highlight,

    /// Texture that contains the highlight mask, that can be optionally rendered on top of the scene.
    HighlightMask);

  // Defines type of formula used in fog calculation.
  TFogFormula = (
    // Fog calculated as (far - d) / (far - near).
    Linear,

    // Fog calculated as c x e^(-(d x b)^2).
    Exponential,

    // Ground fog with linear density and exponential depth.
    Ground);

  // Defines how distance is calculated for depth fog.
  TDepthFogDistance = (
    // Distance is based on depth.
    ZBased,

    // Distance is relative to camera position.
    EyeRelative);

  // Type of the mesh meta-tag.
  TMeshMetaTagType = (
    // Tag type is not determined.
    Indeterminate,

    // Tag represents a geometry group.
    GeometryGroup,

    // Tag represents an object group.
    ObjectGroup);

  // Type of texture used in scene mesh material.
  TSceneMeshTexture = (
    // Diffuse color texture.
    Diffuse,

    // Normal-mapping texture.
    Normals,

    // Parallax-mapping texture.
    Parallax);

  // Camera movement/rotation command.
  TCameraCommand = (
    // Start camera movement on XZ plane.
    Movement,

    // Start camera dragging.
    Dragging,

    // Start camera rotation.
    Rotation,

    // Update camera movement/rotation.
    Update,

    // Stop camera movement/rotation.
    Stop);

  // Type of mouse event corresponding to the notification.
  TMouseEvent = (
    // Mouse button is pressed.
    MouseDown,

    // Mouse cursor is being moved.
    MouseMove,

    // Mouse button is de-pressed.
    MouseUp,

    // Mouse wheel has been rotated up.
    WheelUp,

    // Mouse wheel has been rotated down.
    WheelDown,

    // Mouse has entered component's area.
    MouseEnter,

    // Mouse has left component's area.
    MouseLeave,

    // Mouse double-click event.
    MouseDoubleClick);

  // Type of mouse button that corresponds to the notification.
  TMouseButton = (
    // None or unknown button (typically specified during mouse move event).
    None,

    // Left mouse button.
    Left,

    // Right mouse button.
    Right,

    // Middle mouse button.
    Middle);

  // Type of keyboard event corresponding to the notification.
  TKeyEvent = (
    // Key has been pressed.
    Pressed,

    // Key has been released.
    Released,

    // Key is being typed (for Unicode input).
    Typing);

  // Key constants (portable).
  TKey = (
    Null = $00,
    // $01: SOH (Start of Heading)
    Home = $02, // STX (Start of Text)
  {$IFNDEF PASDOC}
    &End = $03, // ETX (End of Text)
  {$ENDIF}
    // $04: EOT (End of Transmission)
    PrintScreen = $05, // ENQ (Enquiry)
    // $06: ACK (Acknowledge)
    // $07: BEL (Bell)
    Backspace = $08,
    Tab = $09,
    Linefeed = $0A, // LF, NL (Newline)
    Clear = $0B, // VT (Vertical Tab)
    // $0C: FF (NP form feed, new page)
    Return = $0D, // Enter, CR (Carriage Return)
    PageUp = $0E, // SO (Shift Out)
    PageDown = $0F, // SI (Shift In)
    // $10: DLE (Data Link Escape)
    CapsLock = $11, // DC1 (Device Control 1)
    NumLock = $12, // DC2 (Device Control 2)
    Pause = $13, // Hold, DC3 (Device Control 3)
    ScrollLock = $14, // DC4 (Device Control 4)
    SysReq = $15, // SysRq, NAK (Negative Acknowledge)
    // $16: SYN (Synchronous Idle)
    // $17: ETB (End of Trans. Block)
    Cancel = $18,
    // $19: EM (End of Medium)
    Insert = $1A, // SUB (Substitute)
    Escape = $1B,
    Left = $1C, // $1C: FS (File Separator)
    Up = $1D, // $1D: GS (Group Separator)
    Right = $1E, // $1E: RS (Record Separator)
    Down = $1F, // $1F: US (Unit Separator)
    Space = $20,
    // $21 - $7E: ASCII characters.
    Delete = $7F, // DEL
    // Extended keys
    F1 = $80,
    F2 = $81,
    F3 = $82,
    F4 = $83,
    F5 = $84,
    F6 = $85,
    F7 = $86,
    F8 = $87,
    F9 = $88,
    F10 = $89,
    F11 = $8A,
    F12 = $8B,
    // $8C - $97 (F13-F24 keys)
    // Control keys
    ShiftLeft = $98,
    ShiftRight = $99,
    CtrlLeft = $9A,
    CtrlRight = $9B,
    AltLeft = $9C,
    AltRight = $9D,
    SuperLeft = $9E, // Left Windows key
    SuperRight = $9F, // Right Windows key
    // Numpad keys
    Numpad0 = $A0,
    Numpad1 = $A1,
    Numpad2 = $A2,
    Numpad3 = $A3,
    Numpad4 = $A4,
    Numpad5 = $A5,
    Numpad6 = $A6,
    Numpad7 = $A7,
    Numpad8 = $A8,
    Numpad9 = $A9,
    // Numpad operators
    Multiply = $AA,
    Divide = $AB,
    Add = $AC,
    Subtract = $AD,
    // Numpad misc
    Separator = $AE,
    Decimal = $AF,
    // $B0 - $BF: reserved
    // Power keys
    Sleep = $C0,
    // $C1 - $CB: reserved
    VolumeUp = $CC,
    VolumeDown = $CE,
    VolumeMute  = $CF,
    // Media playback keys
    MediaNextTrack = $D0,
    MediaPrevTrack = $D1,
    MediaStop = $D2,
    MediaPlayPause = $D3,
    // $D4 - $DF: reserved
    // Misc keys
    Select = $E0,
    Print = $E1,
    Execute = $E2,
    Help = $E3,
    Apps = $E4 // Applications key
    // $E5 - $FE: reserved
    // $FF: reserved
  );

  // Window state enumeration.
  TApplicationWindowState = (
    // Windows appears normally with its title and border.
    Windowed,

    // Window appears minimized, iconic or hidden.
    Minimized,

    // Window appears maximized to fill the screen's client area.
    Maximized,

    // Window appears occupying the entire screen.
    FullScreen);

  // Type of application event corresponding to the notification.
  TApplicationEvent = (
    // Application has been activated.
    Activate,

    // Application has been de-activated.
    Deactivate,

    // Application has been minimized.
    Minimize,

    // Application has been restored.
    Restore,

    // DPI changed or user switched between dark/white styles.
    Appearance);

  // Application cursor enumeration.
  TAppCursor = (
    // Blank (invisible) cursor.
    Blank = 0,

    // Standard arrow cursor.
    Arrow = 1,

    // Text selection cursor.
    TextSelect,

    // Vertical text selection cursor.
    TextSelectVertical,

    // Wait cursor.
    Wait,

    // Arrow cursor with wait icon.
    ArrowWait,

    // Crosshair cursor.
    CrossHair,

    // Cell cursor.
    Cell,

    // Hyperlink selection cursor.
    LinkSelect,

    // Not allowed cursor.
    NotAllowed,

    // Help cursor.
    Help,

    // Move cursor.
    Move,

    // Drag cursor.
    Drag,

    // Dragging cursor.
    Dragging,

    // Vertical resize cursor.
    ResizeVert,

    // Horizontal resize cursor.
    ResizeHoriz,

    // Diagonal north-east south-west resize cursor.
    Resize1,

    // Diagonal north-west south-east resize cursor.
    Resize2,

    // Top resize cursor.
    ResizeTop,

    // Bottom resize cursor.
    ResizeBottom,

    // Left resize cursor.
    ResizeLeft,

    // Right resize cursor.
    ResizeRight,

    // Top/left resize cursor.
    ResizeTopLeft,

    // Top/right resize cursor.
    ResizeTopRight,

    // Bottom/right resize cursor.
    ResizeBottomRight,

    // Bottom/left resize cursor.
    ResizeBottomLeft,

    // Undefined or unspecified cursor.
    Undefined = 255);

  // File chooser dialog type enumeration that can be passed as one of ::FileChooserDialog values.
  TFileChooserDialog = (
    // Open file dialog.
    OpenFile,

    // Save file dialog.
    SaveFile,

    // Select directory dialog.
    Directory);

  // Pointer to @link(TPathJoint).
  PPathJoint = ^TPathJoint;

  // Type of joint for connecting path lines.
  TPathJoint = (
    // No joint is produced, lines on each joint end with a butt cap.
    None,

    // Simple interpolated joint that does not guarantee correct line width on sharp corners.
    Simple,

    // Miter joint with angular corners.
    Miter,

    // Beveled joint.
    Bevel,

    // Round joint.
    Round,

    // Miter joint unless the miter would extend beyond its limit multiplied by half thickness.
    MiterBevel);

  // Pointer to @link(TLineCaps).
  PLineCaps = ^TLineCaps;

  // Type of caps that covers line end points.
  TLineCaps = (
    // Cap that starts and ends exactly at the center of end points.
    Butt,

    // Cap that extends by half thickness after the end points.
    Square,

    // Round cap with a radius equal to half thickness with center being each line end point.
    Round);

  // Pointer to @link(TPointShape).
  PPointShape = ^TPointShape;

  // Shape of point primitive.
  TPointShape = (
    // Square point.
    Square,

    // Round point.
    Round,

    // Equilateral triangle point.
    Triangle,

    // 5-sided star point.
    Star,

    // Cross point.
    Cross);

  // Type of surface layer that should be cleared.
  TClearLayer = (
    // Color buffer. @br @br
    Color,

    // Depth buffer. @br @br
    Depth,

    // Stencil buffer.
    Stencil);

  // One or more layer clear options.
  TClearLayers = set of TClearLayer;

  // Axis alignment that defines mesh placement in a 3D scene.
  TMeshAlign = (
    // Mesh is aligned from the edge of positive axis.
    Positive,

    // Mesh is aligned in the middle of axis origin.
    Origin,

    // Mesh is aligned from the edge of negative axis.
    Negative,

    // Mesh is unaligned on the axis.
    Unaligned);

  // Type of transform as used by object models.
  TModelTransform = (
    // Local object transform.
    Local,

    // Local Model object transform (for rendering).
    LocalModel,

    // Local Volume object transform (AABB Unity Cube).
    LocalVolume,

    // Global object transform.
    Global,

    // Global Model object transform (for rendering).
    GlobalModel,

    // Global Volume object transform (AABB Unity Cube).
    GlobalVolume);

  // Cumulative flags for a 3D object model that define its status.
  TModelAttribute = (
    // Object is visible so can be rendered and selected (if selected flag is set).
    Visible,

    // Object can be selected.
    Selectable,

    // Object is semi-transparent (might be rendered through a different mechanism).
    Transparent,

    // Object does not participate in bounding volume hierarchy (BVH) calculation. This is particularly
    // useful for constantly moving objects or those objects that have unusually large dimensions
    // overlapping with other objects.
    Hierarchyless,

    // Object should not automatically realign itself.
    DisableRealign,

    // Object does not appear among visible objects in the view. This is useful for abstract objects that
    // have no associated mesh, so aren't rendered in any way, but can still be selected.
    NonViewable);

  // One or more 3D object model flags.
  TModelAttributes = set of TModelAttribute;

  // Type of comparison applied to an ordered list of objects.
  TObjectModelViewCompare = (
    // Objects are compared by their depth.
    Depth,

    // Objects are compared by their depth in reverse (for rendering transparency without OIT).
    DepthReverse,

    // Objects are compared first by their order index, then by depth.
    Ordered,

    // Objects are compared first by their mesh and then by depth.
    Meshes,

    // Objects are sorted by their instance type id, mesh and then material.
    Objects);

  // Type of latch used in the 3D scene mesh.
  TSceneMeshLatchType = (
    // Bone joint connection.
    Joint,

    // Movement waypoint.
    Waypoint
  );

  // Alignment of the widget respective its parent.
  TWidgetAlignment = (
    // No alignment is applied to widget.
    None,

    // Widget occupies the entire client area.
    Client,

    // Widget is placed on the left occupying the entire client height.
    Left,

    // Widget is placed on the top occupying the entire client width.
    Top,

    // Widget is placed on the right occupying the entire client height.
    Right,

    // Widget is placed on the bottom occupying the entire client width.
    Bottom);

  // Data type of a widget property.
  TWidgetPropertyType = (
    // Unknown or undefined type. This may also refer to an event rather than property.
    None,

    // 32-bit signed integer.
    Integer,

    // 64-bit signed integer.
    Int64,

    // 32-bit floating-point type.
    Float,

    // 64-bit floating-point type.
    Real,

    // Boolean value (either yes/no or true/false).
    Boolean,

    // Floating-point 2D vector.
    Point,

    // Floating-point 3D vector.
    Vector,

    // Rectangle defined by four floating-point values: left, top, width and height.
    Rect,

    // Margins defined by four floating-point values: left, top, right and bottom.
    Margins,

    // Color value.
    Color,

    // A pair of two colors.
    ColorPair,

    // A set of four colors.
    ColorRect,

    // Enumeration (e.g. alignment) that is represented as a single byte.
    Enumeration,

    // UTF-8 encoded string.
    TextString,

    // Text font.
    Font);

  // Behavior of the property.
  TWidgetPropertyBehavior = (
    // Standard property behavior.
    Normal,

    // Property wraps an existing variable of the parent.
    Static,

    // Property is accessed through callback events.
    Indirect,

    // Property is considered temporary or "volatile".
    Volatile,

    // Property represents an event.
    Event);

  // Texture type used for the compositioning.
  TWidgetManagerTextureType = (
    // Texture with multisampling that is used for rendering using canvas.
    Canvas,

    // Final compositioning texture.
    Screen,

    // Auxiliary texture used for compositioning effects.
    Auxiliary);
