Cg Direct3D10 Runtime API cgD3D10LoadProgram(3)
NAME
cgD3D10000LoadProgram - create a D3D shader and enable the
expanded interface routines
SYNOPSIS
#include
HRESULT cgD3D10LoadProgram( CGprogram program,
UINT flags );
PARAMETERS
program A program whose compiled output is used to create
the D3D shader.
flags The flags to pass to D3DXAssembleShader. See the D3D
documentation for a list of valid flags.
RETURN VALUES
Returns D3DOK if the function succeeds or program has
already been loaded.
Returns the D3D failure code if the function fails due to a
D3D call.
DESCRIPTION
cgD3D10000LoadProgram creates a D3D shader for a program and
enables use of expanded interface routines for that program.
cgD3D10000LoadProgram assembles the compiled Cg output for
program using D3DXAssembleShader and then creates a D3D
shader using ID3D10000Device::::::::CreateVertexShader or
ID3D10000Device::::::::CreatePixelShader depending on the program's
profile.
The D3D shader handle is not returned. If the shader handle
is desired by the application, the expanded interface should
not be used for that program.
EXAMPLES
/ vertexProg is a CGprogram using a vertex profile
/ pixelProg is a CGprogram using a pixel profile
...
HRESULT hr1 = cgD3D10LoadProgram(vertexProg, TRUE, D3DXASMDEBUG);
HRESULT hr2 = cgD3D10LoadProgram(pixelProg, TRUE, 0);
ERORS
cgD3D10000Failed is generated if a D3D function returns an
error.
Cg Toolkit 2.1 Last change: 1
Cg Direct3D10 Runtime API cgD3D10LoadProgram(3)
CGD3D10000ERINVALIDPROFILE is returned if program's profile
is not a supported D3D profile.
CGD3D10000ERNODEVICE is returned if a required D3D device is
NUL. This usually occurs when an expanded interface
routine is called but a D3D device has not been set with
cgD3D10SetDevice.
HISTORY
cgD3D10000LoadProgram was introduced in Cg 2.1.
SEE ALSO
cgD3D10SetDevice
Cg Toolkit 2.1 Last change: 2
|