From: jpbruyere Date: Sat, 2 May 2015 07:19:19 +0000 (+0200) Subject: Layouting queue, debug X-Git-Tag: 0.2~98^2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=40392cc3bcaee5b67d85b0aabfd42d2881823bd6;p=jp%2Fcrow.git Layouting queue, debug test4 validated --- diff --git a/Tests/GOLIBTest_4.1.cs b/Tests/GOLIBTest_4.1.cs new file mode 100644 index 00000000..01621df8 --- /dev/null +++ b/Tests/GOLIBTest_4.1.cs @@ -0,0 +1,55 @@ +#define MONO_CAIRO_DEBUG_DISPOSE + + +using System; +using System.Runtime.InteropServices; +using OpenTK; +using OpenTK.Graphics.OpenGL; +using OpenTK.Input; + +using System.Diagnostics; + +//using GGL; +using go; +using System.Threading; + + +namespace test +{ + class GOLIBTest_4_1 : OpenTKGameWindow + { + public GOLIBTest_4_1 () + : base(1024, 600,"test") + {} + + Group g; + + protected override void OnLoad (EventArgs e) + { + base.OnLoad (e); + LoadInterface("Interfaces/test4.1.goml", out g); + + } + protected override void OnRenderFrame (FrameEventArgs e) + { + GL.Clear (ClearBufferMask.ColorBufferBit); + base.OnRenderFrame (e); + SwapBuffers (); + } + + protected override void OnUpdateFrame (FrameEventArgs e) + { + base.OnUpdateFrame (e); + } + + [STAThread] + static void Main () + { + Console.WriteLine ("starting example"); + + using (GOLIBTest_4_1 win = new GOLIBTest_4_1( )) { + win.Run (30.0); + } + } + } +} \ No newline at end of file diff --git a/Tests/GOLIBTest_4.cs b/Tests/GOLIBTest_4.cs index 2482a66e..5ee286b6 100644 --- a/Tests/GOLIBTest_4.cs +++ b/Tests/GOLIBTest_4.cs @@ -113,8 +113,8 @@ namespace test } ); i++; - if (i > 50) - break; +// if (i > 50) +// break; } } void pFps_mousemove(object sender, MouseMoveEventArgs e) @@ -124,7 +124,6 @@ namespace test redrawClip.AddRectangle (c.ScreenCoordinates(c.Slot)); c.Left += e.XDelta; c.Top += e.YDelta; - c.LayoutIsValid = false; c.registerForGraphicUpdate (); } protected override void OnRenderFrame (FrameEventArgs e) diff --git a/Tests/GOLIBTest_fps.cs b/Tests/GOLIBTest_fps.cs new file mode 100644 index 00000000..946eb5e1 --- /dev/null +++ b/Tests/GOLIBTest_fps.cs @@ -0,0 +1,101 @@ +#define MONO_CAIRO_DEBUG_DISPOSE + + +using System; +using System.Runtime.InteropServices; +using OpenTK; +using OpenTK.Graphics.OpenGL; +using OpenTK.Input; + +using System.Diagnostics; + +//using GGL; +using go; +using System.Threading; + + +namespace test +{ + class GOLIBTest_fps : OpenTKGameWindow + { + #region FPS + static int _fps = 0; + + public static int fps { + get { return _fps; } + set { + _fps = value; + if (_fps > fpsMax) + fpsMax = _fps; + else if (_fps < fpsMin) + fpsMin = _fps; + } + + } + + public static int fpsMin = int.MaxValue; + public static int fpsMax = 0; + + static void resetFps () + { + fpsMin = int.MaxValue; + fpsMax = 0; + _fps = 0; + } + #endregion + + public GOLIBTest_fps () + : base(400, 200,"test") + {} + + Container g; + Label labFps, labFpsMin, labFpsMax, labUpdate; + + protected override void OnLoad (EventArgs e) + { + base.OnLoad (e); + LoadInterface("Interfaces/fps.goml", out g); + + labFps = g.FindByName ("labFps") as Label; + labFpsMin = g.FindByName ("labFpsMin") as Label; + labFpsMax = g.FindByName ("labFpsMax") as Label; + labUpdate = g.FindByName ("labUpdate") as Label; + + } + protected override void OnRenderFrame (FrameEventArgs e) + { + GL.Clear (ClearBufferMask.ColorBufferBit); + base.OnRenderFrame (e); + SwapBuffers (); + } + + private int frameCpt = 0; + protected override void OnUpdateFrame (FrameEventArgs e) + { + base.OnUpdateFrame (e); + + fps = (int)RenderFrequency; + + labFps.Text = fps.ToString(); + labUpdate.Text = this.updateTime.ElapsedMilliseconds.ToString() + " ms"; + if (frameCpt > 200) { + labFpsMin.Text = fpsMin.ToString(); + labFpsMax.Text = fpsMax.ToString(); + resetFps (); + frameCpt = 0; + + } + frameCpt++; + } + + [STAThread] + static void Main () + { + Console.WriteLine ("starting example"); + + using (GOLIBTest_fps win = new GOLIBTest_fps( )) { + win.Run (30.0); + } + } + } +} \ No newline at end of file diff --git a/Tests/Interfaces/fps.goml b/Tests/Interfaces/fps.goml new file mode 100755 index 00000000..85b60afd --- /dev/null +++ b/Tests/Interfaces/fps.goml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/test1.1.goml b/Tests/Interfaces/test1.1.goml index 6ccf2c1c..86faa998 100755 --- a/Tests/Interfaces/test1.1.goml +++ b/Tests/Interfaces/test1.1.goml @@ -1,15 +1,15 @@  - - + Name="PhaseOverlay1" Width="100" Height="100" Path="image/u.svg" Background="Red"/> + Name="PhaseOverlay2" Width="100" Height="100" Path="image/u.svg" Background="Red"/> - + \ No newline at end of file diff --git a/Tests/Interfaces/test1.2.goml b/Tests/Interfaces/test1.2.goml index 1ccc51ec..c467cd51 100755 --- a/Tests/Interfaces/test1.2.goml +++ b/Tests/Interfaces/test1.2.goml @@ -1,10 +1,10 @@  - - + +