* Source/Examples/OpenTK/Test/GameWindowStates.cs: Handle

MouseButtonUp event to make mouse visible.
This commit is contained in:
the_fiddler 2010-10-18 15:48:32 +00:00
parent 42e0880cbb
commit f201c3bed9

View file

@ -41,6 +41,7 @@ namespace Examples.Tests
WindowStateChanged += delegate { refresh_text = true; }; WindowStateChanged += delegate { refresh_text = true; };
Mouse.Move += MouseMoveHandler; Mouse.Move += MouseMoveHandler;
Mouse.ButtonDown += MouseButtonHandler; Mouse.ButtonDown += MouseButtonHandler;
Mouse.ButtonUp += MouseButtonHandler;
} }
void KeyDownHandler(object sender, KeyboardKeyEventArgs e) void KeyDownHandler(object sender, KeyboardKeyEventArgs e)
@ -85,6 +86,8 @@ namespace Examples.Tests
{ {
refresh_text = true; refresh_text = true;
if (e.Button == MouseButton.Left)
{
if (e.IsPressed) if (e.IsPressed)
{ {
CursorVisible = false; CursorVisible = false;
@ -96,6 +99,7 @@ namespace Examples.Tests
move_window = false; move_window = false;
} }
} }
}
static int Clamp(int val, int min, int max) static int Clamp(int val, int min, int max)
{ {