diff options
author | Adrian Kummerlaender | 2019-02-22 21:49:07 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2019-02-22 21:49:07 +0100 |
commit | f0b536ac93b3a9a49dfff8a7637f09b153a3b955 (patch) | |
tree | dbddeb503d50276fcee06d889d8c8b1edfd36a02 /src/glfw/window.cc | |
parent | 1870b510acb351b5956402a21572835aa0d2dee0 (diff) | |
download | compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.tar compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.tar.gz compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.tar.bz2 compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.tar.lz compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.tar.xz compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.tar.zst compustream-f0b536ac93b3a9a49dfff8a7637f09b153a3b955.zip |
Improvise interactive wall drawing
Internal wall cells need to be disabled to prevent delayed propagation
of the reflected populations.
This is just quickly thrown together - both the visual drawing and the backend's
material handling remain to be improved.
Diffstat (limited to 'src/glfw/window.cc')
-rw-r--r-- | src/glfw/window.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/glfw/window.cc b/src/glfw/window.cc index 98890b7..4f14501 100644 --- a/src/glfw/window.cc +++ b/src/glfw/window.cc @@ -37,14 +37,19 @@ int Window::getHeight() const { return _height; } -std::tuple<bool,int,int> Window::getMouse() const { - const bool clicked = glfwGetMouseButton(_handle, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS; +std::tuple<int,int,int> Window::getMouse() const { + int state = 0; + if ( glfwGetMouseButton(_handle, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS ) { + state = 1; + } else if ( glfwGetMouseButton(_handle, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS ) { + state = 2; + } double x, y; glfwGetCursorPos(_handle, &x, &y); return std::make_tuple( - clicked, + state, x - int(getWidth()/2), int(getHeight()/2 - y) ); |