Began implementing windows handle, game state manager, and game loop.
This commit is contained in:
35
src/SlatedGameToolkit.Framework/Exceptions/SDLException.cs
Normal file
35
src/SlatedGameToolkit.Framework/Exceptions/SDLException.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using SDL2;
|
||||
|
||||
namespace SlatedGameToolkit.Framework.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// An SDLException is defined as an exception that is thrown whenever an error occurrs in any SDL functions.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SDLException : Exception {
|
||||
public string SDLMessage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates an SDL exception.
|
||||
/// </summary>
|
||||
/// <param name="Fetch">Whether or not to fetch the last error message that occurred in SDL.</param>
|
||||
public SDLException(bool autoFlush = true) : base() {
|
||||
if (autoFlush) {
|
||||
SDLMessage = SDL.SDL_GetError();
|
||||
SDL.SDL_ClearError();
|
||||
}
|
||||
}
|
||||
|
||||
public SDLException(string message, Exception inner) : base(message, inner) {
|
||||
|
||||
}
|
||||
|
||||
public SDLException(string message, bool autoFlush = true) : base(message) {
|
||||
if (autoFlush) {
|
||||
SDLMessage = SDL.SDL_GetError();
|
||||
SDL.SDL_ClearError();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace SlatedGameToolkit.Framework.Exceptions
|
||||
{
|
||||
public class SlatedGameToolkitException : Exception {
|
||||
public SlatedGameToolkitException() {
|
||||
|
||||
}
|
||||
|
||||
public SlatedGameToolkitException(string message) : base(message) {
|
||||
|
||||
}
|
||||
|
||||
public SlatedGameToolkitException(string message, Exception inner) : base(message, inner) {
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user