Class WGLNVDXInterop



  • public class WGLNVDXInterop
    extends java.lang.Object
    Native bindings to the WGL_NV_DX_interop extension.

    This extension allows OpenGL to directly access DirectX buffers and surfaces. A DirectX vertex buffer may be shared as an OpenGL buffer object and a DirectX surface may be shared as an OpenGL texture or renderbuffer object.

    Requires OpenGL 2.1.

    • Method Detail

      • wglDXSetResourceShareHandleNV

        public static boolean wglDXSetResourceShareHandleNV(long dxObject,
                                                            long shareHandle)
        Parameters:
        dxObject - a pointer to the DirectX resource that will be shared
        shareHandle - the share handle that the OS generated for the resource
      • wglDXOpenDeviceNV

        public static long wglDXOpenDeviceNV(long dxDevice)
        Prepares a DirectX device for interoperability and returns a handle to a GL/DirectX interop device.
        Parameters:
        dxDevice - a pointer to a supported Direct3D device object
      • wglDXCloseDeviceNV

        public static boolean wglDXCloseDeviceNV(long device)
      • wglDXRegisterObjectNV

        public static long wglDXRegisterObjectNV(long device,
                                                 long dxResource,
                                                 int name,
                                                 int type,
                                                 int access)
        Prepares a DirectX object for use by the GL and returns a handle to a GL/DirectX interop object.
        Parameters:
        device - a GL/DirectX interop device handle, as returned by DXOpenDeviceNV
        dxResource - a pointer to a DirectX resource to be registered with the GL
        name - the GL object name to be assigned to the DirectX resource in the namespace of the objects identified by type in the current GL context
        type - the GL object type that will map to the DirectX resource being shared
        access - indicates the intended usage of the resource in GL. One of:
        ACCESS_READ_ONLY_NVACCESS_READ_WRITE_NVACCESS_WRITE_DISCARD_NV
      • wglDXUnregisterObjectNV

        public static boolean wglDXUnregisterObjectNV(long device,
                                                      long object)
      • wglDXObjectAccessNV

        public static boolean wglDXObjectAccessNV(long object,
                                                  int access)
        Modifies the access mode of an interop object, if a different access mode is required after the object has been registered.
        Parameters:
        object - the GL/DirectX interop object
        access - the new access mode. One of:
        ACCESS_READ_ONLY_NVACCESS_READ_WRITE_NVACCESS_WRITE_DISCARD_NV
      • wglDXLockObjectsNV

        public static boolean wglDXLockObjectsNV(long device,
                                                 org.lwjgl.PointerBuffer objects)
        Before a GL object which is associated with a DirectX resource may be used, it must be locked with this function.

        A return value of TRUE indicates that all objects were successfully locked. A return value of FALSE indicates an error. If the function returns FALSE, none of the objects will be locked.

        Attempting to access an interop object via GL when the object is not locked, or attempting to access the DirectX resource through the DirectX API when it is locked by GL, will result in undefined behavior and may result in data corruption or program termination. Likewise, passing invalid interop device or object handles to this function has undefined results, including program termination.

        Parameters:
        device - the GL/DirectX interop device handle
        objects - an array of count interop objects
      • wglDXUnlockObjectsNV

        public static boolean wglDXUnlockObjectsNV(long device,
                                                   org.lwjgl.PointerBuffer objects)
        Return control of an object to DirectX.
        Parameters:
        device - the GL/DirectX interop device handle
        objects - an array of count interop objects