daily update on 20240213 by nitload youmu. 逐步弃用GLFW,正在使用wgl重写glfw底层,相关实现转移到C#实现,SSC彻底变成线性代数计算器。
This commit is contained in:
@@ -21,6 +21,11 @@ namespace StgSharp.Graphics
|
||||
api = context;
|
||||
}
|
||||
|
||||
GLcontext* IglFunc.Context
|
||||
{
|
||||
get => api;
|
||||
}
|
||||
|
||||
void IglFunc.SwitchContext()
|
||||
{
|
||||
|
||||
@@ -104,11 +109,11 @@ namespace StgSharp.Graphics
|
||||
byte[] data = Encoding.UTF8.GetBytes(shaderCodeArray[i] + '\0');
|
||||
fixed (byte* codePtr = data)
|
||||
{
|
||||
shaderID = InternalIO.InternalLoadShaderCode(codePtr, (int)shaderType);
|
||||
shaderID = InternalIO.InternalLoadShaderCode(api, codePtr, (int)shaderType);
|
||||
}
|
||||
if (shaderID == 0) //compile error handler
|
||||
{
|
||||
IntPtr logPtr = InternalIO.InternalReadLog();
|
||||
IntPtr logPtr = InternalIO.InternalReadSSCLog();
|
||||
string log;
|
||||
try
|
||||
{
|
||||
@@ -326,6 +331,7 @@ namespace StgSharp.Graphics
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels)
|
||||
{
|
||||
Console.WriteLine(pixels);
|
||||
IntPtr source = GCHandle.Alloc(pixels, GCHandleType.Pinned).AddrOfPinnedObject();
|
||||
api->glTexImage2D(
|
||||
(uint)target, level, internalformat, width, height, 0, format, type, (void*)source
|
||||
|
||||
Reference in New Issue
Block a user