Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class WGLNVDXInterop

extends Object
Class Inheritance
Imports
org.lwjgl.*, org.lwjgl.system.*

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

Modifier and TypeField and Description
public static final int
WGL_ACCESS_READ_ONLY_NV

Accepted by the access parameters of DXRegisterObjectNV and DXObjectAccessNV.

public static final int
WGL_ACCESS_READ_WRITE_NV

Accepted by the access parameters of DXRegisterObjectNV and DXObjectAccessNV.

public static final int
WGL_ACCESS_WRITE_DISCARD_NV

Accepted by the access parameters of DXRegisterObjectNV and DXObjectAccessNV.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nwglDXLockObjectsNV(long device, int
the number of objects to lock
count
,
long objects)

Unsafe version of: DXLockObjectsNV

public static int
nwglDXUnlockObjectsNV(long device, int
the number of objects to unlock
count
,
long objects)

Unsafe version of: DXUnlockObjectsNV

public static boolean
wglDXCloseDeviceNV(long device)

public static boolean
wglDXLockObjectsNV(long
the GL/DirectX interop device handle
device
,
PointerBuffer
an array of count interop objects
objects
)

Before a GL object which is associated with a DirectX resource may be used, it must be locked with this function.

public static boolean
wglDXObjectAccessNV(long
the GL/DirectX interop object
object
,
int access)

Modifies the access mode of an interop object, if a different access mode is required after the object has been registered.

public static long
wglDXOpenDeviceNV(long
a pointer to a supported Direct3D device object
dxDevice
)

Prepares a DirectX device for interoperability and returns a handle to a GL/DirectX interop device.

public static long
wglDXRegisterObjectNV(long
a GL/DirectX interop device handle, as returned by DXOpenDeviceNV
device
,
long
a pointer to a DirectX resource to be registered with the GL
dxResource
,
int
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
name
,
int
the GL object type that will map to the DirectX resource being shared
type
,
int
indicates the intended usage of the resource in GL. One of:
ACCESS_READ_ONLY_NVACCESS_READ_WRITE_NVACCESS_WRITE_DISCARD_NV
access
)

Prepares a DirectX object for use by the GL and returns a handle to a GL/DirectX interop object.

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

public static boolean
wglDXUnlockObjectsNV(long
the GL/DirectX interop device handle
device
,
PointerBuffer
an array of count interop objects
objects
)

Return control of an object to DirectX.

public static boolean
wglDXUnregisterObjectNV(long device, long object)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

WGL_ACCESS_READ_ONLY_NVback to summary
public static final int WGL_ACCESS_READ_ONLY_NV

Accepted by the access parameters of DXRegisterObjectNV and DXObjectAccessNV.

WGL_ACCESS_READ_WRITE_NVback to summary
public static final int WGL_ACCESS_READ_WRITE_NV

Accepted by the access parameters of DXRegisterObjectNV and DXObjectAccessNV.

WGL_ACCESS_WRITE_DISCARD_NVback to summary
public static final int WGL_ACCESS_WRITE_DISCARD_NV

Accepted by the access parameters of DXRegisterObjectNV and DXObjectAccessNV.

Constructor Detail

WGLNVDXInteropback to summary
protected WGLNVDXInterop()

Method Detail

nwglDXLockObjectsNVback to summary
public static int nwglDXLockObjectsNV(long device, int count, long objects)

Unsafe version of: DXLockObjectsNV

Parameters
count:int

the number of objects to lock

nwglDXUnlockObjectsNVback to summary
public static int nwglDXUnlockObjectsNV(long device, int count, long objects)

Unsafe version of: DXUnlockObjectsNV

Parameters
count:int

the number of objects to unlock

wglDXCloseDeviceNVback to summary
public static boolean wglDXCloseDeviceNV(long device)
Annotations
@NativeType:BOOL
wglDXLockObjectsNVback to summary
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.

Parameters
device:long

the GL/DirectX interop device handle

objects:PointerBuffer

an array of count interop objects

Annotations
@NativeType:BOOL
wglDXObjectAccessNVback to summary
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:long

the GL/DirectX interop object

access:int

the new access mode. One of:

ACCESS_READ_ONLY_NVACCESS_READ_WRITE_NVACCESS_WRITE_DISCARD_NV
Annotations
@NativeType:BOOL
wglDXOpenDeviceNVback to summary
public static long wglDXOpenDeviceNV(long dxDevice)

Prepares a DirectX device for interoperability and returns a handle to a GL/DirectX interop device.

Parameters
dxDevice:long

a pointer to a supported Direct3D device object

Annotations
@NativeType:HANDLE
wglDXRegisterObjectNVback to summary
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:long

a GL/DirectX interop device handle, as returned by DXOpenDeviceNV

dxResource:long

a pointer to a DirectX resource to be registered with the GL

name:int

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:int

the GL object type that will map to the DirectX resource being shared

access:int

indicates the intended usage of the resource in GL. One of:

ACCESS_READ_ONLY_NVACCESS_READ_WRITE_NVACCESS_WRITE_DISCARD_NV
Annotations
@NativeType:HANDLE
wglDXSetResourceShareHandleNVback to summary
public static boolean wglDXSetResourceShareHandleNV(long dxObject, long shareHandle)
Parameters
dxObject:long

a pointer to the DirectX resource that will be shared

shareHandle:long

the share handle that the OS generated for the resource

Annotations
@NativeType:BOOL
wglDXUnlockObjectsNVback to summary
public static boolean wglDXUnlockObjectsNV(long device, PointerBuffer objects)

Return control of an object to DirectX.

Parameters
device:long

the GL/DirectX interop device handle

objects:PointerBuffer

an array of count interop objects

Annotations
@NativeType:BOOL
wglDXUnregisterObjectNVback to summary
public static boolean wglDXUnregisterObjectNV(long device, long object)
Annotations
@NativeType:BOOL