Package org.lwjgl.vulkan
Class VkViewport
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkViewport
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class VkViewport extends Struct
Khronos Reference Page
Vulkan SpecificationDescribes viewport transformation parameters.
Valid Usage
widthmust be greater than0.0and less than or equal toVkPhysicalDeviceLimits::maxViewportDimensions[0]heightmust be greater than0.0and less than or equal toVkPhysicalDeviceLimits::maxViewportDimensions[1]xandymust each be betweenviewportBoundsRange[0] andviewportBoundsRange[1], inclusivex+widthmust be less than or equal toviewportBoundsRange[1]y+heightmust be less than or equal toviewportBoundsRange[1]minDepthmust be between0.0and1.0, inclusivemaxDepthmust be between0.0and1.0, inclusive
Member documentation
x– the viewport's left boundy– the viewport's upper boundwidth– the viewport's widthheight– the viewport's heightminDepth– the minimum viewport depthmaxDepth– the maximum viewport depth
Layout
struct VkViewport { float x; float y; float width; float height; float minDepth; float maxDepth; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classVkViewport.BufferAn array ofVkViewportstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description VkViewport(java.nio.ByteBuffer container)Creates aVkViewportinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static VkViewportcalloc()Returns a newVkViewportinstance allocated withmemCalloc.static VkViewport.Buffercalloc(int capacity)Returns a newVkViewport.Bufferinstance allocated withmemCalloc.static VkViewportcallocStack()Returns a newVkViewportinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkViewport.BuffercallocStack(int capacity)Returns a newVkViewport.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkViewport.BuffercallocStack(int capacity, MemoryStack stack)Returns a newVkViewport.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkViewportcallocStack(MemoryStack stack)Returns a newVkViewportinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkViewportcreate()Returns a newVkViewportinstance allocated withBufferUtils.static VkViewport.Buffercreate(int capacity)Returns a newVkViewport.Bufferinstance allocated withBufferUtils.static VkViewportcreate(long address)static VkViewport.Buffercreate(long address, int capacity)Create aVkViewport.Bufferinstance at the specified memory.floatheight()Returns the value of theheightfield.VkViewportheight(float value)Sets the specified value to theheightfield.static VkViewportmalloc()Returns a newVkViewportinstance allocated withmemAlloc.static VkViewport.Buffermalloc(int capacity)Returns a newVkViewport.Bufferinstance allocated withmemAlloc.static VkViewportmallocStack()Returns a newVkViewportinstance allocated on the thread-localMemoryStack.static VkViewport.BuffermallocStack(int capacity)Returns a newVkViewport.Bufferinstance allocated on the thread-localMemoryStack.static VkViewport.BuffermallocStack(int capacity, MemoryStack stack)Returns a newVkViewport.Bufferinstance allocated on the specifiedMemoryStack.static VkViewportmallocStack(MemoryStack stack)Returns a newVkViewportinstance allocated on the specifiedMemoryStack.floatmaxDepth()Returns the value of themaxDepthfield.VkViewportmaxDepth(float value)Sets the specified value to themaxDepthfield.floatminDepth()Returns the value of theminDepthfield.VkViewportminDepth(float value)Sets the specified value to theminDepthfield.VkViewportnset(long struct)Unsafe version ofset.VkViewportset(float x, float y, float width, float height, float minDepth, float maxDepth)Initializes this struct with the specified values.VkViewportset(VkViewport src)Copies the specified struct data to this struct.intsizeof()Returns thesizeof(struct).floatwidth()Returns the value of thewidthfield.VkViewportwidth(float value)Sets the specified value to thewidthfield.floatx()Returns the value of thexfield.VkViewportx(float value)Sets the specified value to thexfield.floaty()Returns the value of theyfield.VkViewporty(float value)Sets the specified value to theyfield.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
VkViewport
public VkViewport(java.nio.ByteBuffer container)
Creates aVkViewportinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturns thesizeof(struct).
-
x
public float x()
Returns the value of thexfield.
-
y
public float y()
Returns the value of theyfield.
-
width
public float width()
Returns the value of thewidthfield.
-
height
public float height()
Returns the value of theheightfield.
-
minDepth
public float minDepth()
Returns the value of theminDepthfield.
-
maxDepth
public float maxDepth()
Returns the value of themaxDepthfield.
-
x
public VkViewport x(float value)
Sets the specified value to thexfield.
-
y
public VkViewport y(float value)
Sets the specified value to theyfield.
-
width
public VkViewport width(float value)
Sets the specified value to thewidthfield.
-
height
public VkViewport height(float value)
Sets the specified value to theheightfield.
-
minDepth
public VkViewport minDepth(float value)
Sets the specified value to theminDepthfield.
-
maxDepth
public VkViewport maxDepth(float value)
Sets the specified value to themaxDepthfield.
-
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 ofset.
-
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 newVkViewportinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkViewport calloc()
Returns a newVkViewportinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkViewport create()
Returns a newVkViewportinstance allocated withBufferUtils.
-
create
public static VkViewport create(long address)
-
malloc
public static VkViewport.Buffer malloc(int capacity)
Returns a newVkViewport.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkViewport.Buffer calloc(int capacity)
Returns a newVkViewport.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkViewport.Buffer create(int capacity)
Returns a newVkViewport.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkViewport.Buffer create(long address, int capacity)
Create aVkViewport.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
mallocStack
public static VkViewport mallocStack()
Returns a newVkViewportinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkViewport callocStack()
Returns a newVkViewportinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkViewport mallocStack(MemoryStack stack)
Returns a newVkViewportinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkViewport callocStack(MemoryStack stack)
Returns a newVkViewportinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static VkViewport.Buffer mallocStack(int capacity)
Returns a newVkViewport.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkViewport.Buffer callocStack(int capacity)
Returns a newVkViewport.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkViewport.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkViewport.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkViewport.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newVkViewport.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
-