From 08dfd5fe3d0a07812a389e6b031d7f3474360569 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Mon, 30 Sep 2024 00:11:27 +0100 Subject: [PATCH] Set up repo --- .gitignore | 3 +++ README.md | 3 +++ build | 3 +++ compile | 18 ++++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 build create mode 100755 compile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e47b57 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.cache +compile_commands.json +main diff --git a/README.md b/README.md new file mode 100644 index 0000000..5875ea9 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Learn OpenGL + +Following along with the [Learn OpenGL](https://learnopengl.com) tutorials diff --git a/build b/build new file mode 100755 index 0000000..cd3a103 --- /dev/null +++ b/build @@ -0,0 +1,3 @@ +#!/bin/bash + +bear -- ./compile $@ diff --git a/compile b/compile new file mode 100755 index 0000000..09463bf --- /dev/null +++ b/compile @@ -0,0 +1,18 @@ +#!/bin/bash + +CC=clang +CFLAGS="-g -c -Wall -Isrc/glad/include" +CXX=clang++ +CXXFLAGS="-g -Wall -std=c++20 $(pkg-config --cflags sdl2) -Isrc/glad/include -Isrc/glm" +LIBS="$(pkg-config --libs sdl2) -ldl" +GLAD_SRC="src/glad/src/glad.c" +GLAD_OBJ="glad.o" +SRC="src/*.cc $GLAD_OBJ src/glm/glm/glm.cppm" +OUT=main + +(set -x ; $CC $CFLAGS $GLAD_SRC -o $GLAD_OBJ) +(set -x ; $CXX $CXXFLAGS $LIBS $SRC -o $OUT) + +if [[ -f $GLAD_OBJ ]]; then + rm $GLAD_OBJ +fi