OpenGL Layer on top of Video on iPhone?

后端 未结 2 713
情深已故
情深已故 2021-01-01 07:43

I am trying to display a fullscreen video on the iPhone and overlay it with an OpenGL ES view. So basically, I want a video playing in the background, while there are OpenGL

相关标签:
2条回答
  • 2021-01-01 07:59

    To display a camera video background with a custom overlay view, you can use UIImagePickerController's cameraOverlayView property. The cameraOverlayView will be displayed on top of the default image picker interface. Use the cameraViewTransform property to make the camera preview full screen.

    imagePickerController.cameraViewTransform = 
    CGAffineTransformMakeScale(1.0, 1.03);
    

    To implement an UIView subclass as the overlay view that supports OpenGL ES rendering, take look at Apple's sample code http://developer.apple.com/iphone/library/samplecode/GLGravity/Listings/Classes_GLGravityView_m.html

    The key is to make your overlay view transparent.

    overlayView.opaque = NO; 
    overlayView.alpha = 1.0; 
    overlayView.backgroundColor = [UIColor clearColor];
    

    In your OpenGL ES rendering code, make sure to clear color with a zero alpha.

    glClearColor(0,0,0,0) ;
    
    0 讨论(0)
  • 2021-01-01 08:00

    From the small information leaks it seems that the feature you want will be part of OS 3.1, allowing support for augmented reality, see this post on AppleInsider.

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