Skip to content

Commit

Permalink
Add better error message for when a shader file is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogFeelings committed Oct 7, 2024
1 parent b4af2bd commit a7a9b4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Classes/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ auto Shader::LoadShader(const std::string& vertexText) -> bool

auto Shader::LoadShadertoyShader(std::string& fragmentText, const std::string& commonText) -> bool
{
if (fragmentText.empty())
{
Globals::LastError = "Shader file was empty.";
return false;
}

std::stringstream stream;

stream << "#version 430 core" << "\n";
Expand Down

0 comments on commit a7a9b4b

Please sign in to comment.