summaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-17 19:18:38 +1100
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-17 19:18:38 +1100
commitc557763010a8976680f37609ca10e666ff849cd9 (patch)
treef2fa05b3e45c5fdc3565d654d485b2c46717324e /src/core.c
parent3e1aea0243f54e0b68baa3b19ac19f3d965484e0 (diff)
metal triangle!
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 080e806..210c282 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1,11 +1,18 @@
// The engine "core"
#include <celeritas.h>
+#include <stdlib.h>
NAMESPACED_LOGGER(core);
core g_core = {0};
+#ifdef GPU_METAL
+static const char* gapi = "Metal";
+#else
+static const char* gapi = "Vulkan";
+#endif
+
// forward declares
void key_callback(GLFWwindow* win, int key, int scancode, int action, int mods);
@@ -14,7 +21,11 @@ void core_bringup(const char* window_name, struct GLFWwindow* optional_window) {
INFO("Create GLFW window");
glfwInit();
- GLFWwindow* glfw_window = glfwCreateWindow(800, 600, window_name, NULL, NULL);
+
+ char* full_window_name = malloc(sizeof(char) * 100);
+ int _offset = sprintf(full_window_name, "%s (%s)", window_name, gapi);
+
+ GLFWwindow* glfw_window = glfwCreateWindow(800, 600, full_window_name, NULL, NULL);
g_core.window = glfw_window;
// This may move into a renderer struct