diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 99706c4..fb2e000 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -519,7 +519,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align) } gState->bindTex(); - TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA); + TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA_EXT); TEX::setSmooth(true); Quad &quad = gState->gpQuad(); diff --git a/src/gl-util.h b/src/gl-util.h index 6cec2c0..33d16f2 100644 --- a/src/gl-util.h +++ b/src/gl-util.h @@ -166,26 +166,26 @@ namespace FBO inline ID gen() { ID id; - glGenFramebuffers(1, &id.gl); + glGenFramebuffersEXT(1, &id.gl); return id; } inline void del(ID id) { - glDeleteFramebuffers(1, &id.gl); + glDeleteFramebuffersEXT(1, &id.gl); } inline void bind(ID id, Mode mode = Default) { static const GLenum modes[] = { - GL_DRAW_FRAMEBUFFER, - GL_READ_FRAMEBUFFER, - GL_FRAMEBUFFER + GL_DRAW_FRAMEBUFFER_EXT, + GL_READ_FRAMEBUFFER_EXT, + GL_FRAMEBUFFER_EXT }; - glBindFramebuffer(modes[mode], id.gl); + glBindFramebufferEXT(modes[mode], id.gl); } inline void unbind(Mode mode = Default) @@ -195,12 +195,12 @@ namespace FBO inline void setTarget(TEX::ID target, unsigned colorAttach = 0) { - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_TEXTURE_2D, target.gl, 0); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_TEXTURE_2D, target.gl, 0); } inline void setTarget(RBO::ID target, unsigned colorAttach = 0) { - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_RENDERBUFFER, target.gl); + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_RENDERBUFFER, target.gl); } inline void blit(int srcX, int srcY, @@ -208,9 +208,9 @@ namespace FBO int dstX, int dstY, int dstW, int dstH) { - glBlitFramebuffer(srcX, srcY, srcX+srcW, srcY+srcH, - dstX, dstY, dstX+dstW, dstY+dstH, - GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitFramebufferEXT(srcX, srcY, srcX+srcW, srcY+srcH, + dstX, dstY, dstX+dstW, dstY+dstH, + GL_COLOR_BUFFER_BIT, GL_NEAREST); } inline void blit(int srcX, int srcY, diff --git a/src/glstate.cpp b/src/glstate.cpp index dd47260..229120a 100644 --- a/src/glstate.cpp +++ b/src/glstate.cpp @@ -69,21 +69,21 @@ void GLBlendMode::apply(const BlendType &value) case BlendNormal : glBlendEquation(GL_FUNC_ADD); - glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, - GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, + GL_ONE, GL_ONE_MINUS_SRC_ALPHA); break; case BlendAddition : glBlendEquation(GL_FUNC_ADD); - glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, - GL_ONE, GL_ONE); + glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE, + GL_ONE, GL_ONE); break; case BlendSubstraction : // FIXME Alpha calculation is untested - glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); - glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, - GL_ONE, GL_ONE); + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT_EXT); + glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE, + GL_ONE, GL_ONE); break; } }