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 8741673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:21:31+00:00 2026-06-13T11:21:31+00:00

For some reason, my OpenGL app is getting the wrong bounds information for CAEAGLLayer

  • 0

For some reason, my OpenGL app is getting the wrong bounds information for CAEAGLLayer when running in the ios6 4-Inch Retina simulator.

The CAEAGLLayer bounds are printed out as

layer bounds are: (0.000000,0.000000), (320.000000,480.000000)

from this code:

- (id)initWithCoder:(NSCoder*)coder {


    if ((self = [super initWithCoder:coder])) {
        // Get the layer
        CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;

        eaglLayer.opaque = YES;
        eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
                                        [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];

        printf("layer bounds are: (%f,%f), (%f,%f)\n", eaglLayer.bounds.origin.x, eaglLayer.bounds.origin.y, eaglLayer.bounds.size.width, eaglLayer.bounds.size.height );

        context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];

        if (!context || ![EAGLContext setCurrentContext:context]) {
            [self release];
            return nil;
        }

        animationInterval = 1.0 / 60.0;
    }
    return self;
}

The window contents are then shifted up, and 0,0 is no longer at the right location.

Anyone have any ideas why the CAEAGLLayer is being set to the incorrect width/height?

Thanks

  • 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-06-13T11:21:32+00:00Added an answer on June 13, 2026 at 11:21 am

    Ah, someone else had this problem as well. Couldn’t find it when I searched before.

    This is the solution:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
        self.window.frame = CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen mainScreen]bounds].size.height);
    
    }
    

    From here: How to make a uitableview in interface builder compatible with a 4 inch iPhone

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

Sidebar

Related Questions

For some reason i cant draw anything past z>1 in openGL. The Z buffer
For some reason, my spec isn't passing. It appears that @categories isn't getting to
For some reason, I am getting a weird overlapping dropdown menu glitch. It works
For some reason my universal app suddenly does not want to launch in fullscreen
OpenGL is acting very strangely for some reason. In my subclass of NSOpenGLView, I
I have been following an opengl tutorial, but for some reason when i added
So I am doing some OpenGL experimentation using this tutorial but I am running
I'd like to generate some revenue for my OpenGL based iPhone app w/ Apple's
For some reason when I resize my OpenGL windows, everything falls apart. The image
I'm trying to learn how to use JoGL, and for some reason I'm getting

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.