daily update on 20240407 by nitload youmu
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
//using StgSharp.Envitronment.Win32;
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Graphic;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Math;
|
||||
|
||||
@@ -18,6 +19,7 @@ namespace StgSharp
|
||||
private Texture texture;
|
||||
private VertexArray vao;
|
||||
private VertexBuffer vbo;
|
||||
private Camera camera;
|
||||
|
||||
protected override unsafe void ProcessInput()
|
||||
{
|
||||
@@ -38,7 +40,6 @@ namespace StgSharp
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
InternalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info);
|
||||
@@ -54,6 +55,7 @@ namespace StgSharp
|
||||
{
|
||||
GL.Viewport(0, 0, width, height);
|
||||
};
|
||||
|
||||
shader = CreateShaderProgram();
|
||||
var vertex = CreateShader(ShaderType.Vertex, 1);
|
||||
var fragment = CreateShader(ShaderType.Fragment, 1);
|
||||
@@ -68,10 +70,10 @@ namespace StgSharp
|
||||
0.0f, 0.5f, 0.0f
|
||||
);
|
||||
Rectangle rec = new Rectangle(
|
||||
-0.5f, 0.5f, 0.0f,
|
||||
0.5f, 0.5f, 0.0f,
|
||||
0.5f, -0.5f, 0.0f,
|
||||
-0.5f, -0.5f, 0.0f
|
||||
-0.75f, 0.75f, 0.0f,
|
||||
0.75f, 0.75f, 0.0f,
|
||||
0.75f, -0.75f, 0.0f,
|
||||
-0.75f, -0.75f, 0.0f
|
||||
);
|
||||
Polygon5 polygon = new Polygon5(
|
||||
-0.4f, 0.5f, 0.0f,
|
||||
@@ -117,6 +119,14 @@ namespace StgSharp
|
||||
ourTexture2 = shader.GetUniform<int>("ourTexture2");
|
||||
GL.SetValue(ourTexture2, 1);
|
||||
/**/
|
||||
|
||||
camera = new Camera(
|
||||
new vec3d(0,0,1.0f),
|
||||
new vec3d(0,0,0),
|
||||
new vec3d(0,1,0)
|
||||
);
|
||||
camera.Perspective(new Radius(Scaler.Pi / 3),this.Size,0.5f,-0.5f);
|
||||
camera.GainAllUniforms(shader, "projection", "lookAt");
|
||||
}
|
||||
|
||||
protected override void Main()
|
||||
@@ -145,6 +155,7 @@ namespace StgSharp
|
||||
0.5f + MathF.Sin(time * 0.33333f + Scaler.Pi / 3),
|
||||
time
|
||||
);
|
||||
camera.SetAllUniforms();
|
||||
/**/
|
||||
|
||||
GL.DrawElements(GepmetryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero);
|
||||
@@ -153,7 +164,7 @@ namespace StgSharp
|
||||
/**/
|
||||
}
|
||||
|
||||
[MultiFrameActivity()]
|
||||
//[MultiFrameActivity()]
|
||||
public void Beep()
|
||||
{
|
||||
if (CurrentFrameCount%60==0)
|
||||
@@ -163,8 +174,8 @@ namespace StgSharp
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoOptimization)]
|
||||
[RenderActivity(RenderPriority.Pre_1)]
|
||||
|
||||
//[RenderActivity(RenderPriority.Pre_1)]
|
||||
public void NoOp()
|
||||
{
|
||||
int a = 1;
|
||||
|
||||
Reference in New Issue
Block a user