/* setup the render buffer for depth */
gl->GenRenderbuffers (1, &convert->depth_buffer);
gl->BindRenderbuffer (GL_RENDERBUFFER, convert->depth_buffer);
- if (USING_OPENGL (convert->context)) {
+ if (USING_OPENGL (convert->context) || USING_OPENGL3 (convert->context)) {
gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT,
out_width, out_height);
gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8,
GstGLDisplay *display;
gboolean create_context;
const char *glx_exts;
- int x_error;
+ int x_error = 0;
Display *device;
guintptr external_gl_context = 0;
if (create_context && context_glx->priv->glXCreateContextAttribsARB) {
int context_attribs_3[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
- GLX_CONTEXT_MINOR_VERSION_ARB, 0,
- //GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
+ GLX_CONTEXT_MINOR_VERSION_ARB, 1,
+ GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
#if !defined(GST_DISABLE_GST_DEBUG)
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
#endif
None
};
- gst_gl_window_x11_trap_x_errors ();
- context_glx->glx_context =
- context_glx->priv->glXCreateContextAttribsARB (device,
- context_glx->priv->fbconfigs[0], (GLXContext) external_gl_context, True,
- context_attribs_3);
+ if (gl_api & GST_GL_API_OPENGL3) {
+ GST_DEBUG_OBJECT (window, "trying to create a GL 3.1 core context");
+ gst_gl_window_x11_trap_x_errors ();
+ context_glx->glx_context =
+ context_glx->priv->glXCreateContextAttribsARB (device,
+ context_glx->priv->fbconfigs[0], (GLXContext) external_gl_context,
+ True, context_attribs_3);
- x_error = gst_gl_window_x11_untrap_x_errors ();
- context_glx->priv->context_api = GST_GL_API_OPENGL;
+ x_error = gst_gl_window_x11_untrap_x_errors ();
+
+ if (x_error != 0)
+ context_glx->glx_context = NULL;
+ context_glx->priv->context_api = GST_GL_API_OPENGL3;
+ }
- if (!context_glx->glx_context || x_error != 0) {
- GST_DEBUG ("Failed to create an Opengl 3 context. trying a legacy one");
+ if (gl_api & GST_GL_API_OPENGL && context_glx->glx_context == NULL) {
+ GST_DEBUG_OBJECT (window, "trying to create a GL 1.4 context");
gst_gl_window_x11_trap_x_errors ();
context_glx->glx_context =