View Full Version : Accepting Mouse Moved Events
geezusfreeek
2002.11.16, 06:41 PM
When a game is in window mode, all you have to do is [window setAcceptsMouseMovedEvents:YES]. How do you achieve this when in full screen mode using CGDirectDisplay? I'm guessing that the way would be to get the shield window's ID and set that window to accept the mouse moved events, no? If this is they way, how do you use a window's ID to send messages to the window? Otherwise, how do you accept mouse moved events?
OneSadCookie
2002.11.16, 06:43 PM
Omni does it by creating a window even in full-screen mode. See their GDC "Porting games to Mac OS X" PDF for details.
You can also do it with Carbon Events, or by getting your mouse movements from the HID manager (on Jaguar).
geezusfreeek
2002.11.16, 06:47 PM
Oh, okay. I was using their code as a guide and did not quite catch that.
geezusfreeek
2002.11.16, 06:55 PM
Hey wait a minute! I was reading the code over again and found this:
// Enable mouse moved events. We only need to do this if
we actually have an NSWindow. Fullscreen GL applications do not
need their own NSWindow. The system will create a window them
itself and will turn on mouse movement events
[window setAcceptsMouseMovedEvents: YES];
Does this mean that the CoreGraphics shield window is automatically set to accept mouse movement events or are they referring to when you use some other method of going full screen with OpenGL?
OneSadCookie
2002.11.16, 07:06 PM
Hey, sounds like it! Try it and see :)
Sorry, I don't remember seeing that before. Have they updated it recently?
geezusfreeek
2002.11.16, 07:11 PM
I don't think so. It seems like the same old 2001 code.
geezusfreeek
2002.11.16, 08:34 PM
Yay! It does work! :D
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.