Began working on a graphical playground for testing.

Improved SDL exception class.

Engine code changes.

General progress.
This commit is contained in:
2020-05-27 00:20:41 -05:00
parent 0f0395fd63
commit a013c476e7
13 changed files with 191 additions and 43 deletions

View File

@@ -14,18 +14,21 @@ namespace SlatedGameToolkit.Framework.Exceptions
/// 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() {
public SDLException(bool autoFlush = true) : base(autoFlush ? SDL.SDL_GetError() : "SDL error has occurred.") {
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 + " (" + (autoFlush ? SDL.SDL_GetError() : "SDL error has occurred.") + ")") {
if (autoFlush) {
SDLMessage = SDL.SDL_GetError();
SDL.SDL_ClearError();
}
}
public SDLException(string message, bool autoFlush = true) : base(message) {
public SDLException(string message, Exception inner, bool autoFlush = true) : base(message + " (" + (autoFlush ? SDL.SDL_GetError() : "SDL error has occurred.") + ")", inner) {
if (autoFlush) {
SDLMessage = SDL.SDL_GetError();
SDL.SDL_ClearError();