Adding controls.
This commit is contained in:
16
main.cpp
16
main.cpp
@@ -191,6 +191,11 @@ public:
|
||||
LoadShader(vert_name, frag_name);
|
||||
}
|
||||
|
||||
using CmdArgs = std::vector<std::string>;
|
||||
void PositionCmd(const CmdArgs& args) {
|
||||
|
||||
}
|
||||
|
||||
void CreateMenu() {
|
||||
using namespace JUI::UDimLiterals;
|
||||
|
||||
@@ -227,7 +232,11 @@ public:
|
||||
console->OnInput += [this] (const std::string& message) {
|
||||
auto tokens = string_expand(message);
|
||||
|
||||
|
||||
std::string cmd = tokens[0];
|
||||
// TODO: Remove 0th element from tokens before passing to command delegates.
|
||||
|
||||
|
||||
|
||||
if (tokens.size() == 0)
|
||||
{
|
||||
@@ -253,6 +262,8 @@ public:
|
||||
return;
|
||||
}
|
||||
console->Log("Error: Command syntax is ls <shader-name>", Colors::Red);
|
||||
} else if (cmd == "pos") {
|
||||
return PositionCmd(tokens);
|
||||
} else {
|
||||
console->Log(std::format("No such command: {}", cmd), Colors::Red);
|
||||
}
|
||||
@@ -331,6 +342,11 @@ public:
|
||||
// TODO: Vary the rate appropriately.
|
||||
float rate = elapsed * 0.125f;
|
||||
|
||||
if (IsKeyDown(Keys::LeftShift))
|
||||
rate *= 0.125f;
|
||||
|
||||
if (IsKeyDown(Keys::LeftControl))
|
||||
rate *= 0.125f;
|
||||
|
||||
if (IsKeyDown(Keys::Minus))
|
||||
u_scale += rate;
|
||||
|
Reference in New Issue
Block a user