daily update on 20240209 by nitload youmu

This commit is contained in:
Nitload
2024-02-09 23:31:33 +08:00
parent 6fe6b3b3cf
commit 8391569482
159 changed files with 948 additions and 2431 deletions
@@ -4,6 +4,7 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@@ -13,15 +14,30 @@ namespace StgSharp.Graphics
{
internal unsafe partial class GLonUpdate : IglFunc
{
internal IntPtr ActiveTexturePtr = (IntPtr)(delegate*<void>)&InternalActiveTexture;
internal IntPtr AttachShaderPtr = (IntPtr)(delegate*<void>)&InternalAttachShader;
internal IntPtr BindBufferPtr = (IntPtr)(delegate*<void>)&InternalBindBuffer;
internal IntPtr ClearColorPtr = (IntPtr)(delegate*<void>)&InternalClearColor;
internal IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*<void>)&InternalClearGraphicError;
internal IntPtr CompileShaderPtr = (IntPtr)(delegate*<void>)&InternalCompileShader;
IntPtr BindTexturePtr = (IntPtr)(delegate*<void>)&InternalBindTexture;
IntPtr BindVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalBindVertexArray;
private IntPtr ActiveTexturePtr = (IntPtr)(delegate*<void>)&InternalActiveTexture;
private IntPtr AttachShaderPtr = (IntPtr)(delegate*<void>)&InternalAttachShader;
private IntPtr BindBufferPtr = (IntPtr)(delegate*<void>)&InternalBindBuffer;
private IntPtr ClearColorPtr = (IntPtr)(delegate*<void>)&InternalClearColor;
private IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*<void>)&InternalClearGraphicError;
private IntPtr CompileShaderPtr = (IntPtr)(delegate*<void>)&InternalCompileShader;
private IntPtr DeleBufferPtr = (IntPtr)(delegate*<void>)&InternalDeleteBuffer;
private IntPtr BindTexturePtr = (IntPtr)(delegate*<void>)&InternalBindTexture;
private IntPtr BindVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalBindVertexArray;
private IntPtr BufferDataPtr = (IntPtr)(delegate*<void>)&InternalSetBufferData;
private IntPtr ClearPtr = (IntPtr)(delegate*<void>)&InternalClear;
private IntPtr CreateProgramPtr = (IntPtr)(delegate*<void>)&InternalCreateProgram;
private IntPtr CreateProgramSetPtr = (IntPtr)(delegate*<void>)&InternalCreateProgramSet;
private IntPtr DeleteVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalDeleteVertexArrays;
private IntPtr DrawElementsPtr = (IntPtr)(delegate*<void>)&InternalDrawElements;
private IntPtr GenBufferPtr = (IntPtr)(delegate*<void>)&InternalGenBuffers;
private IntPtr GenTexturesPtr = (IntPtr)(delegate*<void>)&InternalGenTextures;
private IntPtr GenVertexArraysPtr = (IntPtr)(delegate*<void>)&InternalGenVertexArrays;
private IntPtr GetUniformLocationPtr = (IntPtr)(delegate*<void>)&InternalGetUniformLocation;
private IntPtr SetVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalSetVertexAttribute;
private IntPtr textureImage2dPtr = (IntPtr)(delegate*<void>)&InternalTextureImage2d;
private IntPtr TextureParameterPtr = (IntPtr)(delegate*<void>)&InternalTextureParameter;
private IntPtr UseProgramPtr = (IntPtr)(delegate*<void>)&InternalUseProgram;
private IntPtr ViewPortPtr = (IntPtr)(delegate*<void>)&InternalViewport;
private static void InternalActiveTexture()
{
@@ -46,9 +62,9 @@ namespace StgSharp.Graphics
private static void InternalBindTexture()
{
uint t, te;
paramQueue.TryDequeue(out t, out te);
paramQueue.context->glBindTexture(t, te);
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glBindTexture(m.UInt32[0], *(uint*)m.IntPtr1);
}
private static void InternalBindVertexArray()
@@ -121,17 +137,6 @@ namespace StgSharp.Graphics
}
}
private void InternalAfterAlign(Form form, Action action)
{
throw new NotImplementedException();
}
private void InternalAlignFrame(Form form)
{
throw new NotImplementedException();
}
IntPtr CreateProgramPtr = (IntPtr)(delegate*<void>)&InternalCreateProgram;
private static void InternalCreateProgram()
{
IntPtr programHandle = default;
@@ -139,8 +144,6 @@ namespace StgSharp.Graphics
*(uint*)programHandle = paramQueue.context->glCreateProgram();
}
IntPtr CreateProgramSetPtr = (IntPtr)(delegate*<void>)&InternalCreateProgramSet;
private static void InternalCreateProgramSet()
{
IntPtr programHandle;
@@ -153,8 +156,6 @@ namespace StgSharp.Graphics
}
}
internal IntPtr DeleBufferPtr = (IntPtr)(delegate*<void>)&InternalDeleteBuffer;
private static void InternalDeleteBuffer()
{
M128 m = default;
@@ -162,44 +163,101 @@ namespace StgSharp.Graphics
paramQueue.context->glDeleteBuffers(m.UInt32[2], (uint*)m.IntPtr0);
}
private void InternalDeleteVertexArrays(glHandleSet arrays)
private static void InternalDeleteVertexArrays()
{
throw new NotImplementedException();
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glDeleteVertexArrays((uint)m.Int32[0], (uint*)m.IntPtr1);
}
private void InternalDrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr)
private static void InternalDrawElements()
{
throw new NotImplementedException();
uint mode, count, type;
IntPtr ptr;
paramQueue.TryDequeue(out mode, out count, out type);
paramQueue.TryDequeue(out ptr);
paramQueue.context->glDrawElements(mode, count, type, (void*)ptr);
}
private void InternalGenBuffers(uint count, glHandleSet ptr)
private static void InternalGenBuffers()
{
throw new NotImplementedException();
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glGenBuffers(m.UInt32[2], (uint*)m.IntPtr0);
}
private void InternalGenTextures(uint count, glHandleSet ptr)
private static void InternalGenTextures()
{
throw new NotImplementedException();
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glGenTextures(m.UInt32[2], (uint*)m.IntPtr0);
}
private void InternalGenVertexArrays(uint count, glHandleSet ptr)
private static void InternalGenVertexArrays()
{
throw new NotImplementedException();
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glGenVertexArrays(m.UInt32[2], (uint*)m.IntPtr0);
}
private void InternalGetGraphicError()
private static void InternalGetUniformLocation()
{
throw new NotImplementedException();
IntPtr programHandle = default, nameHandle = default, targetHandle = default;
paramQueue.TryDequeue(out programHandle, out nameHandle);
paramQueue.TryDequeue(out targetHandle);
*(int*)targetHandle = paramQueue.context->glGetUniformLocation(*(uint*)programHandle, (byte*)nameHandle);
}
private int InternalGetUniformLocation(uint program, byte* ptr)
private static void InternalSetBufferData()
{
throw new NotImplementedException();
uint type = 0, use = 0;
IntPtr size = default, handle = default;
paramQueue.TryDequeue(out type, out use);
paramQueue.TryDequeue(out size, out handle);
paramQueue.context->glBufferData(type, size, (void*)handle, use);
GCHandle.FromIntPtr(handle).Free();
}
private bool InternalGetWindowShouldClose(Form form)
private static void InternalSetVertexAttribute()
{
throw new NotImplementedException();
uint index, type, stride;
int size, normalized, pointer;
paramQueue.TryDequeue(out index, out type, out stride);
paramQueue.TryDequeue(out size, out normalized, out pointer);
paramQueue.context->glVertexAttribPointer(index, size, type, normalized, stride, (void*)pointer);
paramQueue.context->glEnableVertexAttribArray(index);
}
private static void InternalTextureImage2d()
{
IntPtr pix = IntPtr.Zero;
uint target, level, internalFormat, width, height, format, type;
paramQueue.TryDequeue(out pix);
paramQueue.TryDequeue(out level, out internalFormat, out width, out height);
paramQueue.TryDequeue(out target, out format, out type);
paramQueue.context->glTexImage2D(target, (int)level, internalFormat, width, height, 0, format, type, (void*)pix);
GCHandle.FromIntPtr(pix).Free();
}
private static void InternalTextureParameter()
{
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glTextureParameteri(m.UInt32[0], m.UInt32[2], m.Int32[3]);
}
private static void InternalUseProgram()
{
IntPtr handle = IntPtr.Zero;
paramQueue.TryDequeue(out handle);
paramQueue.context->glUseProgram(*(uint*)handle);
}
private static void InternalViewport()
{
M128 m = default;
paramQueue.TryDequeue(out m);
paramQueue.context->glViewport(m.Int32[0], m.Int32[1], m.UInt32[2], m.UInt32[3]);
}
private void InternalMakeContexCurrent(Form form)
@@ -207,94 +265,14 @@ namespace StgSharp.Graphics
throw new NotImplementedException();
}
private void InternalSetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
{
throw new NotImplementedException();
}
private void InternalSetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
{
throw new NotImplementedException();
}
private void InternalSetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<float, float> uniform, float v0, float v1)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<float> uniform, float v0)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<int> uniform, int i0)
{
throw new NotImplementedException();
}
private void InternalSetValue(Uniform<Vec4d> uniform, Vec4d vec)
{
throw new NotImplementedException();
}
private void InternalSetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer)
{
throw new NotImplementedException();
}
private void InternalSetWindowShouldClose(Form form, bool mark)
{
throw new NotImplementedException();
}
private void InternalSwapBuffers(Form form)
{
throw new NotImplementedException();
}
private void InternalSwitchContext()
{
throw new NotImplementedException();
}
private void InternalTextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels)
{
throw new NotImplementedException();
}
private void InternalTextureParameter(uint target, uint pname, int param)
{
throw new NotImplementedException();
}
private void InternalUseProgram(uint program)
{
throw new NotImplementedException();
}
private void InternalViewport(int x, int y, uint width, uint height)
{
throw new NotImplementedException();
}
}
}