MCPcopy Create free account
hub / github.com/christophhart/HISE / getHeader

Method getHeader

hi_scripting/scripting/api/ScriptingGraphics.cpp:567–596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565bool ScriptingObjects::ScriptShader::renderingScreenShot = false;
566
567String ScriptingObjects::ScriptShader::getHeader()
568{
569 String s;
570
571 s << "uniform float uScale;";
572 s << "uniform float iTime;";
573 s << "uniform vec2 iMouse;";
574 s << "uniform vec2 uOffset;";
575 s << "uniform vec3 iResolution;";
576 s << "";
577 s << "vec2 _gl_fc()";
578 s << "{";
579 s << "vec2 p = vec2(pixelPos.x + uOffset.x,";
580 s << " pixelPos.y + uOffset.y) / uScale;";
581 s << "p.y = iResolution.y - p.y;";
582 s << "return p;";
583 s << "}";
584 s << "\n#define fragCoord _gl_fc()\n";
585 s << "#define fragColor gl_FragColor\n";
586
587#if USE_BACKEND
588 // We'll make this dynamic so everybody can adjust it to their graphics card
589 if (GET_HISE_SETTING(dynamic_cast<Processor*>(getScriptProcessor()), HiseSettings::Other::EnableShaderLineNumbers))
590 {
591 s << "#line 0 \"" << shaderName << "\" \n";
592 }
593#endif
594
595 return s;
596}
597
598
599

Callers 4

ServerControllerMethod · 0.45
skinTableMethod · 0.45
ReferenceFinderMethod · 0.45
setupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected