diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/OffscreenContextGLX.cc | 62 | 
1 files changed, 30 insertions, 32 deletions
| diff --git a/src/OffscreenContextGLX.cc b/src/OffscreenContextGLX.cc index 52cf49d..8ec473f 100644 --- a/src/OffscreenContextGLX.cc +++ b/src/OffscreenContextGLX.cc @@ -226,38 +226,7 @@ bool create_glx_dummy_window(OffscreenContext &ctx)    return true;  } - -Bool create_glx_dummy_context(OffscreenContext &ctx) -{ -  // This will alter ctx.openGLContext and ctx.xdisplay and ctx.xwindow if successfull -  int major; -  int minor; -  Bool result = False; - -  ctx.xdisplay = XOpenDisplay( NULL ); -  if ( ctx.xdisplay == NULL ) { -    cerr << "Unable to open a connection to the X server\n"; -    return False; -  } - -  // glxQueryVersion is not always reliable. Use it, but then -  // also check to see if GLX 1.3 functions exist - -  glXQueryVersion(ctx.xdisplay, &major, &minor); -#ifdef glXGetVisualFromFBConfig -  if ( major==1 && minor<=2 && glXGetVisualFromFBConfig==NULL ) { -#else -  if ( major==1 && minor<=2 ) { -#endif -    cerr << "Error: GLX version 1.3 functions missing. " -        << "Your GLX version: " << major << "." << minor << endl; -  } else { -    result = create_glx_dummy_window(ctx); -  } - -  if (!result) XCloseDisplay( ctx.xdisplay ); -  return result; -} +Bool create_glx_dummy_context(OffscreenContext &ctx);  OffscreenContext *create_offscreen_context(int w, int h)  { @@ -293,3 +262,32 @@ bool save_framebuffer(OffscreenContext *ctx, std::ostream &output)  	return save_framebuffer_common(ctx, output);  } +#pragma GCC diagnostic ignored "-Waddress" +Bool create_glx_dummy_context(OffscreenContext &ctx) +{ +  // This will alter ctx.openGLContext and ctx.xdisplay and ctx.xwindow if successfull +  int major; +  int minor; +  Bool result = False; + +  ctx.xdisplay = XOpenDisplay( NULL ); +  if ( ctx.xdisplay == NULL ) { +    cerr << "Unable to open a connection to the X server\n"; +    return False; +  } + +  // glxQueryVersion is not always reliable. Use it, but then +  // also check to see if GLX 1.3 functions exist + +  glXQueryVersion(ctx.xdisplay, &major, &minor); +  if ( major==1 && minor<=2 && glXGetVisualFromFBConfig==NULL ) { +    cerr << "Error: GLX version 1.3 functions missing. " +        << "Your GLX version: " << major << "." << minor << endl; +  } else { +    result = create_glx_dummy_window(ctx); +  } + +  if (!result) XCloseDisplay( ctx.xdisplay ); +  return result; +} + | 
