Package org.lwjgl.openxr
Class XrFoveatedViewConfigurationViewVARJO
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.XrFoveatedViewConfigurationViewVARJO
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XrFoveatedViewConfigurationViewVARJO extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceFoveated view configuration views.Valid Usage (Implicit)
- The
XR_VARJO_foveated_renderingextension must be enabled prior to usingXrFoveatedViewConfigurationViewVARJO typemust beTYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJOnextmust beNULLor a valid pointer to the next structure in a structure chain
For example:
XrInstance instance; // previously populated XrSystemId systemId; // previously populated XrViewConfigurationType viewConfigType; // Select XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO XrSystemFoveatedRenderingPropertiesVARJO foveatedRenderingProperties{XR_TYPE_SYSTEM_FOVEATED_RENDERING_PROPERTIES_VARJO}; XrSystemProperties systemProperties{XR_TYPE_SYSTEM_PROPERTIES, &foveatedRenderingProperties}; CHK_XR(xrGetSystemProperties(instance, systemId, &systemProperties)); uint32_t viewCount; CHK_XR(xrEnumerateViewConfigurationViews(instance, systemId, viewConfigType, 0, &viewCount, nullptr)); // Non-foveated rendering views dimensions std::vector<XrViewConfigurationView> configViews(viewCount, {XR_TYPE_VIEW_CONFIGURATION_VIEW}); CHK_XR(xrEnumerateViewConfigurationViews(instance, systemId, viewConfigType, viewCount, &viewCount, configViews.data())); // Foveated rendering views dimensions std::vector<XrViewConfigurationView> foveatedViews; if (foveatedRenderingProperties.supportsFoveatedRendering && viewConfigType == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO) { std::vector<XrFoveatedViewConfigurationViewVARJO> requestFoveatedConfig{4, {XR_TYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJO, nullptr, XR_TRUE}}; foveatedViews = std::vector<XrViewConfigurationView>{4, {XR_TYPE_VIEW_CONFIGURATION_VIEW}}; for (size_t i = 0; i < 4; i++) { foveatedViews[i].next = &requestFoveatedConfig[i]; } CHK_XR(xrEnumerateViewConfigurationViews(instance, systemId, viewConfigType, viewCount, &viewCount, foveatedViews.data())); }Note
Applications using this extension are encouraged to create 2 sets of swapchains or one big enough set of swapchains and 2 sets of viewports. One set will be used when rendering gaze is not available and other one will be used when foveated rendering and rendering gaze is available. Using foveated textures may not provide optimal visual quality when rendering gaze is not available.
See Also
Layout
struct XrFoveatedViewConfigurationViewVARJO { XrStructureTypetype(); void *next(); XrBool32foveatedRenderingActive(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrFoveatedViewConfigurationViewVARJO.BufferAn array ofXrFoveatedViewConfigurationViewVARJOstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intFOVEATEDRENDERINGACTIVE
NEXTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTYPEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description XrFoveatedViewConfigurationViewVARJO(java.nio.ByteBuffer container)Creates aXrFoveatedViewConfigurationViewVARJOinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XrFoveatedViewConfigurationViewVARJOcalloc()Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated withmemCalloc.static XrFoveatedViewConfigurationViewVARJO.Buffercalloc(int capacity)Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated withmemCalloc.static XrFoveatedViewConfigurationViewVARJO.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrFoveatedViewConfigurationViewVARJOcalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrFoveatedViewConfigurationViewVARJOcreate()Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated withBufferUtils.static XrFoveatedViewConfigurationViewVARJO.Buffercreate(int capacity)Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated withBufferUtils.static XrFoveatedViewConfigurationViewVARJOcreate(long address)Returns a newXrFoveatedViewConfigurationViewVARJOinstance for the specified memory address.static XrFoveatedViewConfigurationViewVARJO.Buffercreate(long address, int capacity)Create aXrFoveatedViewConfigurationViewVARJO.Bufferinstance at the specified memory.static XrFoveatedViewConfigurationViewVARJOcreateSafe(long address)static XrFoveatedViewConfigurationViewVARJO.BuffercreateSafe(long address, int capacity)booleanfoveatedRenderingActive()anXrBool32, indicating if the runtime should return foveated view configuration view.XrFoveatedViewConfigurationViewVARJOfoveatedRenderingActive(boolean value)Sets the specified value to thefoveatedRenderingActive()field.static XrFoveatedViewConfigurationViewVARJOmalloc()Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated withmemAlloc.static XrFoveatedViewConfigurationViewVARJO.Buffermalloc(int capacity)Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated withmemAlloc.static XrFoveatedViewConfigurationViewVARJO.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated on the specifiedMemoryStack.static XrFoveatedViewConfigurationViewVARJOmalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated on the specifiedMemoryStack.longnext()NULLor a pointer to the next structure in a structure chain.XrFoveatedViewConfigurationViewVARJOnext(long value)Sets the specified value to thenext()field.static intnfoveatedRenderingActive(long struct)Unsafe version offoveatedRenderingActive().static voidnfoveatedRenderingActive(long struct, int value)Unsafe version offoveatedRenderingActive.static longnnext(long struct)Unsafe version ofnext().static voidnnext(long struct, long value)Unsafe version ofnext.static intntype(long struct)Unsafe version oftype().static voidntype(long struct, int value)Unsafe version oftype.XrFoveatedViewConfigurationViewVARJOset(int type, long next, boolean foveatedRenderingActive)Initializes this struct with the specified values.XrFoveatedViewConfigurationViewVARJOset(XrFoveatedViewConfigurationViewVARJO src)Copies the specified struct data to this struct.intsizeof()inttype()theXrStructureTypeof this structure.XrFoveatedViewConfigurationViewVARJOtype(int value)Sets the specified value to thetype()field.XrFoveatedViewConfigurationViewVARJOtype$Default()Sets theTYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJOvalue to thetype()field.
-
-
-
Constructor Detail
-
XrFoveatedViewConfigurationViewVARJO
public XrFoveatedViewConfigurationViewVARJO(java.nio.ByteBuffer container)
Creates aXrFoveatedViewConfigurationViewVARJOinstance 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()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
type
public int type()
theXrStructureTypeof this structure.
-
next
public long next()
NULLor a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.
-
foveatedRenderingActive
public boolean foveatedRenderingActive()
anXrBool32, indicating if the runtime should return foveated view configuration view.
-
type
public XrFoveatedViewConfigurationViewVARJO type(int value)
Sets the specified value to thetype()field.
-
type$Default
public XrFoveatedViewConfigurationViewVARJO type$Default()
Sets theTYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJOvalue to thetype()field.
-
next
public XrFoveatedViewConfigurationViewVARJO next(long value)
Sets the specified value to thenext()field.
-
foveatedRenderingActive
public XrFoveatedViewConfigurationViewVARJO foveatedRenderingActive(boolean value)
Sets the specified value to thefoveatedRenderingActive()field.
-
set
public XrFoveatedViewConfigurationViewVARJO set(int type, long next, boolean foveatedRenderingActive)
Initializes this struct with the specified values.
-
set
public XrFoveatedViewConfigurationViewVARJO set(XrFoveatedViewConfigurationViewVARJO src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrFoveatedViewConfigurationViewVARJO malloc()
Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrFoveatedViewConfigurationViewVARJO calloc()
Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrFoveatedViewConfigurationViewVARJO create()
Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated withBufferUtils.
-
create
public static XrFoveatedViewConfigurationViewVARJO create(long address)
Returns a newXrFoveatedViewConfigurationViewVARJOinstance for the specified memory address.
-
createSafe
@Nullable public static XrFoveatedViewConfigurationViewVARJO createSafe(long address)
-
malloc
public static XrFoveatedViewConfigurationViewVARJO.Buffer malloc(int capacity)
Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrFoveatedViewConfigurationViewVARJO.Buffer calloc(int capacity)
Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrFoveatedViewConfigurationViewVARJO.Buffer create(int capacity)
Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrFoveatedViewConfigurationViewVARJO.Buffer create(long address, int capacity)
Create aXrFoveatedViewConfigurationViewVARJO.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrFoveatedViewConfigurationViewVARJO.Buffer createSafe(long address, int capacity)
-
malloc
public static XrFoveatedViewConfigurationViewVARJO malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrFoveatedViewConfigurationViewVARJO calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrFoveatedViewConfigurationViewVARJOinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XrFoveatedViewConfigurationViewVARJO.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XrFoveatedViewConfigurationViewVARJO.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrFoveatedViewConfigurationViewVARJO.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ntype
public static int ntype(long struct)
Unsafe version oftype().
-
nnext
public static long nnext(long struct)
Unsafe version ofnext().
-
nfoveatedRenderingActive
public static int nfoveatedRenderingActive(long struct)
Unsafe version offoveatedRenderingActive().
-
ntype
public static void ntype(long struct, int value)Unsafe version oftype.
-
nnext
public static void nnext(long struct, long value)Unsafe version ofnext.
-
nfoveatedRenderingActive
public static void nfoveatedRenderingActive(long struct, int value)Unsafe version offoveatedRenderingActive.
-
-