Cinder icon indicating copy to clipboard operation
Cinder copied to clipboard

mouse position discrepancy in fullscreen mode

Open jcehle opened this issue 14 years ago • 2 comments

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 )

jcehle avatar Jun 17 '12 18:06 jcehle

I ran into this problem on OSX as well.

gaborpapp avatar Jun 18 '12 07:06 gaborpapp

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.

andrewfb avatar Jun 05 '15 19:06 andrewfb