General progress on getting OpenGL based rendering.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using SlatedGameToolkit.Framework.Graphics;
|
||||
using SlatedGameToolkit.Framework.Graphics.Window;
|
||||
|
||||
namespace SlatedGameToolkit.Framework.Exceptions
|
||||
{
|
||||
|
Reference in New Issue
Block a user