Browse Source

Change bind/unbind to grab/stop

vrld 15 years ago
parent
commit
35093a5c45

+ 4 - 0
.hgignore

@@ -7,6 +7,10 @@ glob:extra/reshax/Debug/
 glob:extra/reshax/resources.h
 glob:extra/reshax/resources.cpp
 glob:*.obj
+glob:*.o
+glob:*.dirstamp
+glob:*.m4
+glob:*.Po
 glob:*.dll
 glob:*.user
 glob:*.suo

+ 2 - 2
src/modules/graphics/opengl/Framebuffer.cpp

@@ -89,7 +89,7 @@ namespace opengl
 		status_to_string[statusCode()];
 	}
 
-	void Framebuffer::bind()
+	void Framebuffer::grab()
 	{
 		glPushAttrib(GL_VIEWPORT_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 		glBindFramebuffer(GL_FRAMEBUFFER, fbo);
@@ -98,7 +98,7 @@ namespace opengl
 		glViewport(0, 0, width, height);
 	}
 
-	void Framebuffer::unbind()
+	void Framebuffer::stop()
 	{
 		glBindFramebuffer(GL_FRAMEBUFFER, 0);
 		glPopAttrib();

+ 2 - 4
src/modules/graphics/opengl/Framebuffer.h

@@ -24,10 +24,8 @@ namespace opengl
 		GLenum statusCode() const { return status_; } //SERIOUS DISLIKE HERE
 		const char* statusMessage() const;
 
-		void bind(); //DOUBTFUL ABOUT NAME
-		void unbind(); //Maybe start/stop?
-		//And what about clearing, clear() isn't entirely what I want either
-		//maybe make bind/start autoclear?
+		void grab();
+		void stop();
 
 		virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy) const;
 

+ 8 - 8
src/modules/graphics/opengl/wrap_Framebuffer.cpp

@@ -17,34 +17,34 @@ namespace opengl
 		if (!lua_isfunction(L, 2))
 			return luaL_error(L, "Need a function to render to fbo");
 
-		fbo->bind();
+		fbo->grab();
 
 		lua_settop(L, 2); // make sure the function is on top of the stack
 		lua_pcall(L, 0, 0, 0);
 
-		fbo->unbind();
+		fbo->stop();
 
 		return 0;
 	}
 
-	int w_Framebuffer_bind(lua_State * L)
+	int w_Framebuffer_grab(lua_State * L)
 	{
 		Framebuffer * fbo = luax_checkfbo(L, 1);
-		fbo->bind();
+		fbo->grab();
 		return 0;
 	}
 
-	int w_Framebuffer_unbind(lua_State * L)
+	int w_Framebuffer_stop(lua_State * L)
 	{
 		Framebuffer * fbo = luax_checkfbo(L, 1);
-		fbo->unbind();
+		fbo->stop();
 		return 0;
 	}
 
 	static const luaL_Reg functions[] = {
 		{ "render", w_Framebuffer_render },
-		{ "bind", w_Framebuffer_bind },
-		{ "unbind", w_Framebuffer_unbind },
+		{ "grab", w_Framebuffer_grab },
+		{ "stop", w_Framebuffer_stop },
 		{ 0, 0 }
 	};