From 2b6cc4ea8c7a6c72af9d7507bffc68424ff9b806 Mon Sep 17 00:00:00 2001 From: vrld Date: Wed, 7 Mar 2012 23:01:05 +0100 Subject: [PATCH] Move VertexBuffer::Bind implementation to header to hint inlining --- src/modules/graphics/opengl/VertexBuffer.cpp | 13 ------------- src/modules/graphics/opengl/VertexBuffer.h | 7 +++++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/modules/graphics/opengl/VertexBuffer.cpp b/src/modules/graphics/opengl/VertexBuffer.cpp index c718dc513..e1dfed529 100644 --- a/src/modules/graphics/opengl/VertexBuffer.cpp +++ b/src/modules/graphics/opengl/VertexBuffer.cpp @@ -59,19 +59,6 @@ namespace opengl { } - // VertexBuffer::Bind - - VertexBuffer::Bind::Bind(VertexBuffer &buf) - : buf(buf) - { - buf.bind(); - } - - VertexBuffer::Bind::~Bind() - { - buf.unbind(); - } - // VertexArray VertexArray::VertexArray(size_t size, GLenum target, GLenum usage) diff --git a/src/modules/graphics/opengl/VertexBuffer.h b/src/modules/graphics/opengl/VertexBuffer.h index 030ad971f..a9e13c8c8 100644 --- a/src/modules/graphics/opengl/VertexBuffer.h +++ b/src/modules/graphics/opengl/VertexBuffer.h @@ -160,12 +160,15 @@ namespace opengl /** * Bind a VertexBuffer. */ - Bind(VertexBuffer &buf); + Bind(VertexBuffer &buf) + : buf(buf) + { buf.bind(); } /** * Unbinds a VertexBuffer. */ - ~Bind(); + ~Bind() + { buf.unbind(); } private: