Graphic mat 44 is now generic; TextRegex source gen will use goto instead of do{}while()
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="EBO"
|
||||
// Project: StgSharp
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace Nitload.Graphics.OpenGL
|
||||
{
|
||||
/// <summary>A set of OpenGL element-buffer handles.</summary>
|
||||
public sealed record class ElementBuffer(
|
||||
GlHandle[] Handles
|
||||
)
|
||||
{
|
||||
|
||||
public int Count => Handles.Length;
|
||||
|
||||
public GlHandle this[int index] => Handles[index];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="FBO"
|
||||
// Project: StgSharp
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace Nitload.Graphics.OpenGL
|
||||
{
|
||||
/// <summary>A set of OpenGL framebuffer handles.</summary>
|
||||
public sealed record class FrameBuffer(
|
||||
GlHandle[] Handles
|
||||
)
|
||||
{
|
||||
|
||||
public int Count => Handles.Length;
|
||||
|
||||
public GlHandle this[int index] => Handles[index];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="RBO"
|
||||
// Project: StgSharp
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace Nitload.Graphics.OpenGL
|
||||
{
|
||||
/// <summary>A set of OpenGL renderbuffer handles.</summary>
|
||||
public sealed record class RenderBuffer(
|
||||
GlHandle[] Handles
|
||||
)
|
||||
{
|
||||
|
||||
public int Count => Handles.Length;
|
||||
|
||||
public GlHandle this[int index] => Handles[index];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="TextureGL"
|
||||
// Project: StgSharp
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace Nitload.Graphics.OpenGL
|
||||
{
|
||||
/// <summary>A set of OpenGL texture handles.</summary>
|
||||
public sealed record class TextureGL(
|
||||
GlHandle[] Handles
|
||||
)
|
||||
{
|
||||
|
||||
public int Count => Handles.Length;
|
||||
|
||||
public GlHandle this[int index] => Handles[index];
|
||||
|
||||
}
|
||||
|
||||
public readonly record struct TextureProperty(
|
||||
TextureFilter FilterOnMagnify,
|
||||
TextureFilter FilterOnMinify,
|
||||
TextureWrap WrapOnHorizontal,
|
||||
TextureWrap WrapOnVertical
|
||||
);
|
||||
|
||||
#pragma warning disable CA1008
|
||||
public enum TextureFilter
|
||||
#pragma warning restore CA1008
|
||||
{
|
||||
|
||||
Nearest = glConst.NEAREST,
|
||||
Linear = glConst.LINEAR,
|
||||
NearestLinearMipmap = glConst.NEAREST_MIPMAP_LINEAR,
|
||||
LinearLinearMipmap = glConst.LINEAR_MIPMAP_LINEAR,
|
||||
NearestNearestMipmap = glConst.NEAREST_MIPMAP_NEAREST,
|
||||
LinearNearestMipmap = glConst.LINEAR_MIPMAP_NEAREST,
|
||||
|
||||
}
|
||||
|
||||
#pragma warning disable CA1008
|
||||
public enum TextureWrap
|
||||
#pragma warning restore CA1008
|
||||
{
|
||||
|
||||
Repeat = glConst.REPEAT,
|
||||
MirroredRepeat = glConst.MIRRORED_REPEAT,
|
||||
ClampToEdge = glConst.CLAMP_TO_EDGE,
|
||||
ClampToBorder = glConst.CLAMP_TO_BORDER,
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="VAO"
|
||||
// Project: StgSharp
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace Nitload.Graphics.OpenGL
|
||||
{
|
||||
/// <summary>A set of OpenGL vertex-array handles.</summary>
|
||||
public sealed record class VertexArray(
|
||||
GlHandle[] Handles
|
||||
)
|
||||
{
|
||||
|
||||
public int Count => Handles.Length;
|
||||
|
||||
public GlHandle this[int index] => Handles[index];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="VBO"
|
||||
// Project: StgSharp
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace Nitload.Graphics.OpenGL
|
||||
{
|
||||
/// <summary>A set of OpenGL vertex-buffer handles.</summary>
|
||||
public sealed record class VertexBuffer(
|
||||
GlHandle[] Handles
|
||||
)
|
||||
{
|
||||
|
||||
public int Count => Handles.Length;
|
||||
|
||||
public GlHandle this[int index] => Handles[index];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1783,9 +1783,12 @@ namespace Nitload.Graphics.OpenGL
|
||||
/// <para>See <see href="https://docs.gl/gl4/glUniform">docs.gl</see>.</para>
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform(int location, bool transpose, GraphicsMatrix value)
|
||||
public void Uniform(int location, bool transpose, GMatrix44<float> value)
|
||||
{
|
||||
__context->glUniformMatrix4fv(location, 1, transpose ? (byte)1 : (byte)0, (float*)&value);
|
||||
fixed (GMatrix44<float>* __value = &value)
|
||||
{
|
||||
__context->glUniformMatrix4fv(location, 1, transpose ? (byte)1 : (byte)0, (float*)__value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1794,9 +1797,9 @@ namespace Nitload.Graphics.OpenGL
|
||||
/// <para>See <see href="https://docs.gl/gl4/glUniform">docs.gl</see>.</para>
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform(int location, bool transpose, ReadOnlySpan<GraphicsMatrix> values)
|
||||
public void Uniform(int location, bool transpose, ReadOnlySpan<GMatrix44<float>> values)
|
||||
{
|
||||
fixed (GraphicsMatrix* __value = values)
|
||||
fixed (GMatrix44<float>* __value = values)
|
||||
{
|
||||
__context->glUniformMatrix4fv(location, values.Length, transpose ? (byte)1 : (byte)0, (float*)__value);
|
||||
}
|
||||
|
||||
@@ -631,9 +631,12 @@ namespace Nitload.Graphics.OpenGL
|
||||
/// <para>See <see href="https://docs.gl/gl4/glProgramUniform">docs.gl</see>.</para>
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ProgramUniform(GlHandle program, int location, bool transpose, GraphicsMatrix value)
|
||||
public void ProgramUniform(GlHandle program, int location, bool transpose, GMatrix44<float> value)
|
||||
{
|
||||
__context->glProgramUniformMatrix4fv(program.Value, location, 1, transpose ? (byte)1 : (byte)0, (float*)&value);
|
||||
fixed (GMatrix44<float>* __value = &value)
|
||||
{
|
||||
__context->glProgramUniformMatrix4fv(program.Value, location, 1, transpose ? (byte)1 : (byte)0, (float*)__value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -642,9 +645,9 @@ namespace Nitload.Graphics.OpenGL
|
||||
/// <para>See <see href="https://docs.gl/gl4/glProgramUniform">docs.gl</see>.</para>
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ProgramUniform(GlHandle program, int location, bool transpose, ReadOnlySpan<GraphicsMatrix> values)
|
||||
public void ProgramUniform(GlHandle program, int location, bool transpose, ReadOnlySpan<GMatrix44<float>> values)
|
||||
{
|
||||
fixed (GraphicsMatrix* __value = values)
|
||||
fixed (GMatrix44<float>* __value = values)
|
||||
{
|
||||
__context->glProgramUniformMatrix4fv(program.Value, location, values.Length, transpose ? (byte)1 : (byte)0, (float*)__value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user