diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-08 00:34:29 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-08 04:38:22 +0200 |
commit | ed649cc4817b6d35e71d15331293afd91fba9358 (patch) | |
tree | f848357fe1abecfb3d1c62533eb91c7ebdbac68e /vcl | |
parent | 375659b8641126cf1deae1c1789880771aa61308 (diff) |
call glewInit in vcl's OpenGLContext just once
Change-Id: I9f9b50615e588e659c7fcdd016cf9ceb8407b974
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 304d9f467dff..8dcaabb89276 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -7,6 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <GL/glew.h> #include <vcl/OpenGLContext.hxx> #include <vcl/syschild.hxx> #include <vcl/sysdata.hxx> @@ -447,6 +448,19 @@ bool OpenGLContext::init( Window* pParent ) #endif + static bool bGlewInit = false; + if(!bGlewInit) + { + glewExperimental = GL_TRUE; + if (glewInit() != GLEW_OK) + { + SAL_WARN("vcl.opengl", "Failed to initialize GLEW"); + return false; + } + else + bGlewInit = true; + } + SAL_INFO("vcl.opengl", "OpenGLContext::init----end"); mbInitialized = true; return true; |