diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp index fe25120d756..28872f19724 100644 --- a/engines/grim/gfx_opengl.cpp +++ b/engines/grim/gfx_opengl.cpp @@ -52,7 +52,7 @@ #include "engines/grim/registry.h" -#if defined (SDL_BACKEND) && defined(GL_ARB_fragment_program) +#if defined (SDL_BACKEND) && defined(GL_ARB_fragment_program) && !defined(USE_GLEW) // We need SDL.h for SDL_GL_GetProcAddress. #include "backends/platform/sdl/sdl-sys.h" @@ -177,6 +177,7 @@ void GfxOpenGL::initExtensions() { } #if defined (SDL_BACKEND) && defined(GL_ARB_fragment_program) +#ifndef USE_GLEW union { void *obj_ptr; void (APIENTRY *func_ptr)(); @@ -194,6 +195,7 @@ void GfxOpenGL::initExtensions() { glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)u.func_ptr; u.obj_ptr = SDL_GL_GetProcAddress("glProgramLocalParameter4fARB"); glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)u.func_ptr; +#endif const char *extensions = (const char *)glGetString(GL_EXTENSIONS); if (strstr(extensions, "ARB_fragment_program")) { diff --git a/engines/grim/gfx_opengl.h b/engines/grim/gfx_opengl.h index a3cb6d5f74e..fc5c54ae127 100644 --- a/engines/grim/gfx_opengl.h +++ b/engines/grim/gfx_opengl.h @@ -27,7 +27,9 @@ #ifdef USE_OPENGL -#if defined (SDL_BACKEND) && !defined(__amigaos4__) +#ifdef USE_GLEW +#include +#elif defined (SDL_BACKEND) && !defined(__amigaos4__) #include #undef ARRAYSIZE #else diff --git a/graphics/opengles2/framebuffer.cpp b/graphics/opengles2/framebuffer.cpp index 568dbc29e75..0550e32402a 100644 --- a/graphics/opengles2/framebuffer.cpp +++ b/graphics/opengles2/framebuffer.cpp @@ -48,7 +48,7 @@ namespace Graphics { -#if defined(SDL_BACKEND) && !defined(USE_OPENGL_SHADERS) +#if defined(SDL_BACKEND) && !defined(USE_GLEW) static bool framebuffer_object_functions = false; static PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebuffer; static PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbuffer; @@ -122,10 +122,12 @@ static bool usePackedBuffer() { FrameBuffer::FrameBuffer(uint width, uint height) : _managedTexture(true), _width(width), _height(height), _texWidth(nextHigher2(width)), _texHeight(nextHigher2(height)) { -#if defined(SDL_BACKEND) && !defined(USE_OPENGL_SHADERS) +#ifdef SDL_BACKEND if (!Graphics::isExtensionSupported("GL_EXT_framebuffer_object")) { error("GL_EXT_framebuffer_object extension is not supported!"); } +#endif +#if defined(SDL_BACKEND) && !defined(USE_GLEW) grabFramebufferObjectPointers(); #endif glGenTextures(1, &_colorTexture);