Commit 89176d8d authored by Gargaj's avatar Gargaj Committed by GitHub
Browse files

check if shader writing was successful

parent 2d36ad7b
......@@ -372,9 +372,16 @@ int main()
if (Renderer::ReloadShader( szShader, strlen(szShader), szError, 4096 ))
{
FILE * f = fopen(Renderer::defaultShaderFilename,"wb");
fwrite( szShader, strlen(szShader), 1, f );
fclose(f);
mDebugOutput.SetText( "" );
if (f)
{
fwrite( szShader, strlen(szShader), 1, f );
fclose(f);
mDebugOutput.SetText( "" );
}
else
{
mDebugOutput.SetText( "Unable to save shader! Your work will be lost when you quit!" );
}
}
else
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment