Ejemplo n.º 1
0
 /// <summary>
 /// Loads this effect from a .cgfx stream
 /// </summary>
 /// <param name="source">Asset source</param>
 public void Load( IStreamSource source )
 {
     using ( Stream streamSource = source.Open( ) )
     {
         using ( StreamReader reader = new StreamReader( streamSource ) )
         {
             string str = reader.ReadToEnd( );
             if ( !CreateFromHandle( TaoCg.cgCreateEffect( m_Context, str, null ) ) )
             {
                 throw new ApplicationException( string.Format( "Unable to create CG effect from stream \"{0}\"\n{1}", source.Path, TaoCg.cgGetLastListing( m_Context ) ) );
             }
         }
     }
 }