diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-17 15:54:22 +1100 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-17 15:54:22 +1100 |
commit | 16afbddeada7161e931dc261d3404bb5bbc1743d (patch) | |
tree | e75db4d668c6a9ebfd07e4dd4d1fdabb66a95896 /src | |
parent | ff96a533014174d0857872f86f1536a06089f3d2 (diff) |
add .m on mac. log INFO and module name
Diffstat (limited to 'src')
-rw-r--r-- | src/backend_mtl.c | 0 | ||||
-rw-r--r-- | src/backend_mtl.m | 22 | ||||
-rw-r--r-- | src/core.c | 6 | ||||
-rw-r--r-- | src/log.c | 6 | ||||
-rw-r--r-- | src/ral.c | 5 |
5 files changed, 30 insertions, 9 deletions
diff --git a/src/backend_mtl.c b/src/backend_mtl.c deleted file mode 100644 index e69de29..0000000 --- a/src/backend_mtl.c +++ /dev/null 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 <celeritas.h> + +// Obj-C imports +#import <Foundation/Foundation.h> +#import <Metal/Metal.h> +#import <MetalKit/MetalKit.h> +#import <QuartzCore/CAMetalLayer.h> + +// --- RAL types +struct gpu_device { + id<MTLDevice> id; +}; + +struct gpu_swapchain { + int width, height; + CAMetalLayer* swapchain; +}; + +#endif
\ No newline at end of file @@ -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; } @@ -1,7 +1,11 @@ #include <celeritas.h> +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); } @@ -1,5 +0,0 @@ -#ifdef GPU_VULKAN - -#elif GPU_METAL - -#endif
\ No newline at end of file |