<None Include="Data\Audio\the_ring_that_fell.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Data\Textures\cursor.png">
+ <None Include="Data\Textures\cursor.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="OpenGL\1.x\OpenGLDiagnostics.rtf" />
<Link>Dependencies\x64\libSDL2.dylib</Link>
</None>
<Compile Include="OpenTK\Test\ExternalContext.cs" />
+ <Compile Include="OpenTK\Test\PointToClient.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
--- /dev/null
+using System;
+using System.Diagnostics;
+using System.Drawing;
+using OpenTK;
+
+namespace Examples.Tests
+{
+ [Example("PointToClient Test", ExampleCategory.OpenTK, "NativeWindow")]
+ public class PointToClientTest
+ {
+ public static void Main()
+ {
+ using (var window = new NativeWindow())
+ {
+ Trace.WriteLine(String.Format("Window bounds: {0}", window.Bounds));
+ Trace.WriteLine(String.Format("Window client: {0}", window.ClientRectangle));
+
+ Point pclient = new Point(100, 100);
+ Point pscreen = window.PointToScreen(pclient);
+ Point ptest = window.PointToClient(pscreen);
+ Trace.WriteLine(String.Format("Client: {0} -> Screen: {1} -> Client: {2}",
+ pclient, pscreen, ptest));
+ Trace.WriteLine(String.Format("Test {0}",
+ ptest == pclient ? "succeeded" : "failed"));
+
+ pscreen = new Point(100, 100);
+ pclient = window.PointToClient(pscreen);
+ ptest = window.PointToScreen(pclient);
+ Trace.WriteLine(String.Format("Screen: {0} -> Client: {1} -> Screen: {2}",
+ pscreen, pclient, ptest));
+ Trace.WriteLine(String.Format("Test {0}",
+ ptest == pscreen ? "succeeded" : "failed"));
+ }
+ }
+ }
+}
+