Class VkViewport

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer


    public class VkViewport
    extends Struct
    Khronos Reference Page
    Vulkan Specification

    Describes viewport transformation parameters.

    Valid Usage
    • width must be greater than 0.0 and less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[0]
    • height must be greater than 0.0 and less than or equal to VkPhysicalDeviceLimits::maxViewportDimensions[1]
    • x and y must each be between viewportBoundsRange[0] and viewportBoundsRange[1], inclusive
    • x + width must be less than or equal to viewportBoundsRange[1]
    • y + height must be less than or equal to viewportBoundsRange[1]
    • minDepth must be between 0.0 and 1.0, inclusive
    • maxDepth must be between 0.0 and 1.0, inclusive

    Member documentation

    • x – the viewport's left bound
    • y – the viewport's upper bound
    • width – the viewport's width
    • height – the viewport's height
    • minDepth – the minimum viewport depth
    • maxDepth – the maximum viewport depth

    Layout

    struct VkViewport {
        float x;
        float y;
        float width;
        float height;
        float minDepth;
        float maxDepth;
    }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • VkViewport

        public VkViewport(java.nio.ByteBuffer container)
        Creates a VkViewport instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns the sizeof(struct).
        Specified by:
        sizeof in class Struct
      • x

        public float x()
        Returns the value of the x field.
      • y

        public float y()
        Returns the value of the y field.
      • width

        public float width()
        Returns the value of the width field.
      • height

        public float height()
        Returns the value of the height field.
      • minDepth

        public float minDepth()
        Returns the value of the minDepth field.
      • maxDepth

        public float maxDepth()
        Returns the value of the maxDepth field.
      • x

        public VkViewport x(float value)
        Sets the specified value to the x field.
      • y

        public VkViewport y(float value)
        Sets the specified value to the y field.
      • width

        public VkViewport width(float value)
        Sets the specified value to the width field.
      • height

        public VkViewport height(float value)
        Sets the specified value to the height field.
      • minDepth

        public VkViewport minDepth(float value)
        Sets the specified value to the minDepth field.
      • maxDepth

        public VkViewport maxDepth(float value)
        Sets the specified value to the maxDepth field.
      • set

        public VkViewport set(float x,
                              float y,
                              float width,
                              float height,
                              float minDepth,
                              float maxDepth)
        Initializes this struct with the specified values.
      • nset

        public VkViewport nset(long struct)
        Unsafe version of set.
      • set

        public VkViewport set(VkViewport src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static VkViewport malloc()
        Returns a new VkViewport instance allocated with memAlloc. The instance must be explicitly freed.
      • create

        public static VkViewport create(long address)
        Returns a new VkViewport instance for the specified memory address or null if the address is NULL.
      • malloc

        public static VkViewport.Buffer malloc(int capacity)
        Returns a new VkViewport.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static VkViewport.Buffer create(long address,
                                               int capacity)
        Create a VkViewport.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • callocStack

        public static VkViewport callocStack()
        Returns a new VkViewport instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • callocStack

        public static VkViewport callocStack(MemoryStack stack)
        Returns a new VkViewport instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkViewport.Buffer callocStack(int capacity)
        Returns a new VkViewport.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static VkViewport.Buffer callocStack(int capacity,
                                                    MemoryStack stack)
        Returns a new VkViewport.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity