New IO structure, unexpexted error in C code

This commit is contained in:
Nitload
2023-06-22 03:33:24 +08:00
parent 50b4965e54
commit ee8132c149
172 changed files with 1344 additions and 4023 deletions
+28 -9
View File
@@ -1,17 +1,31 @@
using StgSharp.Control;
using StgSharp.Graphics;
using StgSharp.Graphics.GL;
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp
{
public static unsafe class Graphic
public static unsafe partial class Graphic
{
public static unsafe void LoadGL()
{
GraphicIOPack GLpack = internalIO.InternalInitGraphicApi();
}
internal static byte[] loadShaderCodeStr(string str)
{
byte[] cahrStr;
try
{
cahrStr = System.Text.Encoding.ASCII.GetBytes(str);
return cahrStr;
}
catch (Exception)
{
throw;
}
}
/// <summary>
/// Init a form, attach its data to GLFW program,
/// and return the pointer of the GLFW package of the form.
@@ -22,7 +36,7 @@ namespace StgSharp
/// or GLAD program fail to init</exception>
public static unsafe IntPtr InitWindow(Form form)
{
IntPtr a= internalIO.InternalInitWindow(form.info);
IntPtr a = internalIO.InternalInitWindow(form.info);
if ((long)a == -1)
{
throw new Exception("Failed to init form.");
@@ -39,9 +53,14 @@ namespace StgSharp
public static unsafe void LoadForm(Form form)
{
ProgramTimeLine.allForm.Add(form);
TimeLine.allForm.Add(form);
}
public static unsafe bool ShouldFormClose(Form form)
{
int a = internalIO.InternalShouldFormClose(form.windowPtr);
return a != 0;
}
}
}