Skip to content

Commit 1de60a5

Browse files
Merge pull request #7 from wojciech-graj/v1.1
Release v1.1
2 parents af01b6b + 7c7d4bb commit 1de60a5

File tree

17 files changed

+500
-205
lines changed

17 files changed

+500
-205
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
SRC = src/termgl.c
2-
DEMO = test/termgl_test.c
2+
DEMO = demodir/termgl_demo.c
3+
LIB_BIN = lib/libtermgl.so
4+
DEMO_BIN = demo
35
WARNINGS := -Wall -Wextra -Wpedantic -Wdouble-promotion -Wstrict-prototypes -Wshadow -Wduplicated-cond -Wduplicated-branches -Wjump-misses-init -Wnull-dereference -Wrestrict -Wlogical-op -Wno-maybe-uninitialized -Walloc-zero -Wformat-security -Wformat-signedness -Winit-self -Wlogical-op -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wswitch-enum -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-discarded-qualifiers
4-
CFLAGS += -std=c11 -march=native
6+
CFLAGS += -std=c99 -march=native
57
LINK_CFLAGS := -Ilib -lm
68
RELEASE_CFLAGS := -O3
79

@@ -10,6 +12,9 @@ COMPILER = gcc
1012
endif
1113

1214
shared:
13-
$(COMPILER) -c $(SRC) -shared -o lib/libtermgl.so $(WARNINGS) $(CFLAGS) $(LINK_CFLAGS) $(RELEASE_CFLAGS) -fPIC
15+
$(COMPILER) -c $(SRC) -shared -o $(LIB_BIN) $(WARNINGS) $(CFLAGS) $(LINK_CFLAGS) $(RELEASE_CFLAGS) -fPIC
1416
demo:
15-
$(COMPILER) $(SRC) $(DEMO) -o demo $(WARNINGS) $(CFLAGS) $(LINK_CFLAGS) $(RELEASE_CFLAGS) -DTERMGL3D -DTERMGLUTIL
17+
$(COMPILER) $(SRC) $(DEMO) -o $(DEMO_BIN) $(WARNINGS) $(CFLAGS) $(LINK_CFLAGS) $(RELEASE_CFLAGS) -DTERMGL3D -DTERMGLUTIL
18+
clean:
19+
rm -f $(DEMO_BIN)
20+
rm -f $(LIB_BIN)

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
A terminal-based graphics library for both 2D and 3D graphics.\
66
Works in all terminals supporting ANSI escape codes.\
77
Support for Windows and UNIX.\
8-
C11 compliant, with no external dependencies.\
9-
Can read from terminal for user-interaction.
8+
C99 compliant, with no external dependencies.\
9+
Realtime input reading from terminal for user-interaction.
1010

1111
## Table of Contents
1212

@@ -16,11 +16,11 @@ Can read from terminal for user-interaction.
1616

1717
## Gallery
1818

19-
![LOGO](test/logo.gif)
19+
![LOGO](demodir/logo.gif)
2020

21-
![CANYON](test/canyon.gif)
21+
![CANYON](demodir/canyon.gif)
2222

23-
![TEAPOT](test/teapot.gif)
23+
![TEAPOT](demodir/teapot.gif)
2424

2525
## Build
2626

@@ -57,12 +57,36 @@ If compiling using mingw on linux, use ```COMPILER=i686-w64-mingw32-gcc-win32```
5757

5858
### Demo
5959

60-
To compile a demo program, run the makefile ```make demo```. Use the ```a``` and ```d``` keys to rotate view in the demo.
60+
To compile a demo program, run the makefile ```make demo```.
6161

6262
## Documentation
6363

6464
Certain settings can be changed at the top of [lib/termgl.h](lib/termgl.h) prior to compilation, e.g. memory allocation functions, clear screen command, compiler-specific commands.\
65-
A sample program exists here: [test/termgl_test.c](test/termgl_test.c), and utilizes all major features of the TermGL library.\
6665
The header file [lib/termgl.h](lib/termgl.h) contains brief documentation for all functions and structs.\
6766
Compiler-specific (GCC) macros are used for loop unrolling in the ```itgl_mulmat``` and ```itgl_clip_triangle_plane``` functions.\
6867
The TermGLUtil extension contains functions for reading keyboard input, but requires either Windows of UNIX headers.
68+
69+
### Demo
70+
71+
A demo can be found here: [demodir/termgl_demo.c](demodir/termgl_demo.c).\
72+
Available demos and TermGL features used:
73+
1. Utah Teapot\
74+
Renders a rotating 3D Utah Teapot.
75+
- Backface culling
76+
- Z buffering
77+
- Double-width characters
78+
- 3D camera
79+
- 3D transformations
80+
- 3D rendering
81+
- 3D Shaders
82+
2. Star Polygon\
83+
Renders a star polygon in steps using random colors.
84+
- Colors
85+
- Line rendering
86+
3. Mandelbrot\
87+
Renders an infinitely zooming-in Mandelbrot set.
88+
- Point rendering
89+
4. Realtime Keyboard\
90+
Displays keyboard input in realtime.
91+
- Text rendering
92+
- Realtime keyboard input
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)