diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | assets/rod.obj | 151 | ||||
-rw-r--r-- | main.c | 2 |
5 files changed, 12 insertions, 155 deletions
@@ -1,4 +1,6 @@ sandbox +*.tar.gz +*.zip tags TAGS *~ @@ -1,2 +1,7 @@ sandbox: *.[ch] $(CC) -Wall -Wconversion -Wshadow -Wno-unused-function -I/usr/include/SDL2 main.c -DDEBUG=1 -O0 -g -o sandbox -lSDL2 -lm +release: + $(CC) -Wall -Wconversion -Wshadow -Wno-unused-function -I/usr/include/SDL2 main.c -O3 -o sandbox -lSDL2 -lm +sandbox-linux.tar.gz: release + tar --transform "s,^,FunctionSandbox/," -czf $@ sandbox sandboxes example.png + @@ -27,14 +27,15 @@ All the pre-installed sandboxes were just made with trial and error. ## Compiling it yourself -First, install SDL2. On Linux, just run +On Linux, install SDL2 with ``` sudo apt install libsdl2-dev ``` -or equivalent. On Windows, download Visual Studio, [the VC development libraries for SDL2](https://libsdl.org/release/SDL2-devel-2.0.16-VC.zip), -add `vcvarsall.bat` to your PATH, then run `make.bat`. +or equivalent, then run `make release`. +On Windows, download Visual Studio, [the VC development libraries for SDL2](https://libsdl.org/release/SDL2-devel-2.0.16-VC.zip), +add `vcvarsall.bat` to your PATH, then run `make.bat release`. Alternatively, you can just compile `main.c` with any C compiler, making sure that `SDL.h` is in your include path (and you're linking with SDL2). diff --git a/assets/rod.obj b/assets/rod.obj deleted file mode 100644 index 32ae202..0000000 --- a/assets/rod.obj +++ /dev/null @@ -1,151 +0,0 @@ -# Blender v2.83.5 OBJ File: '' -# www.blender.org -mtllib rod.mtl -o Cube -v 0.575736 0.575736 -4.334822 -v 0.575736 1.000000 -3.910558 -v 1.000000 0.575736 -3.910558 -v 0.575736 -1.000000 -3.910558 -v 0.575736 -0.575736 -4.334822 -v 1.000000 -0.575736 -3.910558 -v 1.000000 0.575736 3.910558 -v 0.575736 1.000000 3.910558 -v 0.575736 0.575736 4.334822 -v 1.000000 -0.575736 3.910558 -v 0.575736 -0.575736 4.334822 -v 0.575736 -1.000000 3.910558 -v -0.575736 0.575736 -4.334822 -v -1.000000 0.575736 -3.910558 -v -0.575736 1.000000 -3.910558 -v -1.000000 -0.575736 -3.910558 -v -0.575736 -0.575736 -4.334822 -v -0.575736 -1.000000 -3.910558 -v -1.000000 0.575736 3.910558 -v -0.575736 0.575736 4.334822 -v -0.575736 1.000000 3.910558 -v -0.575736 -1.000000 3.910558 -v -0.575736 -0.575736 4.334822 -v -1.000000 -0.575736 3.910558 -vt 0.321967 0.512234 -vt 0.178033 0.737766 -vt 0.178033 0.512234 -vt 0.571967 0.012234 -vt 0.428033 0.237766 -vt 0.428033 0.012234 -vt 0.571967 0.803033 -vt 0.428033 0.946967 -vt 0.428033 0.803033 -vt 0.821967 0.512234 -vt 0.678033 0.737766 -vt 0.678033 0.512234 -vt 0.571967 0.512234 -vt 0.428033 0.737766 -vt 0.428033 0.512234 -vt 0.571967 0.446967 -vt 0.625000 0.446967 -vt 0.571967 0.500000 -vt 0.321967 0.500000 -vt 0.375000 0.512234 -vt 0.571967 0.737766 -vt 0.625000 0.737766 -vt 0.571967 0.750000 -vt 0.428033 0.750000 -vt 0.375000 0.737766 -vt 0.571967 0.303033 -vt 0.571967 0.250000 -vt 0.625000 0.303033 -vt 0.428033 0.250000 -vt 0.375000 0.237766 -vt 0.571967 0.000000 -vt 0.625000 0.012234 -vt 0.178033 0.750000 -vt 0.125000 0.737766 -vt 0.125000 0.512234 -vt 0.571967 0.946967 -vt 0.428033 1.000000 -vt 0.428033 0.303033 -vt 0.571967 0.237766 -vt 0.821967 0.737766 -vt 0.678033 0.750000 -vt 0.321967 0.737766 -vt 0.875000 0.737766 -vt 0.821967 0.500000 -vt 0.428033 0.446967 -vt 0.178033 0.500000 -vt 0.571967 1.000000 -vt 0.821967 0.750000 -vt 0.321967 0.750000 -vt 0.875000 0.512234 -vt 0.678033 0.500000 -vn 0.0000 -1.0000 0.0000 -vn -1.0000 0.0000 0.0000 -vn 0.0000 0.0000 1.0000 -vn 0.0000 1.0000 0.0000 -vn 1.0000 0.0000 0.0000 -vn 0.5774 0.5774 -0.5774 -vn 0.5774 -0.5774 -0.5774 -vn 0.5774 0.5774 0.5774 -vn 0.5774 -0.5774 0.5774 -vn -0.5774 0.5774 -0.5774 -vn -0.5774 -0.5774 -0.5774 -vn -0.5774 0.5774 0.5774 -vn -0.5774 -0.5774 0.5774 -vn -0.7071 -0.7071 0.0000 -vn 0.0000 -0.7071 -0.7071 -vn 0.7071 0.0000 -0.7071 -vn -0.7071 0.0000 0.7071 -vn 0.7071 0.0000 0.7071 -vn -0.7071 0.0000 -0.7071 -vn 0.0000 0.7071 0.7071 -vn 0.7071 0.7071 0.0000 -vn 0.0000 -0.7071 0.7071 -vn -0.7071 0.7071 0.0000 -vn 0.0000 0.7071 -0.7071 -vn 0.7071 -0.7071 0.0000 -vn 0.0000 0.0000 -1.0000 -usemtl Material -s off -f 4/1/1 22/2/1 18/3/1 -f 19/4/2 16/5/2 24/6/2 -f 9/7/3 23/8/3 11/9/3 -f 15/10/4 8/11/4 2/12/4 -f 3/13/5 10/14/5 6/15/5 -f 1/16/6 2/17/6 3/18/6 -f 4/1/7 5/19/7 6/20/7 -f 7/21/8 8/22/8 9/23/8 -f 10/14/9 11/24/9 12/25/9 -f 13/26/10 14/27/10 15/28/10 -f 16/5/11 17/29/11 18/30/11 -f 19/4/12 20/31/12 21/32/12 -f 22/2/13 23/33/13 24/34/13 -f 22/2/14 16/35/14 18/3/14 -f 18/3/15 5/19/15 4/1/15 -f 6/15/16 1/16/16 3/13/16 -f 20/36/17 24/37/17 23/8/17 -f 11/9/18 7/21/18 9/7/18 -f 17/38/19 14/39/19 13/26/19 -f 21/40/20 9/41/20 8/11/20 -f 8/11/21 3/13/21 2/12/21 -f 12/42/22 23/33/22 22/2/22 -f 15/10/23 19/43/23 21/40/23 -f 2/12/24 13/44/24 15/10/24 -f 4/1/25 10/14/25 12/42/25 -f 13/26/26 5/45/26 17/38/26 -f 4/1/1 12/42/1 22/2/1 -f 19/4/2 14/39/2 16/5/2 -f 9/7/3 20/36/3 23/8/3 -f 15/10/4 21/40/4 8/11/4 -f 3/13/5 7/21/5 10/14/5 -f 22/2/14 24/34/14 16/35/14 -f 18/3/15 17/46/15 5/19/15 -f 6/15/16 5/45/16 1/16/16 -f 20/36/17 19/47/17 24/37/17 -f 11/9/18 10/14/18 7/21/18 -f 17/38/19 16/5/19 14/39/19 -f 21/40/20 20/48/20 9/41/20 -f 8/11/21 7/21/21 3/13/21 -f 12/42/22 11/49/22 23/33/22 -f 15/10/23 14/50/23 19/43/23 -f 2/12/24 1/51/24 13/44/24 -f 4/1/25 6/15/25 10/14/25 -f 13/26/26 1/16/26 5/45/26 @@ -377,7 +377,7 @@ int main(int argc, char **argv) { if (!window_create("sandbox", 1280, 720, 0)) { return -1; } - if (gl_version_major * 100 + gl_version_minor < 310) { + if (gl_version_major * 100 + gl_version_minor < 310) { // we need glDrawArraysInstanced window_message_box_error("Error", "Couldn't get OpenGL 3.1 context (your graphics drivers are too old)."); return -1; } |