Cinder
Cinder copied to clipboard
mouse position discrepancy in fullscreen mode
what: when in windowed mode, the Vec2i returned by event.getPos() and getMousePos() are similar (sometimes off by 1 for y) when in fullscreen mode, the two Vectors are greatly different
steps to reproduce:
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class cinder_delApp : public AppBasic {
public:
void mouseDown( MouseEvent event );
void mouseMove(MouseEvent event);
void draw();
};
void cinder_delApp::mouseDown( MouseEvent event )
{
setFullScreen( !isFullScreen() );
}
void cinder_delApp::mouseMove(MouseEvent event)
{
console() << "event.getPos()" << event.getPos() << " , getMousePos() " << getMousePos() <<endl;
}
void cinder_delApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
}
CINDER_APP_BASIC( cinder_delApp, RendererGl )
I ran into this problem on OSX as well.
Apologies for the delay on this. Just confirmed both platforms work correctly with the new definitions, which is that event.getPos() is window-relative, and getMousePos() is screen relative.