2013-12-22 14:04:33 +00:00
|
|
|
#include "OpenGLSharedState.h"
|
|
|
|
|
|
|
|
OpenGLSharedState::OpenGLSharedState()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-12-22 17:05:11 +00:00
|
|
|
void OpenGLSharedState::apply(OpenGLShaderProgram *program, int &texture_unit)
|
2013-12-22 14:04:33 +00:00
|
|
|
{
|
|
|
|
for (const auto &pair : variables)
|
|
|
|
{
|
2013-12-22 17:05:11 +00:00
|
|
|
pair.second->apply(program, texture_unit);
|
2013-12-22 14:04:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OpenGLVariable *OpenGLSharedState::get(const std::string &name)
|
|
|
|
{
|
|
|
|
OpenGLVariable*& var = variables[name];
|
|
|
|
if (var == 0)
|
|
|
|
{
|
|
|
|
var = new OpenGLVariable(name);
|
|
|
|
}
|
|
|
|
return var;
|
|
|
|
}
|