daily update on 20240828 by nitload youmu, autotexture added

This commit is contained in:
Nitload
2024-08-28 10:58:31 +08:00
parent d082071f2d
commit 1ee4e4a42f
586 changed files with 60910 additions and 123106 deletions
+35 -3
View File
@@ -1,4 +1,34 @@
using System;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="ErrorDefine.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -8,10 +38,12 @@ namespace StgSharp
{
public class UniformEmptyReferenceException : Exception
{
public UniformEmptyReferenceException(string program, string name):
public UniformEmptyReferenceException(string program, string name) :
base($"Location -1 returned when trying to find uniform {name} in shader program {program}")
{
}
}
}
@@ -41,19 +41,13 @@ namespace StgSharp
{
public static unsafe partial class StgSharp
{
private static int _mainThreadID = -1;
internal const int ssdSegmentLength = 16;
static byte[] _currentHash;
private static bool _inited;
internal const int ssdSegmentLength = 16;
public static int MainThreadID
{
get => _mainThreadID == -1 ?
throw new InvalidOperationException("StgSharp environment is not inited. " +
"Main thread id is not available") :_mainThreadID;
}
private static int _mainThreadID = -1;
public static byte[] CurrentAssemblyHash
{
@@ -73,6 +67,13 @@ namespace StgSharp
}
}
public static int 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.
@@ -104,6 +105,8 @@ namespace StgSharp
vsyncActivated = value;
}
}
}
}//-------------------------------------- End of Class ---------------------------------------//
}
+37 -8
View File
@@ -1,4 +1,34 @@
using StgSharp.Graphics;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Monitors.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Graphics;
using System;
using System.Collections.Generic;
@@ -11,18 +41,19 @@ namespace StgSharp
{
public static partial class StgSharp
{
private unsafe static IntPtr[] monitorsArray;
private static unsafe IntPtr[] monitorsArray;
public static unsafe IntPtr[] MonitorsHandleArray
{
get
get
{
if (monitorsArray == null)
{
int count = 0;
IntPtr* arrayhandle = InternalIO.glfwGetMonitors(&count);
monitorsArray = new IntPtr[count];
Marshal.Copy((IntPtr)arrayhandle,monitorsArray,0,count);
Marshal.Copy((IntPtr)arrayhandle, monitorsArray, 0, count);
Marshal.FreeHGlobal((IntPtr)arrayhandle);
}
return monitorsArray;
@@ -31,11 +62,9 @@ namespace StgSharp
public static IntPtr DefaultMonitor
{
get
{
return MonitorsHandleArray[0];
}
get { return MonitorsHandleArray[0]; }
}
}
+7 -6
View File
@@ -75,8 +75,9 @@ namespace StgSharp
/// </summary>
public const long version = 430;
private static uint markCount = 0;
private static bool vsyncActivated;
private static uint markCount = 0;
internal static GraphicAPI API = default;
public static void Init()
@@ -96,6 +97,11 @@ namespace StgSharp
InternalIO.InternalWriteLog(ex.Message, LogType.Error);
}
public static void LogInfo(string log)
{
InternalIO.InternalWriteLog(log, LogType.Info);
}
public static void LogWarning(string log)
{
InternalIO.InternalWriteLog(log, LogType.Warning);
@@ -105,11 +111,6 @@ namespace StgSharp
InternalIO.InternalWriteLog(notVerySeriesException.Message, LogType.Warning);
}
public static void LogInfo(string log)
{
InternalIO.InternalWriteLog(log, LogType.Info);
}
public static void Mark(bool needConsole)
{
markCount++;
+13 -10
View File
@@ -28,7 +28,9 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Logic;
using StgSharp.Timing;
using System;
using System.Collections.Generic;
@@ -50,9 +52,10 @@ namespace StgSharp
public sealed class StgSharpTime : TimeSourceProviderBase
{
private static List<TimeSpanProvider> subscriberList = new List<TimeSpanProvider>();
private static long accuracy;
private static Stopwatch mainProvider = new Stopwatch();
private static List<TimeSpanProvider> subscriberList = new List<TimeSpanProvider>();
private static Thread timeProvideThread;
internal StgSharpTime()
@@ -90,6 +93,14 @@ namespace StgSharp
timeProvideThread.Start();
}
public override void StopProvidingTime()
{
lock (mainProvider)
{
mainProvider.Stop();
}
}
public void Terminate()
{
lock (mainProvider)
@@ -109,14 +120,6 @@ namespace StgSharp
subscriberList.Remove(subscriber);
}
public override void StopProvidingTime()
{
lock (mainProvider)
{
mainProvider.Stop();
}
}
private void ProvideTime()
{
long totalMS, internalFrequncy = Stopwatch.Frequency;
@@ -1,4 +1,34 @@
using System;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="globalKeyStat.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
@@ -10,7 +40,8 @@ namespace StgSharp
public static partial class StgSharp
{
private static ConcurrentDictionary<int, KeyStatus> keyListener
private static ConcurrentDictionary<int, KeyStatus> keyListener
= new ConcurrentDictionary<int, KeyStatus>();
public static KeyStatus CheckKey(KeyboardKey key)