Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 63897e3

Browse files
committed
testing
1 parent cf97a72 commit 63897e3

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

source/Tests/GraphicsWindowTest.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,33 @@ public GraphicsWindowTest()
5151

5252
~GraphicsWindowTest()
5353
{
54-
_window.Dispose();
55-
_graphics.Dispose();
54+
//_window.Dispose();
55+
//_graphics.Dispose();
5656
}
5757

5858
public void Run()
5959
{
6060
_window.Create();
6161

62+
Console.WriteLine(_window.Handle.ToString("X"));
63+
}
64+
65+
public void Join()
66+
{
6267
_window.Join();
6368
}
6469

70+
public void Stop()
71+
{
72+
_window.Dispose();
73+
_graphics.Dispose();
74+
}
75+
76+
public void ReCreate()
77+
{
78+
_window.Recreate();
79+
}
80+
6581
private void _window_SetupGraphics(object sender, SetupGraphicsEventArgs e)
6682
{
6783
var gfx = e.Graphics;
@@ -70,6 +86,8 @@ private void _window_SetupGraphics(object sender, SetupGraphicsEventArgs e)
7086
_brushes["white"] = gfx.CreateSolidBrush(255, 255, 255);
7187
_brushes["background"] = gfx.CreateSolidBrush(0, 0x27, 0x31, 255.0f * 0.8f);
7288

89+
Console.WriteLine(_window.Handle.ToString("X"));
90+
7391
// fonts don't need to be recreated since they are owned by the font factory and not the drawing device
7492
if (e.RecreateResources) return;
7593

source/Tests/Program.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ public static void Main(string[] _)
99
var overlay = new GraphicsWindowTest();
1010

1111
overlay.Run();
12+
13+
Console.ReadLine();
14+
15+
overlay.ReCreate();
16+
17+
Console.WriteLine("Recreated");
18+
19+
Console.ReadLine();
20+
21+
overlay.Stop();
22+
23+
Console.WriteLine("Stopped");
24+
25+
Console.ReadLine();
1226
}
1327
}
1428
}

0 commit comments

Comments
 (0)