gl/cocoa: set the view to use for drawing by the context
authorJulien Isorce <julien.isorce@gmail.com>
Thu, 24 Apr 2014 07:49:54 +0000 (08:49 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:37 +0000 (19:31 +0000)
It avoids to draw to an invalid buffer.
Withtout this the default frame buffer is undefined:
glBindFramebuffer (GL_FRAMEBUFFER, 0)

Visually you could see some white frames at the beginning
when lunching videotestsrc ! glimagesink

With OpenGL Profiler from XCode you could see some
GL_INVALID_FRAMEBUFFER_OPERATION for the first frames

gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m

index 023b64147ae63ec69e56fac3ae93d6093eab7574..c40be8057563651cdd48b852ac0bc61f00f42583 100644 (file)
@@ -261,6 +261,8 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api,
 
   context_cocoa->priv->gl_context = glContext;
 
+  [glContext setView:glView];
+
   [glView setOpenGLContext:glContext];
 
 #else