Class Direct3dExecuteBuffer
public class Direct3dExecuteBuffer implements
IDirect3dExecuteBuffer
{
// Methods
public int addLVertexData(D3dLVertex vertex, int bufferindex);
public int addTLVertexData(D3dTLVertex vertex, int bufferindex);
public int addVertexData(D3dVertex vertex, int bufferindex);
public int exit(int bufferindex);
public native void getDataAsArrayFloats(float[] d);
public native void getDataAsArrayInts(int[] d);
public void getExecuteData(D3dExecuteData data);
public native int lineList(int cnt, char segs, int bufferindex);
public void lock(D3dExecuteBufferDesc Desc);
public native int matrixLoad(int hdest, int hsrc,
int bufferindex);
public native int matrixMultiply(int hsrc1, int hsrc2, int hdest,
int bufferindex);
public native int pointList(int cnt, char first, int bufferindex);
public int processVertices(int cnt, int bufferindex);
public int processVerticesData(int flags, int start, int dest,
int cnt, int bufferindex);
public native void setDataAsArrayFloats(float[] d);
public native void setDataAsArrayInts(int[] d);
public void setExecuteData(D3dExecuteData data);
public int setStatus(int flags, int status, int x1, int y1,
int x2, int y2, int bufferindex);
public native int spanList(int cnt, char first, int bufferindex);
public int stateLight(int cnt, int bufferindex);
public int stateLightData(int flags, int Arg, int bufferindex);
public int stateRender(int cnt, int bufferindex);
public int stateRenderData(int flags, int Arg, int bufferindex);
public int stateTransForm(int cnt, int bufferindex);
public int stateTransFormData(int flags, int Arg,
int bufferindex);
public native int textureLoad(int hdest, int hsrc,
int bufferindex);
public int triangleList(int cnt, int bufferindex);
public int triangleListData(D3dTriangle triangle,
int bufferindex);
public void unlock();
}
Applications use the methods of the Direct3dExecuteBuffer class to set up and control a Microsoft® Direct3D® execute buffer.
Note This class does not provide an initialize method. Use the Direct3dDevice.createExecuteBuffer method to create and initialize Direct3dExecuteBuffer objects.
public int addLVertexData(D3dLVertex vertex, int bufferindex);
Adds a lit, untransformed vertex to the execute buffer at the position indicated by the bufferindex.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
vertex
| A D3dVertex object.
|
bufferindex
| The position in the execute buffer to place the vertex.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int addTLVertexData(D3dTLVertex vertex, int bufferindex);
Adds a lit and transformed vertex to the execute buffer at the position indicated by the bufferindex.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
vertex
| A D3dVertex object.
|
bufferindex
| The position in the execute buffer to place the vertex.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int addVertexData(D3dVertex vertex, int bufferindex);
Adds an unlit, untransformed vertex to the execute buffer at the position indicated by bufferindex.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
vertex
| A D3dVertex object
|
bufferindex
| The position in the execute buffer to place the vertex.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int exit(int bufferindex);
public native void getDataAsArrayFloats(float[] d);
Retrieves the data contained in the execute buffer as an array of float types.
Return Value:
No return value.
Parameter | Description |
d
| The array of floats that the data is copied to.
|
public native void getDataAsArrayInts(int[] d);
Retrieves the data contained in the execute buffer as an array of int types.
Return Value:
No return value.
Parameter | Description |
d
| The array of ints that the data is copied to.
|
public void getExecuteData(D3dExecuteData data);
Retrieves the execute data state of the Direct3dExecuteBuffer object. The execute data is used to describe the contents of the object.
Return Value:
No return value.
Remarks:
This call fails if the Direct3dExecuteBuffer object is locked.
See Also: setExecuteData
public native int lineList(int cnt, char segs, int bufferindex);
Sets the number of LINE instructions that will proceed with this instruction in the execute buffer. This method emulates the similar macro found in the Direct3d d3dmacs.h header file.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
segs
| |
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public void lock(D3dExecuteBufferDesc Desc);
Obtains the command data from the execute buffer.
Return Value:
No return value.
Remarks:
This method can obtain data from either system or video memory as specified by the caps field of Desc. The length of the array assigned to buffer must be set in the bufferSize field before making the call.
The application may use the lock method to request that Direct3D move the data between system or video memory.
This method fails if the Direct3dExecuteBuffer object is lockedthat is, if another thread is accessing the buffer or if a Direct3dDevice.execute method that was issued on this buffer has not yet been completed.
See Also: unlock
public native int matrixLoad(int hdest, int hsrc, int bufferindex);
Loads a matrix.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
hdest
| The handle of the destination matrix.
|
hsrc
| The handle of a source matrix.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
public native int matrixMultiply(int hsrc1, int hsrc2, int hdest,
int bufferindex);
Multiplies two matrices.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
hsrc1
| The handle of one of the matrices to multiply.
|
hsrc2
| The handle of one of the matrices to multiply.
|
hdest
| The handle of a destination matrix to copy the result of the multiplication to.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
public native int pointList(int cnt, char first, int bufferindex);
Sets the number of POINT instructions that will proceed with this instruction in the execute buffer. This method emulates the similar macro found in the Direct3d d3dmacs.h header file.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
first
| |
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int processVertices(int cnt, int bufferindex);
Sets the number of PROCESSVERTICES instructions that will proceed with this instruction in the execute buffer.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int processVerticesData(int flags, int start, int dest, int cnt, int
bufferindex);
Sets the data for the PROCESSVERTICES instruction in the execute buffer. This method describes how vertices in the execute buffer should be handled by the driver.
Return Value:
Returns the number of 32-bit values added.
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public native void setDataAsArrayFloats(float[] d);
Sets the data in the execute buffer to the specified array of floats.
Return Value:
No return value.
Parameter | Description |
d
| The array to set the data in the execute buffer to.
|
public native void setDataAsArrayInts(int[] d);
Sets the data in the execute buffer to the specified array of ints.
Return Value:
No return value.
Parameter | Description |
d
| The array to set the data in the execute buffer to.
|
public void setExecuteData(D3dExecuteData data);
Sets the execute data state of the Direct3dExecuteBuffer object. The execute data is used to describe the contents of the object.
Return Value:
No return value.
Parameter | Description |
data
| A D3dExecuteData object that describes the execute buffer layout.
|
Remarks:
This call fails if the Direct3dExecuteBuffer object is locked.
See Also: getExecuteData
public int setStatus(int flags, int status, int x1, int y1, int x2, int y2,
int bufferindex);
Resets the status of the execute buffer.
Return Value:
Returns the number of 32-bit values added to the buffer.
Parameter | Description |
flags
| Specifies whether the status, extents, or both are being set.
- D3DSETSTATUS_STATUS
- Sets the status.
- D3DSETSTATUS_EXTENTS
- Sets the extents specified by a given bounding box (x1,y1,x2,y2).
- D3DSETSTATUS_ALL
- Sets both the status and the extents.
|
status
| The clipping flags. This parameter may be one or more of the following flags:
- D3DSTATUS_CLIPINTERSECTIONALL
- Combination of all CLIPINTERSECTION flags.
- Other CLIPINTERSECTION flags include D3DSTATUS_CLIPINTERSECTIONBACK, D3DSTATUS_CLIPINTERSECTIONBOTTOM, D3DSTATUS_CLIPINTERSECTIONFRONT, and D3DSTATUS_CLIPINTERSECTIONGEN0 through D3DSTATUS_CLIPINTERSECTIONGEN5.
- D3DSTATUS_CLIPUNIONALL
- Combination of all CLIPUNION flags.
- Other CLIPUNION flags include
- D3DSTATUS_CLIPUNIONBOTTOM,
- D3DSTATUS_CLIPUNIONTOP, D3DSTATUS_CLIPUNIONLEFT, and D3DSTATUS_CLIPUNIONRIGHT.
- D3DSTATUS_DEFAULT
- the default is a combination of D3DSTATUS_CLIPINTERSECTION and D3DSTATUS_ZNOTVISIBLE flags.
- Basic clipping flags include D3DCLIP_BACK, D3DCLIP_LEFT, and D3DCLIP_TOP.
|
x1
| Defines a bounding box for all relevant vertices. The x coordinate of the bounding box's upper-left corner.
|
x2
| The y coordinate of the bounding box's upper-left corner.
|
y1
| The x coordinate of the bounding box's lower-right corner.
|
y2
| The y coordinate of the bounding box's lower-right corner.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The status is a rolling status and is updated during each execution. The bounding box specified can grow with each execution, but it does not shrink. It can be reset by calling this method again.
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public native int spanList(int cnt, char first, int bufferindex);
Sets the number of SPAN instructions that will proceed with this instruction in the execute buffer. This method emulates the similar macro found in the Direct3d d3dmacs.h header file.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
first
| |
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int stateLight(int cnt, int bufferindex);
Sets the number of STATELIGHT instructions that will proceed with this instruction in the execute buffer. This method emulates the similar macro found in the Direct3d d3dmacs.h header file.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int stateLightData(int flags, int Arg, int bufferindex);
Describes the transformation state for the STATELIGHT instruction.
Return Value:
Returns the number of 32-bit values added.
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int stateRender(int cnt, int bufferindex);
Sets the number of STATERENDER instructions in the execute buffer.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int stateRenderData(int flags, int Arg, int bufferindex);
Describes the render state for the STATERENDER instruction.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
flags
| The flags that describe the render state. For a complete listing of D3DRENDERSTATE_ flags, see DirectXConstants.
|
Arg
| A value that is dependant on the D3DRENDERSTATE_ flag.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int stateTransForm(int cnt, int bufferindex);
Sets the number of STATETRANSFORM instructions that will proceed with this instruction in the execute buffer.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int stateTransFormData(int flags, int Arg, int bufferindex);
Describes the transformation state for the STATETRANSFORM instruction.
Return Value:
Returns the number of 32-bit values added.
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public native int textureLoad(int hdest, int hsrc, int bufferindex);
Loads a texture.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
hdest
| The handle of the destination texture.
|
hsrc
| The handle of a source texture.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
public int triangleList(int cnt, int bufferindex);
Sets the number of TRIANGLE instructions that will proceed with this instruction in the execute buffer. This method emulates the similar macro found in the Direct3d d3dmacs.h header file.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
cnt
| The number of instructions.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public int triangleListData(D3dTriangle triangle, int bufferindex);
Describes the transformation state for the TRIANGLE instruction.
Return Value:
Returns the number of 32-bit values added.
Parameter | Description |
triangle
| The D3dTriangle object.
|
bufferindex
| The position in the execute buffer to place the instruction.
|
Remarks:
The execute buffer is treated as an array of 32-bit values, which is a collection of floats and ints that describe vertices and instructions. It is up to the user to manage the position of each item added to the buffer.
public void unlock();
Releases access to the commands in the execute buffer. This must be done prior to calling the execute method for the buffer.
Return Value:
No return value.
See Also: lock