ios vout: Avoid opengles1.1 naming convention for 2.0 version
authorGleb Pinigin <gpinigin@gmail.com>
Sat, 9 Feb 2013 11:01:57 +0000 (18:01 +0700)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 9 Feb 2013 11:57:08 +0000 (12:57 +0100)
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
modules/video_output/ios.m

index 6059e57..69b586b 100644 (file)
@@ -297,7 +297,7 @@ static void OpenglSwap(vlc_gl_t *gl)
 {
     vout_display_sys_t *sys = gl->sys;
     EAGLContext *context = [sys->glView context];
-    [context presentRenderbuffer:GL_RENDERBUFFER_OES];
+    [context presentRenderbuffer:GL_RENDERBUFFER];
 }
 
 /*****************************************************************************
@@ -394,22 +394,22 @@ static void OpenglSwap(vlc_gl_t *gl)
     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);
     [EAGLContext setCurrentContext:_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
-    glGenRenderbuffersOES(1, &_colorRenderbuffer);
-    glBindFramebufferOES(GL_FRAMEBUFFER_OES, _defaultFramebuffer);
-    glBindRenderbufferOES(GL_RENDERBUFFER_OES, _colorRenderbuffer);
+    glGenFramebuffers(1, &_defaultFramebuffer); // Generate one framebuffer, store it in _defaultFrameBuffer
+    glGenRenderbuffers(1, &_colorRenderbuffer);
+    glBindFramebuffer(GL_FRAMEBUFFER, _defaultFramebuffer);
+    glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer);
 
     // This call associates the storage for the current render buffer with the EAGLDrawable (our CAEAGLLayer)
     // allowing us to draw into a buffer that will later be rendered to screen wherever the layer is (which corresponds with our view).
-    [_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id<EAGLDrawable>)self.layer];
-    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, _colorRenderbuffer);
+    [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(id<EAGLDrawable>)self.layer];
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _colorRenderbuffer);
 
     GLint backingWidth, backingHeight;
-    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
-    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
+    glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth);
+    glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight);
 
-    if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
-        msg_Err(_vd, "Failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
+    if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
+        msg_Err(_vd, "Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER));
     }
     [self _updateViewportWithBackingWitdh:backingWidth andBackingHeight:backingHeight];
 }
@@ -456,9 +456,9 @@ static void OpenglSwap(vlc_gl_t *gl)
 
 - (void)_destroyFramebuffer {
     [EAGLContext setCurrentContext:_context];
-    glDeleteFramebuffersOES(1, &_defaultFramebuffer);
+    glDeleteFramebuffers(1, &_defaultFramebuffer);
     _defaultFramebuffer = 0;
-    glDeleteRenderbuffersOES(1, &_colorRenderbuffer);
+    glDeleteRenderbuffers(1, &_colorRenderbuffer);
     _colorRenderbuffer = 0;
 }
 @end