glutWarpPointer lag and fps movement

Member
Posts: 20
Joined: 2010.09
Post: #1
I have a windows/mac game based on glut and have noticed that the glutWarpPointer function on the mac introduces alot of lag. Makes the game unplayable. From what I've read, it is a known problem. I replaced glutWarpPointer with my own code wrapped around CGDisplayMoveCursorToPoint, but it doesn't perform any better.

How can I warp the cursor to the center of the screen without the lag? How are people writing fps games for the Mac?

Thomas.
http://www.rattansoftware.com
Groundhog Assault 3D (Apple App Store)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
You need to call CGSetLocalEventsSuppressionInterval to turn off the delay (which will fix glutWarpPointer too), but you shouldn't be using GLUT at all Rasp
Quote this message in a reply
Member
Posts: 20
Joined: 2010.09
Post: #3
Thanks OneSadCookie,
I'll give that a try tommorrow and post afterwards.

So, if I am not to use GLUT, and I was to stay crossplatform, what would you recommend? It is a valid apple supported framework, isn't it?

T.

Thomas.
http://www.rattansoftware.com
Groundhog Assault 3D (Apple App Store)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
It's not really intended for shipping a game. For one thing, it has that awful settings window that you can't get rid of. The keyboard input routines leave much to be desired, and the full-screen management is pretty awful, too.

SDL is a possibility if you really want cross-platform. It's not a perfect Mac citizen, but there's plenty of commercial games using it. It also exists for iOS, which GLUT doesn't as far as I know.

If you're willing to learn a little, you can roll your own shell for each platform you care about. It's not much code per platform, and you can be a better citizen on each than something like SDL allows.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glutwarppointer, what should i use instead? m3the01 11 7,910 Mar 18, 2010 01:28 AM
Last Post: Ingemar
  AI/Movement wonza 6 3,894 Nov 26, 2008 10:23 AM
Last Post: wonza
  Slower Movement Nick 7 3,775 Aug 27, 2004 02:15 PM
Last Post: Josh