Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing GLFW window move callback #2282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cinder/app/linux/AppImplLinuxGlfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class GlfwCallbacks {
sWindowMapping[glfwWindow] = std::make_pair( cinderAppImpl, cinderWindow );

::glfwSetWindowSizeCallback( glfwWindow, GlfwCallbacks::onWindowSize );
::glfwSetWindowPosCallback( glfwWindow, GlfwCallbacks::onWindowMove );
::glfwSetKeyCallback( glfwWindow, GlfwCallbacks::onKeyboard );
::glfwSetCharCallback( glfwWindow, GlfwCallbacks::onCharInput );
::glfwSetCursorPosCallback( glfwWindow, GlfwCallbacks::onMousePos );
Expand Down Expand Up @@ -70,6 +71,17 @@ class GlfwCallbacks {
}
}

static void onWindowMove( GLFWwindow* glfwWindow, int xpos, int ypos ) {
auto iter = sWindowMapping.find( glfwWindow );
if( sWindowMapping.end() != iter ) {
auto& cinderAppImpl = iter->second.first;
auto& cinderWindow = iter->second.second;
cinderAppImpl->setWindow( cinderWindow );

cinderWindow->emitMove();
}
}

//! Translates GLFW \a mods into ci::KeyEvent modifier values
static int extractKeyModifiers( int mods )
{
Expand Down