openGLES draws for 3.0 but not 2.2.1... why?

Discussion in 'iOS Programming' started by Chirone, Oct 7, 2009.

  1. Chirone macrumors 6502

    Mar 2, 2009
    ok this time i won't find the answer straight after i post...

    in my program i have a whole heap of drawing code in the -(void)drawView method
    it draws fine when running it on 3.0 and 3.1
    but as soon as i switch back to 2.2.1 nothing appears

    i put break points in the drawView method and it never stopped at them
    so it's not even calling the method

    i tried calling the -(void)layoutSubviews from the initWithCoder that is just the
    - (void)layoutSubviews {
        [EAGLContext setCurrentContext:context];
        [self destroyFramebuffer];
        [self createFramebuffer];
        [self drawView];

    which is what was there when i first made the project and it worked fine with 2.2.1, and it goes through all the methods without problem but it still doesn't draw anything..

    what makes it draw in 3.0 and not in 2.2.1?
  2. Kingbombs macrumors member

    Jun 24, 2009
    did you use the framework for the 3.0 OS, as that OpenGL ES is 2.0 and not 1.1 like the other OS for the iphone have.
  3. Chirone thread starter macrumors 6502

    Mar 2, 2009
    it would have given compile errors if i was using openGLES 2

    the project used to from the template that worked with iphone 2.2.1

    i didn't actually notice when it stopped working until now when the app is almost complete...
  4. Kingbombs macrumors member

    Jun 24, 2009
    app delegate is calling it correctly?
    the init method being called correctly?
    i would put print statements step by step and then you will find exactly where the problem is
  5. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Or better yet, set a breakpoint and step through the code using the Debugger.
  6. Chirone thread starter macrumors 6502

    Mar 2, 2009

    ok, so i took a wild shot and looked back at the MainView's initWithNibName

    in there is the code:

    PageViewController* pageView = [[PageViewController alloc] initWithNibName: @"PageView" bundle:nil];
    		[self.view addSubview: pageView.view];
    		[pageView release];
    in 3.0 this works fine

    in 2.2.1 if i take out the [pageView release] line it works... all the interactions and stuff work as well

    i thought I had to release it because that's what I read in the docs somewhere

    is this going to cause problems on the ones apps built for 3.0?

    if i don't release it in the initWithNib method then when should I release it?

Share This Page