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

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    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
    Code:
    - (void)layoutSubviews {
        [EAGLContext setCurrentContext:context];
        [self destroyFramebuffer];
        [self createFramebuffer];
        [self drawView];
    }
    code

    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

    Joined:
    Jun 24, 2009
    #2
    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

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #3
    nope
    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

    Joined:
    Jun 24, 2009
    #4
    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

    dejo

    Staff Member

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

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #6
    hmmm

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

    in there is the code:

    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