New IO structure, unexpexted error in C code
This commit is contained in:
@@ -1,25 +1,22 @@
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static unsafe partial class internalIO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initTriangle")]
|
||||
internal static unsafe extern triangleVertexArray initTriangleVertex();
|
||||
internal static extern unsafe triangleVertexArray initTriangleVertex();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initPolygon4")]
|
||||
internal static unsafe extern Polygon4VertexArray initPolygon4Vertex();
|
||||
internal static extern unsafe Polygon4VertexArray initPolygon4Vertex();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initPolygon5")]
|
||||
internal static unsafe extern Polygon5VertexArray initPolygon5Vertex();
|
||||
internal static extern unsafe Polygon5VertexArray initPolygon5Vertex();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "inputTriangle")]
|
||||
internal static unsafe extern void internalLoadTriangle(triangleVertexArray triangle);
|
||||
internal static extern unsafe void internalLoadTriangle(triangleVertexArray triangle);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,47 @@
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Graphics.GL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static partial class internalIO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "InitGL")]
|
||||
[DllImport("StgSharpGraphics.dll",
|
||||
EntryPoint = "loadGLApi", CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern GraphicIOPack InternalInitGraphicApi();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll",
|
||||
EntryPoint = "InitGL", CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void InternalInitGL();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "InitWindow")]
|
||||
[DllImport("StgSharpGraphics.dll",
|
||||
EntryPoint = "InitWindow", CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe IntPtr InternalInitWindow(formInfo win);
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "CompileShader")]
|
||||
internal static unsafe extern void InternalCompileShader
|
||||
[DllImport("StgSharpGraphics.dll",
|
||||
EntryPoint = "CompileShader", CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void InternalCompileShader
|
||||
(
|
||||
shaderObject* shaderObj
|
||||
);
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "RenderWindow")]
|
||||
internal static unsafe extern void InternalRenderWindow
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "SSGraphicShouldWindowClose",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe int InternalShouldFormClose(IntPtr formPtr);
|
||||
|
||||
[DllImport("StgSharpGraphics.dll",
|
||||
EntryPoint = "RenderWindow", CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void InternalRenderWindow
|
||||
(
|
||||
IntPtr window,
|
||||
IntPtr window,
|
||||
formInfo info,
|
||||
shaderObject* shaderObj
|
||||
);
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "TerminateWindow")]
|
||||
internal static unsafe extern void TerminateWindow(shaderObject* shaderObj);
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "TerminateWindow"
|
||||
, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void TerminateWindow(shaderObject* shaderObj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Control
|
||||
{
|
||||
internal delegate void InternalInitGLDelegate();
|
||||
internal delegate IntPtr InternalGLcreateWindowDelegate
|
||||
(int width, int height, char[] tittle, IntPtr monitor, IntPtr share);
|
||||
internal delegate void InternalGLmakeContextCurrent(IntPtr window);
|
||||
internal delegate void InternalGLswapInterval(int interval);
|
||||
internal delegate void InternalGLclearColorDelegate
|
||||
(float red, float green, float blue, float alpha);
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct GraphicIOPack
|
||||
{
|
||||
internal InternalInitGLDelegate InternalLoadGL;
|
||||
internal InternalGLcreateWindowDelegate InternalGLcreatWindow;
|
||||
internal InternalGLmakeContextCurrent InternalGLmakeContextCurrent;
|
||||
internal InternalGLswapInterval InternalGLswapInterval;
|
||||
internal InternalGLclearColorDelegate InternalGLclearColor;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Control
|
||||
{
|
||||
|
||||
public delegate int InitWindow(int width, int height);
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GraphicIOPack
|
||||
{
|
||||
public InitWindow initWindowPtr = default;
|
||||
|
||||
|
||||
|
||||
public GraphicIOPack()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user