Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.directX   Previous This
Package
Next

 


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.

Methods

addLVertexData

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.

ParameterDescription
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.

addTLVertexData

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.

ParameterDescription
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.

addVertexData

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.

ParameterDescription
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.

exit

public int exit(int bufferindex);

getDataAsArrayFloats

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.

ParameterDescription
d The array of floats that the data is copied to.

getDataAsArrayInts

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.

ParameterDescription
d The array of ints that the data is copied to.

getExecuteData

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.

ParameterDescription
data The D3dExecuteData object that receives the current execute data state of the Direct3dExecuteBuffer object.

Remarks:

This call fails if the Direct3dExecuteBuffer object is locked.

See Also: setExecuteData

lineList

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.

ParameterDescription
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.

lock

public void lock(D3dExecuteBufferDesc Desc);

Obtains the command data from the execute buffer.

Return Value:

No return value.

ParameterDescription
Desc The D3dExecuteBufferDesc object.

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 locked—that 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

matrixLoad

public native int matrixLoad(int hdest, int hsrc, int bufferindex);

Loads a matrix.

Return Value:

Returns the number of 32-bit values added.

ParameterDescription
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.

matrixMultiply

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.

ParameterDescription
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.

pointList

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.

ParameterDescription
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.

processVertices

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.

ParameterDescription
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.

processVerticesData

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.

ParameterDescription
flags The flags that indicate how the driver should process the vertices. These may be:
D3DPROCESSVERTICES_COPY
D3DPROCESSVERTICES_NOCOLOR
D3DPROCESSVERTICES_OPMASK
D3DPROCESSVERTICES_TRANSFORM
D3DPROCESSVERTICES_TRANSFORMLIGHT
D3DPROCESSVERTICES_UPDATEEXTENTS
start The index of the first vertex in the source.
dest The index of the first vertex in the local buffer.
cnt The number of vertices to be processed.
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.

setDataAsArrayFloats

public native void setDataAsArrayFloats(float[] d);

Sets the data in the execute buffer to the specified array of floats.

Return Value:

No return value.

ParameterDescription
d The array to set the data in the execute buffer to.

setDataAsArrayInts

public native void setDataAsArrayInts(int[] d);

Sets the data in the execute buffer to the specified array of ints.

Return Value:

No return value.

ParameterDescription
d The array to set the data in the execute buffer to.

setExecuteData

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.

ParameterDescription
data A D3dExecuteData object that describes the execute buffer layout.

Remarks:

This call fails if the Direct3dExecuteBuffer object is locked.

See Also: getExecuteData

setStatus

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.

ParameterDescription
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.

spanList

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.

ParameterDescription
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.

stateLight

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.

ParameterDescription
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.

stateLightData

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.

ParameterDescription
flags One of the following values:
D3DLIGHTSTATE_MATERIAL
Defines the material used to compute the final color and intensity values during rasterization.
D3DLIGHTSTATE_AMBIENT
Sets the color and intensity of the current ambient light.
D3DLIGHTSTATE_COLORMODEL
One of the D3DCOLORMODEL types.
D3DLIGHTSTATE_FOGMODE
One of the D3DFOGMODE types.
D3DLIGHTSTATE_FOGSTART
Defines the starting value for fog.
D3DLIGHTSTATE_FOGEND
Defines the ending value for fog.
D3DLIGHTSTATE_FOGDENSITY
Defines the density setting for fog.
Arg A value that is dependant on which flag is set.
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.

stateRender

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.

ParameterDescription
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.

stateRenderData

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.

ParameterDescription
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.

stateTransForm

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.

ParameterDescription
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.

stateTransFormData

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.

ParameterDescription
flags May be one of the following flags:
D3DTRANSFORMSTATE_WORLD
D3DTRANSFORMSTATE_VIEW
D3DTRANSFORMSTATE_PROJECTION
Arg The handle of the matrices for the world, view, and projection transformations. The default values for these are null.
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.

textureLoad

public native int textureLoad(int hdest, int hsrc, int bufferindex);

Loads a texture.

Return Value:

Returns the number of 32-bit values added.

ParameterDescription
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.

triangleList

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.

ParameterDescription
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.

triangleListData

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.

ParameterDescription
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.

unlock

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

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.