2012-03-14 05:54:13 +00:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
2012-09-07 09:48:45 +00:00
|
|
|
using SharpDX.D3DCompiler;
|
2012-03-14 05:54:13 +00:00
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2012-03-14 05:54:13 +00:00
|
|
|
|
2012-09-15 13:43:31 +00:00
|
|
|
#if DX10
|
|
|
|
namespace ANX.RenderSystem.Windows.DX10
|
|
|
|
#endif
|
|
|
|
#if DX11
|
|
|
|
namespace ANX.RenderSystem.Windows.DX11
|
|
|
|
#endif
|
2012-03-14 05:54:13 +00:00
|
|
|
{
|
2012-09-08 10:37:41 +00:00
|
|
|
public class IncludeHandler : Include
|
2012-03-14 05:54:13 +00:00
|
|
|
{
|
2012-09-07 09:48:45 +00:00
|
|
|
private string directory;
|
|
|
|
|
|
|
|
public IDisposable Shadow { get; set; }
|
2012-03-14 05:54:13 +00:00
|
|
|
|
|
|
|
public IncludeHandler(string directory)
|
|
|
|
{
|
|
|
|
this.directory = directory;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Close(Stream stream)
|
|
|
|
{
|
|
|
|
stream.Close();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Stream Open(IncludeType type, string fileName, Stream parentStream)
|
|
|
|
{
|
|
|
|
//Console.WriteLine("Including {0} file {1} from directory {2}", type.ToString(), fileName, directory);
|
|
|
|
|
2012-09-07 09:48:45 +00:00
|
|
|
return File.OpenRead(Path.Combine(directory, fileName));
|
2012-03-14 05:54:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|