smrendererv3/SM_TEST/Program.cs
Michel Fedde beb9c19081 28.10.2020
SM.Core:
+ Particle System
+ scriptable system for scripts

~ Moved Texts- and Particles-namespace to SM.Base.Drawing
~ Changed how you tell the stopwatch to pause. (From method to property)
~ Fixed Randomize.GetFloat(min, max)
~ Now automaticly adds the DrawingBase.Transformation to DrawContext.ModelMatrix. No need to change DrawContext.Instances[0], anymore.

SM.OGL:
+ "one-file-shader"-support

SM2D:
+ DrawParticles (Control for Texture and Color not there yet)

~ Changed coordnate system to upper-right as (1,1)
~ Changed default shader to "one-file-shader"
2020-10-28 18:19:15 +01:00

63 lines
No EOL
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Security.Authentication.ExtendedProtection.Configuration;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using SM.Base;
using SM.Base.Scene;
using SM.Base.Time;
using SM.Utility;
using SM2D;
using SM2D.Drawing;
using SM2D.Object;
using SM2D.Scene;
using Font = SM.Base.Drawing.Text.Font;
using Vector2 = OpenTK.Vector2;
namespace SM_TEST
{
class Program
{
static Scene scene;
private static Font font;
private static GLWindow2D window;
static void Main(string[] args)
{
font = new Font(@"C:\Windows\Fonts\Arial.ttf")
{
FontSize = 32
};
Log.SetLogFile(compressionFolder:"logs");
window = new GLWindow2D {Scaling = new Vector2(0, 1000)};
//window.GrabCursor();
window.SetScene(scene = new Scene());
window.Load += WindowOnLoad;
window.RenderFrame += WindowOnUpdateFrame;
window.Run();
}
private static DrawParticles particles;
private static void WindowOnUpdateFrame(object sender, FrameEventArgs e)
{
if (Keyboard.GetState()[Key.R])
particles.Trigger();
particles.Paused = Keyboard.GetState()[Key.P];
}
private static void WindowOnLoad(object sender, EventArgs e)
{
particles = new DrawParticles(TimeSpan.FromSeconds(5))
{
MaxSpeed = 10
};
window.CurrentScene.Objects.Add(particles);
//particles.Trigger();
}
}
}