GRAPHICS: Only manually pull pointers if USE_GLEW not defined
This commit is contained in:
parent
9e1b0f1516
commit
5c813a8b64
3 changed files with 10 additions and 4 deletions
|
@ -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")) {
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
|
||||
#ifdef USE_OPENGL
|
||||
|
||||
#if defined (SDL_BACKEND) && !defined(__amigaos4__)
|
||||
#ifdef USE_GLEW
|
||||
#include <GL/glew.h>
|
||||
#elif defined (SDL_BACKEND) && !defined(__amigaos4__)
|
||||
#include <SDL_opengl.h>
|
||||
#undef ARRAYSIZE
|
||||
#else
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue