diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbdd632 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +example +example.* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6e4ba49 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +CC ?= gcc +INSTALL ?= install +RM ?= rm +PREFIX ?= /usr/local + +.PHONY: all +all: example + +example: examples/simple.c + $(CC) $(CPPFLAGS) $(CFLAGS) -I. $< -o example -lglfw -lm + +.PHONY: clean +clean: + $(RM) example + +.PHONY: install +install: gltext.h + $(INSTALL) $< $(PREFIX)/include/ + +.PHONY: uninstall +uninstall: gltext.h + $(RM) $(PREFIX)/include/$< + diff --git a/examples/simple.c b/examples/simple.c index 778a8ef..6f99b32 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -11,9 +11,10 @@ #include -#include /* https://github.com/Dav1dde/glad */ +#define GLAD_GL_IMPLEMENTATION +#include /* https://github.com/Dav1dde/glad */ +#define GLFW_INCLUDE_NONE #include /* https://github.com/glfw/glfw */ - #define GLT_IMPLEMENTATION #include "gltext.h" /* https://github.com/vallentin/glText */ @@ -52,7 +53,7 @@ int main(int argc, char *argv[]) glfwShowWindow(window); glfwMakeContextCurrent(window); - if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) + if (!gladLoadGL((GLADloadfunc)glfwGetProcAddress)) { fprintf(stderr, "Failed to load OpenGL functions and extensions\n"); glfwTerminate();