Use EXT version of gl functions
This commit is contained in:
parent
ef6bacf201
commit
abc927c91d
|
@ -519,7 +519,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
|
||||||
}
|
}
|
||||||
|
|
||||||
gState->bindTex();
|
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);
|
TEX::setSmooth(true);
|
||||||
|
|
||||||
Quad &quad = gState->gpQuad();
|
Quad &quad = gState->gpQuad();
|
||||||
|
|
|
@ -166,26 +166,26 @@ namespace FBO
|
||||||
inline ID gen()
|
inline ID gen()
|
||||||
{
|
{
|
||||||
ID id;
|
ID id;
|
||||||
glGenFramebuffers(1, &id.gl);
|
glGenFramebuffersEXT(1, &id.gl);
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void del(ID id)
|
inline void del(ID id)
|
||||||
{
|
{
|
||||||
glDeleteFramebuffers(1, &id.gl);
|
glDeleteFramebuffersEXT(1, &id.gl);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bind(ID id, Mode mode = Default)
|
inline void bind(ID id, Mode mode = Default)
|
||||||
{
|
{
|
||||||
static const GLenum modes[] =
|
static const GLenum modes[] =
|
||||||
{
|
{
|
||||||
GL_DRAW_FRAMEBUFFER,
|
GL_DRAW_FRAMEBUFFER_EXT,
|
||||||
GL_READ_FRAMEBUFFER,
|
GL_READ_FRAMEBUFFER_EXT,
|
||||||
GL_FRAMEBUFFER
|
GL_FRAMEBUFFER_EXT
|
||||||
};
|
};
|
||||||
|
|
||||||
glBindFramebuffer(modes[mode], id.gl);
|
glBindFramebufferEXT(modes[mode], id.gl);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void unbind(Mode mode = Default)
|
inline void unbind(Mode mode = Default)
|
||||||
|
@ -195,12 +195,12 @@ namespace FBO
|
||||||
|
|
||||||
inline void setTarget(TEX::ID target, unsigned colorAttach = 0)
|
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)
|
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,
|
inline void blit(int srcX, int srcY,
|
||||||
|
@ -208,7 +208,7 @@ namespace FBO
|
||||||
int dstX, int dstY,
|
int dstX, int dstY,
|
||||||
int dstW, int dstH)
|
int dstW, int dstH)
|
||||||
{
|
{
|
||||||
glBlitFramebuffer(srcX, srcY, srcX+srcW, srcY+srcH,
|
glBlitFramebufferEXT(srcX, srcY, srcX+srcW, srcY+srcH,
|
||||||
dstX, dstY, dstX+dstW, dstY+dstH,
|
dstX, dstY, dstX+dstW, dstY+dstH,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,20 +69,20 @@ void GLBlendMode::apply(const BlendType &value)
|
||||||
|
|
||||||
case BlendNormal :
|
case BlendNormal :
|
||||||
glBlendEquation(GL_FUNC_ADD);
|
glBlendEquation(GL_FUNC_ADD);
|
||||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
|
glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
|
||||||
GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BlendAddition :
|
case BlendAddition :
|
||||||
glBlendEquation(GL_FUNC_ADD);
|
glBlendEquation(GL_FUNC_ADD);
|
||||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE,
|
glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE,
|
||||||
GL_ONE, GL_ONE);
|
GL_ONE, GL_ONE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BlendSubstraction :
|
case BlendSubstraction :
|
||||||
// FIXME Alpha calculation is untested
|
// FIXME Alpha calculation is untested
|
||||||
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
|
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT_EXT);
|
||||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE,
|
glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE,
|
||||||
GL_ONE, GL_ONE);
|
GL_ONE, GL_ONE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue