daily update on 20231016 by nitload youmu, vao,vbo,ebo struct added
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,9 +6,9 @@ namespace StgSharp
|
||||
public static unsafe partial class Geometry
|
||||
{
|
||||
public static unsafe Triangle InitTriagnle<T>(
|
||||
Vec3d vertex1,
|
||||
Vec3d vertex2,
|
||||
Vec3d vertex3
|
||||
vec3d vertex1,
|
||||
vec3d vertex2,
|
||||
vec3d vertex3
|
||||
) where T : Triangle
|
||||
{
|
||||
Triangle t = new Triangle();
|
||||
|
||||
@@ -328,6 +328,11 @@ namespace StgSharp
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, GLFWframebuffersizefun callback);
|
||||
|
||||
//window is the pointer to a glfwwindow instance
|
||||
[DllImport(SSGC_libname, EntryPoint = "glfwSetFramebufferSizeCallback",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHadler callback);
|
||||
|
||||
[DllImport(SSGC_libname, EntryPoint = "glfwSetErrorCallback",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
|
||||
|
||||
@@ -1,20 +1,74 @@
|
||||
|
||||
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal enum LogType
|
||||
{
|
||||
Error,
|
||||
Warning,
|
||||
Info,
|
||||
InfoError,
|
||||
InfoWarning,
|
||||
}
|
||||
|
||||
internal static unsafe partial class internalIO
|
||||
{
|
||||
|
||||
internal const string SSGC_libname =
|
||||
"StgSharpGraphic";
|
||||
|
||||
internal const string SSG_errorlog =
|
||||
"SSG_errorlog.log";
|
||||
|
||||
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
|
||||
{
|
||||
if (!File.Exists(internalIO.SSG_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(internalIO.SSG_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
|
||||
{
|
||||
logStream.WriteLine(beforeTime);
|
||||
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
|
||||
logStream.WriteLine(logLine);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InternalWriteLog(string logLine, LogType logType)
|
||||
{
|
||||
if (!File.Exists(internalIO.SSG_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(internalIO.SSG_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
|
||||
{
|
||||
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
|
||||
|
||||
logStream.WriteLine(logLine);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InternalAppendLog(string log)
|
||||
{
|
||||
if (!File.Exists(internalIO.SSG_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(internalIO.SSG_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
|
||||
{
|
||||
logStream.WriteLine(log);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@ namespace StgSharp
|
||||
public abstract class IEntity
|
||||
{
|
||||
internal Point _pos;
|
||||
internal LinkedList<IPlainGeometry> _collisionBox;
|
||||
internal Sensor<IPlainGeometry> _collisionSensor;
|
||||
internal LinkedList<PlainGeometry> _collisionBox;
|
||||
internal Sensor<PlainGeometry> _collisionSensor;
|
||||
internal string _texture;
|
||||
internal Point _position;
|
||||
internal Point _basePoint;
|
||||
internal GetLocationHandler _movHandler;
|
||||
protected uint _bornTick;
|
||||
|
||||
public LinkedList<IPlainGeometry> CollisionBox
|
||||
public LinkedList<PlainGeometry> CollisionBox
|
||||
{
|
||||
get { return _collisionBox; }
|
||||
set { _collisionBox = value; }
|
||||
@@ -23,7 +23,7 @@ namespace StgSharp
|
||||
/// <summary>
|
||||
/// A sensor used for cheking out if a bullet hit a player or something else
|
||||
/// </summary>
|
||||
public Sensor<IPlainGeometry> CollisionSensor
|
||||
public Sensor<PlainGeometry> CollisionSensor
|
||||
{
|
||||
get { return _collisionSensor; }
|
||||
set { _collisionSensor = value; }
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Arc : IPlainGeometry
|
||||
public class Arc : PlainGeometry
|
||||
{
|
||||
internal Point center;
|
||||
internal Point beginPoint;
|
||||
@@ -18,11 +18,13 @@ namespace StgSharp.Geometries
|
||||
|
||||
public override Point RefPoint2 => endPoint;
|
||||
|
||||
public virtual Vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
|
||||
internal override int[] Indices => throw new NotImplementedException();
|
||||
|
||||
public virtual Vec3d MovBegin(uint tick) => movBeginOperation.Invoke(tick);
|
||||
public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MovEnd(uint tick) => movEndOperation.Invoke(tick);
|
||||
public virtual vec3d MovBegin(uint tick) => movBeginOperation.Invoke(tick);
|
||||
|
||||
public virtual vec3d MovEnd(uint tick) => movEndOperation.Invoke(tick);
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Circle : IPlainGeometry
|
||||
public class Circle : PlainGeometry
|
||||
{
|
||||
internal Point center;
|
||||
internal Point pointOnCircle;
|
||||
@@ -19,11 +19,13 @@ namespace StgSharp.Geometries
|
||||
|
||||
public override Point RefPoint2 => pointOnPlain;
|
||||
|
||||
public virtual Vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
|
||||
internal override int[] Indices => throw new NotImplementedException();
|
||||
|
||||
public virtual Vec3d UpdateRadius(uint tick) => movBeginOperation.Invoke(tick);
|
||||
public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
|
||||
|
||||
public virtual Vec3d UpdatePlain(uint tick) => movEndOperation.Invoke(tick);
|
||||
public virtual vec3d UpdateRadius(uint tick) => movBeginOperation.Invoke(tick);
|
||||
|
||||
public virtual vec3d UpdatePlain(uint tick) => movEndOperation.Invoke(tick);
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算位移失量,需要手动输入游戏刻以提供时间数据
|
||||
/// Caculate the movement of a point.
|
||||
/// </summary>
|
||||
/// <param name="tick"></param>
|
||||
/// <returns>表示位移量的三维矢量</returns>
|
||||
public delegate Vec3d GetLocationHandler(uint tick);
|
||||
/// <param name="tick">The game tick represent time passed by</param>
|
||||
/// <returns>A 3d vector representing movement</returns>
|
||||
public delegate vec3d GetLocationHandler(uint tick);
|
||||
|
||||
public static unsafe class GeometryOperation
|
||||
{
|
||||
public static Vec3d DefualtMotion(uint tick)
|
||||
public static vec3d DefualtMotion(uint tick)
|
||||
{
|
||||
return default(Vec3d);
|
||||
return default(vec3d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Numerics;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Line : IPlainGeometry
|
||||
public class Line : PlainGeometry
|
||||
{
|
||||
internal Point basePoint;
|
||||
internal Point beginPoint;
|
||||
@@ -16,6 +16,11 @@ namespace StgSharp.Geometries
|
||||
public override Point RefPoint1 => endPoint;
|
||||
public override Point RefPoint2 => default;
|
||||
|
||||
internal override int[] Indices
|
||||
{
|
||||
get { throw new Exception(); }
|
||||
}
|
||||
|
||||
public Line(Point begin, Point end)
|
||||
{
|
||||
this.beginPoint = begin;
|
||||
@@ -31,11 +36,11 @@ namespace StgSharp.Geometries
|
||||
public Line() { }
|
||||
|
||||
//计算线起点的方法,通过对线的派生的重写实现功能
|
||||
public virtual Vec3d MoveBeginPoint(uint tick)
|
||||
public virtual vec3d MoveBeginPoint(uint tick)
|
||||
=> movBegin.Invoke(tick);
|
||||
|
||||
//计算线重点的方法,通过对线的派生的重写实现功能
|
||||
public virtual Vec3d MoveEndPoint(uint tick)
|
||||
public virtual vec3d MoveEndPoint(uint tick)
|
||||
=> movEnd.Invoke(tick);
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
|
||||
@@ -3,7 +3,7 @@ using StgSharp.Math;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
internal class Parallelogram : Polygon4
|
||||
public class Parallelogram : Polygon4
|
||||
{
|
||||
internal Point center;
|
||||
|
||||
@@ -11,13 +11,35 @@ namespace StgSharp.Geometries
|
||||
public sealed override Point RefPoint1 => new Point(vertexMat.mat.colum0);
|
||||
public sealed override Point RefPoint2 => new Point(vertexMat.mat.colum1);
|
||||
|
||||
internal readonly GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal readonly GetLocationHandler movCenterOperation =
|
||||
new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
|
||||
public GetLocationHandler MovCenterOperation { get { return movCenterOperation; } }
|
||||
public GetLocationHandler MovVertex01Operation { get { return moveVertex0Operation; } }
|
||||
public GetLocationHandler MovVertex02Operation { get { return moveVertex1Operation; } }
|
||||
|
||||
public virtual Vec3d MovCenter(uint tick)
|
||||
public Parallelogram(
|
||||
float v0x, float v0y, float v0z,
|
||||
float v1x, float v1y, float v1z,
|
||||
float v2x, float v2y, float v2z,
|
||||
float v3x, float v3y, float v3z
|
||||
) : base(
|
||||
v0x, v0y, v0z,
|
||||
v1x, v1y, v1z,
|
||||
v2x, v2y, v2z,
|
||||
v3x, v2y, v3z
|
||||
)
|
||||
{
|
||||
if (
|
||||
vertexMat.Colum0 + vertexMat.Colum2 !=
|
||||
vertexMat.Colum1 + vertexMat.Colum3
|
||||
)
|
||||
{
|
||||
internalIO.InternalWriteLog("Init of geometry item failed, because four vertices cannot form a rectangle.", LogType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual vec3d MovCenter(uint tick)
|
||||
{
|
||||
return movCenterOperation.Invoke(tick);
|
||||
}
|
||||
@@ -28,7 +50,7 @@ namespace StgSharp.Geometries
|
||||
/// <param name="tick">Current time tick</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="UnusedVertexException">Geometry overdefined</exception>
|
||||
public sealed override Vec3d MoveVertex2(uint tick)
|
||||
public sealed override vec3d MoveVertex2(uint tick)
|
||||
{
|
||||
throw new UnusedVertexException();
|
||||
}
|
||||
@@ -39,7 +61,7 @@ namespace StgSharp.Geometries
|
||||
/// <param name="tick">Current time tick</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="UnusedVertexException">Geometry overdefined</exception>
|
||||
public sealed override Vec3d MoveVertex3(uint tick)
|
||||
public sealed override vec3d MoveVertex3(uint tick)
|
||||
{
|
||||
throw new UnusedVertexException();
|
||||
}
|
||||
|
||||
@@ -5,22 +5,22 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public unsafe class Plain
|
||||
{
|
||||
internal Vec3d origin;
|
||||
internal Vec3d vec1;
|
||||
internal Vec3d vec2;
|
||||
internal vec3d origin;
|
||||
internal vec3d vec1;
|
||||
internal vec3d vec2;
|
||||
|
||||
internal Vec3d plainParameter;
|
||||
internal vec3d plainParameter;
|
||||
internal readonly float d = -1;
|
||||
|
||||
internal Plain(Vector4 origin, Vector4 p1, Vector4 p2)
|
||||
{
|
||||
this.origin = new Vec3d(origin);
|
||||
this.origin = new vec3d(origin);
|
||||
|
||||
vec1 = new Vec3d(p1 - origin);
|
||||
vec2 = new Vec3d(p2 - origin);
|
||||
vec1 = new vec3d(p1 - origin);
|
||||
vec2 = new vec3d(p2 - origin);
|
||||
}
|
||||
|
||||
public Plain(Vec3d o, Vec3d v1, Vec3d v2)
|
||||
public Plain(vec3d o, vec3d v1, vec3d v2)
|
||||
{
|
||||
this.origin = o;
|
||||
this.vec1 = v1 - v2 * (v1.Y / v2.Y); //计算平面在xz平面上的方向投影
|
||||
@@ -39,9 +39,9 @@ namespace StgSharp.Geometries
|
||||
|
||||
public Plain(Point p1, Point p2, Point p3)
|
||||
{
|
||||
Vec3d origin = p1.Position;
|
||||
Vec3d v1 = p2.Position - origin;
|
||||
Vec3d v2 = p3.Position - origin;
|
||||
vec3d origin = p1.Position;
|
||||
vec3d v1 = p2.Position - origin;
|
||||
vec3d v2 = p3.Position - origin;
|
||||
|
||||
|
||||
vec1 = v1 - v2 * (v1.Y / v2.Y); //计算平面在xz平面上的方向投影
|
||||
|
||||
+10
-5
@@ -1,10 +1,12 @@
|
||||
namespace StgSharp.Geometries
|
||||
using StgSharp.Math;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
/// </summary>
|
||||
public abstract class IPlainGeometry
|
||||
public abstract class PlainGeometry
|
||||
{
|
||||
protected readonly uint bornTick;
|
||||
internal readonly Point refOrigin;
|
||||
@@ -14,19 +16,22 @@
|
||||
public abstract Point RefPoint0 { get; }
|
||||
public abstract Point RefPoint1 { get; }
|
||||
public abstract Point RefPoint2 { get; }
|
||||
|
||||
public uint BornTime => bornTick;
|
||||
|
||||
public IPlainGeometry(uint bornTime)
|
||||
internal abstract int[] Indices { get; }
|
||||
|
||||
public PlainGeometry(uint bornTime)
|
||||
{
|
||||
bornTick = bornTime;
|
||||
}
|
||||
|
||||
public IPlainGeometry(Counter<uint> MainTimer)
|
||||
public PlainGeometry(Counter<uint> MainTimer)
|
||||
{
|
||||
bornTick = MainTimer.Value;
|
||||
}
|
||||
|
||||
public IPlainGeometry() { }
|
||||
public PlainGeometry() { }
|
||||
|
||||
|
||||
internal abstract void OnRender(uint tick);
|
||||
@@ -8,27 +8,27 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public unsafe class Point
|
||||
{
|
||||
internal Vec3d position;
|
||||
internal vec3d position;
|
||||
internal readonly bool isVertex;
|
||||
|
||||
public Point() { }
|
||||
|
||||
internal Point(Vec3d p)
|
||||
internal Point(vec3d p)
|
||||
{
|
||||
position = p;
|
||||
}
|
||||
|
||||
internal Point(Vector4 vector)
|
||||
{
|
||||
position = new Vec3d(vector);
|
||||
position = new vec3d(vector);
|
||||
}
|
||||
|
||||
public Point(float x, float y, float z)
|
||||
{
|
||||
position = new Vec3d(x, y, z);
|
||||
position = new vec3d(x, y, z);
|
||||
}
|
||||
|
||||
public Vec3d Position
|
||||
public vec3d Position
|
||||
{
|
||||
get { return position; }
|
||||
set { position = value; }
|
||||
@@ -64,12 +64,12 @@ namespace StgSharp.Geometries
|
||||
/// <param name="tick">Time passes since the program begin, counted by frames</param>
|
||||
public virtual void Update(uint tick) { }
|
||||
|
||||
public bool IsInGeometry(IPlainGeometry geo)
|
||||
public bool IsInGeometry(PlainGeometry geo)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool IsOnPlain(IPlainGeometry geo)
|
||||
public bool IsOnPlain(PlainGeometry geo)
|
||||
{
|
||||
return position * geo.GetPlain().plainParameter == 1;
|
||||
}
|
||||
|
||||
@@ -1,54 +1,102 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Math;
|
||||
using System.Numerics;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Polygon4 : IPlainGeometry
|
||||
public class Polygon4 : PlainGeometry
|
||||
{
|
||||
internal Matrix3x4 vertexMat;
|
||||
|
||||
internal Point vertex0 { get; set; }
|
||||
internal Point vertex1 { get; set; }
|
||||
internal Point vertex2 { get; set; }
|
||||
internal Point vertex3 { get; set; }
|
||||
|
||||
internal readonly GetLocationHandler moveVertex0Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal readonly GetLocationHandler moveVertex1Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal readonly GetLocationHandler moveVertex2Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal readonly GetLocationHandler moveVertex3Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
|
||||
internal Matrix3x4 vertexMat;
|
||||
|
||||
internal Polygon4()
|
||||
{
|
||||
}
|
||||
|
||||
public Polygon4(
|
||||
float v0x, float v0y, float v0z,
|
||||
float v1x, float v1y, float v1z,
|
||||
float v2x, float v2y, float v2z,
|
||||
float v3x, float v3y, float v3z
|
||||
)
|
||||
{
|
||||
vertexMat.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
|
||||
vertexMat.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
|
||||
vertexMat.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
|
||||
vertexMat.mat.colum3 = new Vector4(v3x, v3y, v3z, 0);
|
||||
}
|
||||
|
||||
public GetLocationHandler MovVertex0Operaion { get { return moveVertex0Operation; } }
|
||||
public GetLocationHandler MovVertex1Operaion { get { return moveVertex1Operation; } }
|
||||
public GetLocationHandler MovVertex2Operaion { get { return moveVertex2Operation; } }
|
||||
public GetLocationHandler MovVertex3Operaion { get { return moveVertex3Operation; } }
|
||||
|
||||
public override Point RefPoint0
|
||||
{
|
||||
get { return new Point(vertexMat.transpose.colum0); }
|
||||
get { return new Point(vertexMat.mat.colum0); }
|
||||
}
|
||||
|
||||
public override Point RefPoint1
|
||||
{
|
||||
get { return new Point(vertexMat.transpose.colum1); }
|
||||
get { return new Point(vertexMat.mat.colum1); }
|
||||
}
|
||||
|
||||
public override Point RefPoint2
|
||||
{
|
||||
get { return new Point(vertexMat.transpose.colum2); }
|
||||
get { return new Point(vertexMat.mat.colum2); }
|
||||
}
|
||||
|
||||
public GetLocationHandler MovVertex01Operaion { get { return moveVertex0Operation; } }
|
||||
public GetLocationHandler MovVertex02Operaion { get { return moveVertex1Operation; } }
|
||||
public GetLocationHandler MovVertex03Operaion { get { return moveVertex2Operation; } }
|
||||
public GetLocationHandler MovVertex04Operaion { get { return moveVertex3Operation; } }
|
||||
|
||||
public unsafe Polygon4()
|
||||
internal sealed override int[] Indices
|
||||
{
|
||||
get
|
||||
{
|
||||
return new int[6] {
|
||||
0,1,2,
|
||||
0,2,3};
|
||||
}
|
||||
}
|
||||
|
||||
public Mat4 VertexBuffer
|
||||
{
|
||||
get { return vertexMat.mat; }
|
||||
}
|
||||
|
||||
public Point Vertex0
|
||||
{
|
||||
get => new Point(vertexMat.mat.colum0);
|
||||
set { vertexMat.mat.colum0 = value.position.vec; }
|
||||
}
|
||||
|
||||
public Point Vertex1
|
||||
{
|
||||
get => new Point(vertexMat.mat.colum1);
|
||||
set { vertexMat.mat.colum1 = value.position.vec; }
|
||||
}
|
||||
|
||||
public Point Vertex2
|
||||
{
|
||||
get => new Point(vertexMat.mat.colum2);
|
||||
set { vertexMat.mat.colum1 = value.position.vec; }
|
||||
}
|
||||
|
||||
internal Point Vertex3
|
||||
{
|
||||
get => new Point(vertexMat.mat.colum3);
|
||||
set { vertexMat.mat.colum1 = value.position.vec; }
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
Line[] sides = new Line[4]
|
||||
{
|
||||
new Line(vertex0,vertex1),
|
||||
new Line(vertex1, vertex2),
|
||||
new Line(vertex2, vertex3),
|
||||
new Line(vertex3, vertex0)
|
||||
new Line(Vertex0, Vertex1),
|
||||
new Line(Vertex1, Vertex2),
|
||||
new Line(Vertex2, Vertex3),
|
||||
new Line(Vertex3, Vertex0)
|
||||
};
|
||||
|
||||
return sides;
|
||||
@@ -63,14 +111,17 @@ namespace StgSharp.Geometries
|
||||
vertexMat.mat.colum2);
|
||||
}
|
||||
|
||||
public virtual vec3d MoveVertex0(uint tick)
|
||||
=> moveVertex0Operation.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MoveVertex0(uint tick) => moveVertex0Operation.Invoke(tick);
|
||||
public virtual vec3d MoveVertex1(uint tick)
|
||||
=> moveVertex1Operation.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MoveVertex1(uint tick) => moveVertex1Operation.Invoke(tick);
|
||||
public virtual vec3d MoveVertex2(uint tick)
|
||||
=> moveVertex2Operation.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MoveVertex2(uint tick) => moveVertex2Operation.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MoveVertex3(uint tick) => moveVertex3Operation.Invoke(tick);
|
||||
public virtual vec3d MoveVertex3(uint tick)
|
||||
=> moveVertex3Operation.Invoke(tick);
|
||||
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
|
||||
@@ -1,30 +1,39 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.Math.Linear;
|
||||
using System.Numerics;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public unsafe class Polygon5 : IPlainGeometry
|
||||
public unsafe class Polygon5 : PlainGeometry
|
||||
{
|
||||
|
||||
internal Point _refOrigin;
|
||||
internal readonly Point vertex1;
|
||||
internal readonly Point vertex2;
|
||||
internal readonly Point vertex3;
|
||||
internal readonly Point vertex4;
|
||||
internal readonly Point vertex5;
|
||||
internal readonly int _vertexCount;
|
||||
|
||||
public override Point RefPoint0 => vertex1;
|
||||
|
||||
public override Point RefPoint1 => vertex2;
|
||||
|
||||
public override Point RefPoint2 => vertex3;
|
||||
|
||||
internal GetLocationHandler movP01Operation = default;
|
||||
internal GetLocationHandler movP02Operation = default;
|
||||
internal GetLocationHandler movP03Operation = default;
|
||||
internal GetLocationHandler movP04Operation = default;
|
||||
internal GetLocationHandler movP05Operation = default;
|
||||
internal mat5 vertexMat;
|
||||
|
||||
public unsafe Polygon5()
|
||||
{
|
||||
}
|
||||
|
||||
public Polygon5(
|
||||
float v0x, float v0y, float v0z,
|
||||
float v1x, float v1y, float v1z,
|
||||
float v2x, float v2y, float v2z,
|
||||
float v3x, float v3y, float v3z,
|
||||
float v4x, float v4y, float v4z
|
||||
)
|
||||
{
|
||||
vertexMat.vec0 = new Vector4(v0x, v0y, v0z, 0);
|
||||
vertexMat.vec1 = new Vector4(v1x, v1y, v1z, 0);
|
||||
vertexMat.vec2 = new Vector4(v2x, v2y, v2z, 0);
|
||||
vertexMat.vec3 = new Vector4(v3x, v3y, v3z, 0);
|
||||
vertexMat.vec4 = new Vector4(v4x, v4y, v4z, 0);
|
||||
}
|
||||
|
||||
|
||||
public GetLocationHandler MovP01Operation { get => movP01Operation; }
|
||||
public GetLocationHandler MovP02Operation { get => movP02Operation; }
|
||||
@@ -32,46 +41,91 @@ namespace StgSharp.Geometries
|
||||
public GetLocationHandler MovP04Operation { get => movP04Operation; }
|
||||
public GetLocationHandler MovP05Operation { get => movP05Operation; }
|
||||
|
||||
public unsafe Polygon5()
|
||||
public override Point RefPoint0 => Vertex0;
|
||||
public override Point RefPoint1 => Vertex1;
|
||||
public override Point RefPoint2 => Vertex2;
|
||||
|
||||
public mat5 VertexBuffer
|
||||
{
|
||||
get { return vertexMat; }
|
||||
}
|
||||
|
||||
public virtual Vec3d movPoint01(uint tick) => movP01Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual Vec3d movPoint02(uint tick) => movP02Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual Vec3d movPoint03(uint tick) => movP03Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual Vec3d movPoint04(uint tick) => movP04Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual Vec3d movPoint05(uint tick) => movP05Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
public Point Vertex0
|
||||
{
|
||||
uint nowTick = tick - BornTime;
|
||||
vertex1.Position = RefOrigin.Position + movPoint01(nowTick);
|
||||
vertex2.Position = RefOrigin.Position + movPoint02(nowTick);
|
||||
vertex3.Position = RefOrigin.Position + movPoint03(nowTick);
|
||||
vertex4.Position = RefOrigin.Position + movPoint04(nowTick);
|
||||
vertex5.Position = RefOrigin.Position + movPoint05(nowTick);
|
||||
get => new Point(vertexMat.vec0);
|
||||
set { vertexMat.vec0 = value.position.vec; }
|
||||
}
|
||||
|
||||
public Point Vertex1
|
||||
{
|
||||
get => new Point(vertexMat.vec1);
|
||||
set { vertexMat.vec1 = value.position.vec; }
|
||||
}
|
||||
|
||||
public Point Vertex2
|
||||
{
|
||||
get => new Point(vertexMat.vec2);
|
||||
set { vertexMat.vec2 = value.position.vec; }
|
||||
}
|
||||
|
||||
public Point Vertex3
|
||||
{
|
||||
get => new Point(vertexMat.vec3);
|
||||
set { vertexMat.vec3 = value.position.vec; }
|
||||
}
|
||||
|
||||
public Point Vertex4
|
||||
{
|
||||
get => new Point(vertexMat.vec4);
|
||||
set { vertexMat.vec4 = value.position.vec; }
|
||||
}
|
||||
|
||||
internal override int[] Indices
|
||||
{
|
||||
get
|
||||
{
|
||||
return new int[9]{
|
||||
0,1,2,
|
||||
0,2,3,
|
||||
0,3,4};
|
||||
}
|
||||
}
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
return new Line[5]
|
||||
{
|
||||
new Line(vertex1,vertex2),
|
||||
new Line(vertex2,vertex3),
|
||||
new Line(vertex3,vertex4),
|
||||
new Line(vertex4,vertex5),
|
||||
new Line(vertex5,vertex1)
|
||||
new Line(Vertex0,Vertex1),
|
||||
new Line(Vertex1,Vertex2),
|
||||
new Line(Vertex2,Vertex3),
|
||||
new Line(Vertex3,Vertex4),
|
||||
new Line(Vertex4,Vertex0)
|
||||
};
|
||||
}
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(vertex1, vertex2, vertex3);
|
||||
return new Plain(Vertex0, Vertex1, Vertex2);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex01(uint tick) => movP01Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movVertex02(uint tick) => movP02Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movVertex03(uint tick) => movP03Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movVertex04(uint tick) => movP04Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movVertex05(uint tick) => movP05Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
uint nowTick = tick - BornTime;
|
||||
vertexMat.vec0 = (RefOrigin.Position + movVertex01(nowTick)).vec;
|
||||
vertexMat.vec1 = (RefOrigin.Position + movVertex02(nowTick)).vec;
|
||||
vertexMat.vec2 = (RefOrigin.Position + movVertex03(nowTick)).vec;
|
||||
vertexMat.vec3 = (RefOrigin.Position + movVertex04(nowTick)).vec;
|
||||
vertexMat.vec4 = (RefOrigin.Position + movVertex05(nowTick)).vec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,97 +1,139 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.Math.Linear;
|
||||
using System.Numerics;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Polygon6 : IPlainGeometry
|
||||
public class Polygon6 : PlainGeometry
|
||||
{
|
||||
internal Point _refOrigin;
|
||||
internal Point vertex1;
|
||||
internal Point vertex2;
|
||||
internal Point vertex3;
|
||||
internal Point vertex4;
|
||||
internal Point vertex5;
|
||||
internal Point vertex6;
|
||||
internal readonly int _vertexCount;
|
||||
|
||||
public override Point RefPoint0 => vertex1;
|
||||
|
||||
public override Point RefPoint1 => vertex2;
|
||||
|
||||
public override Point RefPoint2 => vertex3;
|
||||
internal GetLocationHandler movVertex0Operation = default;
|
||||
internal GetLocationHandler movVertex1Operation = default;
|
||||
internal GetLocationHandler movVertex2Operation = default;
|
||||
internal GetLocationHandler movVertex3Operation = default;
|
||||
internal GetLocationHandler movVertex4Operation = default;
|
||||
internal GetLocationHandler movVertex5Operation = default;
|
||||
internal mat6 vertexMat;
|
||||
|
||||
|
||||
internal GetLocationHandler movP01Operation = default;
|
||||
internal GetLocationHandler movP02Operation = default;
|
||||
internal GetLocationHandler movP03Operation = default;
|
||||
internal GetLocationHandler movP04Operation = default;
|
||||
internal GetLocationHandler movP05Operation = default;
|
||||
internal GetLocationHandler movP06Operation = default;
|
||||
public GetLocationHandler MovVertex0Operation { get => movVertex0Operation; }
|
||||
public GetLocationHandler MovVertex1Operation { get => movVertex1Operation; }
|
||||
public GetLocationHandler MovVertex2Operation { get => movVertex2Operation; }
|
||||
public GetLocationHandler MovVertex3Operation { get => movVertex3Operation; }
|
||||
public GetLocationHandler MovVertex4Operation { get => movVertex4Operation; }
|
||||
public GetLocationHandler MovVertex5Operation { get => movVertex5Operation; }
|
||||
|
||||
public GetLocationHandler MovP01Operation { get => movP01Operation; }
|
||||
public GetLocationHandler MovP02Operation { get => movP02Operation; }
|
||||
public GetLocationHandler MovP03Operation { get => movP03Operation; }
|
||||
public GetLocationHandler MovP04Operation { get => movP04Operation; }
|
||||
public GetLocationHandler MovP05Operation { get => movP05Operation; }
|
||||
public GetLocationHandler MovP06Operation { get => movP06Operation; }
|
||||
public override Point RefPoint0 => Vertex0;
|
||||
public override Point RefPoint1 => Vertex1;
|
||||
public override Point RefPoint2 => Vertex2;
|
||||
|
||||
public virtual Vec3d movPoint01(uint tick)
|
||||
internal override int[] Indices
|
||||
{
|
||||
return movP01Operation.Invoke(TimeLine.tickCounter._value);
|
||||
get
|
||||
{
|
||||
return new int[12] {
|
||||
0,1,2,
|
||||
0,2,3,
|
||||
0,3,4,
|
||||
0,4,5};
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Vec3d movPoint02(uint tick)
|
||||
public Point Vertex0
|
||||
{
|
||||
return movP02Operation.Invoke(TimeLine.tickCounter._value);
|
||||
get => new Point(vertexMat.vec0);
|
||||
set { vertexMat.vec0 = value.position.vec; }
|
||||
}
|
||||
|
||||
public virtual Vec3d movPoint03(uint tick)
|
||||
public Point Vertex1
|
||||
{
|
||||
return movP03Operation.Invoke(TimeLine.tickCounter._value);
|
||||
get => new Point(vertexMat.vec1);
|
||||
set { vertexMat.vec1 = value.position.vec; }
|
||||
}
|
||||
|
||||
public virtual Vec3d movPoint04(uint tick)
|
||||
public Point Vertex2
|
||||
{
|
||||
return movP04Operation.Invoke(TimeLine.tickCounter._value);
|
||||
get => new Point(vertexMat.vec2);
|
||||
set { vertexMat.vec2 = value.position.vec; }
|
||||
}
|
||||
|
||||
public virtual Vec3d movPoint05(uint tick)
|
||||
public Point Vertex3
|
||||
{
|
||||
return movP05Operation.Invoke(TimeLine.tickCounter._value);
|
||||
get => new Point(vertexMat.vec3);
|
||||
set { vertexMat.vec3 = value.position.vec; }
|
||||
}
|
||||
|
||||
public virtual Vec3d movPoint06(uint tick)
|
||||
public Point Vertex4
|
||||
{
|
||||
return movP06Operation.Invoke(TimeLine.tickCounter._value);
|
||||
get => new Point(vertexMat.vec4);
|
||||
set { vertexMat.vec4 = value.position.vec; }
|
||||
}
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
public Point Vertex5
|
||||
{
|
||||
uint nowTick = tick - BornTime;
|
||||
vertex1.Position = RefOrigin.Position + movPoint01(nowTick);
|
||||
vertex2.Position = RefOrigin.Position + movPoint02(nowTick);
|
||||
vertex3.Position = RefOrigin.Position + movPoint03(nowTick);
|
||||
vertex4.Position = RefOrigin.Position + movPoint04(nowTick);
|
||||
vertex5.Position = RefOrigin.Position + movPoint05(nowTick);
|
||||
vertex6.Position = RefOrigin.Position + movPoint06(nowTick);
|
||||
get => new Point(vertexMat.vec5);
|
||||
set { vertexMat.vec5 = value.position.vec; }
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
return new Line[6]
|
||||
{
|
||||
new Line(vertex1,vertex2),
|
||||
new Line(vertex2,vertex3),
|
||||
new Line(vertex3,vertex4),
|
||||
new Line(vertex4,vertex5),
|
||||
new Line(vertex5,vertex6),
|
||||
new Line(vertex6,vertex1)
|
||||
new Line(Vertex0,Vertex1),
|
||||
new Line(Vertex1,Vertex2),
|
||||
new Line(Vertex2,Vertex3),
|
||||
new Line(Vertex3,Vertex4),
|
||||
new Line(Vertex4,Vertex5),
|
||||
new Line(Vertex5,Vertex0)
|
||||
};
|
||||
}
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(vertex1, vertex2, vertex3);
|
||||
return new Plain(Vertex0, Vertex1, Vertex2);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex0(uint tick)
|
||||
{
|
||||
return movVertex0Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex1(uint tick)
|
||||
{
|
||||
return movVertex1Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex2(uint tick)
|
||||
{
|
||||
return movVertex2Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex3(uint tick)
|
||||
{
|
||||
return movVertex3Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex4(uint tick)
|
||||
{
|
||||
return movVertex4Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movVertex5(uint tick)
|
||||
{
|
||||
return movVertex5Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
uint nowTick = tick - BornTime;
|
||||
Vector4 origin = RefOrigin.Position.vec;
|
||||
vertexMat.vec0 = origin + movVertex0(nowTick).vec;
|
||||
vertexMat.vec1 = origin + movVertex1(nowTick).vec;
|
||||
vertexMat.vec2 = origin + movVertex2(nowTick).vec;
|
||||
vertexMat.vec3 = origin + movVertex3(nowTick).vec;
|
||||
vertexMat.vec4 = origin + movVertex4(nowTick).vec;
|
||||
vertexMat.vec5 = origin + movVertex5(nowTick).vec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,27 +3,28 @@ using System.Numerics;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Rectangle : Polygon4
|
||||
public class Rectangle : Parallelogram
|
||||
{
|
||||
internal Point center;
|
||||
|
||||
public sealed override Point RefPoint0 => center;
|
||||
|
||||
public sealed override Point RefPoint1 => new Point(vertexMat.transpose.colum0);
|
||||
|
||||
public sealed override Point RefPoint2 => new Point(vertexMat.transpose.colum1);
|
||||
|
||||
public Rectangle(
|
||||
float v0x, float v0y, float v0z,
|
||||
float v1x, float v1y, float v1z,
|
||||
float v2x, float v2y, float v2z,
|
||||
float v3x, float v3y, float v3z
|
||||
)
|
||||
) : base(
|
||||
v0x, v0y, v0z,
|
||||
v1x, v1y, v1z,
|
||||
v2x, v2y, v2z,
|
||||
v3x, v2y, v3z
|
||||
)
|
||||
{
|
||||
vertexMat.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
|
||||
vertexMat.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
|
||||
vertexMat.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
|
||||
vertexMat.mat.colum3 = new Vector4(v3x, v3y, v3z, 0);
|
||||
vec3d side0 = vertexMat.Colum0 - vertexMat.Colum1;
|
||||
vec3d side1 = vertexMat.Colum2 - vertexMat.Colum1;
|
||||
if (side0.Cross(side1) == Vec3d.Zero)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,25 +34,9 @@ namespace StgSharp.Geometries
|
||||
/// </summary>
|
||||
/// <param name="tick">当前游戏刻</param>
|
||||
/// <returns></returns>
|
||||
public virtual Vec3d MovCenter(uint tick) => default(Vec3d);
|
||||
public virtual vec3d MovCenter(uint tick) => default(vec3d);
|
||||
|
||||
public sealed override Vec3d MoveVertex2(uint tick)
|
||||
{
|
||||
return
|
||||
new Vec3d(this.center.position.vec * 2 - vertexMat.mat.colum0);
|
||||
}
|
||||
|
||||
public sealed override Vec3d MoveVertex3(uint tick)
|
||||
{
|
||||
return
|
||||
new Vec3d(this.center.position.vec * 2 - vertexMat.mat.colum1);
|
||||
}
|
||||
|
||||
internal sealed override void OnRender(uint tick)
|
||||
{
|
||||
tick -= bornTick;
|
||||
this.MovCenter(tick);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
}
|
||||
|
||||
public sealed override Vec3d MoveVertex1(uint tick)
|
||||
public sealed override vec3d MoveVertex1(uint tick)
|
||||
{
|
||||
return this.center.Position * 2 - this.vertexMat.Colum0;
|
||||
}
|
||||
|
||||
@@ -6,43 +6,29 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
|
||||
public unsafe class Triangle : IPlainGeometry
|
||||
public unsafe class Triangle : PlainGeometry
|
||||
{
|
||||
|
||||
internal Matrix3x3 vertexMap;
|
||||
|
||||
internal GetLocationHandler movVertex01Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal GetLocationHandler movVertex02Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal GetLocationHandler movVertex03Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
|
||||
public sealed override Point RefPoint0 => new Point(vertexMap.mat.colum0);
|
||||
public sealed override Point RefPoint1 => new Point(vertexMap.mat.colum1);
|
||||
public sealed override Point RefPoint2 => new Point(vertexMap.mat.colum2);
|
||||
|
||||
public GetLocationHandler MovVertex01Operation => this.movVertex01Opearion;
|
||||
public GetLocationHandler MovVertex02Operation => this.movVertex02Opearion;
|
||||
public GetLocationHandler MovVertex03Operation => this.movVertex03Opearion;
|
||||
|
||||
public virtual Vec3d MovVertex01(uint tick) => movVertex01Opearion.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MovVertex02(uint tick) => movVertex02Opearion.Invoke(tick);
|
||||
|
||||
public virtual Vec3d MovVertex03(uint tick) => movVertex03Opearion.Invoke(tick);
|
||||
internal Matrix3x3 vertexMat;
|
||||
|
||||
public Triangle()
|
||||
{
|
||||
vertexMap = new Matrix3x3();
|
||||
vertexMat = new Matrix3x3();
|
||||
}
|
||||
|
||||
public Triangle(
|
||||
Vec3d vertex01,
|
||||
Vec3d vertex02,
|
||||
Vec3d vertex03
|
||||
vec3d vertex01,
|
||||
vec3d vertex02,
|
||||
vec3d vertex03
|
||||
)
|
||||
{
|
||||
vertexMap.mat.colum0 = vertex01.vec;
|
||||
vertexMap.mat.colum1 = vertex02.vec;
|
||||
vertexMap.mat.colum2 = vertex03.vec;
|
||||
vertexMat.mat.colum0 = vertex01.vec;
|
||||
vertexMat.mat.colum1 = vertex02.vec;
|
||||
vertexMat.mat.colum2 = vertex03.vec;
|
||||
}
|
||||
|
||||
public Triangle(
|
||||
@@ -51,26 +37,35 @@ namespace StgSharp.Geometries
|
||||
float v2x, float v2y, float v2z
|
||||
)
|
||||
{
|
||||
vertexMap.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
|
||||
vertexMap.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
|
||||
vertexMap.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
|
||||
vertexMat.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
|
||||
vertexMat.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
|
||||
vertexMat.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
|
||||
}
|
||||
|
||||
internal sealed override void OnRender(uint tick)
|
||||
public GetLocationHandler MovVertex01Operation => this.movVertex01Opearion;
|
||||
public GetLocationHandler MovVertex02Operation => this.movVertex02Opearion;
|
||||
public GetLocationHandler MovVertex03Operation => this.movVertex03Opearion;
|
||||
public sealed override Point RefPoint0 => new Point(vertexMat.mat.colum0);
|
||||
public sealed override Point RefPoint1 => new Point(vertexMat.mat.colum1);
|
||||
public sealed override Point RefPoint2 => new Point(vertexMat.mat.colum2);
|
||||
|
||||
public Mat3 VertexBuffer
|
||||
{
|
||||
tick -= this.bornTick;
|
||||
vertexMap.mat.colum0 = RefOrigin.Position.vec + MovVertex01(tick).vec;
|
||||
vertexMap.mat.colum1 = RefOrigin.Position.vec + MovVertex02(tick).vec;
|
||||
vertexMap.mat.colum2 = RefOrigin.Position.vec + MovVertex03(tick).vec;
|
||||
get { return vertexMat.mat; }
|
||||
}
|
||||
|
||||
internal sealed override int[] Indices
|
||||
{
|
||||
get { return new int[3] { 0, 1, 2 }; }
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
Line[] sides = new Line[3]
|
||||
{
|
||||
new Line(vertexMap.mat.colum0,vertexMap.mat.colum1),
|
||||
new Line(vertexMap.mat.colum1,vertexMap.mat.colum2),
|
||||
new Line(vertexMap.mat.colum2,vertexMap.mat.colum0)
|
||||
new Line(vertexMat.mat.colum0,vertexMat.mat.colum1),
|
||||
new Line(vertexMat.mat.colum1,vertexMat.mat.colum2),
|
||||
new Line(vertexMat.mat.colum2,vertexMat.mat.colum0)
|
||||
};
|
||||
|
||||
return sides;
|
||||
@@ -78,8 +73,20 @@ namespace StgSharp.Geometries
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(this.vertexMap.mat.colum0, this.vertexMap.mat.colum1, this.vertexMap.mat.colum2);
|
||||
return new Plain(this.vertexMat.mat.colum0, this.vertexMat.mat.colum1, this.vertexMat.mat.colum2);
|
||||
}
|
||||
|
||||
public virtual vec3d MovVertex01(uint tick) => movVertex01Opearion.Invoke(tick);
|
||||
|
||||
public virtual vec3d MovVertex02(uint tick) => movVertex02Opearion.Invoke(tick);
|
||||
|
||||
public virtual vec3d MovVertex03(uint tick) => movVertex03Opearion.Invoke(tick);
|
||||
internal sealed override void OnRender(uint tick)
|
||||
{
|
||||
tick -= this.bornTick;
|
||||
vertexMat.mat.colum0 = RefOrigin.Position.vec + MovVertex01(tick).vec;
|
||||
vertexMat.mat.colum1 = RefOrigin.Position.vec + MovVertex02(tick).vec;
|
||||
vertexMat.mat.colum2 = RefOrigin.Position.vec + MovVertex03(tick).vec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal unsafe struct ElementBuffer : IDisposable
|
||||
{
|
||||
uint _bufferID;
|
||||
|
||||
public ElementBuffer(int n)
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glGenBuffers(n, id);
|
||||
}
|
||||
}
|
||||
|
||||
public void Bind()
|
||||
{
|
||||
Graphic.glBindBuffer(GLFW.GL_ELEMENT_ARRAY_BUFFER, _bufferID);
|
||||
}
|
||||
|
||||
public void SetData<T>(T bufferData, BufferReadType readType) where T : IMat
|
||||
{
|
||||
int size = Marshal.SizeOf(bufferData);
|
||||
Graphic.glBufferData(
|
||||
(int)BufferType.ELEMENT_ARRAY_BUFFER,
|
||||
size,
|
||||
&bufferData,
|
||||
(int)readType);
|
||||
}
|
||||
|
||||
public void SetData<T>(T[] bufferArray, BufferReadType readType) where T : struct, IConvertible
|
||||
{
|
||||
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
|
||||
fixed (void* bufferPtr = &bufferArray[0])
|
||||
Graphic.glBufferData(
|
||||
(int)BufferType.ELEMENT_ARRAY_BUFFER,
|
||||
size,
|
||||
bufferPtr,
|
||||
(int)readType);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glDeleteBuffers(1, id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace StgSharp.Graphics
|
||||
|
||||
using _glfw = _GLFWlibrary;
|
||||
|
||||
public static unsafe partial class GLFW
|
||||
internal static unsafe class GLFW
|
||||
{
|
||||
internal static _glfw glfw = new _glfw();
|
||||
|
||||
@@ -2045,4 +2045,31 @@ namespace StgSharp.Graphics
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public enum ShaderType : int
|
||||
{
|
||||
FRAGMENT = 0x8B30,
|
||||
VERTEX = 0x8B31
|
||||
}
|
||||
|
||||
public enum BufferType : int
|
||||
{
|
||||
ARRAY_BUFFER = 0x8892,
|
||||
ELEMENT_ARRAY_BUFFER = 0x8893,
|
||||
ARRAY_BUFFER_BINDING = 0x8894
|
||||
}
|
||||
|
||||
public enum BufferReadType : int
|
||||
{
|
||||
STREAM_DRAW = 0x88E0,
|
||||
STREAM_READ = 0x88E1,
|
||||
STREAM_COPY = 0x88E2,
|
||||
STATIC_DRAW = 0x88E4,
|
||||
STATIC_READ = 0x88E5,
|
||||
STATIC_COPY = 0x88E6,
|
||||
DYNAMIC_DRAW = 0x88E8,
|
||||
DYNAMIC_READ = 0x88E9,
|
||||
DYNAMIC_COPY = 0x88EA
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Graphics.GL
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct shaderObject
|
||||
{
|
||||
uint VBO;
|
||||
uint VAO;
|
||||
uint shaderProgram;
|
||||
}
|
||||
}
|
||||
+134
-62
@@ -1,16 +1,95 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public static unsafe partial class Graphic
|
||||
{
|
||||
/// <summary>
|
||||
/// sets the framebuffer resize callback of the specified <see cref="Form"/>,
|
||||
///which is called when the framebuffer of the specified <see cref="Form"/> is resized.
|
||||
/// </summary>
|
||||
/// <param name="form">The Form instance to be controlled</param>
|
||||
/// <param name="handler">Method hadler </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void SetFrameBufferSizeCallback(Form form, FrameBufferSizeHadler handler)
|
||||
{
|
||||
internalIO.glfwSetFramebufferSizeCallback(form.windowID, handler);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Call glClearColor in OpenGL
|
||||
/// specifies the red, green, blue, and alpha values used by glClear to clear the color buffers.
|
||||
/// Values specified by glClearColor are clamped to the range [0,1]
|
||||
/// </summary>
|
||||
/// <param name="R">Specify the red values used when the color buffers are cleared.</param>
|
||||
/// <param name="G">Specify the red values used when the color buffers are cleared.</param>
|
||||
/// <param name="B">Specify the red values used when the color buffers are cleared.</param>
|
||||
/// <param name="A">Specify the red values used when the color buffers are cleared.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
glClearColor(R, G, B, A);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Conpile the provided shader code in string form.
|
||||
/// </summary>
|
||||
/// <param name="shaderCode">A string represent the shader's code</param>
|
||||
/// <param name="shaderType">An <see cref="ShaderType"/> enum represent the type of the shader to
|
||||
/// conpile, including vertex shader and fragment shader.</param>
|
||||
/// <returns>An uint value as the only mark of conpiled shader</returns>
|
||||
public static unsafe uint CompileShader(string shaderCode, ShaderType shaderType)
|
||||
{
|
||||
uint shaderID;
|
||||
shaderCode += '\0';
|
||||
byte[] buffer = Encoding.ASCII.GetBytes(shaderCode);
|
||||
fixed (byte* data = &buffer[0])
|
||||
{
|
||||
shaderID = internalIO.InternalLoadShaderCode(data, (int)shaderType);
|
||||
}
|
||||
if (shaderID == 0)
|
||||
{
|
||||
IntPtr logPtr = internalIO.InternalReadLog();
|
||||
string log;
|
||||
try
|
||||
{
|
||||
byte[] logByte = new byte[512];
|
||||
Marshal.Copy(logPtr, logByte, 0, 512);
|
||||
log = Encoding.UTF8.GetString(logByte);
|
||||
log = log.Replace("\0", "");
|
||||
|
||||
bool isUseful = false;
|
||||
foreach (char item in log)
|
||||
{
|
||||
if (!char.IsControl(item))
|
||||
{
|
||||
isUseful = true; break;
|
||||
}
|
||||
}
|
||||
if (!isUseful)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
log = "Failed to compile shader.\nFailed to get GLSL compiler log";
|
||||
|
||||
}
|
||||
|
||||
internalIO.InternalWriteLog(log, LogType.Error);
|
||||
|
||||
}
|
||||
return shaderID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a form and its associated context.
|
||||
@@ -22,7 +101,7 @@ namespace StgSharp
|
||||
/// <param name="share"></param>
|
||||
/// <returns>The instance of created form</returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static unsafe Form GLcreateWindow(
|
||||
public static unsafe Form CreateWindow(
|
||||
int width, int height, string tittle, IntPtr monitor, Form share)
|
||||
{
|
||||
byte[] tittleBytes = Encoding.UTF8.GetBytes(tittle);
|
||||
@@ -30,7 +109,7 @@ namespace StgSharp
|
||||
if (share == null)
|
||||
{
|
||||
windowPtr = internalIO.glfwCreateWindow(
|
||||
800, 600, tittleBytes, monitor, IntPtr.Zero);
|
||||
width, height, tittleBytes, monitor, IntPtr.Zero);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -52,71 +131,64 @@ namespace StgSharp
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a window and its associated context.
|
||||
/// </summary>
|
||||
/// <param name="width">Required width</param>
|
||||
/// <param name="height">Required width</param>
|
||||
/// <param name="tittle">Tittle of the window </param>
|
||||
/// <param name="monitor"></param>
|
||||
/// <param name="share"></param>
|
||||
/// <returns>The handle of created window</returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static unsafe Form GLcreateWindow(int width, int height, string tittle, IntPtr monitor, IntPtr share)
|
||||
|
||||
public static unsafe uint CreatGraphicProgram()
|
||||
{
|
||||
byte[] tittleCharArray = System.Text.Encoding.UTF8.GetBytes(tittle);
|
||||
IntPtr windowPtr = internalIO.glfwCreateWindow
|
||||
(width, height, tittleCharArray, monitor, share);
|
||||
|
||||
if ((int)windowPtr == -1 || (int)windowPtr == -2)
|
||||
{
|
||||
throw new Exception("Cannot create the form!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Form form = new Form();
|
||||
form.Size = new Vec2d(width, height);
|
||||
form.windowID = windowPtr;
|
||||
return form;
|
||||
}
|
||||
return glCreateProgram();
|
||||
}
|
||||
|
||||
|
||||
public static unsafe void GLmakeContexCurrent(Form form)
|
||||
{
|
||||
internalIO.glfwMakeContextCurrent(form.windowID);
|
||||
}
|
||||
|
||||
|
||||
public static unsafe bool GLwindowShouldClose(Form form)
|
||||
{
|
||||
int a = internalIO.glfwWindowShouldClose(form.windowID);
|
||||
return a != 0;
|
||||
}
|
||||
|
||||
|
||||
public static unsafe void GLswapBuffers(Form form)
|
||||
{
|
||||
internalIO.glfwSwapBuffers(form.windowID);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static IntPtr GetProcAddress(string name)
|
||||
{
|
||||
IntPtr ret = internalIO.glfwGetProcAddress(name);
|
||||
if (ret == IntPtr.Zero)
|
||||
{
|
||||
#if DEBUG
|
||||
Console.WriteLine(name);
|
||||
#endif
|
||||
return internalIO.glfwGetProcAddress(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static unsafe bool GetWindowShouldClose(Form form)
|
||||
{
|
||||
return internalIO.glfwWindowShouldClose(form.windowID) != 0;
|
||||
}
|
||||
|
||||
public static unsafe void GLswapBuffers(Form form)
|
||||
{
|
||||
if (form.windowID == IntPtr.Zero)
|
||||
{
|
||||
return;
|
||||
}
|
||||
internalIO.glfwSwapBuffers(form.windowID);
|
||||
}
|
||||
|
||||
public static unsafe void MakeContexCurrent(Form form)
|
||||
{
|
||||
if (form.windowID == IntPtr.Zero)
|
||||
{
|
||||
return;
|
||||
}
|
||||
internalIO.glfwMakeContextCurrent(form.windowID);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetBufferData<T>(BufferType bufferType, T bufferData, BufferReadType readType) where T : IMat
|
||||
{
|
||||
int size = Marshal.SizeOf(bufferData);
|
||||
glBufferData(
|
||||
(int)bufferType,
|
||||
size,
|
||||
&bufferData,
|
||||
(int)readType);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferReadType readType) where T : struct, IConvertible
|
||||
{
|
||||
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
|
||||
fixed (void* bufferPtr = &bufferArray[0])
|
||||
glBufferData(
|
||||
(int)bufferType,
|
||||
size,
|
||||
bufferPtr,
|
||||
(int)readType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+731
-708
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,8 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Graphics;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public static unsafe partial class Graphic
|
||||
{
|
||||
@@ -39,7 +38,7 @@ namespace StgSharp
|
||||
/// and before other graphic method.
|
||||
/// </summary>
|
||||
/// <exception cref="Exception">The accident that program cannot attach GLFW to GLAD</exception>
|
||||
public static unsafe void InitGLAD(glLoader loader)
|
||||
public static unsafe void InitGLManager(glLoader loader)
|
||||
{
|
||||
|
||||
if (!isGLADset)
|
||||
@@ -63,13 +62,6 @@ namespace StgSharp
|
||||
throw new Exception("Do not init GLAD twice.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics.SSG
|
||||
{
|
||||
internal class Buffer
|
||||
{
|
||||
BufferType type;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal class Shader
|
||||
{
|
||||
public readonly uint programID;
|
||||
internal uint vertexShaderID;
|
||||
internal uint fragmentShaderID;
|
||||
|
||||
public Shader()
|
||||
{
|
||||
programID = Graphic.glCreateProgram();
|
||||
}
|
||||
|
||||
public void CompileVertexShader(string shaderCode)
|
||||
{
|
||||
vertexShaderID = Graphic.CompileShader(shaderCode, ShaderType.VERTEX);
|
||||
Graphic.glAttachShader(programID, vertexShaderID);
|
||||
}
|
||||
|
||||
public void CompileFragmentShader(string shaderCode)
|
||||
{
|
||||
fragmentShaderID = Graphic.CompileShader(shaderCode, ShaderType.FRAGMENT);
|
||||
Graphic.glAttachShader(programID, fragmentShaderID);
|
||||
}
|
||||
|
||||
public void Link()
|
||||
{
|
||||
if (internalIO.InternalLinkShaderProgram(programID) == 0)
|
||||
{
|
||||
IntPtr logPtr = internalIO.InternalReadLog();
|
||||
try
|
||||
{
|
||||
byte[] logByte = new byte[512];
|
||||
Marshal.Copy(logPtr, logByte, 0, 512);
|
||||
string log = Encoding.UTF8.GetString(logByte);
|
||||
log = log.Replace("\0", "");
|
||||
internalIO.InternalWriteLog(log, LogType.Error);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Use()
|
||||
{
|
||||
Graphic.glUseProgram(programID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal unsafe struct VertexArray : IDisposable
|
||||
{
|
||||
internal uint _bufferID;
|
||||
|
||||
public VertexArray()
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glGenVertexArrays(1, id);
|
||||
}
|
||||
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, _bufferID);
|
||||
}
|
||||
|
||||
public VertexArray(int n)
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glGenVertexArrays(n, id);
|
||||
}
|
||||
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, _bufferID);
|
||||
}
|
||||
|
||||
public void Bind()
|
||||
{
|
||||
Graphic.glBindVertexArray(_bufferID);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glDeleteVertexArrays(1, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public unsafe struct VertexBuffer : IDisposable
|
||||
{
|
||||
internal uint _bufferID;
|
||||
|
||||
public VertexBuffer(int n)
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glGenBuffers(n, id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public uint BufferID
|
||||
{
|
||||
get { return _bufferID; }
|
||||
}
|
||||
public void Bind()
|
||||
{
|
||||
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, _bufferID);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
fixed (uint* id = &_bufferID)
|
||||
{
|
||||
Graphic.glDeleteBuffers(1, id);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetData<T>(T bufferData, BufferReadType readType) where T : IMat
|
||||
{
|
||||
int size = Marshal.SizeOf(bufferData);
|
||||
Graphic.glBufferData(
|
||||
(int)BufferType.ARRAY_BUFFER,
|
||||
size,
|
||||
&bufferData,
|
||||
(int)readType);
|
||||
}
|
||||
|
||||
public void SetData<T>(T[] bufferArray, BufferReadType readType) where T : struct, IConvertible
|
||||
{
|
||||
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
|
||||
fixed (void* bufferPtr = &bufferArray[0])
|
||||
Graphic.glBufferData(
|
||||
(int)BufferType.ARRAY_BUFFER,
|
||||
size,
|
||||
bufferPtr,
|
||||
(int)readType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace StgSharp
|
||||
public class Pool
|
||||
{
|
||||
internal LinkedList<Vector4Map> _Vector4mapContainer;
|
||||
internal LinkedList<IPlainGeometry> _geometryContainer;
|
||||
internal LinkedList<PlainGeometry> _geometryContainer;
|
||||
internal LinkedList<IEntity> _bulletContainer;
|
||||
internal LinkedList<IEntity> _awardContainer;
|
||||
internal LinkedList<IEntity> _enemyContainer;
|
||||
@@ -33,7 +33,7 @@ namespace StgSharp
|
||||
_bulletContainer = new LinkedList<IEntity>();
|
||||
_awardContainer = new LinkedList<IEntity>();
|
||||
_enemyContainer = new LinkedList<IEntity>();
|
||||
_geometryContainer = new LinkedList<IPlainGeometry>();
|
||||
_geometryContainer = new LinkedList<PlainGeometry>();
|
||||
}
|
||||
|
||||
public void OnRender()
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
namespace StgSharp
|
||||
{
|
||||
|
||||
public delegate bool SensorRuleHandler(IPlainGeometry target, IPlainGeometry boarder);
|
||||
public delegate bool SensorRuleHandler(PlainGeometry target, PlainGeometry boarder);
|
||||
|
||||
public class Sensor<T>
|
||||
{
|
||||
internal IPlainGeometry _boarder;
|
||||
internal IPlainGeometry _target;
|
||||
internal PlainGeometry _boarder;
|
||||
internal PlainGeometry _target;
|
||||
internal SensorRuleHandler _rule;
|
||||
|
||||
|
||||
public IPlainGeometry boarder
|
||||
public PlainGeometry boarder
|
||||
{
|
||||
get { return _boarder; }
|
||||
}
|
||||
|
||||
public IPlainGeometry target
|
||||
public PlainGeometry target
|
||||
{
|
||||
get { return _target; }
|
||||
set { _target = value; }
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public interface IMat
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@
|
||||
return vec1.X * vec2.Y - vec1.Y * vec2.X;
|
||||
}
|
||||
|
||||
public static Vec3d Cross(Vec3d vec1, Vec3d vec2)
|
||||
public static vec3d Cross(vec3d vec1, vec3d vec2)
|
||||
{
|
||||
return new Vec3d(
|
||||
return new vec3d(
|
||||
vec1.Y * vec2.Z - vec1.Z * vec2.Y,
|
||||
vec1.X * vec2.Z - vec1.Z * vec2.X,
|
||||
vec1.X * vec2.Y - vec1.Y * vec2.X
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public static unsafe partial class Vector
|
||||
{
|
||||
/*
|
||||
public static float Det(Matrix2x2 array)
|
||||
{
|
||||
return Cross(array.row1, array.row2);
|
||||
}
|
||||
/**/
|
||||
|
||||
/*
|
||||
public static unsafe float Det(matrix3x3 array)
|
||||
{
|
||||
float* p = &array.row1.X;
|
||||
|
||||
matrix2x2 matrix1 = new matrix2x2(
|
||||
*(p + 4), *(p + 5),
|
||||
*(p + 7), *(p + 8)
|
||||
);
|
||||
matrix2x2 matrix2 = new matrix2x2(
|
||||
*(p + 3), *(p + 5),
|
||||
*(p + 6), *(p + 8)
|
||||
);
|
||||
matrix2x2 matrix3 = new matrix2x2(
|
||||
*(p + 3), *(p + 4),
|
||||
*(p + 6), *(p + 7)
|
||||
);
|
||||
|
||||
return
|
||||
*p * Det(matrix1)
|
||||
- *(p + 1) * Det(matrix2)
|
||||
+ *(p + 2) * Det(matrix3)
|
||||
;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
);
|
||||
}
|
||||
|
||||
public static float GetAngle(Vec3d vec1, Vec3d vec2)
|
||||
public static float GetAngle(vec3d vec1, vec3d vec2)
|
||||
{
|
||||
return Calc.ACos(
|
||||
vec1 * vec2
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
public static unsafe partial class Vector
|
||||
{
|
||||
public static float GetLength(this Vec3d vec)
|
||||
public static float GetLength(this vec3d vec)
|
||||
{
|
||||
return Calc.Sqrt(
|
||||
vec.X * vec.X +
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace StgSharp.Math
|
||||
{
|
||||
/*
|
||||
|
||||
public static unsafe float Multiple(Vec3d vec1, Vec3d vec2)
|
||||
public static unsafe float Multiple(vec3d vec1, vec3d vec2)
|
||||
{
|
||||
IntPtr retPtr = internalIO.mulps_internal(vec1._Vector4Ptr,vec2._Vector4Ptr);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace StgSharp.Math
|
||||
Vector4.single_2;
|
||||
}
|
||||
|
||||
public static unsafe float Multiple(Vec4d vec1,Vec3d vec2)
|
||||
public static unsafe float Multiple(Vec4d vec1,vec3d vec2)
|
||||
{
|
||||
IntPtr retPtr = internalIO.mulps_internal(vec1._Vector4Ptr,vec2._Vector4Ptr);
|
||||
Vector4 Vector4 = *(Vector4*)retPtr;
|
||||
|
||||
@@ -5,12 +5,12 @@ namespace StgSharp.Math
|
||||
{
|
||||
public unsafe static partial class VectorCalc
|
||||
{
|
||||
public static Vec3d To3D(Vec2d vec)
|
||||
public static vec3d To3D(Vec2d vec)
|
||||
{
|
||||
return new Vec3d(vec.X, vec.Y, 0.0f);
|
||||
return new vec3d(vec.X, vec.Y, 0.0f);
|
||||
}
|
||||
|
||||
public static Vec2d To2D(Vec3d vec, CordinatePlain plain)
|
||||
public static Vec2d To2D(vec3d vec, CordinatePlain plain)
|
||||
{
|
||||
switch (plain)
|
||||
{
|
||||
@@ -30,9 +30,9 @@ namespace StgSharp.Math
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static Vec3d To3D(Vector4 vector)
|
||||
internal static vec3d To3D(Vector4 vector)
|
||||
{
|
||||
return new Vec3d(vector);
|
||||
return new vec3d(vector);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace StgSharp
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)]
|
||||
internal struct Mat3 : IEquatable<Mat3>
|
||||
public struct Mat3 : IEquatable<Mat3>
|
||||
{
|
||||
|
||||
[FieldOffset(0)] internal Vector4 colum0;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace StgSharp.Math
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16 * sizeof(float))]
|
||||
internal struct Mat4 : IEquatable<Mat4>
|
||||
public struct Mat4 : IEquatable<Mat4>, IMat
|
||||
{
|
||||
[FieldOffset(0)] internal Vector4 colum0;
|
||||
[FieldOffset(16)] internal Vector4 colum1;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math.Linear
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 5 * 4 * sizeof(float))]
|
||||
public struct mat5 : IMat
|
||||
{
|
||||
[FieldOffset(0 * 4 * sizeof(float))] internal Vector4 vec0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] internal Vector4 vec1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] internal Vector4 vec2;
|
||||
[FieldOffset(3 * 4 * sizeof(float))] internal Vector4 vec3;
|
||||
[FieldOffset(4 * 4 * sizeof(float))] internal Vector4 vec4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math.Linear
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct mat6 : IMat
|
||||
{
|
||||
internal Vector4 vec0;
|
||||
internal Vector4 vec1;
|
||||
internal Vector4 vec2;
|
||||
internal Vector4 vec3;
|
||||
internal Vector4 vec4;
|
||||
internal Vector4 vec5;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 2 * 2 * 4 * sizeof(float) + sizeof(bool), Pack = 16)]
|
||||
public struct Matrix2x2
|
||||
public struct Matrix2x2 : IMat
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
internal Mat2 mat;
|
||||
@@ -19,8 +19,8 @@ namespace StgSharp.Math
|
||||
float a10, float a11
|
||||
)
|
||||
{
|
||||
mat.colum0 = new Vector4(a00,a10,0,0);
|
||||
mat.colum1 = new Vector4(a01,a11,0,0);
|
||||
mat.colum0 = new Vector4(a00, a10, 0, 0);
|
||||
mat.colum1 = new Vector4(a01, a11, 0, 0);
|
||||
}
|
||||
|
||||
internal Matrix2x2(
|
||||
@@ -104,11 +104,11 @@ namespace StgSharp.Math
|
||||
{
|
||||
left.InternalTranspose();
|
||||
return new Matrix2x2(
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum0),
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum1),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum0),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum1),
|
||||
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum0),
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum1)
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum0),
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum1)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -117,13 +117,13 @@ namespace StgSharp.Math
|
||||
{
|
||||
left.InternalTranspose();
|
||||
return new Matrix2x3(
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum0),
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum1),
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum2),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum0),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum1),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum2),
|
||||
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum0),
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum1),
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum2)
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum0),
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum1),
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum2)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,15 +132,15 @@ namespace StgSharp.Math
|
||||
{
|
||||
left.InternalTranspose();
|
||||
return new Matrix2x4(
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum0),
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum1),
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum2),
|
||||
Vector4.Dot( left.transpose.colum0, right.mat.colum3),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum0),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum1),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum2),
|
||||
Vector4.Dot(left.transpose.colum0, right.mat.colum3),
|
||||
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum0),
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum1),
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum2),
|
||||
Vector4.Dot( left.transpose.colum1, right.mat.colum3)
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum0),
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum1),
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum2),
|
||||
Vector4.Dot(left.transpose.colum1, right.mat.colum3)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace StgSharp.Math
|
||||
[FieldOffset(0)] internal Mat3 mat;
|
||||
[FieldOffset(3 * 4 * sizeof(float))] internal Mat3 transpose;
|
||||
[FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed;
|
||||
[FieldOffset(0 * 4 * sizeof(float))] public Vec3d Colum0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] public Vec3d Colum1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] public Vec3d Colum2;
|
||||
[FieldOffset(0 * 4 * sizeof(float))] public vec3d Colum0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] public vec3d Colum1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2;
|
||||
|
||||
public Matrix3x3(
|
||||
float a00, float a01, float a02,
|
||||
@@ -66,7 +66,10 @@ namespace StgSharp.Math
|
||||
}
|
||||
if (columNum > 2 || columNum < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(columNum));
|
||||
internalIO.InternalWriteLog(
|
||||
$"Attempt to write unused space in {GetType().Name} {nameof(mat)}",
|
||||
LogType.Error
|
||||
);
|
||||
}
|
||||
InternalTranspose();
|
||||
fixed (float* p = &this.transpose.m00)
|
||||
@@ -142,6 +145,17 @@ namespace StgSharp.Math
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static vec3d operator *(Matrix3x3 left, vec3d right)
|
||||
{
|
||||
left.InternalTranspose();
|
||||
return new vec3d(
|
||||
Vector4.Dot(left.transpose.colum0, right.vec),
|
||||
Vector4.Dot(left.transpose.colum1, right.vec),
|
||||
Vector4.Dot(left.transpose.colum2, right.vec)
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Matrix3x2 operator *(Matrix3x3 left, Matrix3x2 right)
|
||||
{
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace StgSharp.Math
|
||||
[FieldOffset(4 * 4 * sizeof(float))] internal Mat3 transpose;
|
||||
[FieldOffset(7 * 4 * sizeof(float))] internal bool isTransposed;
|
||||
|
||||
[FieldOffset(0 * 4 * sizeof(float))] public Vec3d Colum0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] public Vec3d Colum1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] public Vec3d Colum2;
|
||||
[FieldOffset(3 * 4 * sizeof(float))] public Vec3d Colum3;
|
||||
[FieldOffset(0 * 4 * sizeof(float))] public vec3d Colum0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] public vec3d Colum1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2;
|
||||
[FieldOffset(3 * 4 * sizeof(float))] public vec3d Colum3;
|
||||
|
||||
public Matrix3x4(
|
||||
float a00, float a01, float a02, float a03,
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
using StgSharp.Controlling;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public static class Vec3d
|
||||
{
|
||||
public static vec3d Zero => new vec3d(0, 0, 0);
|
||||
public static vec3d Unit => new vec3d(1, 1, 1);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
|
||||
public struct Vec3d
|
||||
public struct vec3d : IEquatable<vec3d>
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
internal Vector4 vec;
|
||||
@@ -16,42 +22,67 @@ namespace StgSharp.Math
|
||||
[FieldOffset(4)] public float Y;
|
||||
[FieldOffset(8)] public float Z;
|
||||
|
||||
public Vec3d(
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public vec3d Zero()
|
||||
{
|
||||
return new vec3d(0, 0, 0);
|
||||
}
|
||||
|
||||
public vec3d(
|
||||
float x, float y, float z)
|
||||
{
|
||||
X = x; Y = y; Z = z;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal Vec3d(Vector4 vector)
|
||||
public float Dot(vec3d right)
|
||||
{
|
||||
Vector4 vector4 = this.vec * right.vec;
|
||||
return vector4.X
|
||||
+ vector4.Y
|
||||
+ vector4.Z;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public vec3d Cross(vec3d right)
|
||||
{
|
||||
return new vec3d(
|
||||
this.Y * right.Z - this.Z * right.Y,
|
||||
this.X * right.Z - this.Z * right.X,
|
||||
this.X * right.Y - this.Y * right.X
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal vec3d(Vector4 vector)
|
||||
{
|
||||
vec = vector;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vec3d operator +(Vec3d vec1, Vec3d vec2)
|
||||
public static vec3d operator +(vec3d left, vec3d right)
|
||||
{
|
||||
return new Vec3d(
|
||||
vec1.X + vec2.X,
|
||||
vec1.Y + vec2.Y,
|
||||
vec1.Z + vec2.Z
|
||||
return new vec3d(
|
||||
left.X + right.X,
|
||||
left.Y + right.Y,
|
||||
left.Z + right.Z
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vec3d operator -(Vec3d vec1, Vec3d vec2)
|
||||
public static vec3d operator -(vec3d left, vec3d right)
|
||||
{
|
||||
return new Vec3d(
|
||||
vec1.X - vec2.X,
|
||||
vec1.Y - vec2.Y,
|
||||
vec1.Z - vec2.Z
|
||||
return new vec3d(
|
||||
left.X - right.X,
|
||||
left.Y - right.Y,
|
||||
left.Z - right.Z
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vec3d operator *(Vec3d vec, float value)
|
||||
public static vec3d operator *(vec3d vec, float value)
|
||||
{
|
||||
return new Vec3d(
|
||||
return new vec3d(
|
||||
vec.X * value,
|
||||
vec.Y * value,
|
||||
vec.Z * value
|
||||
@@ -59,9 +90,9 @@ namespace StgSharp.Math
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vec3d operator /(Vec3d vec, float value)
|
||||
public static vec3d operator /(vec3d vec, float value)
|
||||
{
|
||||
return new Vec3d(
|
||||
return new vec3d(
|
||||
vec.X / value,
|
||||
vec.Y / value,
|
||||
vec.Z / value
|
||||
@@ -69,12 +100,28 @@ namespace StgSharp.Math
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float operator *(Vec3d vec1, Vec3d vec2)
|
||||
public static float operator *(vec3d left, vec3d right)
|
||||
{
|
||||
return
|
||||
vec1.X * vec2.X +
|
||||
vec1.Y * vec2.Y +
|
||||
vec1.Z * vec2.Z;
|
||||
left.X * right.X +
|
||||
left.Y * right.Y +
|
||||
left.Z * right.Z;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(vec3d left, vec3d right)
|
||||
{
|
||||
return left.X == right.X
|
||||
&& left.Y == right.Y
|
||||
&& left.Z == right.Z;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(vec3d left, vec3d right)
|
||||
{
|
||||
return left.X != right.X
|
||||
&& left.Y != right.Y
|
||||
&& left.Z != right.Z;
|
||||
}
|
||||
|
||||
public string ToString(string sample)
|
||||
@@ -82,7 +129,32 @@ namespace StgSharp.Math
|
||||
return $"{this.X}\t{this.Y}\t{this.Z}\t";
|
||||
}
|
||||
|
||||
public bool Equals(vec3d other)
|
||||
{
|
||||
return this.vec == other.vec;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is vec3d)
|
||||
{
|
||||
return this == (vec3d)obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe override int GetHashCode()
|
||||
{
|
||||
fixed (float* add = &X)
|
||||
return HashCode.Combine(X, Y, Z, (ulong)add);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[{X},{Y},{Z}]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -4,16 +4,21 @@
|
||||
<name>StgSharp</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:StgSharp.Instruction.InitPool">
|
||||
<member name="M:StgSharp.Control.InitPool">
|
||||
<summary>
|
||||
Add a pool to timeline controller, and return the instance of the pool.
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Control.GLFWproc">
|
||||
|
||||
<member name="M:StgSharp.Control.GetKeyStatus(StgSharp.Graphics.Form,StgSharp.Control.Key)">
|
||||
<summary>
|
||||
Get the status of a certain key on the keyboard.
|
||||
</summary>
|
||||
<param name="form"></param>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="F:StgSharp.Control.TimeLine.tickCounter">
|
||||
<member name="F:StgSharp.Controlling.TimeLine.tickCounter">
|
||||
<summary>
|
||||
Tick counter count the frames passed since the program start.
|
||||
</summary>
|
||||
@@ -55,7 +60,7 @@
|
||||
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex03(System.UInt32)">
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
|
||||
<summary>
|
||||
Move the third vertix. this is a useless method for Parallelograms.
|
||||
</summary>
|
||||
@@ -63,7 +68,7 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex04(System.UInt32)">
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)">
|
||||
<summary>
|
||||
Move the third vertix. This method is useless for Parallelograms.
|
||||
</summary>
|
||||
@@ -103,7 +108,7 @@
|
||||
but only can be referred by pointers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.Byte[],System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Creates a form and its associated context.
|
||||
</summary>
|
||||
@@ -127,22 +132,14 @@
|
||||
<returns>The handle of created window</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.LoadGL">
|
||||
<summary>
|
||||
Load OpenGL API to StgSharp core programm,
|
||||
please call this method before call any other
|
||||
graphic APIs in StgSharp.
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">If run this method twice, will throw exception</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGL">
|
||||
<member name="M:StgSharp.Graphic.InitGL(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Init an instance of OpenGL program,
|
||||
This method should be called before other
|
||||
graphic methods, after LoadGL method.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGLAD">
|
||||
<member name="M:StgSharp.Graphic.InitGLAD(StgSharp.glLoader)">
|
||||
<summary>
|
||||
Attach GLFW API to GLAD,
|
||||
this method should be called after LoadGL
|
||||
@@ -150,6 +147,13 @@
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">The accident that program cannot attach GLFW to GLAD</exception>
|
||||
</member>
|
||||
<member name="T:StgSharp.glLoader">
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.LinkedList`1.Add(`0)">
|
||||
<summary>
|
||||
Add an item to the tail of linked list.
|
||||
|
||||
Binary file not shown.
@@ -50,15 +50,10 @@
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.GetLocationHandler">
|
||||
<summary>
|
||||
计算位移失量,需要手动输入游戏刻以提供时间数据
|
||||
</summary>
|
||||
<param name="tick"></param>
|
||||
<returns>表示位移量的三维矢量</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.IPlainGeometry">
|
||||
<summary>
|
||||
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
Caculate the movement of a point.
|
||||
</summary>
|
||||
<param name="tick">The game tick represent time passed by</param>
|
||||
<returns>A 3d vector representing movement</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
|
||||
<summary>
|
||||
@@ -76,6 +71,11 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.PlainGeometry">
|
||||
<summary>
|
||||
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
|
||||
<summary>
|
||||
Update the coordinate of the point. If this is a moving point,
|
||||
@@ -102,13 +102,35 @@
|
||||
initilize all the customizing operations.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.SSGwindow">
|
||||
<summary>
|
||||
A window struct that has nearly no differencr with GLFWwindow,
|
||||
but only can be referred by pointers.
|
||||
</summary>
|
||||
<member name="M:StgSharp.Graphics.Graphic.SetFrameBufferSizeCallback(StgSharp.Graphics.Form,StgSharp.Graphics.FrameBufferSizeHadler)">
|
||||
<summary>
|
||||
sets the framebuffer resize callback of the specified <see cref="T:StgSharp.Graphics.Form"/>,
|
||||
which is called when the framebuffer of the specified <see cref="T:StgSharp.Graphics.Form"/> is resized.
|
||||
</summary>
|
||||
<param name="form">The Form instance to be controlled</param>
|
||||
<param name="handler">Method hadler </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Graphic.ClearColor(System.Single,System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Call glClearColor in OpenGL
|
||||
specifies the red, green, blue, and alpha values used by glClear to clear the color buffers.
|
||||
Values specified by glClearColor are clamped to the range [0,1]
|
||||
</summary>
|
||||
<param name="R">Specify the red values used when the color buffers are cleared.</param>
|
||||
<param name="G">Specify the red values used when the color buffers are cleared.</param>
|
||||
<param name="B">Specify the red values used when the color buffers are cleared.</param>
|
||||
<param name="A">Specify the red values used when the color buffers are cleared.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Graphic.CompileShader(System.String,StgSharp.Graphics.ShaderType)">
|
||||
<summary>
|
||||
Conpile the provided shader code in string form.
|
||||
</summary>
|
||||
<param name="shaderCode">A string represent the shader's code</param>
|
||||
<param name="shaderType">An <see cref="T:StgSharp.Graphics.ShaderType"/> enum represent the type of the shader to
|
||||
conpile, including vertex shader and fragment shader.</param>
|
||||
<returns>An uint value as the only mark of conpiled shader</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Graphic.CreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Creates a form and its associated context.
|
||||
</summary>
|
||||
@@ -120,26 +142,14 @@
|
||||
<returns>The instance of created form</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,System.IntPtr)">
|
||||
<summary>
|
||||
Creates a window and its associated context.
|
||||
</summary>
|
||||
<param name="width">Required width</param>
|
||||
<param name="height">Required width</param>
|
||||
<param name="tittle">Tittle of the window </param>
|
||||
<param name="monitor"></param>
|
||||
<param name="share"></param>
|
||||
<returns>The handle of created window</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGL(System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.Graphic.InitGL(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Init an instance of OpenGL program,
|
||||
This method should be called before other
|
||||
graphic methods, after LoadGL method.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGLAD(StgSharp.glLoader)">
|
||||
<member name="M:StgSharp.Graphics.Graphic.InitGLManager(StgSharp.Graphics.glLoader)">
|
||||
<summary>
|
||||
Attach GLFW API to GLAD,
|
||||
this method should be called after LoadGL
|
||||
@@ -147,13 +157,19 @@
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">The accident that program cannot attach GLFW to GLAD</exception>
|
||||
</member>
|
||||
<member name="T:StgSharp.glLoader">
|
||||
<member name="T:StgSharp.Graphics.glLoader">
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.SSGwindow">
|
||||
<summary>
|
||||
A window struct that has nearly no differencr with GLFWwindow,
|
||||
but only can be referred by pointers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.LinkedList`1.Add(`0)">
|
||||
<summary>
|
||||
Add an item to the tail of linked list.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
f6acdcb7485571fc33859ff7052c64de7abcc14b
|
||||
07a65f778769dfbe3a0d49a795a6ced1fb5f9aac
|
||||
|
||||
Binary file not shown.
@@ -4,16 +4,21 @@
|
||||
<name>StgSharp</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:StgSharp.Instruction.InitPool">
|
||||
<member name="M:StgSharp.Control.InitPool">
|
||||
<summary>
|
||||
Add a pool to timeline controller, and return the instance of the pool.
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Control.GLFWproc">
|
||||
|
||||
<member name="M:StgSharp.Control.GetKeyStatus(StgSharp.Graphics.Form,StgSharp.Control.Key)">
|
||||
<summary>
|
||||
Get the status of a certain key on the keyboard.
|
||||
</summary>
|
||||
<param name="form"></param>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="F:StgSharp.Control.TimeLine.tickCounter">
|
||||
<member name="F:StgSharp.Controlling.TimeLine.tickCounter">
|
||||
<summary>
|
||||
Tick counter count the frames passed since the program start.
|
||||
</summary>
|
||||
@@ -55,7 +60,7 @@
|
||||
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex03(System.UInt32)">
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
|
||||
<summary>
|
||||
Move the third vertix. this is a useless method for Parallelograms.
|
||||
</summary>
|
||||
@@ -63,7 +68,7 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex04(System.UInt32)">
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)">
|
||||
<summary>
|
||||
Move the third vertix. This method is useless for Parallelograms.
|
||||
</summary>
|
||||
@@ -103,7 +108,7 @@
|
||||
but only can be referred by pointers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.Byte[],System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Creates a form and its associated context.
|
||||
</summary>
|
||||
@@ -127,22 +132,14 @@
|
||||
<returns>The handle of created window</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.LoadGL">
|
||||
<summary>
|
||||
Load OpenGL API to StgSharp core programm,
|
||||
please call this method before call any other
|
||||
graphic APIs in StgSharp.
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">If run this method twice, will throw exception</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGL">
|
||||
<member name="M:StgSharp.Graphic.InitGL(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Init an instance of OpenGL program,
|
||||
This method should be called before other
|
||||
graphic methods, after LoadGL method.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGLAD">
|
||||
<member name="M:StgSharp.Graphic.InitGLAD(StgSharp.glLoader)">
|
||||
<summary>
|
||||
Attach GLFW API to GLAD,
|
||||
this method should be called after LoadGL
|
||||
@@ -150,6 +147,13 @@
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">The accident that program cannot attach GLFW to GLAD</exception>
|
||||
</member>
|
||||
<member name="T:StgSharp.glLoader">
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.LinkedList`1.Add(`0)">
|
||||
<summary>
|
||||
Add an item to the tail of linked list.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
a58e0bad75f945d384a0d1dfa8c31c469d253ee7
|
||||
b955a5d62f7daf5d0377cd19de08b0c75c3cfa93
|
||||
|
||||
Binary file not shown.
@@ -50,15 +50,10 @@
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.GetLocationHandler">
|
||||
<summary>
|
||||
计算位移失量,需要手动输入游戏刻以提供时间数据
|
||||
</summary>
|
||||
<param name="tick"></param>
|
||||
<returns>表示位移量的三维矢量</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.IPlainGeometry">
|
||||
<summary>
|
||||
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
Caculate the movement of a point.
|
||||
</summary>
|
||||
<param name="tick">The game tick represent time passed by</param>
|
||||
<returns>A 3d vector representing movement</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
|
||||
<summary>
|
||||
@@ -76,6 +71,11 @@
|
||||
<returns></returns>
|
||||
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.PlainGeometry">
|
||||
<summary>
|
||||
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
|
||||
<summary>
|
||||
Update the coordinate of the point. If this is a moving point,
|
||||
@@ -102,13 +102,35 @@
|
||||
initilize all the customizing operations.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.SSGwindow">
|
||||
<summary>
|
||||
A window struct that has nearly no differencr with GLFWwindow,
|
||||
but only can be referred by pointers.
|
||||
</summary>
|
||||
<member name="M:StgSharp.Graphics.Graphic.SetFrameBufferSizeCallback(StgSharp.Graphics.Form,StgSharp.Graphics.FrameBufferSizeHadler)">
|
||||
<summary>
|
||||
sets the framebuffer resize callback of the specified <see cref="T:StgSharp.Graphics.Form"/>,
|
||||
which is called when the framebuffer of the specified <see cref="T:StgSharp.Graphics.Form"/> is resized.
|
||||
</summary>
|
||||
<param name="form">The Form instance to be controlled</param>
|
||||
<param name="handler">Method hadler </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Graphic.ClearColor(System.Single,System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Call glClearColor in OpenGL
|
||||
specifies the red, green, blue, and alpha values used by glClear to clear the color buffers.
|
||||
Values specified by glClearColor are clamped to the range [0,1]
|
||||
</summary>
|
||||
<param name="R">Specify the red values used when the color buffers are cleared.</param>
|
||||
<param name="G">Specify the red values used when the color buffers are cleared.</param>
|
||||
<param name="B">Specify the red values used when the color buffers are cleared.</param>
|
||||
<param name="A">Specify the red values used when the color buffers are cleared.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Graphic.CompileShader(System.String,StgSharp.Graphics.ShaderType)">
|
||||
<summary>
|
||||
Conpile the provided shader code in string form.
|
||||
</summary>
|
||||
<param name="shaderCode">A string represent the shader's code</param>
|
||||
<param name="shaderType">An <see cref="T:StgSharp.Graphics.ShaderType"/> enum represent the type of the shader to
|
||||
conpile, including vertex shader and fragment shader.</param>
|
||||
<returns>An uint value as the only mark of conpiled shader</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Graphic.CreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Creates a form and its associated context.
|
||||
</summary>
|
||||
@@ -120,26 +142,14 @@
|
||||
<returns>The instance of created form</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.GLcreateWindow(System.Int32,System.Int32,System.String,System.IntPtr,System.IntPtr)">
|
||||
<summary>
|
||||
Creates a window and its associated context.
|
||||
</summary>
|
||||
<param name="width">Required width</param>
|
||||
<param name="height">Required width</param>
|
||||
<param name="tittle">Tittle of the window </param>
|
||||
<param name="monitor"></param>
|
||||
<param name="share"></param>
|
||||
<returns>The handle of created window</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGL(System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.Graphic.InitGL(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Init an instance of OpenGL program,
|
||||
This method should be called before other
|
||||
graphic methods, after LoadGL method.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphic.InitGLAD(StgSharp.glLoader)">
|
||||
<member name="M:StgSharp.Graphics.Graphic.InitGLManager(StgSharp.Graphics.glLoader)">
|
||||
<summary>
|
||||
Attach GLFW API to GLAD,
|
||||
this method should be called after LoadGL
|
||||
@@ -147,13 +157,19 @@
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">The accident that program cannot attach GLFW to GLAD</exception>
|
||||
</member>
|
||||
<member name="T:StgSharp.glLoader">
|
||||
<member name="T:StgSharp.Graphics.glLoader">
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.SSGwindow">
|
||||
<summary>
|
||||
A window struct that has nearly no differencr with GLFWwindow,
|
||||
but only can be referred by pointers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.LinkedList`1.Add(`0)">
|
||||
<summary>
|
||||
Add an item to the tail of linked list.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+63
-62
@@ -6,7 +6,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
@@ -17,61 +16,30 @@ namespace StgSharp
|
||||
|
||||
internal unsafe static void Main(string[] args)
|
||||
{
|
||||
internalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info);
|
||||
|
||||
Graphic.InitGL(3, 3);
|
||||
Graphic.InitGL(4, 6);
|
||||
|
||||
Form f = Graphic.GLcreateWindow(
|
||||
Form f = Graphic.CreateWindow(
|
||||
800, 600, "Test STG#!", IntPtr.Zero, null
|
||||
);
|
||||
Graphic.GLmakeContexCurrent(f);
|
||||
internalIO.glfwSetFramebufferSizeCallback(f.windowID, FormSizeCallback);
|
||||
Graphic.MakeContexCurrent(f);
|
||||
Graphic.SetFrameBufferSizeCallback(f, FormSizeCallback);
|
||||
|
||||
GetApiRep();
|
||||
Graphic.InitGLAD(Graphic.GetProcAddress);
|
||||
Graphic.InitGLManager(Graphic.GetProcAddress);
|
||||
|
||||
string vertstr = File.ReadAllText("Shader\\vertex.vert", Encoding.ASCII);
|
||||
byte[] vert = Encoding.ASCII.GetBytes(vertstr + '\0');
|
||||
uint vertexShader;
|
||||
fixed (byte* shaderSource = vert)
|
||||
{
|
||||
vertexShader = internalIO.InternalLoadShaderCode(shaderSource, GLFW.GL_VERTEX_SHADER);
|
||||
if (vertexShader == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
Shader shader = new Shader();
|
||||
shader.CompileVertexShader(
|
||||
File.ReadAllText("Shader\\vertex.vert")
|
||||
);
|
||||
shader.CompileFragmentShader(
|
||||
File.ReadAllText("Shader\\fragment.frag")
|
||||
);
|
||||
shader.Link();
|
||||
|
||||
|
||||
|
||||
string fragstr = File.ReadAllText("Shader\\fragment.frag", Encoding.ASCII);
|
||||
byte[] frag = Encoding.ASCII.GetBytes(fragstr + '\0');
|
||||
|
||||
uint fragmentShader;
|
||||
fixed (byte* shaderSource = frag)
|
||||
{
|
||||
fragmentShader = internalIO.InternalLoadShaderCode(shaderSource, GLFW.GL_FRAGMENT_SHADER);
|
||||
if (fragmentShader == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint shaderProgram = Graphic.glCreateProgram();
|
||||
|
||||
Graphic.glAttachShader(shaderProgram, vertexShader);
|
||||
Graphic.glAttachShader(shaderProgram, fragmentShader);
|
||||
|
||||
if (internalIO.InternalLinkShaderProgram(shaderProgram) == 0)
|
||||
{
|
||||
IntPtr log = internalIO.InternalReadLog();
|
||||
Console.WriteLine(Marshal.PtrToStringAnsi(log));
|
||||
}
|
||||
|
||||
Graphic.glDeleteShader(vertexShader);
|
||||
Graphic.glDeleteShader(fragmentShader);
|
||||
|
||||
|
||||
|
||||
Triangle tri = new Triangle(
|
||||
-0.5f, -0.3f, 0.0f,
|
||||
@@ -80,16 +48,30 @@ namespace StgSharp
|
||||
);
|
||||
|
||||
Rectangle rec = new Rectangle(
|
||||
-0.5f, 0.5f, 0.0f,
|
||||
-0.4f, 0.5f, 0.0f,
|
||||
0.5f, 0.5f, 0.0f,
|
||||
0.5f, -0.5f, 0.0f,
|
||||
-0.5f, -0.5f, 0.0f
|
||||
0.6f, -0.5f, 0.0f,
|
||||
-0.7f, -0.5f, 0.0f
|
||||
);
|
||||
|
||||
Polygon5 polygon = new Polygon5(
|
||||
-0.4f, 0.5f, 0.0f,
|
||||
0.5f, 0.5f, 0.0f,
|
||||
0.6f, -0.5f, 0.0f,
|
||||
0, -1, 0,
|
||||
-0.7f, -0.5f, 0.0f
|
||||
);
|
||||
|
||||
VertexArray vao = new VertexArray(1);
|
||||
vao.Bind();
|
||||
|
||||
/*
|
||||
uint VAO;
|
||||
Graphic.glGenVertexArrays(1, &VAO);
|
||||
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, VAO);
|
||||
Graphic.glBindVertexArray(VAO);
|
||||
/**/
|
||||
|
||||
|
||||
/*
|
||||
// for triangle rendering
|
||||
@@ -109,27 +91,38 @@ namespace StgSharp
|
||||
/**/
|
||||
// for rectangle rendering
|
||||
|
||||
VertexBuffer vbo = new VertexBuffer(1);
|
||||
vbo.Bind();
|
||||
vbo.SetData(polygon.VertexBuffer, BufferReadType.STATIC_DRAW);
|
||||
|
||||
/*
|
||||
uint VBO;
|
||||
Graphic.glGenBuffers(1, &VBO);
|
||||
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, VBO);
|
||||
Graphic.SetBufferData(BufferType.ARRAY_BUFFER, polygon.VertexBuffer, BufferReadType.STATIC_DRAW);
|
||||
/**/
|
||||
|
||||
|
||||
/*
|
||||
fixed (void* data = &rec.vertexMat)
|
||||
{
|
||||
Graphic.glBufferData(GLFW.GL_ARRAY_BUFFER, 16 * sizeof(float), data, GLFW.GL_STATIC_DRAW);
|
||||
}
|
||||
/**/
|
||||
|
||||
uint[] indices = new uint[6]
|
||||
{
|
||||
0,1,3,
|
||||
1,2,3
|
||||
};
|
||||
|
||||
ElementBuffer ebo = new ElementBuffer(1);
|
||||
ebo.Bind();
|
||||
ebo.SetData(polygon.Indices, BufferReadType.STATIC_DRAW);
|
||||
|
||||
/*
|
||||
uint EBO;
|
||||
Graphic.glGenBuffers(1, &EBO);
|
||||
Graphic.glBindBuffer(GLFW.GL_ELEMENT_ARRAY_BUFFER, EBO);
|
||||
fixed (void* data = &indices[0])
|
||||
{
|
||||
Graphic.glBufferData(GLFW.GL_ELEMENT_ARRAY_BUFFER, indices.Length * sizeof(uint), data, GLFW.GL_STATIC_DRAW);
|
||||
}
|
||||
|
||||
Graphic.SetBufferData(BufferType.ELEMENT_ARRAY_BUFFER, polygon.Indices, BufferReadType.STATIC_DRAW);
|
||||
/**/
|
||||
|
||||
|
||||
Graphic.glVertexAttribPointer(0, 3, GLFW.GL_FLOAT, false, 4 * sizeof(float), (void*)0);
|
||||
Graphic.glEnableVertexAttribArray(0);
|
||||
@@ -144,14 +137,15 @@ namespace StgSharp
|
||||
{
|
||||
ProcessInput(f.windowID);
|
||||
|
||||
Graphic.glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
|
||||
Graphic.ClearColor(0.2f, 0.3f, 0.3f, 1.0f);
|
||||
Graphic.glClear(GLFW.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
Graphic.glUseProgram(shaderProgram);
|
||||
Graphic.glBindVertexArray(VAO);
|
||||
shader.Use();
|
||||
|
||||
Graphic.glBindVertexArray(vao._bufferID);
|
||||
|
||||
//Graphic.glDrawArrays(GLFW.GL_TRIANGLES, 0, 3);
|
||||
Graphic.glDrawElements(GLFW.GL_TRIANGLES, 6, GLFW.GL_UNSIGNED_INT, (void*)0);
|
||||
Graphic.glDrawElements(GLFW.GL_TRIANGLES, 9, GLFW.GL_UNSIGNED_INT, (void*)0);
|
||||
|
||||
Graphic.glBindVertexArray(0);
|
||||
|
||||
@@ -159,9 +153,16 @@ namespace StgSharp
|
||||
internalIO.glfwPollEvents();
|
||||
}
|
||||
|
||||
vao.Dispose();
|
||||
vbo.Dispose();
|
||||
ebo.Dispose();
|
||||
|
||||
/*
|
||||
Graphic.glDeleteVertexArrays(1, &VAO);
|
||||
Graphic.glDeleteBuffers(1, &VBO);
|
||||
Graphic.glDeleteBuffers(1, &EBO);
|
||||
/**/
|
||||
|
||||
internalIO.glfwTerminate();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2023-10-12T03:19:58.7324364+08:00
|
||||
Program start
|
||||
Error @2023-10-12T03:19:58.9477954+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNTEXIMAGEPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9482257+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNUNIFORMDVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9485975+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPDVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9488976+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPFVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9492129+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPIVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9495375+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPFVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9498299+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUIVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9501350+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUSVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9504419+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPOLYGONSTIPPLEPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9509285+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCOLORTABLEPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9512426+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCONVOLUTIONFILTERPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9516907+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNSEPARABLEFILTERPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9519956+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNHISTOGRAMPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9524417+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMINMAXPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9532268+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9535437+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @2023-10-12T03:19:58.9567819+08:00
|
||||
Failed to compile shader.
|
||||
Failed to get GLSL compiler log
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2023-10-12T03:21:10.3239543+08:00
|
||||
Program start
|
||||
Error @2023-10-12T03:21:10.5396246+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNTEXIMAGEPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5400425+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNUNIFORMDVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5405159+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPDVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5408213+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPFVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5411072+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPIVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5415211+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPFVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5418449+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUIVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5422912+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUSVPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5426171+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPOLYGONSTIPPLEPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5429361+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCOLORTABLEPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5432113+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCONVOLUTIONFILTERPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5434825+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNSEPARABLEFILTERPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5438002+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNHISTOGRAMPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5440688+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMINMAXPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5448575+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5451568+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @2023-10-12T03:21:10.5486110+08:00
|
||||
WARNING: 0:1: '' : #version directive missing
|
||||
ERROR: 0:1: '000' : syntax error syntax error
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2023-10-12T03:30:21.8443425+08:00
|
||||
Program start
|
||||
Error @ 2023-10-12T03:30:22.0611696+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNTEXIMAGEPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0616111+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNUNIFORMDVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0619801+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPDVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0622986+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPFVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0625983+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPIVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0628976+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPFVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0631880+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUIVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0635372+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUSVPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0638550+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPOLYGONSTIPPLEPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0642010+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCOLORTABLEPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0644943+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCONVOLUTIONFILTERPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0648024+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNSEPARABLEFILTERPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0650890+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNHISTOGRAMPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0653715+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMINMAXPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0661823+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @ 2023-10-12T03:30:22.0664910+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, this API may not exist.
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2023-10-14T17:37:50.5533658+08:00
|
||||
Program start
|
||||
Error @ 2023-10-14T17:37:50.7759452+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNTEXIMAGEPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7763345+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNUNIFORMDVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7767533+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPDVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7770227+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPFVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7772878+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPIVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7775394+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPFVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7777922+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUIVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7790220+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUSVPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7792883+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPOLYGONSTIPPLEPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7795385+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCOLORTABLEPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7797798+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCONVOLUTIONFILTERPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7800150+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNSEPARABLEFILTERPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7802471+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNHISTOGRAMPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7804766+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMINMAXPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7812494+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @ 2023-10-14T17:37:50.7815166+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, this API may not exist.
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2023-10-17T01:20:46.8252003+08:00
|
||||
Program start
|
||||
Error @ 2023-10-17T01:20:47.1820184+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNTEXIMAGEPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1824725+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNUNIFORMDVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1830568+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPDVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1833733+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPFVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1836861+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMAPIVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1840030+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPFVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1843191+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUIVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1846322+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPIXELMAPUSVPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1849560+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNPOLYGONSTIPPLEPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1852808+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCOLORTABLEPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1855842+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNCONVOLUTIONFILTERPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1858751+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNSEPARABLEFILTERPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1861646+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNHISTOGRAMPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1864511+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLGETNMINMAXPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1874607+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Error @ 2023-10-17T01:20:47.1878654+08:00
|
||||
Cannot load OpenGL API called StgSharp.Graphics.PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, this API may not exist.
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
208acf897e20abb578d5ef8df864296ff6184c25
|
||||
a316b7e2a6832a40e13c8c0573c75a737e389983
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -43,8 +43,6 @@ SSGC_API unsigned int loadShaderCode(char* const shaderCode, GLint shadertype)
|
||||
if (!success)
|
||||
{
|
||||
glGetShaderInfoLog(shader, 512, NULL, infolog);
|
||||
infolog[511] = '\0';
|
||||
printf(infolog);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -62,7 +60,6 @@ SSGC_API unsigned int linkShaderProgram(GLuint shaderProgram)
|
||||
if (!success)
|
||||
{
|
||||
glGetProgramInfoLog(shaderProgram, 512, NULL, infolog);
|
||||
printf(infolog);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -74,5 +71,6 @@ SSGC_API unsigned int linkShaderProgram(GLuint shaderProgram)
|
||||
|
||||
char* _cdecl readLog()
|
||||
{
|
||||
return infolog[0];
|
||||
infolog[511] = '\0';
|
||||
return &infolog;
|
||||
}
|
||||
|
||||
@@ -29,10 +29,6 @@ extern __m128* defaultVecPtr;
|
||||
|
||||
|
||||
|
||||
|
||||
SSGC_API _inline float __cdecl mulps_sum_internal(__m128 left, __m128 right);
|
||||
SSGC_API _inline float __cdecl mulps_total_internal(__m128 vec);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
SSGC_API char* infolog[512];
|
||||
|
||||
@@ -0,0 +1,796 @@
|
||||
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.37.32824.0
|
||||
|
||||
include listing.inc
|
||||
|
||||
INCLUDELIB MSVCRT
|
||||
INCLUDELIB OLDNAMES
|
||||
|
||||
PUBLIC infolog
|
||||
_DATA SEGMENT
|
||||
COMM report:QWORD
|
||||
_DATA ENDS
|
||||
_BSS SEGMENT
|
||||
infolog DQ 0200H DUP (?)
|
||||
_BSS ENDS
|
||||
msvcjmc SEGMENT
|
||||
__9C03CD75_concurrencysal@h DB 01H
|
||||
__CA64BAF1_sal@h DB 01H
|
||||
__95655E73_vadefs@h DB 01H
|
||||
__1D560A45_vcruntime@h DB 01H
|
||||
__ED683015_stdint@h DB 01H
|
||||
__018B5678_khrplatform@h DB 01H
|
||||
__79FC18F0_glad@h DB 01H
|
||||
__1B0272D9_corecrt@h DB 01H
|
||||
__13F5961F_stddef@h DB 01H
|
||||
__986CAB3E_glfw3@h DB 01H
|
||||
__0ED14FEE_winpackagefamily@h DB 01H
|
||||
__F92EF742_winapifamily@h DB 01H
|
||||
__22E515EB_sdkddkver@h DB 01H
|
||||
__F214EFBF_excpt@h DB 01H
|
||||
__D9B78EDA_stdarg@h DB 01H
|
||||
__29F49F40_specstrings_undef@h DB 01H
|
||||
__D0F42932_specstrings_strict@h DB 01H
|
||||
__F00405FD_sdv_driverspecs@h DB 01H
|
||||
__173E09CA_driverspecs@h DB 01H
|
||||
__9A452361_specstrings@h DB 01H
|
||||
__74484FB3_corecrt_wctype@h DB 01H
|
||||
__1EC467ED_ctype@h DB 01H
|
||||
__98517906_kernelspecs@h DB 01H
|
||||
__D3497022_basetsd@h DB 01H
|
||||
__61CC25A1_errno@h DB 01H
|
||||
__7061C667_vcruntime_string@h DB 01H
|
||||
__E4C945B4_corecrt_memcpy_s@h DB 01H
|
||||
__8EAFF484_corecrt_memory@h DB 01H
|
||||
__6490AEC5_corecrt_wstring@h DB 01H
|
||||
__E8295E1E_string@h DB 01H
|
||||
__7FCB5136_guiddef@h DB 01H
|
||||
__FF8A9E11_pshpack4@h DB 01H
|
||||
__D5438902_poppack@h DB 01H
|
||||
__FB07E2A3_pshpack2@h DB 01H
|
||||
__F6906775_pshpack8@h DB 01H
|
||||
__F9415CFA_pshpack1@h DB 01H
|
||||
__E58C6F1C_apiset@h DB 01H
|
||||
__A5C52262_ktmtypes@h DB 01H
|
||||
__FBBA8F9D_winnt@h DB 01H
|
||||
__A32D3D2C_minwindef@h DB 01H
|
||||
__7D798299_windef@h DB 01H
|
||||
__9AE108E9_apisetcconv@h DB 01H
|
||||
__9CE53D2C_minwinbase@h DB 01H
|
||||
__5D0AA210_apiquery2@h DB 01H
|
||||
__4DD4E726_processenv@h DB 01H
|
||||
__3575CC96_fileapi@h DB 01H
|
||||
__8EA220E6_fileapifromapp@h DB 01H
|
||||
__BF9B31FE_debugapi@h DB 01H
|
||||
__C3AFE134_utilapiset@h DB 01H
|
||||
__76F69E51_handleapi@h DB 01H
|
||||
__7E63D784_errhandlingapi@h DB 01H
|
||||
__FFA7003C_fibersapi@h DB 01H
|
||||
__8971CECF_namedpipeapi@h DB 01H
|
||||
__46C9D8A6_profileapi@h DB 01H
|
||||
__98D4F0A3_heapapi@h DB 01H
|
||||
__50EF2A88_ioapiset@h DB 01H
|
||||
__92EA1464_synchapi@h DB 01H
|
||||
__A53D8AED_interlockedapi@h DB 01H
|
||||
__B506CAAF_processthreadsapi@h DB 01H
|
||||
__FF735694_sysinfoapi@h DB 01H
|
||||
__29589789_memoryapi@h DB 01H
|
||||
__E9C7A663_enclaveapi@h DB 01H
|
||||
__D035F9F7_threadpoollegacyapiset@h DB 01H
|
||||
__C899130C_threadpoolapiset@h DB 01H
|
||||
__E0441EE7_jobapi@h DB 01H
|
||||
__CEF86838_jobapi2@h DB 01H
|
||||
__35AC6B9A_wow64apiset@h DB 01H
|
||||
__C8AE41A5_libloaderapi@h DB 01H
|
||||
__CC9E232D_securitybaseapi@h DB 01H
|
||||
__C9D0C9B8_namespaceapi@h DB 01H
|
||||
__30FF9CAD_systemtopologyapi@h DB 01H
|
||||
__4D358795_processtopologyapi@h DB 01H
|
||||
__40446D10_securityappcontainer@h DB 01H
|
||||
__3A952EDF_realtimeapiset@h DB 01H
|
||||
__F4865F4B_winerror@h DB 01H
|
||||
__53C1BD93_timezoneapi@h DB 01H
|
||||
__1FFBEDBF_winbase@h DB 01H
|
||||
__43D3FA34_wingdi@h DB 01H
|
||||
__D24A7391_tvout@h DB 01H
|
||||
__7713A6C8_winuser@h DB 01H
|
||||
__0B345F71_datetimeapi@h DB 01H
|
||||
__9AC6960C_winnls@h DB 01H
|
||||
__973A40A8_stringapiset@h DB 01H
|
||||
__CC46FEE2_wincontypes@h DB 01H
|
||||
__97D70BE1_consoleapi@h DB 01H
|
||||
__27EC5E18_consoleapi2@h DB 01H
|
||||
__262E342F_consoleapi3@h DB 01H
|
||||
__641DCD70_wincon@h DB 01H
|
||||
__5A96C7A7_verrsrc@h DB 01H
|
||||
__B69C6FF2_winver@h DB 01H
|
||||
__7AEB8C37_reason@h DB 01H
|
||||
__59F1A8A9_winreg@h DB 01H
|
||||
__EE0E2B7F_wnnc@h DB 01H
|
||||
__DCDB7054_winnetwk@h DB 01H
|
||||
__81DDEDE3_stralign@h DB 01H
|
||||
__2134D1B4_winsvc@h DB 01H
|
||||
__11C07376_mcx@h DB 01H
|
||||
__577CE3E7_ime_cmodes@h DB 01H
|
||||
__1E72C31E_imm@h DB 01H
|
||||
__E15BF856_windows@h DB 01H
|
||||
__F7492337_framework@h DB 01H
|
||||
__44420885_corecrt_stdio_config@h DB 01H
|
||||
__AB601D8D_corecrt_wstdio@h DB 01H
|
||||
__C1EC35D3_stdio@h DB 01H
|
||||
__11E77DD3_mmintrin@h DB 01H
|
||||
__45DED006_corecrt_malloc@h DB 01H
|
||||
__FA77ED4C_malloc@h DB 01H
|
||||
__9D836611_xmmintrin@h DB 01H
|
||||
__F8E1EFDD_emmintrin@h DB 01H
|
||||
__27408754_pmmintrin@h DB 01H
|
||||
__9799F4D6_tmmintrin@h DB 01H
|
||||
__BEA2E155_smmintrin@h DB 01H
|
||||
__DBC06899_nmmintrin@h DB 01H
|
||||
__0E7B92D7_wmmintrin@h DB 01H
|
||||
__C5EFDFD0_zmmintrin@h DB 01H
|
||||
__F2FB7D1A_immintrin@h DB 01H
|
||||
__C508448F_StgSharpGraphic@h DB 01H
|
||||
__52DA9D07_StgSharpGraphic@c DB 01H
|
||||
msvcjmc ENDS
|
||||
PUBLIC __local_stdio_printf_options
|
||||
PUBLIC _vfprintf_l
|
||||
PUBLIC printf
|
||||
PUBLIC printShaderCode
|
||||
PUBLIC initGL
|
||||
PUBLIC initGLAD
|
||||
PUBLIC loadShaderCode
|
||||
PUBLIC linkShaderProgram
|
||||
PUBLIC readLog
|
||||
PUBLIC __JustMyCode_Default
|
||||
EXTRN gladLoadGLLoader:PROC
|
||||
EXTRN glfwInit:PROC
|
||||
EXTRN glfwWindowHint:PROC
|
||||
EXTRN glfwGetProcAddress:PROC
|
||||
EXTRN __imp___acrt_iob_func:PROC
|
||||
EXTRN __imp___stdio_common_vfprintf:PROC
|
||||
EXTRN __CheckForDebuggerJustMyCode:PROC
|
||||
EXTRN __GSHandlerCheck:PROC
|
||||
EXTRN __security_check_cookie:PROC
|
||||
EXTRN glad_glCompileShader:QWORD
|
||||
EXTRN glad_glCreateShader:QWORD
|
||||
EXTRN glad_glGetProgramiv:QWORD
|
||||
EXTRN glad_glGetProgramInfoLog:QWORD
|
||||
EXTRN glad_glGetShaderiv:QWORD
|
||||
EXTRN glad_glGetShaderInfoLog:QWORD
|
||||
EXTRN glad_glLinkProgram:QWORD
|
||||
EXTRN glad_glShaderSource:QWORD
|
||||
EXTRN __security_cookie:QWORD
|
||||
_DATA SEGMENT
|
||||
COMM ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9:QWORD ; `__local_stdio_printf_options'::`2'::_OptionsStorage
|
||||
_DATA ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$__local_stdio_printf_options DD imagerel $LN3
|
||||
DD imagerel $LN3+36
|
||||
DD imagerel $unwind$__local_stdio_printf_options
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$_vfprintf_l DD imagerel $LN3
|
||||
DD imagerel $LN3+83
|
||||
DD imagerel $unwind$_vfprintf_l
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$printf DD imagerel $LN3
|
||||
DD imagerel $LN3+129
|
||||
DD imagerel $unwind$printf
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$printShaderCode DD imagerel $LN3
|
||||
DD imagerel $LN3+45
|
||||
DD imagerel $unwind$printShaderCode
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$initGL DD imagerel $LN3
|
||||
DD imagerel $LN3+82
|
||||
DD imagerel $unwind$initGL
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$initGLAD DD imagerel $LN3
|
||||
DD imagerel $LN3+41
|
||||
DD imagerel $unwind$initGLAD
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$loadShaderCode DD imagerel $LN5
|
||||
DD imagerel $LN5+201
|
||||
DD imagerel $unwind$loadShaderCode
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$linkShaderProgram DD imagerel $LN5
|
||||
DD imagerel $LN5+136
|
||||
DD imagerel $unwind$linkShaderProgram
|
||||
pdata ENDS
|
||||
; COMDAT pdata
|
||||
pdata SEGMENT
|
||||
$pdata$readLog DD imagerel $LN3
|
||||
DD imagerel $LN3+49
|
||||
DD imagerel $unwind$readLog
|
||||
pdata ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$readLog DD 025030b01H
|
||||
DD 0b206230bH
|
||||
DD 05002H
|
||||
xdata ENDS
|
||||
; COMDAT voltbl
|
||||
voltbl SEGMENT
|
||||
_volmd DB 018H
|
||||
DB 076H
|
||||
voltbl ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$linkShaderProgram DD 025031c19H
|
||||
DD 0d209230eH
|
||||
DD 05005H
|
||||
DD imagerel __GSHandlerCheck
|
||||
DD 068H
|
||||
xdata ENDS
|
||||
; COMDAT voltbl
|
||||
voltbl SEGMENT
|
||||
_volmd DB 01dH
|
||||
DB 0b7H
|
||||
voltbl ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$loadShaderCode DD 025032119H
|
||||
DD 0d20e2313H
|
||||
DD 0500aH
|
||||
DD imagerel __GSHandlerCheck
|
||||
DD 068H
|
||||
xdata ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$initGLAD DD 025030b01H
|
||||
DD 0b206230bH
|
||||
DD 05002H
|
||||
xdata ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$initGL DD 025031201H
|
||||
DD 0b20d2312H
|
||||
DD 05009H
|
||||
xdata ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$printShaderCode DD 025030f01H
|
||||
DD 0b20a230fH
|
||||
DD 05006H
|
||||
xdata ENDS
|
||||
; COMDAT voltbl
|
||||
voltbl SEGMENT
|
||||
_volmd DB 02bH
|
||||
DB 06fH
|
||||
voltbl ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$printf DD 025032f19H
|
||||
DD 0f21c2321H
|
||||
DD 05015H
|
||||
DD imagerel __GSHandlerCheck
|
||||
DD 070H
|
||||
xdata ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$_vfprintf_l DD 035031e01H
|
||||
DD 0d219331eH
|
||||
DD 05015H
|
||||
xdata ENDS
|
||||
; COMDAT xdata
|
||||
xdata SEGMENT
|
||||
$unwind$__local_stdio_printf_options DD 025030b01H
|
||||
DD 0b206230bH
|
||||
DD 05002H
|
||||
xdata ENDS
|
||||
; Function compile flags: /Odt
|
||||
; COMDAT __JustMyCode_Default
|
||||
_TEXT SEGMENT
|
||||
__JustMyCode_Default PROC ; COMDAT
|
||||
00000 c2 00 00 ret 0
|
||||
__JustMyCode_Default ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
|
||||
; COMDAT readLog
|
||||
_TEXT SEGMENT
|
||||
readLog PROC ; COMDAT
|
||||
|
||||
; 76 : {
|
||||
|
||||
$LN3:
|
||||
00000 40 55 push rbp
|
||||
00002 48 83 ec 60 sub rsp, 96 ; 00000060H
|
||||
00006 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
0000b 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
|
||||
00012 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 77 : return infolog[0];
|
||||
|
||||
00017 b8 08 00 00 00 mov eax, 8
|
||||
0001c 48 6b c0 00 imul rax, rax, 0
|
||||
00020 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:infolog
|
||||
00027 48 8b 04 01 mov rax, QWORD PTR [rcx+rax]
|
||||
|
||||
; 78 : }
|
||||
|
||||
0002b 48 8d 65 40 lea rsp, QWORD PTR [rbp+64]
|
||||
0002f 5d pop rbp
|
||||
00030 c3 ret 0
|
||||
readLog ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
|
||||
; COMDAT linkShaderProgram
|
||||
_TEXT SEGMENT
|
||||
success$ = 0
|
||||
__$ArrayPad$ = 72
|
||||
shaderProgram$ = 96
|
||||
linkShaderProgram PROC ; COMDAT
|
||||
|
||||
; 57 : {
|
||||
|
||||
$LN5:
|
||||
00000 89 4c 24 08 mov DWORD PTR [rsp+8], ecx
|
||||
00004 55 push rbp
|
||||
00005 48 83 ec 70 sub rsp, 112 ; 00000070H
|
||||
00009 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
0000e 48 8b 05 00 00
|
||||
00 00 mov rax, QWORD PTR __security_cookie
|
||||
00015 48 33 c5 xor rax, rbp
|
||||
00018 48 89 45 48 mov QWORD PTR __$ArrayPad$[rbp], rax
|
||||
0001c 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
|
||||
00023 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 58 : glLinkProgram(shaderProgram);
|
||||
|
||||
00028 8b 4d 60 mov ecx, DWORD PTR shaderProgram$[rbp]
|
||||
0002b ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glLinkProgram
|
||||
|
||||
; 59 :
|
||||
; 60 : int success;
|
||||
; 61 : glGetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
|
||||
|
||||
00031 4c 8d 45 00 lea r8, QWORD PTR success$[rbp]
|
||||
00035 ba 82 8b 00 00 mov edx, 35714 ; 00008b82H
|
||||
0003a 8b 4d 60 mov ecx, DWORD PTR shaderProgram$[rbp]
|
||||
0003d ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glGetProgramiv
|
||||
|
||||
; 62 : if (!success)
|
||||
|
||||
00043 83 7d 00 00 cmp DWORD PTR success$[rbp], 0
|
||||
00047 75 2a jne SHORT $LN2@linkShader
|
||||
|
||||
; 63 : {
|
||||
; 64 : glGetProgramInfoLog(shaderProgram, 512, NULL, infolog);
|
||||
|
||||
00049 4c 8d 0d 00 00
|
||||
00 00 lea r9, OFFSET FLAT:infolog
|
||||
00050 45 33 c0 xor r8d, r8d
|
||||
00053 ba 00 02 00 00 mov edx, 512 ; 00000200H
|
||||
00058 8b 4d 60 mov ecx, DWORD PTR shaderProgram$[rbp]
|
||||
0005b ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glGetProgramInfoLog
|
||||
|
||||
; 65 : printf(infolog);
|
||||
|
||||
00061 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:infolog
|
||||
00068 e8 00 00 00 00 call printf
|
||||
|
||||
; 66 : return 0;
|
||||
|
||||
0006d 33 c0 xor eax, eax
|
||||
0006f eb 05 jmp SHORT $LN1@linkShader
|
||||
|
||||
; 67 : }
|
||||
|
||||
00071 eb 03 jmp SHORT $LN3@linkShader
|
||||
$LN2@linkShader:
|
||||
|
||||
; 68 : else
|
||||
; 69 : {
|
||||
; 70 : return shaderProgram;
|
||||
|
||||
00073 8b 45 60 mov eax, DWORD PTR shaderProgram$[rbp]
|
||||
$LN3@linkShader:
|
||||
$LN1@linkShader:
|
||||
|
||||
; 71 : }
|
||||
; 72 :
|
||||
; 73 : }
|
||||
|
||||
00076 48 8b 4d 48 mov rcx, QWORD PTR __$ArrayPad$[rbp]
|
||||
0007a 48 33 cd xor rcx, rbp
|
||||
0007d e8 00 00 00 00 call __security_check_cookie
|
||||
00082 48 8d 65 50 lea rsp, QWORD PTR [rbp+80]
|
||||
00086 5d pop rbp
|
||||
00087 c3 ret 0
|
||||
linkShaderProgram ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
|
||||
; COMDAT loadShaderCode
|
||||
_TEXT SEGMENT
|
||||
shader$ = 0
|
||||
success$ = 4
|
||||
__$ArrayPad$ = 72
|
||||
shaderCode$ = 96
|
||||
shadertype$ = 104
|
||||
loadShaderCode PROC ; COMDAT
|
||||
|
||||
; 37 : {
|
||||
|
||||
$LN5:
|
||||
00000 89 54 24 10 mov DWORD PTR [rsp+16], edx
|
||||
00004 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
|
||||
00009 55 push rbp
|
||||
0000a 48 83 ec 70 sub rsp, 112 ; 00000070H
|
||||
0000e 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
00013 48 8b 05 00 00
|
||||
00 00 mov rax, QWORD PTR __security_cookie
|
||||
0001a 48 33 c5 xor rax, rbp
|
||||
0001d 48 89 45 48 mov QWORD PTR __$ArrayPad$[rbp], rax
|
||||
00021 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
|
||||
00028 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 38 : unsigned int shader = glCreateShader(shadertype);
|
||||
|
||||
0002d 8b 4d 68 mov ecx, DWORD PTR shadertype$[rbp]
|
||||
00030 ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glCreateShader
|
||||
00036 89 45 00 mov DWORD PTR shader$[rbp], eax
|
||||
|
||||
; 39 : glShaderSource(shader, 1, &shaderCode, NULL);
|
||||
|
||||
00039 45 33 c9 xor r9d, r9d
|
||||
0003c 4c 8d 45 60 lea r8, QWORD PTR shaderCode$[rbp]
|
||||
00040 ba 01 00 00 00 mov edx, 1
|
||||
00045 8b 4d 00 mov ecx, DWORD PTR shader$[rbp]
|
||||
00048 ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glShaderSource
|
||||
|
||||
; 40 : glCompileShader(shader);
|
||||
|
||||
0004e 8b 4d 00 mov ecx, DWORD PTR shader$[rbp]
|
||||
00051 ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glCompileShader
|
||||
|
||||
; 41 : int success;
|
||||
; 42 : glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
||||
|
||||
00057 4c 8d 45 04 lea r8, QWORD PTR success$[rbp]
|
||||
0005b ba 81 8b 00 00 mov edx, 35713 ; 00008b81H
|
||||
00060 8b 4d 00 mov ecx, DWORD PTR shader$[rbp]
|
||||
00063 ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glGetShaderiv
|
||||
|
||||
; 43 : if (!success)
|
||||
|
||||
00069 83 7d 04 00 cmp DWORD PTR success$[rbp], 0
|
||||
0006d 75 45 jne SHORT $LN2@loadShader
|
||||
|
||||
; 44 : {
|
||||
; 45 : glGetShaderInfoLog(shader, 512, NULL, infolog);
|
||||
|
||||
0006f 4c 8d 0d 00 00
|
||||
00 00 lea r9, OFFSET FLAT:infolog
|
||||
00076 45 33 c0 xor r8d, r8d
|
||||
00079 ba 00 02 00 00 mov edx, 512 ; 00000200H
|
||||
0007e 8b 4d 00 mov ecx, DWORD PTR shader$[rbp]
|
||||
00081 ff 15 00 00 00
|
||||
00 call QWORD PTR glad_glGetShaderInfoLog
|
||||
|
||||
; 46 : infolog[511] = '\0';
|
||||
|
||||
00087 b8 08 00 00 00 mov eax, 8
|
||||
0008c 48 69 c0 ff 01
|
||||
00 00 imul rax, rax, 511 ; 000001ffH
|
||||
00093 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:infolog
|
||||
0009a 48 c7 04 01 00
|
||||
00 00 00 mov QWORD PTR [rcx+rax], 0
|
||||
|
||||
; 47 : printf(infolog);
|
||||
|
||||
000a2 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:infolog
|
||||
000a9 e8 00 00 00 00 call printf
|
||||
|
||||
; 48 : return 0;
|
||||
|
||||
000ae 33 c0 xor eax, eax
|
||||
000b0 eb 05 jmp SHORT $LN1@loadShader
|
||||
|
||||
; 49 : }
|
||||
|
||||
000b2 eb 03 jmp SHORT $LN3@loadShader
|
||||
$LN2@loadShader:
|
||||
|
||||
; 50 : else
|
||||
; 51 : {
|
||||
; 52 : return shader;
|
||||
|
||||
000b4 8b 45 00 mov eax, DWORD PTR shader$[rbp]
|
||||
$LN3@loadShader:
|
||||
$LN1@loadShader:
|
||||
|
||||
; 53 : }
|
||||
; 54 : }
|
||||
|
||||
000b7 48 8b 4d 48 mov rcx, QWORD PTR __$ArrayPad$[rbp]
|
||||
000bb 48 33 cd xor rcx, rbp
|
||||
000be e8 00 00 00 00 call __security_check_cookie
|
||||
000c3 48 8d 65 50 lea rsp, QWORD PTR [rbp+80]
|
||||
000c7 5d pop rbp
|
||||
000c8 c3 ret 0
|
||||
loadShaderCode ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
|
||||
; COMDAT initGLAD
|
||||
_TEXT SEGMENT
|
||||
initGLAD PROC ; COMDAT
|
||||
|
||||
; 32 : {
|
||||
|
||||
$LN3:
|
||||
00000 40 55 push rbp
|
||||
00002 48 83 ec 60 sub rsp, 96 ; 00000060H
|
||||
00006 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
0000b 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
|
||||
00012 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 33 : return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
|
||||
|
||||
00017 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:glfwGetProcAddress
|
||||
0001e e8 00 00 00 00 call gladLoadGLLoader
|
||||
|
||||
; 34 : }
|
||||
|
||||
00023 48 8d 65 40 lea rsp, QWORD PTR [rbp+64]
|
||||
00027 5d pop rbp
|
||||
00028 c3 ret 0
|
||||
initGLAD ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
|
||||
; COMDAT initGL
|
||||
_TEXT SEGMENT
|
||||
majorVersion$ = 80
|
||||
minorVersion$ = 88
|
||||
initGL PROC ; COMDAT
|
||||
|
||||
; 19 : {
|
||||
|
||||
$LN3:
|
||||
00000 89 54 24 10 mov DWORD PTR [rsp+16], edx
|
||||
00004 89 4c 24 08 mov DWORD PTR [rsp+8], ecx
|
||||
00008 55 push rbp
|
||||
00009 48 83 ec 60 sub rsp, 96 ; 00000060H
|
||||
0000d 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
00012 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
|
||||
00019 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 20 : glfwInit();
|
||||
|
||||
0001e e8 00 00 00 00 call glfwInit
|
||||
|
||||
; 21 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
|
||||
|
||||
00023 8b 55 50 mov edx, DWORD PTR majorVersion$[rbp]
|
||||
00026 b9 02 20 02 00 mov ecx, 139266 ; 00022002H
|
||||
0002b e8 00 00 00 00 call glfwWindowHint
|
||||
|
||||
; 22 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion);
|
||||
|
||||
00030 8b 55 58 mov edx, DWORD PTR minorVersion$[rbp]
|
||||
00033 b9 03 20 02 00 mov ecx, 139267 ; 00022003H
|
||||
00038 e8 00 00 00 00 call glfwWindowHint
|
||||
|
||||
; 23 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
|
||||
0003d ba 01 20 03 00 mov edx, 204801 ; 00032001H
|
||||
00042 b9 08 20 02 00 mov ecx, 139272 ; 00022008H
|
||||
00047 e8 00 00 00 00 call glfwWindowHint
|
||||
|
||||
; 24 :
|
||||
; 25 : #ifdef __APPLE__
|
||||
; 26 : glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
; 27 : #endif // __APPLE__
|
||||
; 28 : }
|
||||
|
||||
0004c 48 8d 65 40 lea rsp, QWORD PTR [rbp+64]
|
||||
00050 5d pop rbp
|
||||
00051 c3 ret 0
|
||||
initGL ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
|
||||
; COMDAT printShaderCode
|
||||
_TEXT SEGMENT
|
||||
code$ = 80
|
||||
printShaderCode PROC ; COMDAT
|
||||
|
||||
; 14 : {
|
||||
|
||||
$LN3:
|
||||
00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
|
||||
00005 55 push rbp
|
||||
00006 48 83 ec 60 sub rsp, 96 ; 00000060H
|
||||
0000a 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
0000f 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
|
||||
00016 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 15 : printf(*code);
|
||||
|
||||
0001b 48 8b 45 50 mov rax, QWORD PTR code$[rbp]
|
||||
0001f 48 8b 08 mov rcx, QWORD PTR [rax]
|
||||
00022 e8 00 00 00 00 call printf
|
||||
|
||||
; 16 : }
|
||||
|
||||
00027 48 8d 65 40 lea rsp, QWORD PTR [rbp+64]
|
||||
0002b 5d pop rbp
|
||||
0002c c3 ret 0
|
||||
printShaderCode ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdio.h
|
||||
; COMDAT printf
|
||||
_TEXT SEGMENT
|
||||
_Result$ = 0
|
||||
_ArgList$ = 8
|
||||
__$ArrayPad$ = 80
|
||||
_Format$ = 112
|
||||
printf PROC ; COMDAT
|
||||
|
||||
; 956 : {
|
||||
|
||||
$LN3:
|
||||
00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
|
||||
00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
|
||||
0000a 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
|
||||
0000f 4c 89 4c 24 20 mov QWORD PTR [rsp+32], r9
|
||||
00014 55 push rbp
|
||||
00015 48 81 ec 80 00
|
||||
00 00 sub rsp, 128 ; 00000080H
|
||||
0001c 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
00021 48 8b 05 00 00
|
||||
00 00 mov rax, QWORD PTR __security_cookie
|
||||
00028 48 33 c5 xor rax, rbp
|
||||
0002b 48 89 45 50 mov QWORD PTR __$ArrayPad$[rbp], rax
|
||||
0002f 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__C1EC35D3_stdio@h
|
||||
00036 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 957 : int _Result;
|
||||
; 958 : va_list _ArgList;
|
||||
; 959 : __crt_va_start(_ArgList, _Format);
|
||||
|
||||
0003b 48 8d 45 78 lea rax, QWORD PTR _Format$[rbp+8]
|
||||
0003f 48 89 45 08 mov QWORD PTR _ArgList$[rbp], rax
|
||||
|
||||
; 960 : _Result = _vfprintf_l(stdout, _Format, NULL, _ArgList);
|
||||
|
||||
00043 b9 01 00 00 00 mov ecx, 1
|
||||
00048 ff 15 00 00 00
|
||||
00 call QWORD PTR __imp___acrt_iob_func
|
||||
0004e 4c 8b 4d 08 mov r9, QWORD PTR _ArgList$[rbp]
|
||||
00052 45 33 c0 xor r8d, r8d
|
||||
00055 48 8b 55 70 mov rdx, QWORD PTR _Format$[rbp]
|
||||
00059 48 8b c8 mov rcx, rax
|
||||
0005c e8 00 00 00 00 call _vfprintf_l
|
||||
00061 89 45 00 mov DWORD PTR _Result$[rbp], eax
|
||||
|
||||
; 961 : __crt_va_end(_ArgList);
|
||||
|
||||
00064 48 c7 45 08 00
|
||||
00 00 00 mov QWORD PTR _ArgList$[rbp], 0
|
||||
|
||||
; 962 : return _Result;
|
||||
|
||||
0006c 8b 45 00 mov eax, DWORD PTR _Result$[rbp]
|
||||
|
||||
; 963 : }
|
||||
|
||||
0006f 48 8b 4d 50 mov rcx, QWORD PTR __$ArrayPad$[rbp]
|
||||
00073 48 33 cd xor rcx, rbp
|
||||
00076 e8 00 00 00 00 call __security_check_cookie
|
||||
0007b 48 8d 65 60 lea rsp, QWORD PTR [rbp+96]
|
||||
0007f 5d pop rbp
|
||||
00080 c3 ret 0
|
||||
printf ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdio.h
|
||||
; COMDAT _vfprintf_l
|
||||
_TEXT SEGMENT
|
||||
_Stream$ = 80
|
||||
_Format$ = 88
|
||||
_Locale$ = 96
|
||||
_ArgList$ = 104
|
||||
_vfprintf_l PROC ; COMDAT
|
||||
|
||||
; 644 : {
|
||||
|
||||
$LN3:
|
||||
00000 4c 89 4c 24 20 mov QWORD PTR [rsp+32], r9
|
||||
00005 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
|
||||
0000a 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
|
||||
0000f 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
|
||||
00014 55 push rbp
|
||||
00015 48 83 ec 70 sub rsp, 112 ; 00000070H
|
||||
00019 48 8d 6c 24 30 lea rbp, QWORD PTR [rsp+48]
|
||||
0001e 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__C1EC35D3_stdio@h
|
||||
00025 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 645 : return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Stream, _Format, _Locale, _ArgList);
|
||||
|
||||
0002a e8 00 00 00 00 call __local_stdio_printf_options
|
||||
0002f 48 8b 4d 68 mov rcx, QWORD PTR _ArgList$[rbp]
|
||||
00033 48 89 4c 24 20 mov QWORD PTR [rsp+32], rcx
|
||||
00038 4c 8b 4d 60 mov r9, QWORD PTR _Locale$[rbp]
|
||||
0003c 4c 8b 45 58 mov r8, QWORD PTR _Format$[rbp]
|
||||
00040 48 8b 55 50 mov rdx, QWORD PTR _Stream$[rbp]
|
||||
00044 48 8b 08 mov rcx, QWORD PTR [rax]
|
||||
00047 ff 15 00 00 00
|
||||
00 call QWORD PTR __imp___stdio_common_vfprintf
|
||||
|
||||
; 646 : }
|
||||
|
||||
0004d 48 8d 65 40 lea rsp, QWORD PTR [rbp+64]
|
||||
00051 5d pop rbp
|
||||
00052 c3 ret 0
|
||||
_vfprintf_l ENDP
|
||||
_TEXT ENDS
|
||||
; Function compile flags: /Odtp /ZI
|
||||
; File C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt_stdio_config.h
|
||||
; COMDAT __local_stdio_printf_options
|
||||
_TEXT SEGMENT
|
||||
__local_stdio_printf_options PROC ; COMDAT
|
||||
|
||||
; 90 : {
|
||||
|
||||
$LN3:
|
||||
00000 40 55 push rbp
|
||||
00002 48 83 ec 60 sub rsp, 96 ; 00000060H
|
||||
00006 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
||||
0000b 48 8d 0d 00 00
|
||||
00 00 lea rcx, OFFSET FLAT:__44420885_corecrt_stdio_config@h
|
||||
00012 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
||||
|
||||
; 91 : static unsigned __int64 _OptionsStorage;
|
||||
; 92 : return &_OptionsStorage;
|
||||
|
||||
00017 48 8d 05 00 00
|
||||
00 00 lea rax, OFFSET FLAT:?_OptionsStorage@?1??__local_stdio_printf_options@@9@9 ; `__local_stdio_printf_options'::`2'::_OptionsStorage
|
||||
|
||||
; 93 : }
|
||||
|
||||
0001e 48 8d 65 40 lea rsp, QWORD PTR [rbp+64]
|
||||
00022 5d pop rbp
|
||||
00023 c3 ret 0
|
||||
__local_stdio_printf_options ENDP
|
||||
_TEXT ENDS
|
||||
END
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,5 @@
|
||||
D:\Programmer\GLenv\glad.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\x64\Debug\glad.obj
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\debuger.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\x64\Debug\debuger.obj
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\dllmain.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\x64\Debug\dllmain.obj
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\linear.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\x64\Debug\linear.obj
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\mat2.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgShqrpGraphic\x64\Debug\mat2.obj
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.36.32532:TargetPlatformVersion=10.0.22000.0:
|
||||
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.37.32822:TargetPlatformVersion=10.0.22621.0:
|
||||
Debug|x64|D:\NitloadIndustry\研究项目\1-Flagship\HUFTDT Cooperation\2023固火方案4\CFS\CADC_flight_simulator\|
|
||||
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user