use modular initing system rather than calling Init() method.

This commit is contained in:
Youmu Liu
2025-11-11 18:22:28 +08:00
parent 678a846e54
commit 44bf78b937
65 changed files with 1328 additions and 1814 deletions
+6 -16
View File
@@ -26,18 +26,9 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Graphics.OpenGL;
using StgSharp.Internal;
using StgSharp.Mathematics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Graphics
{
@@ -56,13 +47,14 @@ namespace StgSharp.Graphics
internal Image(ImageInfo information)
{
_rawInfo = information;
_data = Array.Empty<byte>();
_data = [];
// int length = _rawInfo.width * _rawInfo.height * _rawInfo.channel;
}
public (int width, int height) Size
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => (_rawInfo.Width, _rawInfo.Height);
}
@@ -175,7 +167,10 @@ namespace StgSharp.Graphics
return _data;
}
public Image ProvideImage() => this;
public Image ProvideImage()
{
return this;
}
internal static Image FromMemory(ImageInfo info, byte[] data, int operationCount)
{
@@ -193,9 +188,4 @@ namespace StgSharp.Graphics
}
}
}
namespace StgSharp.Graphics.OpenGL
{
public static partial class GlHelper { }
}