* Method called by UIKit when we have been resized
*/
-(void)layoutSubviews{
// CAUTION : This is called from the main thread
_framebufferDirty=YES;
// CAUTION : This is called from the main thread
_framebufferDirty=YES;
}
-(void)cleanFramebuffer{
if(_framebufferDirty){
[self_destroyFramebuffer];
[self_createFramebuffer];
_framebufferDirty=NO;
}
if(_framebufferDirty){
[self_destroyFramebuffer];
[self_createFramebuffer];
_framebufferDirty=NO;
}
}
@end
@implementationVLCOpenGLESVideoView(Private)
-(void)_createFramebuffer{
msg_Dbg(_vd,"Creating framebuffer for layer %p with bounds (%.1f,%.1f,%.1f,%.1f)",self.layer,self.layer.bounds.origin.x,self.layer.bounds.origin.y,self.layer.bounds.size.width,self.layer.bounds.size.height);
[EAGLContextsetCurrentContext:_context];
// Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer
glGenFramebuffersOES(1,&_defaultFramebuffer);// Generate one framebuffer, store it in _defaultFrameBuffer
msg_Dbg(_vd,"Creating framebuffer for layer %p with bounds (%.1f,%.1f,%.1f,%.1f)",self.layer,self.layer.bounds.origin.x,self.layer.bounds.origin.y,self.layer.bounds.size.width,self.layer.bounds.size.height);
[EAGLContextsetCurrentContext:_context];
// Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer
glGenFramebuffersOES(1,&_defaultFramebuffer);// Generate one framebuffer, store it in _defaultFrameBuffer