Implement quick shader switch hotkeys

This commit is contained in:
Dynamitos
2024-05-23 14:58:14 +02:00
parent 8399b176bb
commit e0961bce24
20 changed files with 160 additions and 110 deletions
+19
View File
@@ -12,6 +12,9 @@
using namespace Seele;
bool usePositionOnly = false;
bool useViewCulling = false;
GameView::GameView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo &createInfo, std::string dllPath)
: View(graphics, window, createInfo, "Game")
, scene(new Scene(graphics))
@@ -98,6 +101,22 @@ void GameView::reloadGame()
void GameView::keyCallback(KeyCode code, InputAction action, KeyModifier modifier)
{
keyboardSystem->keyCallback(code, action, modifier);
if (code == KeyCode::KEY_P && action == InputAction::RELEASE)
{
usePositionOnly = true;
}
if (code == KeyCode::KEY_O && action == InputAction::RELEASE)
{
usePositionOnly = false;
}
if (code == KeyCode::KEY_L && action == InputAction::RELEASE)
{
useViewCulling = true;
}
if (code == KeyCode::KEY_K && action == InputAction::RELEASE)
{
useViewCulling = false;
}
}
void GameView::mouseMoveCallback(double xPos, double yPos)