- D3DOP_POINT
- - used to send one or more points to the renderer. The points to be sent should be in a D3DPOINT structure. For this opcode, we have to specify the starting index of the point(s) in the vertex list and the number of points to be rendered
- D3DOP_LINE
- - used to send a line to the renderer. The line to be rendered has to be sent in the D3DLINE structure. For the opcode, we have to specify two vertices of the line, as indices into the vertex list
- D3DOP_TRIANGLE
- - used to send a triangle to the renderer. The triangle to be rendered has to be sent in the D3DTRIANGLE structure. For the opcode, we have to specify three vertices which make up the triangle, which are indices into the vertex list. Alongith the points, a flag indicating the edges of the triangle to be rendered, is also specified. The flag describes which edges of the triangle are enabled and is only useful while displaying wireframe models. Some of the value of the flag are
- D3DTRIFLAG_EDGEENABLE1 - draw an edge only between the first and second point
- D3DTRIFLAG_EDGEENABLETRIANGLE - draws all edges of the triangle, namely between p1-p2, p2-p3 and p3-p1
- D3DOP_MATRIXLOAD
- - used to load a matrix into a destination matrix. The matrices have to be specified in the D3DMATRIXLOAD structure. Each of the matrices specified has to be in the D3DMATRIX structure. This opcode copies the source matrix into the destination matrix
- D3DOP_MATRIXMULTIPLY
- - used to multiply two matrices, into a third matrix. This operation takes two source matrices and multiplies them into a third matrix. The three matrices have to be specified in the D3DMATRIXMULTIPLY structure, with each matrix specified in the D3DMATRIX structure
- D3DOP_PROCESSVERTICES
- - used to set the lighting and transformations for the specified vertices. The vertices to be processed have to be specified in the
D3DPROCESSVERTICES structure. In this structure, the indices of the start vertex in the source and destination buffers have to be specified, alongwith the number of vertices and a processing flag. The flag indicates the processing to be done on the specified vertices. Some of the values of this flag are:- D3DPROCESSVERTICES_COPY
- D3DPROCESSVERTICES_TRANSFORMLIGHT
- D3DPROCESSVERTICES_TRANSFORM
- D3DOP_STATEX
- - used to set the value of the internal variables in the rendering engine. For setting values of the different modules, the are different state opcodes, one to set each variable. Here, the X represents the variable to be used. The different opcodes used are D3DOP_STATETRANSFORM, D3DOP_STATELIGHT and D3DOP_STATERENDER. For each of these opcode, we have to use the D3DSTATE structure. In this structure, we specify the state type to be set and the state information to be set. The different states are:
- D3D_STATETRANSFORM
- - used to set the internal values for the transformation module. Using this state stransformation, we can set the values of the state registers of the transformation module. The state types used to set the different matrices are:
- D3DTRANSFOR_WORLD
- D3DTRANSFORMSATE_VIEW
- D3DTRANSFORM_PROJECTION
- D3D_STATELIGHT
- - used to set the internal values for the lighting module of the rendering engine. Using this state, we can set the values of the ambient light, the material properties and the colour model used in the lighting module. The state types used are:
- D3DLIGHTSTATE_MATERIAL
- D3DLIGHTSTATE_AMBIENT
- D3DLIGHTSTATE_COLORMODEL
The colour model can be of two types, namely the monochromatic model or the RGB model. The RGB model is used by default
- D3D_STATERENDER
- - used to set the internal values for the rasterization module of the rendering engine. Using this state, we can specify the different textures to be used, the texture mapping parameters, and other things. Some of the state types used are:
- D3DRENDERSTATE_TEXTUREHANDLE
- D3DRENDERSTATE_ANTIALIAS
- D3DRENDERSTATE_WRAPU
- D3DRENDERSTATE_WRAPV
- D3DRENDERSTATE_FILLMODE
- D3DOP_TEXTURELOAD
- - used to load a specified texture, to be used for texture mapping. The texture to be loaded is specified in the D3DTEXTURE structure. This structure specifies two texture handles, each in the D3DTEXTUREHANDLE structure. The source texture is copied into the destination texture. A restriction of this opcode is that that the textures have to be of the same size
- D3DOP_EXIT
- - used to indicate the end of the execute buffer. Immediate mode executes the contents of the execute buffer till it encounters the end of the buffer. Hence, it is important to terminate each execute buffer with this opcode