Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:58:18+00:00 2026-05-25T05:58:18+00:00

I have an shipped OpenGL game that I’m adding Game Center support to for

  • 0

I have an shipped OpenGL game that I’m adding Game Center support to for a 1.1 rev. The game does not use a UIViewController and is coded as follows in the AppDelegate:

-(void)applicationDidFinishLaunching:(UIApplication *)application 
{
  window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  [window setUserInteractionEnabled:YES];
  [window setMultipleTouchEnabled:YES];

  glView = [[EAGLView alloc] initWithFrame:[UIScreen mainScreen].bounds];

  [window addSubview:glView];
  [window makeKeyAndVisible];

  [glView performSelectorOnMainThread:@selector(mainGameLoop) withObject:nil waitUntilDone:NO];
}

Everything works great, but when Game Center brings up a window (GKAchievementViewController for example), the window animates on screen fine, but when I touch to scroll it, it doesn’t have any of the momentum or bounce-back like normal windows. When I scroll the window past the top and bottom and it doesn’t return with bounce back.

The window is fully functional, registers touches, it just behaves ugly.

I assume this is because some information is just not being sent down the pipe correctly because I don’t have a UIViewController? I tried creating a UIViewController that sits in-between the UIWindow and the OpenGL UIView, but I get the same behavior.

This is how I’m creating the GKAchievementViewController dialog:

-(void)displayAchievements
{
  achievmentsViewController = [[UIViewController alloc] init];
  [glView addSubview:achievmentsViewController.view];

  GKAchievementViewController *achievements = [[GKAchievementViewController alloc] init];
  if (achievements != nil)
  {
    achievements.achievementDelegate = self;
    [achievmentsViewController presentModalViewController:achievements animated:YES];
  }

  [achievements release];
}

I don’t use any of the UIKit in the game, all buttons, etc are done with straight OpenGL. I am also not using cocos2d or any other framworks.

In my main loop I am doing this:

while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002, TRUE) == kCFRunLoopRunHandledSource);

Other than that, I am not making any regular calls into the OS.

Does anyone know what is going on? My game is ready to submit other than this problem and it’s driving me crazy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:58:19+00:00Added an answer on May 25, 2026 at 5:58 am

    OK, I think I found the answer to this so I’m going to answer my own question in the hopes of saving others a lot of frustration.

    The problem is CFRunLoopRunInMode. It doesn’t play nice with UIKit. I switched to using CADisplayLink and all is well.

    displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget:self selector:@selector(mainLoopBody)];
    [displayLink setFrameInterval:1];
    [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    

    I’ve read that CADisplayLink is causing some games problems and there is a lot of debate about using it vs CFRunLoopRunInMode vs NSTimer. I’ll use this for a while and see if it causes any problems, but windows scroll right again.

    My one concern with CADisplayLink is if the frame rate starts to bog down. Under my old CFRunLoopRunInMode system, if the frames took longer the delta time reflected that. With CADisplayLink, I’m not sure if that is still the case.

    Oh the fun of programming.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The SimpleThreadPool class shipped along with Quartz Scheduler does not have a FIFO behavior.
I have an already shipped app on App Store that made use of Storyboard.
I have a line of PHP code that does the following: $xml = <xml><request>...[snipped
I have an .xml file that is going to be shipped within my app.
I have some resources (zipped) that needs to be shipped with my iphone application.
I have MinGW installed on my computer (I just use the one shipped with
i have an app that will be shipped by different providers. So i need
I have updated a project to use the new Entity Framework shipped with VS2012
Since WAS 8.5 is by default shipped with IBM JDK6, I have installed IBM
Im using the standard java ws implementation shipped with e.g. java6 (javax.jws.*). I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.