Rename 'RB'(renderbuffer) to 'RBO'(renderbuffer object)
This commit is contained in:
		
							parent
							
								
									a21423ca1c
								
							
						
					
					
						commit
						55596e9da9
					
				
					 2 changed files with 22 additions and 22 deletions
				
			
		| 
						 | 
				
			
			@ -116,7 +116,7 @@ namespace Tex
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace RB
 | 
			
		||||
namespace RBO
 | 
			
		||||
{
 | 
			
		||||
	DEF_GL_ID
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -195,7 +195,7 @@ namespace FBO
 | 
			
		|||
		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);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -348,40 +348,40 @@ struct TexFBO
 | 
			
		|||
	}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct RBFBO
 | 
			
		||||
struct RBOFBO
 | 
			
		||||
{
 | 
			
		||||
	RB::ID rb;
 | 
			
		||||
	RBO::ID rbo;
 | 
			
		||||
	FBO::ID fbo;
 | 
			
		||||
	int width, height;
 | 
			
		||||
 | 
			
		||||
	RBFBO()
 | 
			
		||||
	    : rb(0), fbo(0), width(0), height(0)
 | 
			
		||||
	RBOFBO()
 | 
			
		||||
	    : 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();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	static inline void allocEmpty(RBFBO &obj, int width, int height)
 | 
			
		||||
	static inline void allocEmpty(RBOFBO &obj, int width, int height)
 | 
			
		||||
	{
 | 
			
		||||
		RB::bind(obj.rb);
 | 
			
		||||
		RB::allocEmpty(width, height);
 | 
			
		||||
		RBO::bind(obj.rbo);
 | 
			
		||||
		RBO::allocEmpty(width, height);
 | 
			
		||||
		obj.width = width;
 | 
			
		||||
		obj.height = height;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	static inline void linkFBO(RBFBO &obj)
 | 
			
		||||
	static inline void linkFBO(RBOFBO &obj)
 | 
			
		||||
	{
 | 
			
		||||
		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);
 | 
			
		||||
		RB::del(obj.rb);
 | 
			
		||||
		RBO::del(obj.rbo);
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -469,7 +469,7 @@ struct GraphicsPrivate
 | 
			
		|||
	TexFBO frozenScene;
 | 
			
		||||
	TexFBO currentScene;
 | 
			
		||||
	Quad screenQuad;
 | 
			
		||||
	RBFBO transBuffer;
 | 
			
		||||
	RBOFBO transBuffer;
 | 
			
		||||
 | 
			
		||||
	GraphicsPrivate()
 | 
			
		||||
	    : scRes(640, 480),
 | 
			
		||||
| 
						 | 
				
			
			@ -494,9 +494,9 @@ struct GraphicsPrivate
 | 
			
		|||
		FloatRect screenRect(0, 0, scRes.x, scRes.y);
 | 
			
		||||
		screenQuad.setTexPosRect(screenRect, screenRect);
 | 
			
		||||
 | 
			
		||||
		RBFBO::init(transBuffer);
 | 
			
		||||
		RBFBO::allocEmpty(transBuffer, scRes.x, scRes.y);
 | 
			
		||||
		RBFBO::linkFBO(transBuffer);
 | 
			
		||||
		RBOFBO::init(transBuffer);
 | 
			
		||||
		RBOFBO::allocEmpty(transBuffer, scRes.x, scRes.y);
 | 
			
		||||
		RBOFBO::linkFBO(transBuffer);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	~GraphicsPrivate()
 | 
			
		||||
| 
						 | 
				
			
			@ -504,7 +504,7 @@ struct GraphicsPrivate
 | 
			
		|||
		TexFBO::fini(frozenScene);
 | 
			
		||||
		TexFBO::fini(currentScene);
 | 
			
		||||
 | 
			
		||||
		RBFBO::fini(transBuffer);
 | 
			
		||||
		RBOFBO::fini(transBuffer);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void updateScreenResoRatio()
 | 
			
		||||
| 
						 | 
				
			
			@ -792,8 +792,8 @@ void Graphics::resizeScreen(int width, int height)
 | 
			
		|||
	FloatRect screenRect(0, 0, width, height);
 | 
			
		||||
	p->screenQuad.setTexPosRect(screenRect, screenRect);
 | 
			
		||||
 | 
			
		||||
	RB::bind(p->transBuffer.rb);
 | 
			
		||||
	RB::allocEmpty(width, height);
 | 
			
		||||
	RBO::bind(p->transBuffer.rbo);
 | 
			
		||||
	RBO::allocEmpty(width, height);
 | 
			
		||||
 | 
			
		||||
	p->updateScreenResoRatio();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue