General progress on getting OpenGL based rendering.

This commit is contained in:
2020-06-01 01:27:38 -05:00
parent 5e85eb5de1
commit e59e78e08c
40 changed files with 995 additions and 501 deletions

View File

@@ -0,0 +1,29 @@
using System;
using SlatedGameToolkit.Framework.Graphics;
using SlatedGameToolkit.Framework.Graphics.Window;
namespace SlatedGameToolkit.Framework.Exceptions
{
public class OpenGLErrorException : OpenGLException {
public uint ErrorCode { get; private set; }
public OpenGLErrorException(uint errorCode) : base() {
}
public OpenGLErrorException(uint errorCode, string message) : base(message) {
}
public OpenGLErrorException(uint errorCode, string message, Exception inner) : base(message, inner) {
}
/// <summary>
/// Checks the current context for OpenGL errors that has occurred and throws an exception if there is one.
/// </summary>
public static void CheckGLErrorStatus() {
uint errorCode = WindowContextsManager.CurrentWindowContext.GetGLStatus();
if (errorCode != (uint) GLEnums.GL_NO_ERROR) {
throw new OpenGLErrorException(errorCode, "OpenGL error: " + errorCode.ToString());
}
}
}
}

View File

@@ -1,4 +1,6 @@
using System;
using SlatedGameToolkit.Framework.Graphics;
using SlatedGameToolkit.Framework.Graphics.Window;
namespace SlatedGameToolkit.Framework.Exceptions
{