Open thegrb93 opened 6 years ago
I found out that it's because program.Build builds the shaders with shader.Compile(std::nothrow). If I compile the shaders myself, I think it should work
Yeah, it works when I do
try
{fs.Compile();}
catch(oglplus::CompileError)
{
std::cout << fs.GetInfoLog() << std::endl;
return;
}
Same thing happens with prog.Build when it tries to link. I've replaced prog.Build with this and it works now.
try
{vs.Compile();}
catch(oglplus::CompileError)
{
std::cout << vs.GetInfoLog() << std::endl;
return;
}
try
{fs.Compile();}
catch(oglplus::CompileError)
{
std::cout << fs.GetInfoLog() << std::endl;
return;
}
try
{prog.Link();}
catch(oglplus::LinkError)
{
std::cout << prog.GetInfoLog() << std::endl;
return;
}
I have a program with a shader that fails to compile, but when I try to catch the CompileError, it is uncatchable. I just get
terminate called after throwing an instance of 'oglplus::ObjectError' what(): OpenGL numeric argument out of range
.With this code, 'Test1' is printed and then the terminate message and the program terminates.
If I uncomment the 'throw' then I get Test1 Test4 Test5