Axiom.CgPrograms.CgHelper.CheckCgError C# (CSharp) Метод

CheckCgError() статический приватный Метод

Used to check for a recent Cg error and handle it accordingly.
static private CheckCgError ( string potentialError, IntPtr context ) : void
potentialError string Message to use if an error has indeed occurred.
context System.IntPtr Current Cg context.
Результат void
		internal static void CheckCgError( string potentialError, IntPtr context )
		{

			// check for a Cg error
			int error = Cg.cgGetError();

			if ( error != Cg.CG_NO_ERROR )
			{
				StringBuilder sb = new StringBuilder();
				sb.Append( Environment.NewLine );
				sb.Append( potentialError );
				sb.Append( Environment.NewLine );

				sb.Append( Cg.cgGetErrorString( error ) );
				sb.Append( Environment.NewLine );

				// Check for compiler error, need CG_COMPILER_ERROR const
				if ( error == Cg.CG_COMPILER_ERROR )
				{
					sb.Append( Cg.cgGetLastListing( context ) );
					sb.Append( Environment.NewLine );
				}

				LogManager.Instance.Write( sb.ToString() );
			}
		}
	}

Usage Example

Пример #1
0
        /// <summary>
        ///    Internal constructor.
        /// </summary>
        internal CgProgramFactory()
        {
            // create the Cg context
            cgContext = Cg.cgCreateContext();

            CgHelper.CheckCgError("Error creating Cg context.", cgContext);
        }
All Usage Examples Of Axiom.CgPrograms.CgHelper::CheckCgError