Search code examples
iosopengl-esopengl-es-2.0spriteglkview

iOS+OpenGL ES 2.0: Why are update() and glkView() not called by the GLKViewController?


I am trying to run the Ray Wenderlich sprite example. I have set up a GLKViewController and a GLKView and implemented the methods from the corresponding delegate protocol.

- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect { }

- (void)update { }

But these methods are not called by the GLKViewController! Someone any idea what I am doing wrong?

I already have altered the code to animate some bubbles from bottom to the top.

Please check out a clone from GitHub:

https://github.com/salocinx/SpriteTestOpenGL

Thanks!


Solution

  • Problem solved. I had the following property defined in my category:

    @property(nonatomic, assign) CGSize screen;
    

    This somehow had overwritten a property from the GLKViewController. It's a shame that there's no warning for such case, this cost me more than an entire day...