re implement debugger in C

This commit is contained in:
Greg Wells
2025-05-21 10:16:58 -04:00
parent fa58a2f2d6
commit f97e26d019
12 changed files with 158 additions and 255 deletions

View File

@@ -1,8 +1,14 @@
#pragma once
#include "stdlib.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int gnBool;
#define gnFalse 0;
#define gnTrue 1;
#define gnFalse 0
#define gnTrue 1
#ifdef __cplusplus
}
#endif
typedef size_t gnSize;

View File

@@ -5,7 +5,8 @@ typedef enum gnReturnCode_t {
GN_UNKNOWN_RENDERINGAPI,
GN_UNSUPPORTED_RENDERING_API,
GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY,
GN_FAILED_CREATE_INSTANCE
GN_FAILED_CREATE_INSTANCE,
GN_FAILED_TO_CREATE_DEBUGGER
// GN_UNKNOWN_ERROR,
// GN_UNKNOWN_FRAMEBUFFER_ATTACHMENT,
@@ -25,3 +26,14 @@ typedef enum gnReturnCode_t {
} gnReturnCode;
typedef gnReturnCode gnErrorCode;
static const char* gnErrorCodeToCString(enum gnReturnCode_t returnCode) {
switch (returnCode) {
default: return "GN_FORGOT";
case GN_SUCCESS: return "GN_SUCCESS";
case GN_UNKNOWN_RENDERINGAPI: return "GN_UNKNOWN_RENDERINGAPI";
case GN_UNSUPPORTED_RENDERING_API: return "GN_UNSUPPORTED_RENDERING_API";
case GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY: return "GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY";
case GN_FAILED_CREATE_INSTANCE: return "GN_FAILED_CREATE_INSTANCE";
case GN_FAILED_TO_CREATE_DEBUGGER: return "GN_FAILED_TO_CREATE_DEBUGGER";
}
}