From 482d7ce61b423600b41b459eb26a2cc221cd0acf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 25 Nov 2016 20:25:27 +0000 Subject: change from glew to epoxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit because that works under wayland out of the box and gtk3 uses it already Change-Id: Iefaac31e325534a81a5389f752804af917c1baef Reviewed-on: https://gerrit.libreoffice.org/31213 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/CppunitTest_vcl_bitmap_test.mk | 2 +- vcl/CppunitTest_vcl_wmf_test.mk | 4 +--- vcl/Executable_icontest.mk | 2 +- vcl/Executable_vcldemo.mk | 2 +- vcl/Executable_visualbackendtest.mk | 1 - vcl/Library_vcl.mk | 3 +-- vcl/Library_vclplug_gen.mk | 3 +-- vcl/Library_vclplug_gtk.mk | 2 +- vcl/Library_vclplug_gtk3.mk | 2 +- vcl/Library_vclplug_kde4.mk | 2 +- vcl/inc/opengl/LineRenderUtils.hxx | 1 - vcl/inc/opengl/VertexUtils.hxx | 2 +- vcl/inc/opengl/framebuffer.hxx | 1 - vcl/inc/opengl/program.hxx | 1 - vcl/inc/opengl/texture.hxx | 2 +- vcl/inc/pch/precompiled_vcl.hxx | 2 +- vcl/inc/unx/saldisp.hxx | 2 +- vcl/opengl/win/gdiimpl.cxx | 34 ++++++++++++++++++++++++++++++---- vcl/opengl/x11/gdiimpl.cxx | 31 +++++++++++++------------------ vcl/osx/salobj.cxx | 4 ++-- vcl/source/opengl/OpenGLContext.cxx | 34 ++++++---------------------------- vcl/source/opengl/OpenGLHelper.cxx | 8 ++++---- vcl/unx/generic/app/saldisp.cxx | 1 - vcl/workben/icontest.cxx | 2 -- 24 files changed, 68 insertions(+), 80 deletions(-) (limited to 'vcl') diff --git a/vcl/CppunitTest_vcl_bitmap_test.mk b/vcl/CppunitTest_vcl_bitmap_test.mk index 879c7ac5eaa9..70ce156889dc 100644 --- a/vcl/CppunitTest_vcl_bitmap_test.mk +++ b/vcl/CppunitTest_vcl_bitmap_test.mk @@ -19,7 +19,7 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\ )) ifeq ($(ENABLE_HEADLESS),) $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\ - glew \ + epoxy \ )) endif diff --git a/vcl/CppunitTest_vcl_wmf_test.mk b/vcl/CppunitTest_vcl_wmf_test.mk index 369c79254aff..7cae3639cd0c 100644 --- a/vcl/CppunitTest_vcl_wmf_test.mk +++ b/vcl/CppunitTest_vcl_wmf_test.mk @@ -87,7 +87,7 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\ )) ifeq ($(ENABLE_HEADLESS),) $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\ - glew \ + epoxy \ )) endif @@ -136,7 +136,6 @@ $(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\ -lm \ -ldl \ -lpthread \ - -lGL \ -lX11 \ )) endif @@ -190,7 +189,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS))) $(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\ -lm $(DLOPEN_LIBS) \ -lpthread \ - -lGL \ -lX11 \ -lXext \ )) diff --git a/vcl/Executable_icontest.mk b/vcl/Executable_icontest.mk index 102697b0daa2..cce8feb48a20 100644 --- a/vcl/Executable_icontest.mk +++ b/vcl/Executable_icontest.mk @@ -15,7 +15,7 @@ $(eval $(call gb_Executable_use_externals,icontest,\ )) ifeq ($(ENABLE_HEADLESS),) $(eval $(call gb_Executable_use_externals,icontest,\ - glew \ + epoxy \ )) endif diff --git a/vcl/Executable_vcldemo.mk b/vcl/Executable_vcldemo.mk index bff091e2afeb..a09d3b4936e1 100644 --- a/vcl/Executable_vcldemo.mk +++ b/vcl/Executable_vcldemo.mk @@ -21,7 +21,7 @@ $(eval $(call gb_Executable_use_externals,vcldemo,\ )) ifeq ($(ENABLE_HEADLESS),) $(eval $(call gb_Executable_use_externals,vcldemo,\ - glew \ + epoxy \ )) endif diff --git a/vcl/Executable_visualbackendtest.mk b/vcl/Executable_visualbackendtest.mk index abf8cbe1429b..87044535f03e 100644 --- a/vcl/Executable_visualbackendtest.mk +++ b/vcl/Executable_visualbackendtest.mk @@ -46,7 +46,6 @@ $(eval $(call gb_Executable_add_libs,visualbackendtest,\ -lm \ -ldl \ -lpthread \ - -lGL \ -lX11 \ )) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 1aae3d719a7b..ebffb7c64695 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -122,7 +122,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ )) ifeq ($(ENABLE_HEADLESS),) $(eval $(call gb_Library_use_externals,vcl,\ - glew \ + epoxy \ )) endif @@ -621,7 +621,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS))) $(eval $(call gb_Library_add_libs,vcl,\ -lm $(DLOPEN_LIBS) \ -lpthread \ - -lGL \ -lX11 \ -lXext \ )) diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index f281605d6bd7..0e1c39c15766 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -51,7 +51,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gen,\ boost_headers \ cairo \ graphite \ - glew \ + epoxy \ glm_headers \ harfbuzz \ icu_headers \ @@ -65,7 +65,6 @@ $(eval $(call gb_Library_add_libs,vclplug_gen,\ -lXext \ -lSM \ -lICE \ - -lGL \ )) $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk index c32a127e6b17..67247b73d642 100644 --- a/vcl/Library_vclplug_gtk.mk +++ b/vcl/Library_vclplug_gtk.mk @@ -59,7 +59,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk,\ cairo \ dbus \ gio \ - glew \ + epoxy \ gtk \ gthread \ icuuc \ diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk index 8d013d93e369..1457c1abcf9f 100644 --- a/vcl/Library_vclplug_gtk3.mk +++ b/vcl/Library_vclplug_gtk3.mk @@ -75,7 +75,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_gtk3,\ $(eval $(call gb_Library_use_externals,vclplug_gtk3,\ boost_headers \ - glew \ + epoxy \ dbus \ )) diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk index 30c406961427..acd7bd5981da 100644 --- a/vcl/Library_vclplug_kde4.mk +++ b/vcl/Library_vclplug_kde4.mk @@ -54,7 +54,7 @@ $(eval $(call gb_Library_use_externals,vclplug_kde4,\ boost_headers \ icuuc \ kde4 \ - glew \ + epoxy \ )) $(eval $(call gb_Library_add_libs,vclplug_kde4,\ diff --git a/vcl/inc/opengl/LineRenderUtils.hxx b/vcl/inc/opengl/LineRenderUtils.hxx index 58ae6a809104..e3f375bb3dce 100644 --- a/vcl/inc/opengl/LineRenderUtils.hxx +++ b/vcl/inc/opengl/LineRenderUtils.hxx @@ -11,7 +11,6 @@ #ifndef INCLUDED_VCL_INC_OPENGL_LINERENDERUTILS_H #define INCLUDED_VCL_INC_OPENGL_LINERENDERUTILS_H -#include #include "opengl/VertexUtils.hxx" #include "opengl/RenderList.hxx" diff --git a/vcl/inc/opengl/VertexUtils.hxx b/vcl/inc/opengl/VertexUtils.hxx index f9804ecd978f..de2c070abcc9 100644 --- a/vcl/inc/opengl/VertexUtils.hxx +++ b/vcl/inc/opengl/VertexUtils.hxx @@ -12,7 +12,7 @@ #define INCLUDED_VCL_INC_OPENGL_VERTEXUTILS_H #include -#include +#include #include #include #include diff --git a/vcl/inc/opengl/framebuffer.hxx b/vcl/inc/opengl/framebuffer.hxx index ec7a45099df7..a2dbd1e63282 100644 --- a/vcl/inc/opengl/framebuffer.hxx +++ b/vcl/inc/opengl/framebuffer.hxx @@ -10,7 +10,6 @@ #ifndef INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H #define INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H -#include #include #include diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx index 73cdb7fda6e7..4632ddf44444 100644 --- a/vcl/inc/opengl/program.hxx +++ b/vcl/inc/opengl/program.hxx @@ -14,7 +14,6 @@ #include -#include #include #include diff --git a/vcl/inc/opengl/texture.hxx b/vcl/inc/opengl/texture.hxx index a0c80295f226..fd4eb9724648 100644 --- a/vcl/inc/opengl/texture.hxx +++ b/vcl/inc/opengl/texture.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_VCL_INC_OPENGL_TEXTURE_H #define INCLUDED_VCL_INC_OPENGL_TEXTURE_H -#include +#include #include #include #include diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index 235bb911218f..7d3297788219 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -183,7 +184,6 @@ #include #include #include -#include #include #include #include diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 64998df08332..339ba806d6e8 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -28,7 +28,7 @@ class SalXLib; #include #include #include -#include "GL/glxew.h" +#include #include #include diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx index 1704a19a7234..0d0159d25500 100644 --- a/vcl/opengl/win/gdiimpl.cxx +++ b/vcl/opengl/win/gdiimpl.cxx @@ -16,9 +16,10 @@ #include #include #include -#include +#include static std::vector g_vShareList; +static bool g_bAnyCurrent; class GLWinWindow : public GLWindow { @@ -70,6 +71,7 @@ void WinOpenGLContext::resetCurrent() OpenGLZone aZone; wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; } bool WinOpenGLContext::isCurrent() @@ -81,7 +83,7 @@ bool WinOpenGLContext::isCurrent() bool WinOpenGLContext::isAnyCurrent() { - return wglGetCurrentContext() != nullptr; + return g_bAnyCurrent && wglGetCurrentContext() != nullptr; } void WinOpenGLContext::makeCurrent() @@ -95,10 +97,13 @@ void WinOpenGLContext::makeCurrent() if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC)) { + g_bAnyCurrent = false; SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << WindowsErrorString(GetLastError())); return; } + g_bAnyCurrent = true; + registerAsCurrent(); } @@ -140,7 +145,10 @@ void WinOpenGLContext::destroyCurrentContext() g_vShareList.erase(itr); if (wglGetCurrentContext() != nullptr) + { wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; + } wglDeleteContext( m_aGLWin.hRC ); ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC ); m_aGLWin.hRC = nullptr; @@ -208,11 +216,13 @@ bool InitTempWindow(HWND& hwnd, int width, int height, const PIXELFORMATDESCRIPT if(!ret) { wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(glWin.hRC); ReleaseDC(hwnd, glWin.hDC); DestroyWindow(hwnd); return false; } + g_bAnyCurrent = false; return true; } @@ -275,6 +285,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, { SAL_WARN("vcl.opengl", "Device doesn't support multisample"); wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(glWin.hRC); ReleaseDC(hWnd, glWin.hDC); DestroyWindow(hWnd); @@ -285,6 +296,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, if (!fn_wglChoosePixelFormatARB) { wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(glWin.hRC); ReleaseDC(hWnd, glWin.hDC); DestroyWindow(hWnd); @@ -341,6 +353,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, bArbMultisampleSupported = true; rPixelFormat = pixelFormat; wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(glWin.hRC); ReleaseDC(hWnd, glWin.hDC); DestroyWindow(hWnd); @@ -355,6 +368,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, bArbMultisampleSupported = true; rPixelFormat = pixelFormat; wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(glWin.hRC); ReleaseDC(hWnd, glWin.hDC); DestroyWindow(hWnd); @@ -362,6 +376,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, } // Return the valid format wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(glWin.hRC); ReleaseDC(hWnd, glWin.hDC); DestroyWindow(hWnd); @@ -542,13 +557,17 @@ bool WinOpenGLContext::ImplInit() if (!wglMakeCurrent(m_aGLWin.hDC, hTempRC)) { + g_bAnyCurrent = false; SAL_WARN("vcl.opengl", "wglMakeCurrent failed: "<< WindowsErrorString(GetLastError())); return false; } - if (!InitGLEW()) + g_bAnyCurrent = true; + + if (!InitGL()) { wglMakeCurrent(NULL, NULL); + g_bAnyCurrent = false; wglDeleteContext(hTempRC); return false; } @@ -560,6 +579,7 @@ bool WinOpenGLContext::ImplInit() if (!wglCreateContextAttribsARB) { wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(hTempRC); return false; } @@ -578,6 +598,7 @@ bool WinOpenGLContext::ImplInit() { SAL_WARN("vcl.opengl", "wglCreateContextAttribsARB failed: "<< WindowsErrorString(GetLastError())); wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(hTempRC); return false; } @@ -585,19 +606,24 @@ bool WinOpenGLContext::ImplInit() if (!compiledShaderBinariesWork()) { wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(hTempRC); return false; } wglMakeCurrent(nullptr, nullptr); + g_bAnyCurrent = false; wglDeleteContext(hTempRC); if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC)) { + g_bAnyCurrent = false; SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << WindowsErrorString(GetLastError())); return false; } + g_bAnyCurrent = true; + if (bFirstCall) { // Checking texture size @@ -629,7 +655,7 @@ bool WinOpenGLContext::ImplInit() } } - InitGLEWDebugging(); + InitGLDebugging(); g_vShareList.push_back(m_aGLWin.hRC); diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx index 82f8bc9f14bd..292dd14e7318 100644 --- a/vcl/opengl/x11/gdiimpl.cxx +++ b/vcl/opengl/x11/gdiimpl.cxx @@ -32,6 +32,7 @@ #include static std::vector g_vShareList; +static bool g_bAnyCurrent; class X11OpenGLContext : public OpenGLContext { @@ -184,23 +185,10 @@ namespace return pFBC; } - // we need them before glew can initialize them - // glew needs an OpenGL context so we need to get the address manually - void initOpenGLFunctionPointers() - { - glXChooseFBConfig = reinterpret_cast(glXGetProcAddressARB(reinterpret_cast("glXChooseFBConfig"))); - glXGetVisualFromFBConfig = reinterpret_cast(glXGetProcAddressARB(reinterpret_cast("glXGetVisualFromFBConfig"))); // try to find a visual for the current set of attributes - glXGetFBConfigAttrib = reinterpret_cast(glXGetProcAddressARB(reinterpret_cast("glXGetFBConfigAttrib"))); - glXCreateContextAttribsARB = reinterpret_cast(glXGetProcAddressARB(reinterpret_cast("glXCreateContextAttribsARB"))); - glXCreatePixmap = reinterpret_cast(glXGetProcAddressARB(reinterpret_cast("glXCreatePixmap"))); - } - Visual* getVisual(Display* dpy, Window win) { OpenGLZone aZone; - initOpenGLFunctionPointers(); - XWindowAttributes xattr; if( !XGetWindowAttributes( dpy, win, &xattr ) ) { @@ -235,7 +223,10 @@ void X11OpenGLContext::resetCurrent() OpenGLZone aZone; if (m_aGLWin.dpy) + { glXMakeCurrent(m_aGLWin.dpy, None, nullptr); + g_bAnyCurrent = false; + } } bool X11OpenGLContext::isCurrent() @@ -247,7 +238,7 @@ bool X11OpenGLContext::isCurrent() bool X11OpenGLContext::isAnyCurrent() { - return glXGetCurrentContext() != None; + return g_bAnyCurrent && glXGetCurrentContext() != None; } SystemWindowData X11OpenGLContext::generateWinData(vcl::Window* pParent, bool /*bRequestLegacyContext*/) @@ -266,8 +257,6 @@ SystemWindowData X11OpenGLContext::generateWinData(vcl::Window* pParent, bool /* if( dpy == nullptr || !glXQueryExtension( dpy, nullptr, nullptr ) ) return aWinData; - initOpenGLFunctionPointers(); - int best_fbc = -1; GLXFBConfig* pFBC = getFBConfig(dpy, win, best_fbc, true, false); @@ -355,10 +344,13 @@ bool X11OpenGLContext::ImplInit() if( !glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx ) ) { + g_bAnyCurrent = false; SAL_WARN("vcl.opengl", "unable to select current GLX context"); return false; } + g_bAnyCurrent = true; + int glxMinor, glxMajor; double nGLXVersion = 0; if( glXQueryVersion( m_aGLWin.dpy, &glxMajor, &glxMinor ) ) @@ -400,8 +392,8 @@ bool X11OpenGLContext::ImplInit() } } - bool bRet = InitGLEW(); - InitGLEWDebugging(); + bool bRet = InitGL(); + InitGLDebugging(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); @@ -427,10 +419,12 @@ void X11OpenGLContext::makeCurrent() { if (!glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx )) { + g_bAnyCurrent = false; SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed " "on drawable " << m_aGLWin.win); return; } + g_bAnyCurrent = true; } registerAsCurrent(); @@ -445,6 +439,7 @@ void X11OpenGLContext::destroyCurrentContext() g_vShareList.erase(itr); glXMakeCurrent(m_aGLWin.dpy, None, nullptr); + g_bAnyCurrent = false; if( glGetError() != GL_NO_ERROR ) { SAL_WARN("vcl.opengl", "glError: " << glGetError()); diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx index c75f2a7d866b..9e6e746d5b35 100644 --- a/vcl/osx/salobj.cxx +++ b/vcl/osx/salobj.cxx @@ -321,8 +321,8 @@ bool AquaOpenGLContext::ImplInit() NSOpenGLView* pView = getOpenGLView(); [[pView openGLContext] makeCurrentContext]; - bool bRet = InitGLEW(); - InitGLEWDebugging(); + bool bRet = InitGL(); + InitGLDebugging(); return bRet; } diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 93bde70bcdf7..c04a0cf0c7fc 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -7,7 +7,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include #include @@ -205,13 +204,8 @@ extern "C" void APIENTRY #endif debug_callback(GLenum source, GLenum type, GLuint id, - GLenum severity, GLsizei , const GLchar* message, -#if HAVE_GLEW_1_12 - const GLvoid* -#else - GLvoid* -#endif - ) + GLenum severity, GLsizei , const GLchar* message, + const GLvoid*) { // ignore Nvidia's 131218: "Program/shader state performance warning: Fragment Shader is going to be recompiled because the shader key based on GL state mismatches." // the GLSL compiler is a bit too aggressive in optimizing the state based on the current OpenGL state @@ -280,30 +274,14 @@ OUString getGLString(GLenum eGlEnum) return sString; } -bool OpenGLContext::InitGLEW() +bool OpenGLContext::InitGL() { - static bool bGlewInit = false; - if(!bGlewInit) - { - OpenGLZone aZone; - - glewExperimental = GL_TRUE; - GLenum err = glewInit(); - if (err != GLEW_OK) - { - SAL_WARN("vcl.opengl", "Failed to initialize GLEW: " << glewGetErrorString(err)); - return false; - } - else - bGlewInit = true; - } - VCL_GL_INFO("OpenGLContext::ImplInit----end"); VCL_GL_INFO("Vendor: " << getGLString(GL_VENDOR) << " Renderer: " << getGLString(GL_RENDERER) << " GL version: " << OpenGLHelper::getGLVersion()); mbInitialized = true; // I think we need at least GL 3.0 - if (!GLEW_VERSION_3_0) + if (epoxy_gl_version() < 30) { SAL_WARN("vcl.opengl", "We don't have at least OpenGL 3.0"); return false; @@ -319,11 +297,11 @@ bool OpenGLContext::InitGLEW() return true; } -void OpenGLContext::InitGLEWDebugging() +void OpenGLContext::InitGLDebugging() { #ifdef DBG_UTIL // only enable debug output in dbgutil build - if( GLEW_ARB_debug_output) + if (epoxy_has_gl_extension("GL_ARB_debug_output")) { OpenGLZone aZone; diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index f07e7dcbfa8e..9b91415d2392 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -401,7 +401,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& rVertexShaderName, aGeometryShaderSource = getShaderSource(rGeometryShaderName); GLint bBinaryResult = GL_FALSE; - if( GLEW_ARB_get_program_binary && !rDigest.isEmpty() ) + if (epoxy_has_gl_extension("GL_ARB_get_program_binary") && !rDigest.isEmpty()) { OString aFileName = createFileName(rVertexShaderName, rFragmentShaderName, rGeometryShaderName, rDigest); @@ -473,7 +473,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& rVertexShaderName, if (bHasGeometryShader) glAttachShader(ProgramID, GeometryShaderID); - if( GLEW_ARB_get_program_binary && !rDigest.isEmpty() ) + if (epoxy_has_gl_extension("GL_ARB_get_program_binary") && !rDigest.isEmpty()) { glProgramParameteri(ProgramID, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE); glLinkProgram(ProgramID); @@ -1085,14 +1085,14 @@ void OpenGLHelper::debugMsgPrint(const int nType, const char *pFormat, ...) { OpenGLZone aZone; - if (GLEW_KHR_debug) + if (epoxy_has_gl_extension("GL_KHR_debug")) glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 1, // one[sic] id is as good as another ? // GL_DEBUG_SEVERITY_NOTIFICATION for >= GL4.3 ? GL_DEBUG_SEVERITY_LOW, strlen(pStr), pStr); - else if (GLEW_AMD_debug_output) + else if (epoxy_has_gl_extension("GL_AMD_debug_output")) glDebugMessageInsertAMD(GL_DEBUG_CATEGORY_APPLICATION_AMD, GL_DEBUG_SEVERITY_LOW_AMD, 1, // one[sic] id is as good as another ? diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 0bff9b8352c1..34f0e6f73968 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -47,7 +47,6 @@ #include #endif -#include "GL/glxew.h" #include #include diff --git a/vcl/workben/icontest.cxx b/vcl/workben/icontest.cxx index ae2973b7feef..32d6ae8c05fe 100644 --- a/vcl/workben/icontest.cxx +++ b/vcl/workben/icontest.cxx @@ -20,8 +20,6 @@ #include -#include - #include #include -- cgit