04.10.2020
+ render pipeline system for more control about the renderering. + Log system + Framebuffer system ~ Default shader was moved to pipelines.
This commit is contained in:
parent
97e638d9d9
commit
820d6ce700
34 changed files with 660 additions and 106 deletions
|
|
@ -4,11 +4,12 @@ using System.Net.Http;
|
|||
using System.Runtime.InteropServices;
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
using OpenTK.Platform.Egl;
|
||||
using ErrorCode = OpenTK.Graphics.OpenGL4.ErrorCode;
|
||||
|
||||
namespace SM.OGL
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains everything that is needed to properly debug OpenGL
|
||||
/// Contains everything that is needed to debug OpenGL
|
||||
/// </summary>
|
||||
public static class GLDebugging
|
||||
{
|
||||
|
|
@ -63,5 +64,26 @@ namespace SM.OGL
|
|||
|
||||
if (type == DebugType.DebugTypeError) throw new Exception(msg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A action, that is performed, when <see cref="GLDebugging.CheckGLErrors"/> find an error.
|
||||
/// </summary>
|
||||
public static Action<ErrorCode> GlErrorAction;
|
||||
|
||||
/// <summary>
|
||||
/// Checks for OpenGL errors.
|
||||
/// </summary>
|
||||
public static bool CheckGLErrors()
|
||||
{
|
||||
bool hasError = false;
|
||||
ErrorCode c;
|
||||
while ((c = GL.GetError()) != ErrorCode.NoError)
|
||||
{
|
||||
hasError = true;
|
||||
GlErrorAction?.Invoke(c);
|
||||
}
|
||||
|
||||
return hasError;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue