Holidays 12.10. -> 25.10.2020
~ Moved code around in files. SM.Base: + PostProcessing-system + OnInitialization() for Scenes. + Shader-Extensions + Added option to not react while unfocused to the window. + Added Screenshots to the window. + Connected the log system to the SM.OGL-action system. ~ Replaced IShader with abstract MaterialShader. ~ When a log compression folder doesn't exist, it will create one. SM.OGL: + Added support for UniformArrays + Added ShaderPreProcessing + Added Shader Extensions. + Added Debug actions. + SM.OGL settings ~ Framebuffer Size is automaticly changed, when the window and scale is set. SM2D: + Added easy shader drawing.
This commit is contained in:
parent
2c00dbd31a
commit
03b3942732
102 changed files with 2683 additions and 1398 deletions
|
|
@ -1,43 +1,60 @@
|
|||
using System;
|
||||
#region usings
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace SM.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains utility functions for handling with assemblies.
|
||||
/// Contains utility functions for handling with assemblies.
|
||||
/// </summary>
|
||||
public class AssemblyUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// Read a file that is saved in a assembly
|
||||
/// Read a file that is saved in a assembly
|
||||
/// </summary>
|
||||
/// <param name="ass">The assembly that contains the file</param>
|
||||
/// <param name="path">The path to the file inside the assembly</param>
|
||||
/// <returns></returns>
|
||||
public static string ReadAssemblyFile(Assembly ass, string path) { return new StreamReader(GetAssemblyStream(ass, path)).ReadToEnd(); }
|
||||
public static string ReadAssemblyFile(Assembly ass, string path)
|
||||
{
|
||||
return new StreamReader(GetAssemblyStream(ass, path)).ReadToEnd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a file that is saved in the calling assembly
|
||||
/// Read a file that is saved in the calling assembly
|
||||
/// </summary>
|
||||
/// <param name="path">The path to the file inside the assembly</param>
|
||||
/// <returns></returns>
|
||||
public static string ReadAssemblyFile(string path) { return ReadAssemblyFile(Assembly.GetCallingAssembly(), path); }
|
||||
public static string ReadAssemblyFile(string path)
|
||||
{
|
||||
return ReadAssemblyFile(Assembly.GetCallingAssembly(), path);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a stream of a requested resource.
|
||||
/// Returns a stream of a requested resource.
|
||||
/// </summary>
|
||||
/// <param name="ass">The assembly the resource is in.</param>
|
||||
/// <param name="path">The path to the resource.</param>
|
||||
/// <returns>The stream</returns>
|
||||
public static Stream GetAssemblyStream(Assembly ass, string path) { return ass.GetManifestResourceStream(path) ?? throw new InvalidOperationException("Assembly couldn't find resource at path '" + path + "'."); }
|
||||
public static Stream GetAssemblyStream(Assembly ass, string path)
|
||||
{
|
||||
return ass.GetManifestResourceStream(path) ??
|
||||
throw new InvalidOperationException("Assembly couldn't find resource at path '" + path + "'.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a stream of a requested resource in the calling assembly.
|
||||
/// Returns a stream of a requested resource in the calling assembly.
|
||||
/// </summary>
|
||||
/// <param name="path">The path to the resource</param>
|
||||
/// <returns>The stream</returns>
|
||||
public static Stream GetAssemblyStream(string path) { return GetAssemblyStream(Assembly.GetCallingAssembly(), path); }
|
||||
public static Stream GetAssemblyStream(string path)
|
||||
{
|
||||
return GetAssemblyStream(Assembly.GetCallingAssembly(), path);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue