protected override void LoadFromSource()
{
// bind this program before loading
Gl.glBindProgramNV( programType, programId );
// load the ASM source into an NV program
Gl.glLoadProgramNV( programType, programId, Source.Length, System.Text.Encoding.ASCII.GetBytes( Source ) ); // TAO 2.0
//Gl.glLoadProgramNV( programType, programId, source.Length, source );
// get the error string from the NV program loader
string error = Gl.glGetString( Gl.GL_PROGRAM_ERROR_STRING_NV ); // TAO 2.0
//string error = Marshal.PtrToStringAnsi( Gl.glGetString( Gl.GL_PROGRAM_ERROR_STRING_NV ) );
// if there was an error, report it
if ( error != null && error.Length > 0 )
{
int pos;
// get the position of the error
Gl.glGetIntegerv( Gl.GL_PROGRAM_ERROR_POSITION_ARB, out pos );
throw new Exception( string.Format( "Error on line {0} in program '{1}'\nError: {2}", pos, Name, error ) );
}
}