I’ve got an application where I need to drag the background grid within the x axis using mouse/touch interactions.
I’m using this code to do that:
[scode lang=“C++”]void MyApp::eventDragStart(int buttonIdx, pvr::PointerLocation loc)
glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
// here I’m updating the appropriate matrices
// in order to multiply them with projection and send to a vertex shader
projectionModel = projection * this->getMyTransformMatrix();
glUniformMatrix4fv(mvpLoc, 1, GL_FALSE, glm::value_ptr(projectionModel));
it works with errors but the thing is that the rendering is kinda single discrete - it only moves the grid by a single eventDragStart function call - but it needs to be called every time mouse moved or touch moved.
From the inline docs about eventDragStart.[/blockquote]
[blockquote]\description This event will be fired after a movement of more than a few pixels is detected with a button down.[/blockquote]
It says like it will behave like a mouse move or touch move but the result is different.
What am I mis uderstooding here ?
Why the callback function isn’t being called every time mouse or touch moved ?
How to drag things smoothly ?