mirror of
https://github.com/ApfelTeeSaft/ScuffedMinecraft.git
synced 2026-08-27 03:43:40 +00:00
Fix for Issue #26
Added Global Bool to keep track of MenuState and Check it on every Interaction
This commit is contained in:
@@ -32,6 +32,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos);
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods);
|
||||
|
||||
bool inEscMenu = false;
|
||||
float deltaTime = 0.0f;
|
||||
float lastFrame = 0.0f;
|
||||
int fpsCount = 0;
|
||||
@@ -564,6 +565,7 @@ void processInput(GLFWwindow* window)
|
||||
escapeDown = true;
|
||||
menuMode = !menuMode;
|
||||
glfwSetInputMode(window, GLFW_CURSOR, menuMode ? GLFW_CURSOR_NORMAL : GLFW_CURSOR_DISABLED);
|
||||
inEscMenu = menuMode;
|
||||
firstMouse = true;
|
||||
//glfwSetWindowShouldClose(window, true);
|
||||
}
|
||||
@@ -603,6 +605,7 @@ void processInput(GLFWwindow* window)
|
||||
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if (inEscMenu) return;
|
||||
if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS)
|
||||
{
|
||||
auto result = Physics::Raycast(camera.Position, camera.Front, 5);
|
||||
|
||||
Reference in New Issue
Block a user