Rename 'RB'(renderbuffer) to 'RBO'(renderbuffer object)

This commit is contained in:
Jonas Kulla 2013-09-06 12:16:24 +02:00
parent a21423ca1c
commit 55596e9da9
2 changed files with 22 additions and 22 deletions

View File

@ -116,7 +116,7 @@ namespace Tex
} }
} }
namespace RB namespace RBO
{ {
DEF_GL_ID DEF_GL_ID
@ -195,7 +195,7 @@ namespace FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_TEXTURE_2D, texTarget.gl, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_TEXTURE_2D, texTarget.gl, 0);
} }
inline void setRBTarget(RB::ID rbTarget, unsigned colorAttach = 0) inline void setRBOTarget(RBO::ID rbTarget, unsigned colorAttach = 0)
{ {
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_RENDERBUFFER, rbTarget.gl); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + colorAttach, GL_RENDERBUFFER, rbTarget.gl);
} }
@ -348,40 +348,40 @@ struct TexFBO
} }
}; };
struct RBFBO struct RBOFBO
{ {
RB::ID rb; RBO::ID rbo;
FBO::ID fbo; FBO::ID fbo;
int width, height; int width, height;
RBFBO() RBOFBO()
: rb(0), fbo(0), width(0), height(0) : rbo(0), fbo(0), width(0), height(0)
{} {}
static inline void init(RBFBO &obj) static inline void init(RBOFBO &obj)
{ {
obj.rb = RB::gen(); obj.rbo = RBO::gen();
obj.fbo = FBO::gen(); obj.fbo = FBO::gen();
} }
static inline void allocEmpty(RBFBO &obj, int width, int height) static inline void allocEmpty(RBOFBO &obj, int width, int height)
{ {
RB::bind(obj.rb); RBO::bind(obj.rbo);
RB::allocEmpty(width, height); RBO::allocEmpty(width, height);
obj.width = width; obj.width = width;
obj.height = height; obj.height = height;
} }
static inline void linkFBO(RBFBO &obj) static inline void linkFBO(RBOFBO &obj)
{ {
FBO::bind(obj.fbo); FBO::bind(obj.fbo);
FBO::setRBTarget(obj.rb); FBO::setRBOTarget(obj.rbo);
} }
static inline void fini(RBFBO &obj) static inline void fini(RBOFBO &obj)
{ {
FBO::del(obj.fbo); FBO::del(obj.fbo);
RB::del(obj.rb); RBO::del(obj.rbo);
} }
}; };

View File

@ -469,7 +469,7 @@ struct GraphicsPrivate
TexFBO frozenScene; TexFBO frozenScene;
TexFBO currentScene; TexFBO currentScene;
Quad screenQuad; Quad screenQuad;
RBFBO transBuffer; RBOFBO transBuffer;
GraphicsPrivate() GraphicsPrivate()
: scRes(640, 480), : scRes(640, 480),
@ -494,9 +494,9 @@ struct GraphicsPrivate
FloatRect screenRect(0, 0, scRes.x, scRes.y); FloatRect screenRect(0, 0, scRes.x, scRes.y);
screenQuad.setTexPosRect(screenRect, screenRect); screenQuad.setTexPosRect(screenRect, screenRect);
RBFBO::init(transBuffer); RBOFBO::init(transBuffer);
RBFBO::allocEmpty(transBuffer, scRes.x, scRes.y); RBOFBO::allocEmpty(transBuffer, scRes.x, scRes.y);
RBFBO::linkFBO(transBuffer); RBOFBO::linkFBO(transBuffer);
} }
~GraphicsPrivate() ~GraphicsPrivate()
@ -504,7 +504,7 @@ struct GraphicsPrivate
TexFBO::fini(frozenScene); TexFBO::fini(frozenScene);
TexFBO::fini(currentScene); TexFBO::fini(currentScene);
RBFBO::fini(transBuffer); RBOFBO::fini(transBuffer);
} }
void updateScreenResoRatio() void updateScreenResoRatio()
@ -792,8 +792,8 @@ void Graphics::resizeScreen(int width, int height)
FloatRect screenRect(0, 0, width, height); FloatRect screenRect(0, 0, width, height);
p->screenQuad.setTexPosRect(screenRect, screenRect); p->screenQuad.setTexPosRect(screenRect, screenRect);
RB::bind(p->transBuffer.rb); RBO::bind(p->transBuffer.rbo);
RB::allocEmpty(width, height); RBO::allocEmpty(width, height);
p->updateScreenResoRatio(); p->updateScreenResoRatio();
} }