Skip to content

Commit

Permalink
feat(openvr) update to 2.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Nov 9, 2023
1 parent 9734ed2 commit 3df27bf
Show file tree
Hide file tree
Showing 18 changed files with 327 additions and 81 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,22 @@ jobs:
matrix:
ARCH: [arm32, arm64, ppc64le, riscv64]
include:
# ----
- ARCH: arm32
CROSS_ARCH: armhf
CONTAINER: ubuntu:18.04
TRIPLET: arm-linux-gnueabihf
# ----
- ARCH: arm64
CROSS_ARCH: arm64
CONTAINER: ubuntu:18.04
TRIPLET: aarch64-linux-gnu
# ----
- ARCH: ppc64le
CROSS_ARCH: ppc64el
CONTAINER: ubuntu:18.04
TRIPLET: powerpc64le-linux-gnu
# ----
- ARCH: riscv64
CROSS_ARCH: riscv64
CONTAINER: ubuntu:20.04
Expand Down
1 change: 1 addition & 0 deletions doc/notes/3.3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This build includes the following changes:
- liburing: Updated to 2.5 (up from 2.4)
- LLVM/Clang: Updated to 17.0.4 (up from 16.0.0)
- meshoptimizer: Updated to 0.20 (up from 0.19)
- OpenVR: Updated to 2.0.10 (up from 1.26.7)
- OpenXR: Updated to 1.0.31 (up from 1.0.29)
- Shaderc: Updated to 2023.7 (up from 2023.6)
- stb
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Texture(ByteBuffer container) {
/** @return the value of the {@code handle} field. */
@NativeType("void *")
public long handle() { return nhandle(address()); }
/** one of:<br><table><tr><td>{@link VR#ETextureType_TextureType_Invalid}</td><td>{@link VR#ETextureType_TextureType_DirectX}</td></tr><tr><td>{@link VR#ETextureType_TextureType_OpenGL}</td><td>{@link VR#ETextureType_TextureType_Vulkan}</td></tr><tr><td>{@link VR#ETextureType_TextureType_IOSurface}</td><td>{@link VR#ETextureType_TextureType_DirectX12}</td></tr><tr><td>{@link VR#ETextureType_TextureType_DXGISharedHandle}</td><td>{@link VR#ETextureType_TextureType_Metal}</td></tr></table> */
/** one of:<br><table><tr><td>{@link VR#ETextureType_TextureType_Invalid}</td><td>{@link VR#ETextureType_TextureType_DirectX}</td></tr><tr><td>{@link VR#ETextureType_TextureType_OpenGL}</td><td>{@link VR#ETextureType_TextureType_Vulkan}</td></tr><tr><td>{@link VR#ETextureType_TextureType_IOSurface}</td><td>{@link VR#ETextureType_TextureType_DirectX12}</td></tr><tr><td>{@link VR#ETextureType_TextureType_DXGISharedHandle}</td><td>{@link VR#ETextureType_TextureType_Metal}</td></tr><tr><td>{@link VR#ETextureType_TextureType_Reserved}</td></tr></table> */
@NativeType("ETextureType")
public int eType() { return neType(address()); }
/** one of:<br><table><tr><td>{@link VR#EColorSpace_ColorSpace_Auto}</td><td>{@link VR#EColorSpace_ColorSpace_Gamma}</td></tr><tr><td>{@link VR#EColorSpace_ColorSpace_Linear}</td></tr></table> */
Expand Down
127 changes: 104 additions & 23 deletions modules/lwjgl/openvr/src/generated/java/org/lwjgl/openvr/VR.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static int nVRCompositor_Submit(int eEye, long pTexture, long pBounds, in
* <p>OpenGL dirty state: glBindTexture</p>
*
* @param eEye one of:<br><table><tr><td>{@link VR#EVREye_Eye_Left}</td><td>{@link VR#EVREye_Eye_Right}</td></tr></table>
* @param nSubmitFlags one of:<br><table><tr><td>{@link VR#EVRSubmitFlags_Submit_Default}</td><td>{@link VR#EVRSubmitFlags_Submit_LensDistortionAlreadyApplied}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_GlRenderBuffer}</td><td>{@link VR#EVRSubmitFlags_Submit_Reserved}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_TextureWithDepth}</td><td>{@link VR#EVRSubmitFlags_Submit_FrameDiscontinuty}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_VulkanTextureWithArrayData}</td><td>{@link VR#EVRSubmitFlags_Submit_GlArrayTexture}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_Reserved2}</td><td>{@link VR#EVRSubmitFlags_Submit_Reserved3}</td></tr></table>
* @param nSubmitFlags one of:<br><table><tr><td>{@link VR#EVRSubmitFlags_Submit_Default}</td><td>{@link VR#EVRSubmitFlags_Submit_LensDistortionAlreadyApplied}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_GlRenderBuffer}</td><td>{@link VR#EVRSubmitFlags_Submit_Reserved}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_TextureWithDepth}</td><td>{@link VR#EVRSubmitFlags_Submit_FrameDiscontinuty}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_VulkanTextureWithArrayData}</td><td>{@link VR#EVRSubmitFlags_Submit_GlArrayTexture}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_IsEgl}</td><td>{@link VR#EVRSubmitFlags_Submit_Reserved2}</td></tr><tr><td>{@link VR#EVRSubmitFlags_Submit_Reserved3}</td></tr></table>
*
* @return return codes:
*
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;

/**
Expand All @@ -23,6 +22,7 @@
* struct VREvent_Keyboard_t {
* char {@link #cNewInput}[8];
* uint64_t {@link #uUserValue};
* uint64_t {@link #overlayHandle};
* }</code></pre>
*/
@NativeType("struct VREvent_Keyboard_t")
Expand All @@ -37,11 +37,13 @@ public class VREventKeyboard extends Struct<VREventKeyboard> {
/** The struct member offsets. */
public static final int
CNEWINPUT,
UUSERVALUE;
UUSERVALUE,
OVERLAYHANDLE;

static {
Layout layout = __struct(
__array(1, 8),
__member(8),
__member(8)
);

Expand All @@ -50,6 +52,7 @@ public class VREventKeyboard extends Struct<VREventKeyboard> {

CNEWINPUT = layout.offsetof(0);
UUSERVALUE = layout.offsetof(1);
OVERLAYHANDLE = layout.offsetof(2);
}

protected VREventKeyboard(long address, @Nullable ByteBuffer container) {
Expand All @@ -74,15 +77,18 @@ public VREventKeyboard(ByteBuffer container) {
@Override
public int sizeof() { return SIZEOF; }

/** up to 8 bytes of new input */
/** 7 bytes of utf8 + null */
@NativeType("char[8]")
public ByteBuffer cNewInput() { return ncNewInput(address()); }
/** up to 8 bytes of new input */
@NativeType("char")
public byte cNewInput(int index) { return ncNewInput(address(), index); }
/** possible flags about the new input */
/** 7 bytes of utf8 + null */
@NativeType("char[8]")
public String cNewInputString() { return ncNewInputString(address()); }
/** caller specified opaque token */
@NativeType("uint64_t")
public long uUserValue() { return nuUserValue(address()); }
/** {@code VROverlayHandle_t} */
@NativeType("uint64_t")
public long overlayHandle() { return noverlayHandle(address()); }

// -----------------------------------

Expand Down Expand Up @@ -117,12 +123,12 @@ public static VREventKeyboard.Buffer createSafe(long address, int capacity) {

/** Unsafe version of {@link #cNewInput}. */
public static ByteBuffer ncNewInput(long struct) { return memByteBuffer(struct + VREventKeyboard.CNEWINPUT, 8); }
/** Unsafe version of {@link #cNewInput(int) cNewInput}. */
public static byte ncNewInput(long struct, int index) {
return UNSAFE.getByte(null, struct + VREventKeyboard.CNEWINPUT + check(index, 8) * 1);
}
/** Unsafe version of {@link #cNewInputString}. */
public static String ncNewInputString(long struct) { return memUTF8(struct + VREventKeyboard.CNEWINPUT); }
/** Unsafe version of {@link #uUserValue}. */
public static long nuUserValue(long struct) { return UNSAFE.getLong(null, struct + VREventKeyboard.UUSERVALUE); }
/** Unsafe version of {@link #overlayHandle}. */
public static long noverlayHandle(long struct) { return UNSAFE.getLong(null, struct + VREventKeyboard.OVERLAYHANDLE); }

// -----------------------------------

Expand Down Expand Up @@ -165,12 +171,15 @@ protected VREventKeyboard getElementFactory() {
/** @return a {@link ByteBuffer} view of the {@link VREventKeyboard#cNewInput} field. */
@NativeType("char[8]")
public ByteBuffer cNewInput() { return VREventKeyboard.ncNewInput(address()); }
/** @return the value at the specified index of the {@link VREventKeyboard#cNewInput} field. */
@NativeType("char")
public byte cNewInput(int index) { return VREventKeyboard.ncNewInput(address(), index); }
/** @return the null-terminated string stored in the {@link VREventKeyboard#cNewInput} field. */
@NativeType("char[8]")
public String cNewInputString() { return VREventKeyboard.ncNewInputString(address()); }
/** @return the value of the {@link VREventKeyboard#uUserValue} field. */
@NativeType("uint64_t")
public long uUserValue() { return VREventKeyboard.nuUserValue(address()); }
/** @return the value of the {@link VREventKeyboard#overlayHandle} field. */
@NativeType("uint64_t")
public long overlayHandle() { return VREventKeyboard.noverlayHandle(address()); }

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* float {@link #x};
* float y;
* uint32_t {@link #button};
* uint32_t {@link #cursorIndex};
* }</code></pre>
*/
@NativeType("struct VREvent_Mouse_t")
Expand All @@ -38,10 +39,12 @@ public class VREventMouse extends Struct<VREventMouse> {
public static final int
X,
Y,
BUTTON;
BUTTON,
CURSORINDEX;

static {
Layout layout = __struct(
__member(4),
__member(4),
__member(4),
__member(4)
Expand All @@ -53,6 +56,7 @@ public class VREventMouse extends Struct<VREventMouse> {
X = layout.offsetof(0);
Y = layout.offsetof(1);
BUTTON = layout.offsetof(2);
CURSORINDEX = layout.offsetof(3);
}

protected VREventMouse(long address, @Nullable ByteBuffer container) {
Expand Down Expand Up @@ -84,6 +88,9 @@ public VREventMouse(ByteBuffer container) {
/** one of:<br><table><tr><td>{@link VR#EVRMouseButton_VRMouseButton_Left}</td><td>{@link VR#EVRMouseButton_VRMouseButton_Right}</td></tr><tr><td>{@link VR#EVRMouseButton_VRMouseButton_Middle}</td></tr></table> */
@NativeType("uint32_t")
public int button() { return nbutton(address()); }
/** if from an event triggered by cursor input on an overlay that supports multiple cursors, this is the index of which tracked cursor the event is for */
@NativeType("uint32_t")
public int cursorIndex() { return ncursorIndex(address()); }

// -----------------------------------

Expand Down Expand Up @@ -122,6 +129,8 @@ public static VREventMouse.Buffer createSafe(long address, int capacity) {
public static float ny(long struct) { return UNSAFE.getFloat(null, struct + VREventMouse.Y); }
/** Unsafe version of {@link #button}. */
public static int nbutton(long struct) { return UNSAFE.getInt(null, struct + VREventMouse.BUTTON); }
/** Unsafe version of {@link #cursorIndex}. */
public static int ncursorIndex(long struct) { return UNSAFE.getInt(null, struct + VREventMouse.CURSORINDEX); }

// -----------------------------------

Expand Down Expand Up @@ -168,6 +177,9 @@ protected VREventMouse getElementFactory() {
/** @return the value of the {@link VREventMouse#button} field. */
@NativeType("uint32_t")
public int button() { return VREventMouse.nbutton(address()); }
/** @return the value of the {@link VREventMouse#cursorIndex} field. */
@NativeType("uint32_t")
public int cursorIndex() { return VREventMouse.ncursorIndex(address()); }

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* uint64_t {@link #overlayHandle};
* uint64_t devicePath;
* uint64_t memoryBlockId;
* uint32_t {@link #cursorIndex};
* }</code></pre>
*/
@NativeType("struct VREvent_Overlay_t")
Expand All @@ -38,13 +39,15 @@ public class VREventOverlay extends Struct<VREventOverlay> {
public static final int
OVERLAYHANDLE,
DEVICEPATH,
MEMORYBLOCKID;
MEMORYBLOCKID,
CURSORINDEX;

static {
Layout layout = __struct(
__member(8),
__member(8),
__member(8)
__member(8),
__member(4)
);

SIZEOF = layout.getSize();
Expand All @@ -53,6 +56,7 @@ public class VREventOverlay extends Struct<VREventOverlay> {
OVERLAYHANDLE = layout.offsetof(0);
DEVICEPATH = layout.offsetof(1);
MEMORYBLOCKID = layout.offsetof(2);
CURSORINDEX = layout.offsetof(3);
}

protected VREventOverlay(long address, @Nullable ByteBuffer container) {
Expand Down Expand Up @@ -86,6 +90,9 @@ public VREventOverlay(ByteBuffer container) {
/** @return the value of the {@code memoryBlockId} field. */
@NativeType("uint64_t")
public long memoryBlockId() { return nmemoryBlockId(address()); }
/** if from an event triggered by cursor input on an overlay that supports multiple cursors, this is the index of which tracked cursor the event is for */
@NativeType("uint32_t")
public int cursorIndex() { return ncursorIndex(address()); }

// -----------------------------------

Expand Down Expand Up @@ -124,6 +131,8 @@ public static VREventOverlay.Buffer createSafe(long address, int capacity) {
public static long ndevicePath(long struct) { return UNSAFE.getLong(null, struct + VREventOverlay.DEVICEPATH); }
/** Unsafe version of {@link #memoryBlockId}. */
public static long nmemoryBlockId(long struct) { return UNSAFE.getLong(null, struct + VREventOverlay.MEMORYBLOCKID); }
/** Unsafe version of {@link #cursorIndex}. */
public static int ncursorIndex(long struct) { return UNSAFE.getInt(null, struct + VREventOverlay.CURSORINDEX); }

// -----------------------------------

Expand Down Expand Up @@ -172,6 +181,9 @@ protected VREventOverlay getElementFactory() {
/** @return the value of the {@code memoryBlockId} field. */
@NativeType("uint64_t")
public long memoryBlockId() { return VREventOverlay.nmemoryBlockId(address()); }
/** @return the value of the {@link VREventOverlay#cursorIndex} field. */
@NativeType("uint32_t")
public int cursorIndex() { return VREventOverlay.ncursorIndex(address()); }

}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* float ydelta;
* uint32_t unused;
* float {@link #viewportscale};
* uint32_t {@link #cursorIndex};
* }</code></pre>
*/
@NativeType("struct VREvent_Scroll_t")
Expand All @@ -40,13 +41,15 @@ public class VREventScroll extends Struct<VREventScroll> {
XDELTA,
YDELTA,
UNUSED,
VIEWPORTSCALE;
VIEWPORTSCALE,
CURSORINDEX;

static {
Layout layout = __struct(
__member(4),
__member(4),
__member(4),
__member(4),
__member(4)
);

Expand All @@ -57,6 +60,7 @@ public class VREventScroll extends Struct<VREventScroll> {
YDELTA = layout.offsetof(1);
UNUSED = layout.offsetof(2);
VIEWPORTSCALE = layout.offsetof(3);
CURSORINDEX = layout.offsetof(4);
}

protected VREventScroll(long address, @Nullable ByteBuffer container) {
Expand Down Expand Up @@ -90,6 +94,9 @@ public VREventScroll(ByteBuffer container) {
public int unused() { return nunused(address()); }
/** for scrolling on an overlay with laser mouse, this is the overlay's vertical size relative to the overlay height. Range: {@code [0,1]} */
public float viewportscale() { return nviewportscale(address()); }
/** if from an event triggered by cursor input on an overlay that supports multiple cursors, this is the index of which tracked cursor the event is for */
@NativeType("uint32_t")
public int cursorIndex() { return ncursorIndex(address()); }

// -----------------------------------

Expand Down Expand Up @@ -130,6 +137,8 @@ public static VREventScroll.Buffer createSafe(long address, int capacity) {
public static int nunused(long struct) { return UNSAFE.getInt(null, struct + VREventScroll.UNUSED); }
/** Unsafe version of {@link #viewportscale}. */
public static float nviewportscale(long struct) { return UNSAFE.getFloat(null, struct + VREventScroll.VIEWPORTSCALE); }
/** Unsafe version of {@link #cursorIndex}. */
public static int ncursorIndex(long struct) { return UNSAFE.getInt(null, struct + VREventScroll.CURSORINDEX); }

// -----------------------------------

Expand Down Expand Up @@ -178,6 +187,9 @@ protected VREventScroll getElementFactory() {
public int unused() { return VREventScroll.nunused(address()); }
/** @return the value of the {@link VREventScroll#viewportscale} field. */
public float viewportscale() { return VREventScroll.nviewportscale(address()); }
/** @return the value of the {@link VREventScroll#cursorIndex} field. */
@NativeType("uint32_t")
public int cursorIndex() { return VREventScroll.ncursorIndex(address()); }

}

Expand Down
Loading

0 comments on commit 3df27bf

Please sign in to comment.