From 16afbddeada7161e931dc261d3404bb5bbc1743d Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:54:22 +1100 Subject: add .m on mac. log INFO and module name --- src/backend_mtl.c | 0 src/backend_mtl.m | 22 ++++++++++++++++++++++ src/core.c | 6 +++--- src/log.c | 6 +++++- src/ral.c | 5 ----- 5 files changed, 30 insertions(+), 9 deletions(-) delete mode 100644 src/backend_mtl.c create mode 100644 src/backend_mtl.m (limited to 'src') diff --git a/src/backend_mtl.c b/src/backend_mtl.c deleted file mode 100644 index e69de29..0000000 diff --git a/src/backend_mtl.m b/src/backend_mtl.m new file mode 100644 index 0000000..9a99e14 --- /dev/null +++ b/src/backend_mtl.m @@ -0,0 +1,22 @@ +#define GPU_METAL 1 + +#ifdef GPU_METAL +#include + +// Obj-C imports +#import +#import +#import +#import + +// --- RAL types +struct gpu_device { + id id; +}; + +struct gpu_swapchain { + int width, height; + CAMetalLayer* swapchain; +}; + +#endif \ No newline at end of file diff --git a/src/core.c b/src/core.c index 79b9d6e..0c3c5ea 100644 --- a/src/core.c +++ b/src/core.c @@ -4,12 +4,12 @@ NAMESPACED_LOGGER(core); -void Core_Bringup(const char* window_name, struct GLFWwindow* optional_window) { +void core_bringup(const char* window_name, struct GLFWwindow* optional_window) { // INFO("Initiate Core bringup"); INFO("Initiate Core bringup"); INFO("Create GLFW window"); } -void Core_Shutdown() {} +void core_shutdown() {} -bool AppShouldExit() { return true; } +bool app_should_exit() { return false; } diff --git a/src/log.c b/src/log.c index 2a75201..5a6ca5c 100644 --- a/src/log.c +++ b/src/log.c @@ -1,7 +1,11 @@ #include +static const char* log_level_strings[] = { + "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" +}; + void log_output(char* module, loglevel level, const char* message, ...) { char out_msg[4096]; - printf("Msg: %s\n", message); + printf("[%s] %s Msg: %s\n", module, log_level_strings[level], message); } diff --git a/src/ral.c b/src/ral.c index 45d202b..e69de29 100644 --- a/src/ral.c +++ b/src/ral.c @@ -1,5 +0,0 @@ -#ifdef GPU_VULKAN - -#elif GPU_METAL - -#endif \ No newline at end of file -- cgit v1.2.3-70-g09d2