33 if (map.
hasKey(
"source")) {
34 string path = resPath+(string)map[
"source"];
35 ifstream t(path.c_str());
43 if (map.
hasKey(
"priority")) {
44 funcs[0].priority = (int)map[
"priority"];
46 funcs[0].priority = 0;
49 if (map.
hasKey(
"params")) {
50 ConfigVector::iterator it = map[
"params"].begin();
51 for (;it!=map[
"params"].end();it++) {
52 funcs[0].arguments.push_back(it.base()->getString());
56 if (map.
hasKey(
"varyings")) {
58 for (;it!=map[
"varyings"].endMap();it++) {
59 string type = it->first;
60 std::size_t a_pos = type.find(
"[]");
61 ConfigVector::iterator it2 = map[
"varyings"][type].begin();
62 for (;it2!=map[
"varyings"][type].end();it2++) {
66 if (a_pos != string::npos) {
67 typeName = type.substr(0,a_pos);
68 if (item.
hasKey(
"arraySize")) {
69 string size = map[
"mappings"][(string)item[
"arraySize"]];
70 s <<
"[" << size <<
"]";
83 if (map.
hasKey(
"uniforms")) {
85 for (;it!=map[
"uniforms"].endMap();it++) {
86 string type = it->first;
87 std::size_t a_pos = type.find(
"[]");
88 ConfigVector::iterator it2 = map[
"uniforms"][type].begin();
89 for (;it2!=map[
"uniforms"][type].end();it2++) {
93 if (a_pos != string::npos) {
94 typeName = type.substr(0,a_pos);
95 if (item.
hasKey(
"arraySize")) {
96 string size = map[
"mappings"][(string)item[
"arraySize"]];
97 s <<
"[" << size <<
"]";
110 if (map.
hasKey(
"attributes")) {
112 for (;it!=map[
"attributes"].endMap();it++) {
113 string type = it->first;
114 std::size_t a_pos = type.find(
"[]");
115 ConfigVector::iterator it2 = map[
"attributes"][type].begin();
116 for (;it2!=map[
"attributes"][type].end();it2++) {
120 if (a_pos != string::npos) {
121 typeName = type.substr(0,a_pos);
122 if (item.
hasKey(
"arraySize")) {
123 string size = map[
"mappings"][(string)item[
"arraySize"]];
124 s <<
"[" << size <<
"]";
137 if (map.
hasKey(
"exports")) {
138 ConfigVector::iterator it = map[
"exports"].begin();
139 for (;it!=map[
"exports"].end();it++) {
145 if (map.
hasKey(
"mainVarDecs")) {
147 for (;it!=map[
"mainVarDecs"].endMap();it++) {
148 string type = it->first;
149 std::size_t a_pos = type.find(
"[]");
150 ConfigVector::iterator it2 = map[
"mainVarDecs"][type].begin();
151 for (;it2!=map[
"mainVarDecs"][type].end();it2++) {
155 if (a_pos != string::npos) {
156 typeName = type.substr(0,a_pos);
157 if (item.
hasKey(
"arraySize")) {
158 string size = map[
"mappings"][(string)item[
"arraySize"]];
159 s <<
"[" << size <<
"]";
172 if (map.
hasKey(
"mainVars")) {
174 for (;it!=map[
"mainVars"].endMap();it++) {
175 string type = it->first;
176 std::size_t a_pos = type.find(
"[]");
177 ConfigVector::iterator it2 = map[
"mainVars"][type].begin();
178 for (;it2!=map[
"mainVars"][type].end();it2++) {
182 if (a_pos != string::npos) {
183 typeName = type.substr(0,a_pos);
184 if (item.
hasKey(
"arraySize")) {
185 string size = map[
"mappings"][(string)item[
"arraySize"]];
186 s <<
"[" << size <<
"]";
194 int priority =
funcs[0].priority;
195 if (item.
hasKey(
"priority")) {
196 priority = (int)item[
"priority"];
203 if (map.
hasKey(
"snippets")) {
204 ConfigVector::iterator it = map[
"snippets"].begin();
205 for (;it!=map[
"snippets"].end();it++) {
208 if (item.
hasKey(
"source")) {
209 string path = resPath+(string)item[
"source"];
210 ifstream t(path.c_str());
213 snippet = buffer.str();
215 int priority =
funcs[0].priority;
216 if (item.
hasKey(
"priority")) {
217 priority = (int)item[
"priority"];
void addAttribute(GLSLAttribute att)
void addExport(GLSLExport e)
void addVarying(GLSLVarying varying)
void addMainVar(GLSLVariable var, int priority=0)
Base object of the configmaps library!
std::list< FIFOItem< std::string, ConfigItem > >::iterator iterator
void addUniform(GLSLUniform uniform)
bool hasKey(std::string key)
void addMainVarDec(GLSLAttribute att)
bool hasKey(std::string key)
std::vector< FunctionCall > funcs
YamlShader(std::string name, std::vector< std::string > &args, configmaps::ConfigMap &map, std::string resPath)
void addSnippet(std::string line, int priority=0)