Added a new type of binding pointer which stores offset and size.

TRAC #22753 Signed-off-by: Jamie Madill Signed-off-by: Nicolas Capens Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2110 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 3f72ce35
......@@ -63,4 +63,32 @@ class BindingPointer : public RefCountObjectBindingPointer
ObjectType *operator -> () const { return get(); }
};
template <class ObjectType>
class OffsetBindingPointer : public RefCountObjectBindingPointer
{
public:
OffsetBindingPointer() : mOffset(0), mSize(-1) { }
void set(ObjectType *newObject)
{
RefCountObjectBindingPointer::set(newObject);
mOffset = 0;
mSize = -1;
}
void set(ObjectType *newObject, GLintptr offset, GLsizeiptr size)
{
RefCountObjectBindingPointer::set(newObject);
mOffset = offset;
mSize = size;
}
ObjectType *get() const { return static_cast<ObjectType*>(RefCountObjectBindingPointer::get()); }
ObjectType *operator -> () const { return get(); }
private:
GLintptr mOffset;
GLsizeiptr mSize;
};
#endif // COMMON_REFCOUNTOBJECT_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment