summaryrefslogtreecommitdiffhomepage
path: root/src/input.cpp
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-11-26 16:46:01 -0500
committerrealtradam <[email protected]>2022-11-26 16:46:01 -0500
commit368269070f851ff78a1bce35c1d993d5f02cc5f9 (patch)
tree83292448b320f561148f16efdbb456c85ab00f87 /src/input.cpp
parent68486053b032fd3313c887ea7d73064e59dce570 (diff)
downloadOgle-368269070f851ff78a1bce35c1d993d5f02cc5f9.tar.gz
Ogle-368269070f851ff78a1bce35c1d993d5f02cc5f9.zip
namespace it all
Diffstat (limited to 'src/input.cpp')
-rw-r--r--src/input.cpp62
1 files changed, 32 insertions, 30 deletions
diff --git a/src/input.cpp b/src/input.cpp
index 674b274..ce9bac2 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -5,41 +5,43 @@
// project headers
#include "input.hpp"
-
-namespace Input
+namespace Ogle
{
- namespace {
- int mouse_x;
- int mouse_y;
- bool mouse_click;
- }
- void process(GLFWwindow *window)
+ namespace Input
{
- if(glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
- glfwSetWindowShouldClose(window, true);
- else
+ namespace {
+ int mouse_x;
+ int mouse_y;
+ bool mouse_click;
+ }
+ void process(GLFWwindow *window)
{
- double _mouse_x, _mouse_y;
- glfwGetCursorPos(window, &_mouse_x, &_mouse_y);
- mouse_x = (int)_mouse_x;
- mouse_y = (int)_mouse_y;
- if(GLFW_PRESS == glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT))
- mouse_click = true;
+ if(glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
+ glfwSetWindowShouldClose(window, true);
else
- mouse_click = false;
+ {
+ double _mouse_x, _mouse_y;
+ glfwGetCursorPos(window, &_mouse_x, &_mouse_y);
+ mouse_x = (int)_mouse_x;
+ mouse_y = (int)_mouse_y;
+ if(GLFW_PRESS == glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT))
+ mouse_click = true;
+ else
+ mouse_click = false;
+ }
}
- }
- int get_mouse_x()
- {
- return mouse_x;
- }
- int get_mouse_y()
- {
- return mouse_y;
- }
- bool get_mouse_click()
- {
- return mouse_click;
+ int get_mouse_x()
+ {
+ return mouse_x;
+ }
+ int get_mouse_y()
+ {
+ return mouse_y;
+ }
+ bool get_mouse_click()
+ {
+ return mouse_click;
+ }
}
}