static void checkForCgError(string situation)
{
int error;
string errorString = Cg.cgGetLastErrorString(out error);
if (error != Cg.CG_NO_ERROR)
{
Console.WriteLine("{0}- {1}- {2}",
myProgramName, situation, errorString);
if (error == Cg.CG_COMPILER_ERROR)
{
Console.WriteLine("{0}", Cg.cgGetLastListing(myCgContext));
}
Environment.Exit(0);
}
}