daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user