summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 17:03:15 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 17:03:15 +0100
commit3e3ffdfe8de8b5bdda7f479d2ae198821b65a9dd (patch)
treeca815ebc7173eac374e08f4360d3cb86bac6106c
parentcd18a78e924f262fda022cdaab1fc681cce42fec (diff)
adding cglm
-rw-r--r--.gitmodules3
-rw-r--r--Makefile5
m---------cglm0
-rw-r--r--src/rendering.cc5
-rw-r--r--src/rendering.h16
5 files changed, 29 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
index 9f754be..3fbb5c9 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -11,3 +11,6 @@
[submodule "freetype"]
path = freetype
url = https://github.com/freetype/freetype.git
+[submodule "cglm"]
+ path = cglm
+ url = https://github.com/recp/cglm.git
diff --git a/Makefile b/Makefile
index ea58df2..a454bca 100644
--- a/Makefile
+++ b/Makefile
@@ -50,10 +50,14 @@ FREETYPE_FLAGS = \
-DFT_DISABLE_BROTLI=ON \
-DFT_DISABLE_HARFBUZZ=ON
+CGLM_DIR = $(WORK_DIR)/cglm
+CGLM_INCLUDE = $(CGLM_DIR)/include
+
CSH_FLAGS += \
-I$(MI_INCLUDE) \
-I$(HASHMAP_DIR) \
-I$(GLAD_DIR) \
+ -I$(CGLM_INCLUDE) \
-I$(FREETYPE_INCLUDE)
CMAKE_GENERATOR = "Unix Makefiles"
@@ -68,6 +72,7 @@ SOURCES = \
$(SRC_DIR)/window.c \
$(SRC_DIR)/graphics.cc \
$(SRC_DIR)/text.cc \
+ $(SRC_DIR)/rendering.cc \
$(GLAD_DIR)/glad.c \
$(HASHMAP_SOURCE)
diff --git a/cglm b/cglm
new file mode 160000
+Subproject 83d5b2c97378e61a4666825fd3a5548955c83ad
diff --git a/src/rendering.cc b/src/rendering.cc
new file mode 100644
index 0000000..b26106f
--- /dev/null
+++ b/src/rendering.cc
@@ -0,0 +1,5 @@
+#include "rendering.h"
+
+bool atlas_init(atlas_t* atlas, u32 width, u32 height) {}
+
+void atlas_deinit(atlas_t* atlas) {}
diff --git a/src/rendering.h b/src/rendering.h
new file mode 100644
index 0000000..b7d4a2a
--- /dev/null
+++ b/src/rendering.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <cglm/cglm.h>
+
+#include "cglm/types.h"
+#include "utils.h"
+
+struct uv_s {
+ vec2 uv0;
+ vec2 uv1;
+};
+
+typedef u32 atlas_t;
+
+bool atlas_init(atlas_t* atlas, u32 width, u32 height);
+void atlas_deinit(atlas_t* atlas);