Example #1
0
void DirectxEngine::WriteToShader(const Shader& shader,
                                  const std::string& text)
{
    std::ofstream file(shader.HLSLShaderFile().c_str(), 
        std::ios_base::out | std::ios_base::trunc);

    if (!file.is_open())
    {
        Logger::LogError("Could not open " + shader.HLSLShaderFile());
    }
    else
    {
        file << text << std::endl;
        file.close();
    }
}