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)
        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.
        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.
        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:
      • 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.
        object - the GL/DirectX interop object
        access - the new access mode. One of:
      • nwglDXLockObjectsNV

        public static int nwglDXLockObjectsNV​(long device,
                                              int count,
                                              long objects)
        Unsafe version of: DXLockObjectsNV
        count - the number of objects to lock
      • wglDXLockObjectsNV

        public static boolean wglDXLockObjectsNV​(long device,
                                                 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.

        device - the GL/DirectX interop device handle
        objects - an array of count interop objects
      • nwglDXUnlockObjectsNV

        public static int nwglDXUnlockObjectsNV​(long device,
                                                int count,
                                                long objects)
        Unsafe version of: DXUnlockObjectsNV
        count - the number of objects to unlock
      • wglDXUnlockObjectsNV

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