rubuild file struct 2
This commit is contained in:
@@ -31,7 +31,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -40,7 +42,28 @@ namespace StgSharp
|
||||
public static unsafe partial class StgSharp
|
||||
{
|
||||
|
||||
static byte[] _currentHash;
|
||||
|
||||
private static bool _inited;
|
||||
internal const int ssdSegmentLength = 16;
|
||||
|
||||
public static byte[] CurrentAssemblyHash
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_currentHash == null)
|
||||
{
|
||||
string route = Assembly.GetExecutingAssembly().Location;
|
||||
string time = DateTime.UtcNow.ToString();
|
||||
using (SHA256 sh = SHA256.Create())
|
||||
{
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(route);
|
||||
_currentHash = sh.ComputeHash(bytes);
|
||||
}
|
||||
}
|
||||
return _currentHash;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init an instance of OpenGL program,
|
||||
@@ -76,5 +99,5 @@ namespace StgSharp
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}//------------------------end of class------------------------//
|
||||
}
|
||||
@@ -64,6 +64,8 @@ namespace StgSharp
|
||||
VK
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static partial class StgSharp
|
||||
{
|
||||
|
||||
@@ -83,6 +85,29 @@ namespace StgSharp
|
||||
mainTimeProvider = new StgSharpTime();
|
||||
MainTimeProvider.StartProvidingTime();
|
||||
InternalIO.glfwInit();
|
||||
InternalIO.InternalAppendLog("\n\n\n");
|
||||
InternalIO.InternalWriteLog(
|
||||
$"Program {Assembly.GetEntryAssembly()!.FullName} Started.",
|
||||
LogType.Info);
|
||||
}
|
||||
|
||||
public static void LogError(Exception ex)
|
||||
{
|
||||
InternalIO.InternalWriteLog(ex.Message, LogType.Error);
|
||||
}
|
||||
|
||||
public static void LogWarning(string log)
|
||||
{
|
||||
InternalIO.InternalWriteLog(log, LogType.Warning);
|
||||
}
|
||||
public static void LogWarning(Exception notVerySeriesException)
|
||||
{
|
||||
InternalIO.InternalWriteLog(notVerySeriesException.Message, LogType.Warning);
|
||||
}
|
||||
|
||||
public static void LogInfo(string log)
|
||||
{
|
||||
InternalIO.InternalWriteLog(log, LogType.Info);
|
||||
}
|
||||
|
||||
public static void Mark(bool needConsole)
|
||||
@@ -97,6 +122,7 @@ namespace StgSharp
|
||||
public static void Terminate()
|
||||
{
|
||||
MainTimeProvider.Terminate();
|
||||
InternalIO.glfwTerminate();
|
||||
}
|
||||
|
||||
public static void Track(
|
||||
@@ -129,7 +155,7 @@ namespace StgSharp
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a log message to log file, and mark the level of this message.
|
||||
/// Write a log message to log file, and mark the _level of this message.
|
||||
/// </summary>
|
||||
/// <param name="message">A string contains information of how current evironment runs.</param>
|
||||
/// <param name="logType">The severity of current message.</param>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharpDebug.Logic;
|
||||
using StgSharp.Logic;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -74,17 +74,17 @@ namespace StgSharp.Geometries
|
||||
mutex = new Mutex();
|
||||
}
|
||||
|
||||
List<IInstancing> IInstancingBuffer.InstanceList
|
||||
public List<IInstancing> InstanceList
|
||||
{
|
||||
get => instanceList;
|
||||
}
|
||||
|
||||
List<vec4d> IInstancingBuffer.CoordAndRotationList
|
||||
public List<vec4d> CoordAndRotationList
|
||||
{
|
||||
get => coordList;
|
||||
}
|
||||
|
||||
List<float> IInstancingBuffer.ScalingList
|
||||
public List<float> ScalingList
|
||||
{
|
||||
get => scalingList;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ using System.Text;
|
||||
namespace StgSharp.Graphics.GL
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of handle to Element Buffer Object in OpenGL.
|
||||
/// A collection of handle to Element Buffer Object in OpenglFunc.
|
||||
/// Each <see langword="uint"/> value indexed from instance of this class this
|
||||
/// is the only handle to one Element Buffer Object.
|
||||
/// </summary>
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace StgSharp.Graphics.GL
|
||||
if (proc == IntPtr.Zero)
|
||||
{
|
||||
#if DEBUG
|
||||
Console.WriteLine("Cannot load GL.");
|
||||
Console.WriteLine("Cannot load glFunc.");
|
||||
#endif
|
||||
throw new Exception("Cannot load gl");
|
||||
}
|
||||
|
||||
@@ -18,15 +18,15 @@ namespace StgSharp.Graphics.ShaderEdit
|
||||
{
|
||||
internal Dictionary<glSHandle, ShaderStructMember> uniformPair;
|
||||
|
||||
public ShaderStruct(params (glSHandle, ShaderStructMember)[] UniformPais)
|
||||
public ShaderStruct(params (glSHandle, ShaderStructMember)[] uniformPairs)
|
||||
{
|
||||
uniformPair = new Dictionary<glSHandle, ShaderStructMember>();
|
||||
if (UniformPais.Length == 0)
|
||||
if (uniformPairs.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var item in UniformPais)
|
||||
foreach (var item in uniformPairs)
|
||||
{
|
||||
uniformPair.Add(item.Item1,item.Item2);
|
||||
}
|
||||
|
||||
@@ -9,19 +9,6 @@ using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
|
||||
internal static partial class InternalIO
|
||||
{
|
||||
[DllImport(SSC_libName, EntryPoint = "normalize",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void Normalize(M128* source, M128* target);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public static partial class Linear
|
||||
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+70890e3e339064993a7c905683c70a3ec5bd47f4")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0cac40255bd414b81f65e12c37cd72a7adb12bf0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
Reference in New Issue
Block a user