Commit 704f5322 authored by chili's avatar chili
Browse files

toggling cursor

parent 8cf923ec
......@@ -16,7 +16,6 @@ App::App()
light( wnd.Gfx() )
{
wnd.Gfx().SetProjection( dx::XMMatrixPerspectiveLH( 1.0f,9.0f / 16.0f,0.5f,40.0f ) );
wnd.DisableCursor();
}
void App::DoFrame()
......@@ -29,6 +28,23 @@ void App::DoFrame()
nano.Draw( wnd.Gfx() );
light.Draw( wnd.Gfx() );
while( const auto e = wnd.kbd.ReadKey() )
{
if( e->IsPress() && e->GetCode() == VK_INSERT )
{
if( cursorEnabled )
{
wnd.DisableCursor();
cursorEnabled = false;
}
else
{
wnd.EnableCursor();
cursorEnabled = true;
}
}
}
// imgui windows
cam.SpawnControlWindow();
light.SpawnControlWindow();
......@@ -59,6 +75,7 @@ void App::ShowRawInputWindow()
if( ImGui::Begin( "Raw Input" ) )
{
ImGui::Text( "Tally: (%d,%d)",x,y );
ImGui::Text( "Cursor: %s",cursorEnabled?"enabled":"disabled" );
}
ImGui::End();
}
......
......@@ -19,6 +19,7 @@ private:
void ShowImguiDemoWindow();
void ShowRawInputWindow();
private:
bool cursorEnabled = true;
int x = 0,y = 0;
ImguiManager imgui;
Window wnd;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment