47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System.IO;
|
|
|
|
namespace Kav
|
|
{
|
|
internal class Resources
|
|
{
|
|
public static byte[] PBREffect
|
|
{
|
|
get
|
|
{
|
|
if (pbrEffect == null)
|
|
{
|
|
pbrEffect = GetResource("PBREffect");
|
|
}
|
|
return pbrEffect;
|
|
}
|
|
}
|
|
|
|
public static byte[] SimpleDepthEffect
|
|
{
|
|
get
|
|
{
|
|
if (simpleDepthEffect == null)
|
|
{
|
|
simpleDepthEffect = GetResource("SimpleDepthEffect");
|
|
}
|
|
return simpleDepthEffect;
|
|
}
|
|
}
|
|
|
|
private static byte[] pbrEffect;
|
|
private static byte[] simpleDepthEffect;
|
|
|
|
private static byte[] GetResource(string name)
|
|
{
|
|
Stream stream = typeof(Resources).Assembly.GetManifestResourceStream(
|
|
"Kav.Resources." + name + ".fxb"
|
|
);
|
|
using (MemoryStream ms = new MemoryStream())
|
|
{
|
|
stream.CopyTo(ms);
|
|
return ms.ToArray();
|
|
}
|
|
}
|
|
}
|
|
}
|