From 9ee0dfa9f2faa999a2230b02c3e8caaab189d329 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 2 Apr 2015 11:44:05 +0300 Subject: [PATCH] Passing param as a ref. --- graphics/opengl/buffer_object.cpp | 11 +++++------ graphics/opengl/buffer_object.hpp | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/graphics/opengl/buffer_object.cpp b/graphics/opengl/buffer_object.cpp index cf43d242b5..1ab499b56c 100644 --- a/graphics/opengl/buffer_object.cpp +++ b/graphics/opengl/buffer_object.cpp @@ -14,13 +14,12 @@ namespace graphics { namespace gl { - void BufferObject::Binder::Reset(BufferObject * bufferObj) + void BufferObject::Binder::Reset(BufferObject & bufferObj) { - ASSERT(bufferObj, ()); - ASSERT(!bufferObj->IsBound(), ()); + ASSERT(!bufferObj.IsBound(), ()); - m_bufferObj = bufferObj; - bufferObj->Bind(); + m_bufferObj = &bufferObj; + m_bufferObj->Bind(); } BufferObject::Binder::~Binder() @@ -191,7 +190,7 @@ namespace graphics /*#ifndef OMIM_OS_ANDROID if (m_id != current()) #endif*/ - binder.Reset(this); + binder.Reset(*this); } void BufferObject::Bind() diff --git a/graphics/opengl/buffer_object.hpp b/graphics/opengl/buffer_object.hpp index 23bc498c99..f758319b81 100644 --- a/graphics/opengl/buffer_object.hpp +++ b/graphics/opengl/buffer_object.hpp @@ -34,7 +34,7 @@ namespace graphics friend void BufferObject::makeCurrent(Binder & binder); BufferObject * m_bufferObj; - void Reset(BufferObject * bufferObj); + void Reset(BufferObject & bufferObj); public: Binder() : m_bufferObj(nullptr) {}