daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange

This commit is contained in:
Nitload
2024-10-03 04:03:06 +08:00
parent 0979123ac0
commit 6e2f93b053
265 changed files with 26732 additions and 19058 deletions
+15 -19
View File
@@ -44,7 +44,7 @@ namespace StgSharp
internal const int ssdSegmentLength = 16;
static byte[] _currentHash;
private static byte[] _currentHash;
private static bool _inited;
private static int _mainThreadID = -1;
@@ -53,14 +53,12 @@ namespace StgSharp
{
get
{
if (_currentHash == null)
{
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);
using( SHA256 sh = SHA256.Create() ) {
byte[] bytes = Encoding.UTF8.GetBytes( route );
_currentHash = sh.ComputeHash( bytes );
}
}
return _currentHash;
@@ -69,26 +67,24 @@ namespace StgSharp
public static int MainThreadID
{
get => (_mainThreadID == -1) ?
throw new InvalidOperationException("StgSharp environment is not inited. " +
"Main thread id is not available") : _mainThreadID;
get => ( _mainThreadID == -1 ) ?
throw new InvalidOperationException(
"StgSharp environment is not inited. " + "Main thread id is not available" ) : _mainThreadID;
}
/// <summary>
/// CustomizeInit an instance of OpenGL program,
/// This method should be called before any other StgSharp api.
/// CustomizeInit an instance of OpenGL program, This method should be called before any
/// other StgSharp api.
/// </summary>
public static void InitGL(int majorVersion, int minorVersion)
public static void InitGL( int majorVersion, int minorVersion )
{
if (API == default)
{
if( API == default ) {
API = GraphicAPI.GL;
}
if (API != GraphicAPI.GL)
{
if( API != GraphicAPI.GL ) {
return;
}
InternalIO.InternalInitGL(majorVersion, minorVersion);
InternalIO.InternalInitGL( majorVersion, minorVersion );
}
public static class GlobalSetting
@@ -101,7 +97,7 @@ namespace StgSharp
get => vsyncActivated;
set
{
InternalIO.glfwSwapInterval(value ? 1 : 0);
InternalIO.glfwSwapInterval( value ? 1 : 0 );
vsyncActivated = value;
}
}