-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007, 2009-2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#ifndef MSP_GL_BUFFER_H_
#define MSP_GL_BUFFER_H_
BufferType type;
BufferUsage usage;
unsigned id;
+ unsigned size;
static const Buffer *bound[4];
~Buffer();
private:
- const Buffer *maybe_bind() const;
+ static void require_buffer_type(BufferType);
public:
/** Sets the usage hint of the buffer. It will take effect the next time
not be changed with this call. */
void sub_data(unsigned, unsigned, const void *);
+ unsigned get_size() const { return size; }
+
/** Binds the buffer in its default slot. */
void bind() const { bind_to(type); }
static void unbind_from(BufferType);
private:
static const Buffer *&binding(BufferType);
+ static bool set_current(BufferType, const Buffer *);
static void restore(const Buffer *, BufferType);
};