#include "vertexarray.h"
#include "vertexsetup.h"
+using namespace std;
+
namespace Msp {
namespace GL {
void VertexSetup::set_vertex_array(const VertexArray &a)
{
+ if(!a.get_buffer())
+ throw invalid_argument("VertexSetup::set_vertex_array");
+
vertex_array = &a;
update(VERTEX_ARRAY);
}
void VertexSetup::set_instance_array(const VertexArray *a)
{
if(a)
+ {
+ if(!a->get_buffer())
+ throw invalid_argument("VertexSetup::set_instance_array");
+
static Require req(ARB_instanced_arrays);
+ }
inst_array = a;
update(INSTANCE_ARRAY);