Began implementing windows handle, game state manager, and game loop.

This commit is contained in:
2020-05-23 17:04:54 -05:00
parent 8ee18b1fcf
commit bd6b085687
18 changed files with 10239 additions and 9 deletions

View 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();
}
}
}
}

View File

@@ -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) {
}
}
}