Fix exceptions being thrown when there is no error in the tutorials (#271)
* Fix exceptions being thrown when there is no error in the tutorials * Review fixes
This commit is contained in:
Родитель
a1d6390ebf
Коммит
a7da0ff840
|
@ -136,10 +136,10 @@ namespace Tutorial
|
|||
Gl.LinkProgram(Shader);
|
||||
|
||||
//Checking the linking for errors.
|
||||
string shader = Gl.GetProgramInfoLog(Shader);
|
||||
if (!string.IsNullOrWhiteSpace(shader))
|
||||
Gl.GetProgram(Shader, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
Console.WriteLine($"Error linking shader {infoLog}");
|
||||
Console.WriteLine($"Error linking shader {Gl.GetProgramInfoLog(Shader)}");
|
||||
}
|
||||
|
||||
//Delete the no longer useful individual shaders;
|
||||
|
|
|
@ -25,10 +25,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
//Check for linking errors.
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
//Detach and delete the shaders
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
|
|
|
@ -19,10 +19,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,11 +20,12 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
_gl.DeleteShader(vertex);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace Tutorial
|
|||
_gl.AttachShader(_handle, vertex);
|
||||
_gl.AttachShader(_handle, fragment);
|
||||
_gl.LinkProgram(_handle);
|
||||
string infoLog = _gl.GetProgramInfoLog(_handle);
|
||||
if (!string.IsNullOrWhiteSpace(infoLog))
|
||||
_gl.GetProgram(_handle, GLEnum.LinkStatus, out var status);
|
||||
if (status == 0)
|
||||
{
|
||||
throw new Exception($"Program failed to link with error: {infoLog}");
|
||||
throw new Exception($"Program failed to link with error: {_gl.GetProgramInfoLog(_handle)}");
|
||||
}
|
||||
_gl.DetachShader(_handle, vertex);
|
||||
_gl.DetachShader(_handle, fragment);
|
||||
|
|
Загрузка…
Ссылка в новой задаче