C# Class Axiom.CgPrograms.CgProgram

Specialization of HighLevelGpuProgram to provide support for nVidia's Cg language.
Cg can be used to compile common, high-level, C-like code down to assembler language for both GL and Direct3D, for multiple graphics cards. You must supply a list of profiles which your program must support using SetProfiles() before the program is loaded in order for this to work. The program will then negotiate with the renderer to compile the appropriate program for the API and graphics card capabilities.
Inheritance: Axiom.Graphics.HighLevelGpuProgram
Mostra file Open project: mono-soc-2011/axiom

Protected Properties

Property Type Description
cgContext System.IntPtr
cgProgram System.IntPtr
entry string
profiles string[]
selectedCgProfile int
selectedProfile string

Public Methods

Method Description
CgProgram ( ResourceManager parent, string name, ulong handle, string group, bool isManual, IManualResourceLoader loader, IntPtr context ) : System

Constructor.

SetParam ( string name, string val ) : bool

Method for passing parameters into the CgProgram.

Touch ( ) : void

Only bother with supported programs.

Protected Methods

Method Description
BuildConstantDefinitions ( ) : void
CreateLowLevelImpl ( ) : void

Create as assembler program from the compiled source supplied by the Cg compiler.

LoadFromSource ( ) : void

PopulateParameterNames ( GpuProgramParameters parms ) : void

SelectProfile ( ) : void

Internal method which works out which profile to use for this program

UnloadImpl ( ) : void

Unloads the Cg program.

Method Details

BuildConstantDefinitions() protected method

protected BuildConstantDefinitions ( ) : void
return void

CgProgram() public method

Constructor.
public CgProgram ( ResourceManager parent, string name, ulong handle, string group, bool isManual, IManualResourceLoader loader, IntPtr context ) : System
parent Axiom.Core.ResourceManager
name string Name of this program.
handle ulong
group string
isManual bool
loader IManualResourceLoader
context System.IntPtr CG context id.
return System

CreateLowLevelImpl() protected method

Create as assembler program from the compiled source supplied by the Cg compiler.
protected CreateLowLevelImpl ( ) : void
return void

LoadFromSource() protected method

protected LoadFromSource ( ) : void
return void

PopulateParameterNames() protected method

protected PopulateParameterNames ( GpuProgramParameters parms ) : void
parms Axiom.Graphics.GpuProgramParameters
return void

SelectProfile() protected method

Internal method which works out which profile to use for this program
protected SelectProfile ( ) : void
return void

SetParam() public method

Method for passing parameters into the CgProgram.
public SetParam ( string name, string val ) : bool
name string /// Param name. ///
val string /// Param value. ///
return bool

Touch() public method

Only bother with supported programs.
public Touch ( ) : void
return void

UnloadImpl() protected method

Unloads the Cg program.
protected UnloadImpl ( ) : void
return void

Property Details

cgContext protected_oe property

Current Cg context id.
protected IntPtr,System cgContext
return System.IntPtr

cgProgram protected_oe property

Current Cg program id.
protected IntPtr,System cgProgram
return System.IntPtr

entry protected_oe property

Entry point of the Cg program.
protected string entry
return string

profiles protected_oe property

List of requested profiles for this program.
protected string[] profiles
return string[]

selectedCgProfile protected_oe property

protected int selectedCgProfile
return int

selectedProfile protected_oe property

Chosen profile for this program.
protected string selectedProfile
return string