diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-04 17:31:12 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-11-10 07:59:03 +0100 |
commit | 42dbcedc73c8daf4753ab85796ea4b9494494ce3 (patch) | |
tree | 74df9994b6d88637340a3719329ff1a420d3cbe5 /vcl/source/opengl/OpenGLHelper.cxx | |
parent | 73b1ef159b92e84c3b72fd0a772714761f5c3dac (diff) |
vcl: Get visual info for window from GLX when needed
Change-Id: Id8cea87391835694e20aa703b7fdb3f13434d47b
Diffstat (limited to 'vcl/source/opengl/OpenGLHelper.cxx')
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 9811b990ab62..d3da56db95b4 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -363,4 +363,29 @@ bool OpenGLHelper::supportsVCLOpenGL() return true; } +#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID + +bool OpenGLHelper::GetVisualInfo(Display* pDisplay, int nScreen, XVisualInfo& rVI) +{ + XVisualInfo* pVI; + int aAttrib[] = { GLX_RGBA, + GLX_RED_SIZE, 8, + GLX_GREEN_SIZE, 8, + GLX_BLUE_SIZE, 8, + GLX_DEPTH_SIZE, 24, + GLX_DOUBLEBUFFER, + None }; + + pVI = glXChooseVisual( pDisplay, nScreen, aAttrib ); + if( !pVI ) + return false; + + rVI = *pVI; + XFree( pVI ); + + return true; +} + +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |