SFML community forums
Help => Window => Topic started by: fruitMaster on August 23, 2011, 01:44:17 pm
-
Hi there,
I've got a little problem here. I'm doing an in-game editor, and I've found that when the window has a titlebar, the mouse position is given relative to the top of the titlebar, while when it doesn't have one it's given relative to the window origin.
Biggest problem is having to check wether you are in fullscreen mode or not, to compensate for the titlebar or lack of it (and having to offset the mouse position an ad-hoc and non-portable distance).
Is this a known problem, and are there solutions around it?
Thanks a lot in advance
-
This is not supposed to happen.
-> OS and version of SFML, please ;)
-
OS is Mac OS X 10.6.6.
As for the SFML version, it's a snapshot of 2.0 taken about six months ago. I'll try to update it to the latest snapshot and see if it's fixed...
-
it's a snapshot of 2.0 taken about six months ago.
SFML 2 is still in its development phase so you should always check if the issue has already been issued and solved.
-
It took a while, but I managed to update to the latest snapshot. I confirm the bug is gone in this version ;)
Btw, had to add several frameworks to get SFML compiling: IOKit, AGL and Carbon. The first two I understand, but I thought Carbon was deprecated and not really needed anymore to do anything on MacOS...?
-
Ok, found another problem, now using the latest snapshot on MacOS 10.6.6
When setting window.ShowMouseCursor(false), the mouse is hidden even if it gets out of the window, but if you make it show by changing the focus to another app, then it doesn't autohide again when entering the SFML window.
Is this expected and should I handle this manually checking the mouseleave/enter events?
Edit: just checked on windows, and the same code displays the normal behaviour: mouse disappears when entering SFML window, and reappears when getting out of it, so I'm guessing it's an SFML bug...
-
Btw, had to add several frameworks to get SFML compiling: IOKit, AGL and Carbon.
you added them where ? How did you compile SFML ? If you follow the tutorial about CMake everything should be fine.
The first two I understand, but I thought Carbon was deprecated and not really needed anymore to do anything on MacOS...?
It's more complicated than that because Carbon is not only used for User Interface but also for input (like keyboard stuff for example) among other things.
When setting window.ShowMouseCursor(false), the mouse is hidden even if it gets out of the window, but if you make it show by changing the focus to another app, then it doesn't autohide again when entering the SFML window.
Ok, I'll look into this issue next week.
-
you added them where ? How did you compile SFML ? If you follow the tutorial about CMake everything should be fine.
Yes, well, I generally prefer to work with full source code, so I added the SFML code to my project. It makes it easier to do builds for several combinations of windows/macos/linux, 32/64 bits, debugging on/off, etcetera
It works perfectly fine as long as you add the correct frameworks and libraries.
As for the OSX cursor problem, here's a quick patch I coded that appears to solve the issue.
http://pastebin.com/YreF20zC