New IO structure, unexpexted error in C code
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user