aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-01-05 15:13:49 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2017-01-05 15:13:49 +0100
commit40b16003066ad42604fd82dc0eec9cfa0a4abeca (patch)
tree98edc74358d94df1ce82262ee83c40d0b9dd593b
parente72a5709781c52d0db3468c43313bdba0a5c530d (diff)
openGL draw measure
-rwxr-xr-xTests/Interfaces/perfMsr.crow11
-rw-r--r--Tests/OpenTKGameWindow.cs13
-rw-r--r--Tests/test.style5
3 files changed, 22 insertions, 7 deletions
diff --git a/Tests/Interfaces/perfMsr.crow b/Tests/Interfaces/perfMsr.crow
index f9fa38a9..d823ea42 100755
--- a/Tests/Interfaces/perfMsr.crow
+++ b/Tests/Interfaces/perfMsr.crow
@@ -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>
+
diff --git a/Tests/OpenTKGameWindow.cs b/Tests/OpenTKGameWindow.cs
index f4d13874..1f103079 100644
--- a/Tests/OpenTKGameWindow.cs
+++ b/Tests/OpenTKGameWindow.cs
@@ -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
diff --git a/Tests/test.style b/Tests/test.style
index 6eb18602..fc327ab1 100644
--- a/Tests/test.style
+++ b/Tests/test.style
@@ -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;
}