Marrying Core Animation with OpenGL ES

后端 未结 2 1035
小蘑菇
小蘑菇 2021-02-02 01:45

Edit: I suppose instead of the long explanation below I might also ask: Sending -setNeedsDisplay to an instance of CAEAGLLayer does not cause

相关标签:
2条回答
  • 2021-02-02 01:50

    You can override display instead of drawInContext. During the animation, the animated value is in the presentation layer.

    - (void) display
    {
        GLLayer* myPresentationLayer = (GLLayer*)[self presentationLayer];
        self.renderer.centerPoint = myPresentationLayer.sceneCenterPoint;
        [self.renderer render];
    }
    

    At the end the presentation layer will have the model layer value, so you’ll need to set the final value on the model layer before starting the animation.

    0 讨论(0)
  • 2021-02-02 01:59

    Have you tried making a parent layer above the OpenGL layer and animating that instead?

    0 讨论(0)
提交回复
热议问题