daily update on 20240206 by nitload youmu, token parser change to use regex generator

This commit is contained in:
Nitload
2025-02-06 07:45:06 +08:00
parent 4e5a1b0dfb
commit 7d0470d50b
104 changed files with 2752 additions and 3134 deletions
@@ -43,7 +43,7 @@ namespace StgSharp.Graphics.OpenGL
{
/// <summary>
/// A collection of a sets of OpenGL textures. The collection can automatically select one of
/// the texture with minimum costs to upgrade pixels to buffer. Usually <see
/// the texture with minimum costs to upgrade pixels to Buffer. Usually <see
/// cref="AutoTextureGL" /> is used for <see cref="IImageProvider" /> loading, but not for
/// target of <see cref="OpenGLFunction.FrameBufferTexture2d(FrameBufferTarget, uint,
/// Texture2DTarget, GlHandle, int)" />.
@@ -35,6 +35,7 @@ using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@@ -62,11 +63,11 @@ namespace StgSharp.Graphics.OpenGL
}
public void SetValue<T>( int index, T[] bufferArray, BufferUsage usage )
where T: struct, IConvertible
where T: struct, INumber<T>
{
GL.BindBuffer(
BufferType.ElementArrayBuffer, _bufferHandle[ index ] );
GL.SetBufferData(
GL.SetBufferData<T>(
BufferType.ElementArrayBuffer, bufferArray, usage );
}
@@ -74,11 +75,11 @@ namespace StgSharp.Graphics.OpenGL
int index,
ReadOnlySpan<T> bufferSpan,
BufferUsage usage )
where T: struct, IConvertible
where T: struct, INumber<T>
{
GL.BindBuffer(
BufferType.ElementArrayBuffer, _bufferHandle[ index ] );
GL.SetBufferData( BufferType.ElementArrayBuffer, bufferSpan,
GL.SetBufferData<T>( BufferType.ElementArrayBuffer, bufferSpan,
usage );
}
@@ -63,7 +63,7 @@ namespace StgSharp.Graphics.OpenGL
}
/// <summary>
/// Bind the frame buffer object with _name frame buffer to the frame buffer target specified
/// Bind the frame Buffer object with _name frame Buffer to the frame Buffer target specified
/// by target. <see langword="FrameBufferTarget.All" /> will be set as default target.
/// </summary>
/// <param _name="index"> Index of object to be binded in handle set </param>
@@ -74,10 +74,10 @@ namespace StgSharp.Graphics.OpenGL
}
/// <summary>
/// Bind the frame buffer object with _name frame buffer to the frame buffer target specified
/// by target. Target of this frame buffer should be set manually.
/// Bind the frame Buffer object with _name frame Buffer to the frame Buffer target specified
/// by target. Target of this frame Buffer should be set manually.
/// </summary>
/// <param _name="target"> The frame buffer target of the binding operation. </param>
/// <param _name="target"> The frame Buffer target of the binding operation. </param>
/// <param _name="index"> Index of object to be binded in handle set </param>
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public unsafe void Bind( FrameBufferTarget target, int index )
@@ -28,7 +28,7 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Common.Internal.Intrinsic;
using StgSharp.Intrinsic;
using StgSharp.Internal.Intrinsic;
using StgSharp.Internal.OpenGL;
using StgSharp.Math;
@@ -33,6 +33,7 @@ using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Net.Security;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -64,7 +65,7 @@ namespace StgSharp.Graphics.OpenGL
}
/// <summary>
/// Set _data to current vertex buffer object
/// Set _data to current vertex Buffer object
/// </summary>
/// <typeparam _name="T"> Type of bufferData </typeparam>
/// <param _name="index"> Index to find certain VBO in this instance </param>
@@ -81,7 +82,7 @@ namespace StgSharp.Graphics.OpenGL
}
/// <summary>
/// Set _data to current vertex buffer object
/// Set _data to current vertex Buffer object
/// </summary>
/// <typeparam _name="T"> Type of bufferData </typeparam>
/// <param _name="index"> Index to find certain VBO in this instance </param>
@@ -91,19 +92,14 @@ namespace StgSharp.Graphics.OpenGL
int index,
T[] bufferArray,
BufferUsage usage )
where T: struct,
#if NET8_0_OR_GREATER
INumber
#else
IConvertible
#endif
where T: struct, INumber<T>
{
GL.BindBuffer( BufferType.ArrayBuffer, _bufferHandle[ index ] );
GL.SetBufferData( BufferType.ArrayBuffer, bufferArray, usage );
}
/// <summary>
/// Set _data to current vertex buffer object
/// Set _data to current vertex Buffer object
/// </summary>
/// <typeparam _name="T"> Type of bufferData </typeparam>
/// <param _name="index"> Index to find certain VBO in this instance </param>
@@ -113,19 +109,14 @@ namespace StgSharp.Graphics.OpenGL
int index,
ReadOnlySpan<T> scalerSpan,
BufferUsage usage )
where T: struct,
#if NET8_0_OR_GREATER
INumber
#else
IConvertible
#endif
where T: struct,INumber<T>
{
GL.BindBuffer( BufferType.ArrayBuffer, _bufferHandle[ index ] );
GL.SetBufferData( BufferType.ArrayBuffer, scalerSpan, usage );
}
/// <summary>
/// Set _data to current vertex buffer object
/// Set _data to current vertex Buffer object
/// </summary>
/// <typeparam _name="T"> Type of bufferData </typeparam>
/// <param _name="index"> Index to find certain VBO in this instance </param>
@@ -142,7 +133,7 @@ namespace StgSharp.Graphics.OpenGL
}
/// <summary>
/// Set _data to current vertex buffer object
/// Set _data to current vertex Buffer object
/// </summary>
/// <typeparam _name="T"> Type of bufferData </typeparam>
/// <param _name="index"> Index to find certain VBO in this instance </param>