]> O.S.I.I.S - jp/crow.git/commitdiff
openGL draw measure
authorjpbruyere <jp.bruyere@hotmail.com>
Thu, 5 Jan 2017 14:13:49 +0000 (15:13 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 5 Jan 2017 14:13:49 +0000 (15:13 +0100)
Tests/Interfaces/perfMsr.crow
Tests/OpenTKGameWindow.cs
Tests/test.style

index f9fa38a9048f9d0c1384d9764be6a705c95acc51..d823ea4276ea58f8f54d5cb41d330a5de6e98aea 100755 (executable)
@@ -1,6 +1,10 @@
 <?xml version="1.0"?>
-<GroupBox CornerRadius="0" Margin="0" Caption="{Name}" Height="Fit" Width="160">
-       <VerticalStack>
+
+       <VerticalStack Spacing="0" Fit="true" Width="160">
+               <HorizontalStack Background="Black">
+                       <Label Text="{Name}" Width="Stretched" Font="doid bold, 10" Margin="2"/>
+                       <Button Caption="Reset" MouseClick="onResetClick" Height="Fit"/>
+               </HorizontalStack>
                <HorizontalStack>
                        <Label Text="Current:" Style="FpsLabel"/>
                        <Label Text="{current}" Style="FpsDisp"/>
@@ -25,6 +29,5 @@
                        <Label Text="Cpt:" Style="FpsLabel"/>
                        <Label Text="{cptMeasures}" Style="FpsDisp"/>
                </HorizontalStack>-->
-               <Button Caption="Reset" MouseClick="onResetClick"/>
        </VerticalStack>
-</GroupBox>
+
index f4d13874b5b4b4e0b09c504f8f6cb32bd1360309..1f103079be24726b4ea0427d9d2e504d84c34934 100644 (file)
@@ -80,6 +80,10 @@ namespace Crow
                public string drawing = "";
                public string layouting = "";
                public string clipping = "";
+               #if MEASURE_TIME
+               public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10);
+               #endif
+
                #endregion
 
                #region ctor
@@ -102,7 +106,8 @@ namespace Crow
                                        this.CrowInterface.updateMeasure,
                                        this.CrowInterface.layoutingMeasure,
                                        this.CrowInterface.clippingMeasure,
-                                       this.CrowInterface.drawingMeasure
+                                       this.CrowInterface.drawingMeasure,
+                                       this.glDrawMeasure
                                }
                        );
                        #endif
@@ -184,6 +189,9 @@ namespace Crow
                }
                void OpenGLDraw()
                {
+                       #if MEASURE_TIME
+                       glDrawMeasure.StartCycle();
+                       #endif
                        bool blend, depthTest;
                        GL.GetBoolean (GetPName.Blend, out blend);
                        GL.GetBoolean (GetPName.DepthTest, out depthTest);
@@ -211,6 +219,9 @@ namespace Crow
                                GL.Disable (EnableCap.Blend);
                        if (depthTest)
                                GL.Enable (EnableCap.DepthTest);
+                       #if MEASURE_TIME
+                       glDrawMeasure.StopCycle();
+                       #endif
                }
                #endregion
 
index 6eb186026ef8767369a46fe74476e107da45b968..fc327ab142284da222906b97fb0a98290af5f132 100644 (file)
@@ -1,13 +1,14 @@
 FpsLabel {
        Width = 50%;
        Font = droid, 10;
-       Margin = 1;
+       Margin = 0;
        TextAlignment = Center;
        Background = Onyx;
 }
 FpsDisp {
-       Font = droid , 12;
+       Font = droid bold, 10;
        Width = 50%;
+       Margin = 0;
        TextAlignment = Center;
        Background = Teal;
 }