Class WGLNVDXInterop
- java.lang.Object
-
- org.lwjgl.opengl.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
.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
WGL_ACCESS_READ_ONLY_NV
WGL_ACCESS_READ_WRITE_NV
WGL_ACCESS_WRITE_DISCARD_NV
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static boolean
wglDXCloseDeviceNV(long device)
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.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.static long
wglDXOpenDeviceNV(long dxDevice)
Prepares a DirectX device for interoperability and returns a handle to a GL/DirectX interop device.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.static boolean
wglDXSetResourceShareHandleNV(long dxObject, long shareHandle)
static boolean
wglDXUnlockObjectsNV(long device, org.lwjgl.PointerBuffer objects)
Return control of an object to DirectX.static boolean
wglDXUnregisterObjectNV(long device, long object)
-
-
-
Method Detail
-
wglDXSetResourceShareHandleNV
public static boolean wglDXSetResourceShareHandleNV(long dxObject, long shareHandle)
- Parameters:
dxObject
- a pointer to the DirectX resource that will be sharedshareHandle
- 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 byDXOpenDeviceNV
dxResource
- 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 bytype
in 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_NV
ACCESS_READ_WRITE_NV
ACCESS_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_NV
ACCESS_READ_WRITE_NV
ACCESS_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 handleobjects
- an array ofcount
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 handleobjects
- an array ofcount
interop objects
-
-