Class WGLNVDXInterop
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intnwglDXLockObjectsNV(long device, int count, long objects) Unsafe version of:DXLockObjectsNVstatic intnwglDXUnlockObjectsNV(long device, int count, long objects) Unsafe version of:DXUnlockObjectsNVstatic booleanwglDXCloseDeviceNV(long device) static booleanwglDXLockObjectsNV(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.static booleanwglDXObjectAccessNV(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.static longwglDXOpenDeviceNV(long dxDevice) Prepares a DirectX device for interoperability and returns a handle to a GL/DirectX interop device.static longwglDXRegisterObjectNV(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.static booleanwglDXSetResourceShareHandleNV(long dxObject, long shareHandle) static booleanwglDXUnlockObjectsNV(long device, org.lwjgl.PointerBuffer objects) Return control of an object to DirectX.static booleanwglDXUnregisterObjectNV(long device, long object)
-
Field Details
-
WGL_ACCESS_READ_ONLY_NV
public static final int WGL_ACCESS_READ_ONLY_NV- See Also:
-
WGL_ACCESS_READ_WRITE_NV
public static final int WGL_ACCESS_READ_WRITE_NV- See Also:
-
WGL_ACCESS_WRITE_DISCARD_NV
public static final int WGL_ACCESS_WRITE_DISCARD_NV- See Also:
-
-
Method Details
-
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 byDXOpenDeviceNVdxResource- a pointer to a DirectX resource to be registered with the GLname- the GL object name to be assigned to the DirectX resource in the namespace of the objects identified bytypein the current GL contexttype- the GL object type that will map to the DirectX resource being sharedaccess- 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 objectaccess- the new access mode. One of:ACCESS_READ_ONLY_NVACCESS_READ_WRITE_NVACCESS_WRITE_DISCARD_NV
-
nwglDXLockObjectsNV
public static int nwglDXLockObjectsNV(long device, int count, long objects) Unsafe version of:DXLockObjectsNV- Parameters:
count- the number of objects to lock
-
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 handleobjects- an array ofcountinterop objects
-
nwglDXUnlockObjectsNV
public static int nwglDXUnlockObjectsNV(long device, int count, long objects) Unsafe version of:DXUnlockObjectsNV- Parameters:
count- the number of objects to unlock
-
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 handleobjects- an array ofcountinterop objects