MVVM frame work done, under unit test
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Graphics.GL;
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
|
||||
@@ -43,7 +43,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
|
||||
|
||||
public class MainRenderStream : glRenderStream
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace StgSharp
|
||||
|
||||
protected override string[] OutputPortsName => ["output_1"];
|
||||
|
||||
protected override void Deinit()
|
||||
protected override void CustomizeDeinit()
|
||||
{
|
||||
/**/
|
||||
vao.Dispose();
|
||||
@@ -74,7 +74,7 @@ namespace StgSharp
|
||||
/**/
|
||||
}
|
||||
|
||||
protected override sealed void Init()
|
||||
protected override sealed void CustomizeInit()
|
||||
{
|
||||
//SetSizeLimit(800, 800, 800, 800);
|
||||
|
||||
@@ -130,10 +130,10 @@ namespace StgSharp
|
||||
ebo.SetValue(0, rec.VertexIndices, BufferUsage.StaticDraw);
|
||||
|
||||
vbo.WriteVectorData(0, rec.VertexStream, BufferUsage.StaticDraw);
|
||||
VertexArray.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0);
|
||||
vao.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0);
|
||||
|
||||
vbo.WriteScalerData(1, texCoord, BufferUsage.StaticDraw);
|
||||
VertexArray.SetVertexAttribute(2, 2, TypeCode.Single, false, 2 * sizeof(float), 0);
|
||||
vao.SetVertexAttribute(2, 2, TypeCode.Single, false, 2 * sizeof(float), 0);
|
||||
|
||||
/**/
|
||||
vbo.Unbind();
|
||||
@@ -153,9 +153,9 @@ namespace StgSharp
|
||||
/**/
|
||||
color = shader.GetUniform<float, float, float, float>("color");
|
||||
ourTexture = shader.GetUniform<int>("ourTexture");
|
||||
glFunc.SetUniformValue(ourTexture, 0);
|
||||
GL.SetUniformValue(ourTexture, 0);
|
||||
ourTexture2 = shader.GetUniform<int>("ourTexture2");
|
||||
glFunc.SetUniformValue(ourTexture2, 1);
|
||||
GL.SetUniformValue(ourTexture2, 1);
|
||||
/**/
|
||||
|
||||
NativeCameraViewTarget(
|
||||
@@ -167,9 +167,9 @@ namespace StgSharp
|
||||
NativeCameraUniform(shader, "camera");
|
||||
|
||||
|
||||
TextureGL.Activate(TextureUnit.Unit0);
|
||||
texture.ActivateAs(TextureUnit.Unit0);
|
||||
texture.Bind2D(0);
|
||||
TextureGL.Activate(TextureUnit.Unit1);
|
||||
texture.ActivateAs(TextureUnit.Unit1);
|
||||
texture.Bind2D(1);
|
||||
|
||||
}
|
||||
@@ -179,9 +179,9 @@ namespace StgSharp
|
||||
in Dictionary<string, BlueprintPipeline> output
|
||||
)
|
||||
{
|
||||
glFunc.ClearColor(0.333f, 0.555f, 0.555f, 1.0f);
|
||||
GL.ClearColor(0.333f, 0.555f, 0.555f, 1.0f);
|
||||
//Console.WriteLine(1);
|
||||
glFunc.Clear(MaskBufferBit.COLOR /**/| MaskBufferBit.DEPTH /**/ );
|
||||
GL.Clear(MaskBufferBit.COLOR /**/| MaskBufferBit.DEPTH /**/ );
|
||||
|
||||
/**/
|
||||
vao.Bind(0);
|
||||
@@ -194,7 +194,7 @@ namespace StgSharp
|
||||
float time = /* CurrentFrameCount, / /**/ 0.003f;
|
||||
|
||||
|
||||
glFunc.SetUniformValue(color,
|
||||
GL.SetUniformValue(color,
|
||||
0.5f + MathF.Cos(time),
|
||||
0.5f + MathF.Sin((time * 0.66667f) + ((2 * Scaler.Pi) / 3)),
|
||||
0.5f + MathF.Sin((time * 0.33333f) + (Scaler.Pi / 3)),
|
||||
@@ -206,7 +206,7 @@ namespace StgSharp
|
||||
|
||||
//Console.WriteLine(NativeCamera.Projection);
|
||||
|
||||
glFunc.DrawElements(GeometryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero);
|
||||
GL.DrawElements(GeometryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero);
|
||||
|
||||
VertexArray.BindNull();
|
||||
/**/
|
||||
@@ -255,4 +255,5 @@ namespace StgSharp
|
||||
}
|
||||
/**/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user