1. Bart van Strien
  2. love-experiments

Commits

Boolsheet  committed d2b57d6

For great code-style consistency!

  • Participants
  • Parent commits 37e87c4
  • Branches vbostrategy

Comments (0)

Files changed (1)

File src/modules/graphics/opengl/VertexBuffer.cpp

View file
 // opengl >= 1.5, ARB
 struct VboStrategy
 {
-	virtual void GenBuffers(GLsizei n, GLuint *buffers) = 0;
-	virtual void DeleteBuffers(GLsizei n, const GLuint *buffers) = 0;
-	virtual void BindBuffer(GLenum target, GLuint buffer) = 0;
+	virtual void genBuffers(GLsizei n, GLuint *buffers) = 0;
+	virtual void deleteBuffers(GLsizei n, const GLuint *buffers) = 0;
+	virtual void bindBuffer(GLenum target, GLuint buffer) = 0;
 
-	virtual void BufferData(GLenum target, ptrdiff_t size, const void *data, GLenum usage) = 0;
-	virtual void BufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, const void *data) = 0;
-	virtual void GetBufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, void *data) = 0;
+	virtual void bufferData(GLenum target, ptrdiff_t size, const void *data, GLenum usage) = 0;
+	virtual void bufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, const void *data) = 0;
+	virtual void getBufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, void *data) = 0;
 
-	virtual void *MapBuffer(GLenum target, GLenum access) = 0;
-	virtual GLboolean UnmapBuffer(GLenum target) = 0;
+	virtual void *mapBuffer(GLenum target, GLenum access) = 0;
+	virtual GLboolean unmapBuffer(GLenum target) = 0;
 
-	virtual void GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) = 0;
-	virtual void GetBufferPointerv(GLenum target, GLenum pname, void **params) = 0;
+	virtual void getBufferParameteriv(GLenum target, GLenum pname, GLint *params) = 0;
+	virtual void getBufferPointerv(GLenum target, GLenum pname, void **params) = 0;
 };
 
 struct VboStrategyGL1_5 : public VboStrategy
 {
-	virtual void GenBuffers(GLsizei n, GLuint *buffers) { glGenBuffers(n, buffers); };
-	virtual void DeleteBuffers(GLsizei n, const GLuint *buffers) { glDeleteBuffers(n, buffers); };
-	virtual void BindBuffer(GLenum target, GLuint buffer) { glBindBuffer(target, buffer); };
+	virtual void genBuffers(GLsizei n, GLuint *buffers) { glGenBuffers(n, buffers); };
+	virtual void deleteBuffers(GLsizei n, const GLuint *buffers) { glDeleteBuffers(n, buffers); };
+	virtual void bindBuffer(GLenum target, GLuint buffer) { glBindBuffer(target, buffer); };
 
-	virtual void BufferData(GLenum target, ptrdiff_t size, const void *data, GLenum usage) { glBufferData(target, size, data, usage); };
-	virtual void BufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, const void *data) { glBufferSubData(target, offset, size, data); };
-	virtual void GetBufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, void *data) { glGetBufferSubData(target, offset, size, data); };
+	virtual void bufferData(GLenum target, ptrdiff_t size, const void *data, GLenum usage) { glBufferData(target, size, data, usage); };
+	virtual void bufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, const void *data) { glBufferSubData(target, offset, size, data); };
+	virtual void getBufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, void *data) { glGetBufferSubData(target, offset, size, data); };
 
-	virtual void *MapBuffer(GLenum target, GLenum access) { return glMapBuffer(target, access); };
-	virtual GLboolean UnmapBuffer(GLenum target) { return glUnmapBuffer(target); };
+	virtual void *mapBuffer(GLenum target, GLenum access) { return glMapBuffer(target, access); };
+	virtual GLboolean unmapBuffer(GLenum target) { return glUnmapBuffer(target); };
 
-	virtual void GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) { glGetBufferParameteriv(target, pname, params); };
-	virtual void GetBufferPointerv(GLenum target, GLenum pname, void **params) { glGetBufferPointerv(target, pname, params); };
+	virtual void getBufferParameteriv(GLenum target, GLenum pname, GLint *params) { glGetBufferParameteriv(target, pname, params); };
+	virtual void getBufferPointerv(GLenum target, GLenum pname, void **params) { glGetBufferPointerv(target, pname, params); };
 };
 
 struct VboStrategyARB : public VboStrategy
 {
-	virtual void GenBuffers(GLsizei n, GLuint *buffers) { glGenBuffersARB(n, buffers); };
-	virtual void DeleteBuffers(GLsizei n, const GLuint *buffers) { glDeleteBuffersARB(n, buffers); };
-	virtual void BindBuffer(GLenum target, GLuint buffer) { glBindBufferARB(target, buffer); };
+	virtual void genBuffers(GLsizei n, GLuint *buffers) { glGenBuffersARB(n, buffers); };
+	virtual void deleteBuffers(GLsizei n, const GLuint *buffers) { glDeleteBuffersARB(n, buffers); };
+	virtual void bindBuffer(GLenum target, GLuint buffer) { glBindBufferARB(target, buffer); };
 
-	virtual void BufferData(GLenum target, ptrdiff_t size, const void *data, GLenum usage) { glBufferDataARB(target, size, data, usage); };
-	virtual void BufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, const void *data) { glBufferSubDataARB(target, offset, size, data); };
-	virtual void GetBufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, void *data) { glGetBufferSubDataARB(target, offset, size, data); };
+	virtual void bufferData(GLenum target, ptrdiff_t size, const void *data, GLenum usage) { glBufferDataARB(target, size, data, usage); };
+	virtual void bufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, const void *data) { glBufferSubDataARB(target, offset, size, data); };
+	virtual void getBufferSubData(GLenum target, ptrdiff_t offset, ptrdiff_t size, void *data) { glGetBufferSubDataARB(target, offset, size, data); };
 
-	virtual void *MapBuffer(GLenum target, GLenum access) { return glMapBufferARB(target, access); };
-	virtual GLboolean UnmapBuffer(GLenum target) { return glUnmapBufferARB(target); };
+	virtual void *mapBuffer(GLenum target, GLenum access) { return glMapBufferARB(target, access); };
+	virtual GLboolean unmapBuffer(GLenum target) { return glUnmapBufferARB(target); };
 
-	virtual void GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) { glGetBufferParameterivARB(target, pname, params); };
-	virtual void GetBufferPointerv(GLenum target, GLenum pname, void **params) { glGetBufferPointervARB(target, pname, params); };
+	virtual void getBufferParameteriv(GLenum target, GLenum pname, GLint *params) { glGetBufferParameterivARB(target, pname, params); };
+	virtual void getBufferPointerv(GLenum target, GLenum pname, void **params) { glGetBufferPointervARB(target, pname, params); };
 };
 
 static bool vboStrategyLoaded = false;
 	mapped = malloc(getSize());
 	if (!mapped)
 		throw love::Exception("Out of memory (oh the humanity!)");
-	vboStrategy->GetBufferSubData(getTarget(), 0, getSize(), mapped);
+	vboStrategy->getBufferSubData(getTarget(), 0, getSize(), mapped);
 
 	return mapped;
 }
 {
 	if (mapped)
 	{
-		vboStrategy->BufferSubData(getTarget(), 0, getSize(), mapped);
+		vboStrategy->bufferSubData(getTarget(), 0, getSize(), mapped);
 		free(mapped);
 		mapped = 0;
 	}
 
 void VBO::bind()
 {
-	vboStrategy->BindBuffer(getTarget(), vbo);
+	vboStrategy->bindBuffer(getTarget(), vbo);
 }
 
 void VBO::unbind()
 {
-	vboStrategy->BindBuffer(getTarget(), 0);
+	vboStrategy->bindBuffer(getTarget(), 0);
 }
 
 void VBO::fill(size_t offset, size_t size, const void *data)
 	if (mapped)
 		memcpy(static_cast<char *>(mapped) + offset, data, size);
 	else
-		vboStrategy->BufferSubData(getTarget(), offset, size, data);
+		vboStrategy->bufferSubData(getTarget(), offset, size, data);
 }
 
 const void *VBO::getPointer(size_t offset) const
 
 bool VBO::load(bool restore)
 {
-	vboStrategy->GenBuffers(1, &vbo);
+	vboStrategy->genBuffers(1, &vbo);
 
 	VertexBuffer::Bind bind(*this);
 
 		/* clear error messages */;
 
 	// Note that if 'src' is '0', no data will be copied.
-	vboStrategy->BufferData(getTarget(), getSize(), src, getUsage());
+	vboStrategy->bufferData(getTarget(), getSize(), src, getUsage());
 	GLenum err = glGetError();
 
 	// Clean up buffer_copy, if it exists.
 		VertexBuffer::Bind bind(*this);
 
 		GLint size;
-		vboStrategy->GetBufferParameteriv(getTarget(), GL_BUFFER_SIZE, &size);
+		vboStrategy->getBufferParameteriv(getTarget(), GL_BUFFER_SIZE, &size);
 
 		const char *src = static_cast<char *>(map());
 
 		}
 	}
 
-	vboStrategy->DeleteBuffers(1, &vbo);
+	vboStrategy->deleteBuffers(1, &vbo);
 	vbo = 0;
 }