Microsoft DirectX 8.1 (Visual Basic) |
Creates a vertex shader and if created successfully sets that shader as the current shader.
object.CreateVertexShader( _ DeclarationTokenArray As Long, _ FunctionTokenArray As Any, _ retHandle As Long, _ Usage As Long)
If this parameter is not set to ByVal 0, the shader is programmable.
If the method fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
D3DERR_OUTOFVIDEOMEMORY |
E_OUTOFMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
A vertex shader is defined by two token arrays that specify the declaration and function of the shader. The token arrays are composed of single or multiple Long tokens terminated by a special &HFFFFFFFF token value.
The shader declaration defines the static external interface of the shader, including binding of stream data to vertex register inputs and values loaded into the shader constant memory. The shader function defines the operation of the shader as an array of instructions that are executed in order for each vertex processed during the time the shader is bound to a device. Shaders created without a function array apply the fixed function vertex processing when that shader is current.
See d3dshader.bas for a definition of the constants used to generate the declaration token array.
Direct3DDevice8.DeleteVertexShader, D3DX8.AssembleShader, D3DX8.AssembleShaderFromFile, D3DX8.DeclaratorFromFVF