diff --git a/Makefile b/Makefile index 57e0457..5887356 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ P=main -OBJECTS=libs/glad/glad.o +OBJECTS=objs/glad.o objs/stb_image_precompiled.o CFLAGS=-g -Wall -Wextra -O0 -LDLIBS=-lglfw -lOpenGL -lm -INCLUDES=-Ilibs/glad/include/ -Ilibs/ +LDLIBS=-lglfw -lOpenGL -lm -L objs/libcglm.so +INCLUDES=-Ilibs/glad/include/ -Ilibs/ -Iobjs/ CC=gcc RM=rm -vf @@ -10,9 +10,9 @@ RM=rm -vf build: clean $(CC) $(CFLAGS) $(LDLIBS) $(INCLUDES) $(OBJECTS) $(P).c -o $(P) -.PHONY: all -headers: clean - $(CC) $(CFLAGS) $(LDLIBS) $(INCLUDES) $(OBJECTS) all.h -o all.h.gch +.PHONY: texturepacker +texturepacker: + $(CC) $(CFLAGS) $(LDLIBS) $(INCLUDES) $(OBJECTS) tools/texturepacker.c -o texturepacker .PHONY: run run: build diff --git a/lib.h b/lib.h index 3a9ba45..9cd0011 100644 --- a/lib.h +++ b/lib.h @@ -1,6 +1,20 @@ #pragma once #include #include +#include + +typedef uint8_t u8; +// typedef char16_t c16; +typedef int32_t b32; +typedef int32_t i32; +typedef uint32_t u32; +typedef uint64_t u64; +typedef float f32; +typedef double f64; +typedef uintptr_t uptr; +typedef char byte; +typedef ptrdiff_t size; +typedef size_t usize; void checkCode(int code, char* errorMsg) { if (code < 0) { diff --git a/libs/stb_image/stb_image_precompiled.c b/libs/stb_image/stb_image_precompiled.c new file mode 100644 index 0000000..89cbcad --- /dev/null +++ b/libs/stb_image/stb_image_precompiled.c @@ -0,0 +1,5 @@ +#define STB_IMAGE_IMPLEMENTATION +#define STBI_FAILURE_USERMSG +#include "stb_image.h" +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include "stb_image_write.h" diff --git a/main.c b/main.c index cc56d3d..6218b78 100644 --- a/main.c +++ b/main.c @@ -5,8 +5,6 @@ #include #include "cglm/cglm.h" #include "lib.h" - -#define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #define PI 3.14159f diff --git a/libs/glad/glad.o b/objs/glad.o similarity index 100% rename from libs/glad/glad.o rename to objs/glad.o diff --git a/objs/stb_image_precompiled.o b/objs/stb_image_precompiled.o new file mode 100644 index 0000000..e1fec35 Binary files /dev/null and b/objs/stb_image_precompiled.o differ