Explorar o código

Actually copy existing buffer data to temporary memory region in VBO::map().

vrld %!s(int64=13) %!d(string=hai) anos
pai
achega
39e1c59989
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/modules/graphics/opengl/VertexBuffer.cpp

+ 2 - 1
src/modules/graphics/opengl/VertexBuffer.cpp

@@ -131,13 +131,14 @@ namespace opengl
 		mapped = malloc(getSize());
 		if (!mapped)
 			throw love::Exception("Out of memory (oh the humanity!)");
+		glGetBufferSubDataARB(getTarget(), 0, getSize(), mapped);
 
 		return mapped;
 	}
 
 	void VBO::unmap()
 	{
-		glBufferSubDataARB(getTarget(), 0, getSize(), (void*)mapped);
+		glBufferSubDataARB(getTarget(), 0, getSize(), mapped);
 		free(mapped);
 		mapped = 0;
 	}