#include <msp/core/maputils.h>
+#include <msp/debug/demangle.h>
#include <msp/gl/extensions/arb_direct_state_access.h>
+#include <msp/io/print.h>
#include "buffer.h"
#include "color.h"
#include "error.h"
else if(name[name.size()-1]==']')
throw invalid_argument("ProgramData::uniform");
}
- catch(...)
+ catch(const exception &e)
{
delete uni;
+#ifdef DEBUG
+ IO::print(IO::cerr, "Error while setting uniform %s: %s: %s\n", name, Debug::demangle(typeid(e).name()), e.what());
+ return;
+#else
throw;
+#endif
}
int i = find_uniform_index(name);
return *uniforms[i].value;
}
+const Uniform *ProgramData::find_uniform(const string &name) const
+{
+ int i = find_uniform_index(name);
+ return (i>=0 ? uniforms[i].value : 0);
+}
+
bool ProgramData::uniform_name_compare(const NamedUniform &nu, const string &name)
{
return nu.name<name;