diff --git a/SMCode/SM.Base/Window/RenderPipeline.cs b/SMCode/SM.Base/Window/RenderPipeline.cs index 7365cb5..649d11a 100644 --- a/SMCode/SM.Base/Window/RenderPipeline.cs +++ b/SMCode/SM.Base/Window/RenderPipeline.cs @@ -53,9 +53,10 @@ namespace SM.Base.Window /// public virtual void Initialization() { - MainFramebuffer.Name = GetType().Name + ".MainFramebuffer"; - - if (MainFramebuffer != null) Framebuffers.Add(MainFramebuffer); + if (MainFramebuffer != null) { + Framebuffers.Add(MainFramebuffer); + MainFramebuffer.Name = GetType().Name + ".MainFramebuffer"; + } DefaultShader ??= SMRenderer.DefaultMaterialShader; } diff --git a/SMCode/SM2D/Pipelines/Basic2DPipeline.cs b/SMCode/SM2D/Pipelines/Basic2DPipeline.cs index 2945fe0..0b1b0e8 100644 --- a/SMCode/SM2D/Pipelines/Basic2DPipeline.cs +++ b/SMCode/SM2D/Pipelines/Basic2DPipeline.cs @@ -1,5 +1,7 @@ -using SM.Base.Shaders; +using OpenTK.Graphics.OpenGL4; +using SM.Base.Shaders; using SM.Base.Window; +using SM.OGL.Framebuffer; using SM2D.Shader; namespace SM2D.Pipelines @@ -12,7 +14,8 @@ namespace SM2D.Pipelines /// /// The access to the pipeline. /// - public static Basic2DPipeline Pipeline = new Basic2DPipeline(); + public static Basic2DPipeline Pipeline = + new Basic2DPipeline(); /// public override MaterialShader DefaultShader { get; protected set; } = ShaderCollection.Instanced; @@ -22,6 +25,8 @@ namespace SM2D.Pipelines /// protected override void RenderProcess(ref DrawContext context) { + Framebuffer.Screen.Activate(FramebufferTarget.Framebuffer, ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); + context.Scene?.Draw(context); } } diff --git a/SMCode/SM2D/Properties/AssemblyInfo.cs b/SMCode/SM2D/Properties/AssemblyInfo.cs index 634ede6..d73b59d 100644 --- a/SMCode/SM2D/Properties/AssemblyInfo.cs +++ b/SMCode/SM2D/Properties/AssemblyInfo.cs @@ -35,5 +35,4 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.1.1")] \ No newline at end of file diff --git a/SM_TEST/Program.cs b/SM_TEST/Program.cs index bed67ca..bc5c4f6 100644 --- a/SM_TEST/Program.cs +++ b/SM_TEST/Program.cs @@ -3,9 +3,8 @@ using OpenTK.Graphics; using OpenTK.Input; using SM.Base; using SM.Base.Window; -using SM.Game.Controls; using SM2D; -using SM2D.Drawing; +using SM2D.Pipelines; using SM2D.Scene; using Font = SM.Base.Drawing.Text.Font; using Vector2 = OpenTK.Vector2; @@ -19,20 +18,10 @@ namespace SM_TEST private static GLWindow window; static void Main(string[] args) { - font = new Font(@"C:\Windows\Fonts\Arial.ttf") - { - FontSize = 16 - }; - - //Log.SetLogFile(compressionFolder:"logs"); - - window = new GLWindow {VSync = VSyncMode.Off}; + window = new GLWindow(); window.ApplySetup(new Window2DSetup()); - window.SetRenderPipeline(new TestRenderPipeline()); + window.SetRenderPipeline(Basic2DPipeline.Pipeline); window.SetScene(scene = new Scene()); - window.RunFixedUpdate(60); - window.Load += WindowOnLoad; - window.RenderFrame += WindowOnUpdateFrame; window.Run(); } @@ -41,19 +30,6 @@ namespace SM_TEST } private static void WindowOnLoad(IGenericWindow window) - { - scene.ShowAxisHelper = true; - //scene.Background.Color = Color4.White; - - DrawObject2D box = new DrawObject2D(); - scene.Objects.Add(box); - - DrawText text = new DrawText(font, "Test Text"); - text.Transform.Position.Set(50, 0); - text.Transform.Size.Set(2); - scene.HUD.Add(text); - - //particles.Trigger(); - } + { } } } \ No newline at end of file diff --git a/SM_TEST/SM_TEST.csproj b/SM_TEST/SM_TEST.csproj index 8658e18..b84ebe5 100644 --- a/SM_TEST/SM_TEST.csproj +++ b/SM_TEST/SM_TEST.csproj @@ -36,12 +36,6 @@ ..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll - - ..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll - - - ..\packages\SharpDX.XInput.4.2.0\lib\net45\SharpDX.XInput.dll - @@ -56,6 +50,9 @@ + + + {8e733844-4204-43e7-b3dc-3913cddabb0d} @@ -69,10 +66,6 @@ {a4565538-625a-42c6-a330-dd4f1abb3986} SM2D - - {079bab31-3dc4-40da-90c7-efaa8517c647} - SM.Game - \ No newline at end of file