+#include <stdexcept>
#include "light.h"
#include "lighting.h"
+#include "lightunit.h"
#include "misc.h"
+using namespace std;
+
namespace Msp {
namespace GL {
void Lighting::attach(unsigned i, const Light &l)
{
+ if(i>=LightUnit::get_n_units())
+ throw out_of_range("Lighting::attach");
+
if(i>=lights.size())
lights.resize(i+1);