Changes after Yury comments

This commit is contained in:
Vladimir Byko-Ianko 2015-04-01 19:47:01 +03:00 committed by Alex Zolotarev
parent baa4c4e1d4
commit 29a6050571
2 changed files with 12 additions and 9 deletions

View file

@ -1,13 +1,14 @@
#include "../../base/SRC_FIRST.hpp"
#include "../../base/logging.hpp"
#include "buffer_object.hpp"
#include "opengl.hpp"
#include "../../base/assert.hpp"
#include "../../base/shared_buffer_manager.hpp"
#include "../../base/logging.hpp"
#include "../../base/macros.hpp"
#include "../../base/shared_buffer_manager.hpp"
#include "../../base/SRC_FIRST.hpp"
#include "../../std/list.hpp"
#include "opengl.hpp"
#include "buffer_object.hpp"
namespace graphics
{
@ -16,6 +17,8 @@ namespace graphics
void BufferObject::Binder::Reset(BufferObject * bufferObj)
{
ASSERT(bufferObj, ());
ASSERT(!bufferObj->IsBound(), ());
m_bufferObj = bufferObj;
bufferObj->Bind();
}

View file

@ -51,16 +51,16 @@ namespace graphics
/// Multithreading notes for Bind and Unbind methods:
/// 1. Method Unbind should be called from the same thread on which method Bind was called.
/// 2. After Unbind() call current instance can be used by other threads.
/// Bind the buffer object to the current thread.
/// 2. After Unbind() call the current instance can be used by other threads.
/// Binds the buffer object to the current thread.
void Bind();
/// Unbinds the buffer object from the current thread only for iOS.
void Unbind();
bool IsBound() const { return m_bound; }
/// This method locks the instance of a buffer object and return a pointer to a GPU buffer.
/// This method locks the instance of a buffer object and returns a pointer to a GPU buffer.
/// Notes. The buffer object will be bound to the current thread.
/// It shall not be unbound untill unlock is called.
/// It shall not be unbound until unlock is called.
void * lock();
/// Informs gl that the instance of a buffer object is released and unbind it.
void unlock();