Lines Matching full:oss
200 void printInputColor (ostringstream& oss, const VariableDeclaration& input)
229 oss << "hsv(vec3(" << exp << ", 1.0, 1.0))";
232 oss << "hsv(vec3(" << exp << ", 1.0))";
235 oss << "vec4(" << exp << ", 1.0)";
238 oss << exp;
250 oss << "hsv(vec3(determinant(" << exp << ")))";
261 oss << "hsv(" << exp << ")";
384 void printFloat (ostringstream& oss, double d)
386 oss.setf(oss.fixed | oss.internal);
387 oss.precision(4);
388 oss.width(7);
389 oss << d;
392 void printFloatDeclaration (ostringstream& oss,
402 oss << VariableDeclaration(varType, varName, STORAGE_UNIFORM) << ";\n";
404 oss << VariableDeclaration(varType, varName, STORAGE_CONST)
408 void printRandomInitializer (ostringstream& oss, DataType type, Random& rnd)
414 oss << getDataTypeName(type) << "(";
418 oss << (i == 0 ? "" : ", ");
422 printFloat(oss, rnd.getInt(0, 16) / 16.0);
427 oss << rnd.getInt(0, 255);
431 oss << (rnd.getBool() ? "true" : "false");
440 oss << ")";
449 ostringstream oss;
454 oss << "#version 310 es\n";
456 printFloatDeclaration(oss, varName, uniform, value);
460 oss << *it << ";\n";
462 oss << "const vec2 triangle[3] = vec2[3](\n";
466 oss << "\tvec2(";
470 printFloat(oss, s_quadrants[vertexNdx][componentNdx] * rnd.getInt(4,16) / 16.0);
471 oss << (componentNdx < 1 ? ", " : "");
474 oss << ")" << (vertexNdx < 2 ? "," : "") << "\n";
476 oss << ");\n";
485 oss << "const " << typeName << " " << it->name << "Inits[3] = "
489 oss << (i == 0 ? "\t" : ",\n\t");
490 printRandomInitializer(oss, type, rnd);
492 oss << ");\n";
495 oss << "void main (void)\n"
501 oss << "\t" << it->name << " = " << it->name << "Inits[gl_VertexID];\n";
503 oss << "}\n";
505 return oss.str();
515 ostringstream oss;
517 oss.precision(4);
518 oss.width(7);
519 oss << "#version 310 es\n";
521 oss << "precision highp float;\n";
523 oss << "out vec4 fragColor;\n";
525 printFloatDeclaration(oss, varName, uniform, value);
529 oss << *it << ";\n";
532 oss << "int imod (int n, int d)" << "\n"
537 oss << "vec4 hsv (vec3 hsv)"
547 oss << "void main (void)\n"
550 oss << "\t" << "fragColor = vec4(vec3(" << varName << "), 1.0);" << "\n";
554 oss << "\t"
557 printFloat(oss, rnd.getFloat(0.5f, 2.0f));
558 oss << " * gl_FragCoord.x - ";
560 printFloat(oss, rnd.getFloat(0.5f, 2.0f));
561 oss << " * gl_FragCoord.y)), "
567 oss << "\t\t" << "case " << i << ":" << "\n"
570 printInputColor(oss, inputs[i]);
572 oss << ";" << "\n"
576 oss << "\t\t" << "case " << inputs.size() << ":\n"
578 oss << "\t\t\t" << "break;" << "\n";
580 oss << "\t\t" << "case -1:\n"
582 oss << "\t\t\t" << "break;" << "\n";
584 oss << "\t\t" << "default:" << "\n"
587 oss << "\t" << "}\n";
591 oss << "}\n";
593 return oss.str();
718 ostringstream oss;
720 oss << (params.initSingle ? "1" : "2")
742 return oss.str();