Feeding lights to shaders through ProgramData is not subject to
GL_MAX_LIGHTS, it makes sense to remove that limit from attaching them.
#include <stdexcept>
+#include "error.h"
#include "light.h"
#include "lighting.h"
#include "lightunit.h"
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);
void Lighting::bind() const
{
+ if(lights.size()>LightUnit::get_n_units())
+ throw invalid_operation("Lighting::bind");
+
if(!set_current(this))
return;