aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GOLIBTest_4.cs7
-rw-r--r--Tests/GOLIBTest_Window.cs25
-rw-r--r--Tests/GOLIBTest_fps.cs33
-rwxr-xr-xTests/Interfaces/fps.goml40
-rwxr-xr-xTests/Interfaces/testWindow.goml10
-rw-r--r--Tests/Tests.csproj4
6 files changed, 46 insertions, 73 deletions
diff --git a/Tests/GOLIBTest_4.cs b/Tests/GOLIBTest_4.cs
index 141f41d8..8adb5064 100644
--- a/Tests/GOLIBTest_4.cs
+++ b/Tests/GOLIBTest_4.cs
@@ -150,12 +150,7 @@ namespace test
c.Top += e.YDelta;
c.registerForGraphicUpdate ();
}
- protected override void OnRenderFrame (FrameEventArgs e)
- {
- GL.Clear (ClearBufferMask.ColorBufferBit);
- base.OnRenderFrame (e);
- SwapBuffers ();
- }
+
private int frameCpt = 0;
protected override void OnUpdateFrame (FrameEventArgs e)
{
diff --git a/Tests/GOLIBTest_Window.cs b/Tests/GOLIBTest_Window.cs
index 56a7712b..4ce0b654 100644
--- a/Tests/GOLIBTest_Window.cs
+++ b/Tests/GOLIBTest_Window.cs
@@ -18,6 +18,10 @@ namespace test
{
class GOLIBTest_Window : OpenTKGameWindow , IValueChange
{
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ #endregion
+
#region FPS
int _fps = 0;
@@ -64,7 +68,7 @@ namespace test
#endregion
public GOLIBTest_Window ()
- : base(600, 400,"test")
+ : base(800, 600,"test")
{}
Window g;
@@ -78,15 +82,10 @@ namespace test
// LoadInterface("Interfaces/testWindow.goml", out g);
// LoadInterface("Interfaces/testWindow.goml", out g);
// LoadInterface("Interfaces/testWindow.goml", out g);
-
- }
- protected override void OnRenderFrame (FrameEventArgs e)
- {
- GL.Clear (ClearBufferMask.ColorBufferBit);
- base.OnRenderFrame (e);
- SwapBuffers ();
+ CursorVisible = true;
}
+
private int frameCpt = 0;
protected override void OnUpdateFrame (FrameEventArgs e)
{
@@ -102,11 +101,11 @@ namespace test
frameCpt++;
}
- #region IValueChange implementation
-
- public event EventHandler<ValueChangeEventArgs> ValueChanged;
-
- #endregion
+ protected override void OnKeyDown (KeyboardKeyEventArgs e)
+ {
+ base.OnKeyDown (e);
+ this.Quit ();
+ }
[STAThread]
static void Main ()
diff --git a/Tests/GOLIBTest_fps.cs b/Tests/GOLIBTest_fps.cs
index 12fdf444..c46efcb2 100644
--- a/Tests/GOLIBTest_fps.cs
+++ b/Tests/GOLIBTest_fps.cs
@@ -36,9 +36,10 @@ namespace test
fpsMin = _fps;
ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
}
-
- if (ValueChanged != null)
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
+ this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
}
}
@@ -53,6 +54,8 @@ namespace test
}
#endregion
+ public string update = "";
+
string name = "testName";
public string Name {
@@ -66,31 +69,20 @@ namespace test
public GOLIBTest_fps ()
: base(600, 400,"test")
- {}
-
- Container g;
- Label labFps, labFpsMin, labFpsMax, labUpdate;
+ {
+ VSync = VSyncMode.Off;
+ }
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
- LoadInterface("Interfaces/fps.goml", out g);
+ LoadInterface("Interfaces/fps.goml");
- labFps = g.FindByName ("labFps") as Label;
- labFpsMin = g.FindByName ("labFpsMin") as Label;
- labFpsMax = g.FindByName ("labFpsMax") as Label;
- labUpdate = g.FindByName ("labUpdate") as Label;
//ValueChanged += (object sender, ValueChangeEventArgs vce) => labFps.Text = vce.NewValue.ToString ();
}
- protected override void OnRenderFrame (FrameEventArgs e)
- {
- GL.Clear (ClearBufferMask.ColorBufferBit);
- base.OnRenderFrame (e);
- SwapBuffers ();
- }
private int frameCpt = 0;
protected override void OnUpdateFrame (FrameEventArgs e)
@@ -99,15 +91,10 @@ namespace test
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++;
}
diff --git a/Tests/Interfaces/fps.goml b/Tests/Interfaces/fps.goml
index 50e69604..151d9905 100755
--- a/Tests/Interfaces/fps.goml
+++ b/Tests/Interfaces/fps.goml
@@ -1,29 +1,25 @@
<?xml version="1.0"?>
-<Container Name="MainGrp"
-
- Margin="10" Focusable="True" Fit="True">
- <Expandable Width="150" Background="Green" Margin="2">
-<!-- HorizontalAlignment="Right" VerticalAlignment="Bottom"-->
-<!-- <VerticalStack Fit="True" BorderWidth="1" Margin="5" WidgetSpacing="4">-->
-<!-- <HorizontalStack>
- <Label Text="Update:" FontColor="White" VerticalAlignment="Center" />
- <Label Name="labUpdate" Text="xxxx" FontSize="12" Width="60" TextAlignment="Center" Background="DarkGreen"/>
- </HorizontalStack>-->
+<Container Name="MainGrp" Background="0,5;0,5;0,5;0,5"
+ HorizontalAlignment="Left" VerticalAlignment="Top"
+ Margin="10" Width="-1" Height="-1" Focusable="True" >
+
+ <VerticalStack Name="vsFps" BorderWidth="1" Margin="5" Spacing="4">
<HorizontalStack>
- <Label Text="Fps:" Width = "30" VerticalAlignment="Center" TextAlignment="LeftCenter"/>
- <Label Name="labFps" Text="{fps}" Font="droid bold, 12"
- TextAlignment="Center" Background="AoEnglish"/>
+ <Label Text="Update:" FontColor="White" />
+ <Label Name="labUpdate" Text="{update}" FontSize="12" Background="DarkGreen"/>
</HorizontalStack>
-<!-- <HorizontalStack>
+ <HorizontalStack Name="hsFps" Background="Red" >
+ <Label Name="captionFps" Text="Fps:" />
+ <Label Name="valueFps" Text="{fps}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack Background="Red">
<Label Text="Min:" Width = "30" />
- <Label Name="labFpsMin" Text="{fpsMin}" Font="droid bold, 12"
- TextAlignment="Center" Background="AoEnglish"/>
+ <Label Text="{fpsMin}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
- <HorizontalStack>
+ <HorizontalStack Background="Red" >
<Label Text="Max:" Width = "30"/>
- <Label Name="labFpsMax" Text="{fpsMax}" Font="droid bold, 12"
- TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>-->
-<!-- </VerticalStack>-->
- </Expandable>
+ <Label Text="{fpsMax}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+
+ </VerticalStack>
</Container> \ No newline at end of file
diff --git a/Tests/Interfaces/testWindow.goml b/Tests/Interfaces/testWindow.goml
index ae9cbc25..dc9dc3dc 100755
--- a/Tests/Interfaces/testWindow.goml
+++ b/Tests/Interfaces/testWindow.goml
@@ -2,10 +2,10 @@
<!--<Group>-->
<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,5"
Focusable="True">
- <VerticalStack Name="contentVSStack" Height="0" Width="0" Margin="1" Spacing="10">
- <Slider Name="slider" Height="20" Width="0"/>
+ <VerticalStack Name="contentVSStack" Height="0" Width="0" Margin="10" Spacing="10">
+ <Slider Name="slider" Height="10" Width="0"/>
- <HorizontalStack Width="0" Height="-1" Margin="0" Background="Red">
+ <HorizontalStack Width="-1" Height="-1" Margin="0" Background="Red">
<Checkbox Height="-1" Width="-1"/>
<Checkbox Height="-1" Width="-1"/>
</HorizontalStack>
@@ -14,10 +14,6 @@
<RadioButton Caption="Radio 1"/>
<RadioButton Caption="Radio 2" IsChecked="true"/>
<RadioButton Caption="Radio 3"/>
- <RadioButton Caption="Radio 4"/>
- <RadioButton Caption="Radio 5"/>
- <RadioButton Caption="Radio 6"/>
- <RadioButton Caption="Radio 7"/>
</VerticalStack>
</GroupBox>
<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index a85eadf0..3fa1d1d9 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>test.GOLIBTest_4</StartupObject>
+ <StartupObject>test.GOLIBTest_Window</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>..\bin\$(configuration)</OutputPath>
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
@@ -40,7 +40,7 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Drawing" />
<Reference Include="OpenTK">
- <HintPath>..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>
+ <HintPath>..\..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>