summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-11 23:11:07 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-12 01:13:04 +0300
commitfacd5fbaa7724ecb56f30fbbefcab9a426d4966b (patch)
tree32896d0d1276417a97f506f3eac856d10e17b186 /src/graphicsmanager.cpp
parent8127238e3e06ff9d7952dde9f931c41c0947ba9c (diff)
downloadmv-facd5fbaa7724ecb56f30fbbefcab9a426d4966b.tar.gz
mv-facd5fbaa7724ecb56f30fbbefcab9a426d4966b.tar.bz2
mv-facd5fbaa7724ecb56f30fbbefcab9a426d4966b.tar.xz
mv-facd5fbaa7724ecb56f30fbbefcab9a426d4966b.zip
Fix FBO under windows.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 79830294e..d0464ae45 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -21,10 +21,16 @@
#include "graphicsmanager.h"
#define GL_GLEXT_PROTOTYPES 1
+#ifndef WIN32
#include "GL/glx.h"
// hack to hide warnings
#undef GL_GLEXT_VERSION
#undef GL_GLEXT_PROTOTYPES
+//#else
+//#include "GL/glext.h"
+//#undef GL_GLEXT_VERSION
+//#undef WIN32_LEAN_AND_MEAN
+#endif
#include "configuration.h"
#include "graphics.h"
@@ -388,16 +394,16 @@ void GraphicsManager::deleteFBO(FBOInfo *fbo)
if (!fbo)
return;
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ mglBindFramebuffer(GL_FRAMEBUFFER, 0);
if (fbo->fboId)
{
- glDeleteFramebuffersEXT(1, &fbo->fboId);
+ mglDeleteFramebuffers(1, &fbo->fboId);
fbo->fboId = 0;
}
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+ mglBindRenderbuffer(GL_RENDERBUFFER, 0);
if (fbo->rboId)
{
- glDeleteRenderbuffersEXT(1, &fbo->rboId);
+ mglDeleteRenderbuffers(1, &fbo->rboId);
fbo->rboId = 0;
}
if (fbo->textureId)
@@ -428,6 +434,8 @@ void GraphicsManager::initOpenGLFunctions()
mglBindFramebuffer = (glBindFramebuffer_t)getFunction("glBindFramebuffer");
mglFramebufferTexture2D = (glFramebufferTexture2D_t)getFunction("glFramebufferTexture2D");
mglFramebufferRenderbuffer = (glFramebufferRenderbuffer_t)getFunction("glFramebufferRenderbuffer");
+ mglDeleteFramebuffers = (glDeleteFramebuffers_t)getFunction("glDeleteFramebuffers");
+ mglDeleteRenderbuffers = (glDeleteRenderbuffers_t)getFunction("glDeleteRenderbuffers");
}
else if (supportExtension("GL_EXT_framebuffer_object"))
{ // old frame buffer extension
@@ -438,6 +446,8 @@ void GraphicsManager::initOpenGLFunctions()
mglBindFramebuffer = (glBindFramebuffer_t)getFunction("glBindFramebufferEXT");
mglFramebufferTexture2D = (glFramebufferTexture2D_t)getFunction("glFramebufferTexture2DEXT");
mglFramebufferRenderbuffer = (glFramebufferRenderbuffer_t)getFunction("glFramebufferRenderbufferEXT");
+ mglDeleteFramebuffers = (glDeleteFramebuffers_t)getFunction("glDeleteFramebuffersEXT");
+ mglDeleteRenderbuffers = (glDeleteRenderbuffers_t)getFunction("glDeleteRenderbuffersEXT");
}
else
{ // no frame buffer support