aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples
diff options
context:
space:
mode:
Diffstat (limited to 'Samples')
-rw-r--r--Samples/HelloWorld/main.cs8
-rw-r--r--Samples/PerfTests/Program.cs22
-rw-r--r--Samples/common/src/SampleBase.cs5
3 files changed, 18 insertions, 17 deletions
diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs
index e60b9782..e84607b9 100644
--- a/Samples/HelloWorld/main.cs
+++ b/Samples/HelloWorld/main.cs
@@ -1,13 +1,15 @@
using System;
using Crow;
+using Glfw;
using Samples;
namespace HelloWorld
{
- class Program {
+ class Program : Interface {
+ Program() : base (800, 600, true, true) {}
static void Main (string[] args) {
- using (Interface app = new Interface ()) {
- app.Initialized += (sender, e) => app.LoadIMLFragment (@"<Label Text='Hello World'/>");
+ using (Program app = new Program ()) {
+ app.Initialized += (sender, e) => app.LoadIMLFragment (@"<Window Caption='Hello World'/>");
app.Run ();
}
}
diff --git a/Samples/PerfTests/Program.cs b/Samples/PerfTests/Program.cs
index d7f6a9be..cbe62738 100644
--- a/Samples/PerfTests/Program.cs
+++ b/Samples/PerfTests/Program.cs
@@ -64,7 +64,7 @@ namespace PerfTests
}
public TestInterface (string[] args, int width = 800, int height = 600)
- : base (width, height, false, false)
+ : base (width, height, true, false)
{
string outDir = null;
@@ -141,15 +141,10 @@ namespace PerfTests
writer.WriteLine ("Path;MinEllapsed;MaxEllapsed;MeanEllapsed;MedianEllapsed;sigmaEllapsed;MinMem;MaxMem;MeanMem;MedianMem;sigmaMem;MinAlloc;MaxAlloc;MeanAlloc;MedianAlloc;sigmaAlloc");
}
- if (screenOutput) {
- initBackend ();
+ if (screenOutput)
initSurface ();
- } else {
- SolidBackground = false;
- initBackend (true);
-
- CreateMainSurface (ref clientRectangle);
- }
+ else
+ initBackend ();
initDictionaries ();
loadStyling ();
@@ -163,6 +158,15 @@ namespace PerfTests
outStream.Dispose ();
}
}
+ protected override void initBackend()
+ {
+ if (screenOutput)
+ backend = new Crow.CairoBackend.ImageBackend (WindowHandle, clientRectangle.Width, clientRectangle.Height);
+ else
+ backend = new Crow.CairoBackend.ImageBackend (clientRectangle.Width, clientRectangle.Height);
+
+ clipping = Backend.CreateRegion ();
+ }
struct Measures
{
diff --git a/Samples/common/src/SampleBase.cs b/Samples/common/src/SampleBase.cs
index 2d773af4..2e7440a1 100644
--- a/Samples/common/src/SampleBase.cs
+++ b/Samples/common/src/SampleBase.cs
@@ -20,11 +20,6 @@ namespace Samples
{
public SampleBase(IntPtr hWin) : base(800, 600, hWin) { }
public SampleBase() : base(800, 600, true, true) { }
- public SampleBase(int width, int height, bool startUIThread, bool createSurface) :
- base(width, height, startUIThread, createSurface)
- {
-
- }
public Version CrowVersion => Assembly.GetAssembly(typeof(Widget)).GetName().Version;