first commit
This commit is contained in:
commit
53e0268e7a
21 changed files with 35816 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
build/
|
||||
*.pdb
|
||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[submodule "src/cglm"]
|
||||
path = src/cglm
|
||||
url = https://github.com/recp/cglm
|
||||
[submodule "src/colla"]
|
||||
path = src/colla
|
||||
url = https://git.snarmph.win/snarmph/colla
|
||||
BIN
assets/Macintosh Classic.glb
Normal file
BIN
assets/Macintosh Classic.glb
Normal file
Binary file not shown.
12
assets/lil-house.mtl
Normal file
12
assets/lil-house.mtl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Blender 3.6.23 MTL File: 'lil house.blend'
|
||||
# www.blender.org
|
||||
|
||||
newmtl tileset
|
||||
Ns 250.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
835
assets/lil-house.obj
Normal file
835
assets/lil-house.obj
Normal file
|
|
@ -0,0 +1,835 @@
|
|||
# Blender 3.6.23
|
||||
# www.blender.org
|
||||
mtllib lil-house.mtl
|
||||
o Cube
|
||||
v -0.500000 0.000001 0.500000
|
||||
v 2.000000 0.000001 -2.500000
|
||||
v -1.500000 0.000001 -1.500000
|
||||
v -0.500000 0.000001 0.000000
|
||||
v 0.500000 2.000001 1.500000
|
||||
v 1.000000 0.000001 0.500000
|
||||
v 0.000000 0.000001 0.500000
|
||||
v -1.500000 0.000001 -1.000000
|
||||
v 2.000000 0.000001 -0.500000
|
||||
v 1.000000 0.000001 1.000000
|
||||
v -2.500000 0.000001 -2.000000
|
||||
v -1.500000 0.500001 -0.500000
|
||||
v 1.000000 2.687502 0.500000
|
||||
v 0.000000 0.000001 2.500000
|
||||
v 0.500000 0.000001 0.500000
|
||||
v 0.500000 0.000001 1.000000
|
||||
v 2.000000 0.000001 1.500000
|
||||
v 2.500000 0.000001 0.500000
|
||||
v 1.500000 0.000001 -2.500000
|
||||
v 1.500000 0.000001 1.500000
|
||||
v 0.000000 0.000001 1.000000
|
||||
v -1.000000 0.000001 0.500000
|
||||
v -0.500000 0.000001 -2.500000
|
||||
v -1.000000 0.000001 1.000000
|
||||
v -2.500000 0.000001 1.000000
|
||||
v -0.500000 0.000001 1.000000
|
||||
v -1.500000 0.000001 1.000000
|
||||
v -1.000000 0.000001 -1.000000
|
||||
v -0.500000 0.000001 -1.000000
|
||||
v -0.500000 0.000001 -0.500000
|
||||
v -0.500000 2.000001 -0.500000
|
||||
v -1.000000 2.687502 0.500000
|
||||
v 1.000000 0.000001 -1.500000
|
||||
v 1.500000 0.000001 -2.000000
|
||||
v 2.000000 0.000001 1.000000
|
||||
v 2.000000 0.000001 -2.000000
|
||||
v 0.000000 0.000001 -1.000000
|
||||
v 1.500000 0.000001 -1.000000
|
||||
v -1.000000 0.000001 -2.500000
|
||||
v 0.500000 0.500001 -0.500000
|
||||
v 0.500000 0.000001 -1.000000
|
||||
v 1.000000 0.000001 -1.000000
|
||||
v 0.500000 0.000001 -0.500000
|
||||
v 1.500000 0.000001 -1.500000
|
||||
v 2.000000 0.000001 -1.000000
|
||||
v 2.500000 0.000001 -1.000000
|
||||
v 2.500000 0.000001 -0.500000
|
||||
v 2.500000 0.000001 1.500000
|
||||
v -1.500000 0.500001 1.500000
|
||||
v 2.000000 0.000001 -1.500000
|
||||
v -1.000000 0.000001 0.000000
|
||||
v -0.500000 0.000001 2.000000
|
||||
v 2.500000 0.000001 0.000000
|
||||
v 2.000000 0.000001 0.000000
|
||||
v 2.500000 0.000001 1.000000
|
||||
v 1.500000 0.000001 2.500000
|
||||
v 2.000000 0.000001 0.500000
|
||||
v 1.500000 0.000001 0.500000
|
||||
v 2.000000 0.000001 2.500000
|
||||
v 2.500000 0.000001 2.500000
|
||||
v 2.500000 0.000001 2.000000
|
||||
v -1.500000 0.000001 2.500000
|
||||
v 2.000000 0.000001 2.000000
|
||||
v 1.500000 2.000001 1.500000
|
||||
v 1.000000 0.000001 2.500000
|
||||
v 1.000000 0.000001 1.500000
|
||||
v 1.500000 0.000001 2.000000
|
||||
v 1.000000 0.000001 2.000000
|
||||
v 0.000000 0.000001 2.000000
|
||||
v 0.500000 0.000001 2.500000
|
||||
v 0.500000 0.000001 2.000000
|
||||
v -1.000000 0.000001 2.000000
|
||||
v -1.000000 0.000001 2.500000
|
||||
v -0.500000 0.000001 2.500000
|
||||
v -2.000000 0.500001 1.500000
|
||||
v -2.500000 0.000001 -0.500000
|
||||
v -1.500000 0.000001 0.500000
|
||||
v -2.000000 0.000001 -0.500000
|
||||
v -2.500000 0.000001 -1.000000
|
||||
v -2.000000 0.000001 -1.000000
|
||||
v -2.500000 0.000001 0.500000
|
||||
v -2.000000 0.000001 -1.500000
|
||||
v -1.000000 0.000001 1.500000
|
||||
v -2.500000 0.000001 0.000000
|
||||
v -2.500000 0.000001 1.500000
|
||||
v -2.000000 2.000001 0.000000
|
||||
v -1.000000 0.000001 -1.500000
|
||||
v -2.000000 0.000001 2.500000
|
||||
v -2.000000 0.000001 1.500000
|
||||
v -2.500000 0.000001 2.500000
|
||||
v -1.500000 0.000001 2.000000
|
||||
v -2.000000 0.000001 2.000000
|
||||
v -2.500000 0.000001 -1.500000
|
||||
v -2.500000 0.000001 2.000000
|
||||
v -0.500000 0.000001 -1.500000
|
||||
v -2.000000 0.000001 -2.000000
|
||||
v -2.500000 0.000001 -2.500000
|
||||
v -1.500000 0.000001 -2.500000
|
||||
v -2.000000 0.000001 -2.500000
|
||||
v -0.500000 0.000001 -2.000000
|
||||
v -1.500000 0.000001 -2.000000
|
||||
v -1.000000 0.000001 -2.000000
|
||||
v 0.000000 0.000001 -1.500000
|
||||
v 1.000000 0.000001 -2.000000
|
||||
v 0.000000 0.000001 -2.000000
|
||||
v 0.500000 0.000001 -1.500000
|
||||
v 0.000000 0.000001 -2.500000
|
||||
v 2.500000 0.000001 -1.500000
|
||||
v 0.500000 0.000001 -2.000000
|
||||
v 0.500000 0.000001 -2.500000
|
||||
v 1.000000 0.000001 -2.500000
|
||||
v 2.500000 0.000001 -2.500000
|
||||
v 2.500000 0.000001 -2.000000
|
||||
v -1.500000 0.000001 1.500000
|
||||
v 0.500000 0.000001 1.500000
|
||||
v -0.500000 1.500001 1.500000
|
||||
v 0.000000 1.000001 2.000000
|
||||
v 0.000000 0.000001 1.500000
|
||||
v -0.500000 0.000001 1.500000
|
||||
v 1.500000 0.500001 0.500000
|
||||
v 0.000000 0.500001 1.500000
|
||||
v 0.500000 0.500001 1.500000
|
||||
v 1.000000 0.500001 1.500000
|
||||
v -0.500000 0.500001 1.500000
|
||||
v 1.000000 1.000001 1.500000
|
||||
v -1.000000 0.500001 1.500000
|
||||
v -2.000000 0.000001 1.000000
|
||||
v -2.000000 0.500001 0.500000
|
||||
v -1.500000 1.000001 1.500000
|
||||
v -2.000000 1.000001 1.500000
|
||||
v -0.500000 1.000001 2.000000
|
||||
v 1.500000 1.495234 1.000000
|
||||
v 0.500000 1.000001 1.500000
|
||||
v -2.000000 0.000001 0.500000
|
||||
v 1.000000 1.500001 1.500000
|
||||
v 1.500000 0.000001 1.000000
|
||||
v 1.500000 1.500001 -0.500000
|
||||
v 1.500000 0.500001 1.000000
|
||||
v 1.500000 0.500001 1.500000
|
||||
v 1.500000 1.000001 0.500000
|
||||
v 1.500000 1.000001 1.000000
|
||||
v 1.500000 1.000001 1.500000
|
||||
v 1.500000 2.687502 0.500000
|
||||
v 0.000000 2.687502 0.500000
|
||||
v 0.500000 0.000001 0.000000
|
||||
v -2.000000 0.500001 1.000000
|
||||
v -2.000000 1.500001 -0.500000
|
||||
v -2.000000 1.000001 0.500000
|
||||
v -2.000000 1.000001 1.000000
|
||||
v 0.500000 1.500001 -0.500000
|
||||
v -2.000000 2.000001 0.500000
|
||||
v 0.000000 0.000001 0.000000
|
||||
v -2.000000 0.500001 0.000000
|
||||
v -1.500000 0.000001 0.000000
|
||||
v -2.000000 1.500001 0.500000
|
||||
v 0.500000 2.687502 0.500000
|
||||
v -2.000000 1.500001 1.500000
|
||||
v -0.500000 2.000001 1.500000
|
||||
v -1.000000 1.500001 1.500000
|
||||
v -1.500000 1.500001 1.500000
|
||||
v -1.500000 2.000001 1.500000
|
||||
v -1.000000 2.000001 1.500000
|
||||
v 0.000000 1.500001 1.500000
|
||||
v 0.000000 2.000001 1.500000
|
||||
v 0.500000 1.500001 1.500000
|
||||
v 1.500000 1.500001 1.500000
|
||||
v -2.000000 2.343751 1.000000
|
||||
v -1.500000 0.000001 -0.500000
|
||||
v 1.500000 1.480932 -0.500000
|
||||
v 1.000000 0.000001 -0.500000
|
||||
v 1.000000 2.000001 -0.500000
|
||||
v -2.000000 2.000001 1.500000
|
||||
v 1.000000 2.343751 1.000000
|
||||
v -1.500000 2.343751 1.000000
|
||||
v 0.000000 2.343751 1.000000
|
||||
v 0.500000 2.343751 1.000000
|
||||
v 1.000000 2.000001 1.500000
|
||||
v 1.500000 0.000001 0.000000
|
||||
v 1.500000 1.485699 0.000000
|
||||
v 1.500000 0.500001 0.000000
|
||||
v 1.500000 1.000001 0.000000
|
||||
v 1.500000 0.000001 -0.500000
|
||||
v 1.500000 2.343751 0.000000
|
||||
v 0.000000 0.000001 -0.500000
|
||||
v 1.000000 0.500001 -0.500000
|
||||
v 1.000000 1.000001 -0.500000
|
||||
v -1.000000 0.000001 -0.500000
|
||||
v 1.500000 1.000001 -0.500000
|
||||
v -1.000000 0.500001 -0.500000
|
||||
v -0.500000 0.500001 -0.500000
|
||||
v 0.000000 0.500001 -0.500000
|
||||
v -2.000000 2.687502 0.500000
|
||||
v -1.000000 1.000001 -0.500000
|
||||
v -0.500000 1.000001 -0.500000
|
||||
v -2.000000 2.343751 0.000000
|
||||
v 1.500000 0.500001 -0.500000
|
||||
v 1.000000 1.500001 -0.500000
|
||||
v -1.500000 1.500001 -0.500000
|
||||
v 0.500000 1.000001 -0.500000
|
||||
v 0.000000 1.000001 -0.500000
|
||||
v 1.500000 2.000001 -0.500000
|
||||
v -1.500000 1.000001 -0.500000
|
||||
v -1.000000 1.500001 -0.500000
|
||||
v 0.000000 1.500001 -0.500000
|
||||
v 0.500000 2.343751 0.000000
|
||||
v -0.500000 1.500001 -0.500000
|
||||
v -1.500000 2.687502 0.500000
|
||||
v -2.000000 2.000001 -0.500000
|
||||
v 0.000000 2.000001 -0.500000
|
||||
v 0.500000 2.000001 -0.500000
|
||||
v -2.000000 0.500001 -0.500000
|
||||
v -2.000000 0.000001 0.000000
|
||||
v -2.000000 1.000001 0.000000
|
||||
v -2.000000 1.000001 -0.500000
|
||||
v 1.000000 2.343751 0.000000
|
||||
v -1.000000 2.000001 -0.500000
|
||||
v -0.500000 2.343751 1.000000
|
||||
v -1.500000 2.000001 -0.500000
|
||||
v -1.500000 2.343751 0.000000
|
||||
v 1.500000 2.343751 1.000000
|
||||
v 0.000000 2.343751 0.000000
|
||||
v -1.000000 2.343751 0.000000
|
||||
v -0.500000 2.343751 0.000000
|
||||
v -0.500000 2.687502 0.500000
|
||||
v -1.000000 2.343751 1.000000
|
||||
v 1.500000 2.000001 0.500000
|
||||
v 1.500000 2.000001 0.000000
|
||||
v 1.500000 2.000001 1.000000
|
||||
v 1.500000 1.490467 0.500000
|
||||
v -2.000000 1.500001 0.000000
|
||||
v -2.000000 1.500001 1.000000
|
||||
v -2.000000 2.000001 1.000000
|
||||
v -1.000000 1.000001 2.000000
|
||||
v 0.000000 1.625001 1.500000
|
||||
v -0.500000 1.000001 1.500000
|
||||
v -1.000000 1.000001 1.500000
|
||||
v 0.000000 1.000001 1.500000
|
||||
v 0.000000 1.125001 2.000000
|
||||
v 0.000000 1.125001 1.500000
|
||||
v -0.500000 1.125001 1.500000
|
||||
v -0.500000 1.125001 2.000000
|
||||
v -1.000000 1.125001 2.000000
|
||||
v -1.000000 1.125001 1.500000
|
||||
v -1.000000 1.625001 2.000000
|
||||
v 0.000000 1.625001 2.000000
|
||||
v -0.500000 1.625001 2.000000
|
||||
v -1.000000 1.625001 1.500000
|
||||
vn -0.0000 1.0000 -0.0000
|
||||
vn -0.0000 -0.0000 -1.0000
|
||||
vn -0.0000 -0.0000 1.0000
|
||||
vn 1.0000 -0.0000 -0.0000
|
||||
vn -1.0000 -0.0000 -0.0000
|
||||
vn -0.0000 0.8240 0.5665
|
||||
vn -0.0000 0.8240 -0.5665
|
||||
vt 0.874805 0.250195
|
||||
vt 0.750195 0.374805
|
||||
vt 0.750195 0.250195
|
||||
vt 0.999805 0.250195
|
||||
vt 0.875195 0.374805
|
||||
vt 0.875195 0.250195
|
||||
vt 0.874805 0.375195
|
||||
vt 0.750195 0.499805
|
||||
vt 0.750195 0.375195
|
||||
vt 0.999805 0.375195
|
||||
vt 0.875195 0.499805
|
||||
vt 0.875195 0.375195
|
||||
vt 0.874805 0.499805
|
||||
vt 0.375195 0.125195
|
||||
vt 0.499805 0.249805
|
||||
vt 0.499805 0.125195
|
||||
vt 0.375195 0.249805
|
||||
vt 0.624805 0.500195
|
||||
vt 0.500195 0.624805
|
||||
vt 0.500195 0.500195
|
||||
vt 0.749805 0.500195
|
||||
vt 0.625195 0.624805
|
||||
vt 0.625195 0.500195
|
||||
vt 0.374805 0.125195
|
||||
vt 0.250195 0.249805
|
||||
vt 0.250195 0.125195
|
||||
vt 0.000195 0.125195
|
||||
vt 0.124805 0.249805
|
||||
vt 0.124805 0.125195
|
||||
vt 0.374805 0.249805
|
||||
vt 0.499805 0.148271
|
||||
vt 0.375195 0.156661
|
||||
vt 0.499805 0.136513
|
||||
vt 0.375195 0.188732
|
||||
vt 0.499805 0.188732
|
||||
vt 0.499805 0.156661
|
||||
vt 0.468652 0.156348
|
||||
vt 0.437500 0.249805
|
||||
vt 0.437500 0.187500
|
||||
vt 0.874805 0.503967
|
||||
vt 0.999805 0.503967
|
||||
vt 0.999805 0.582092
|
||||
vt 0.406348 0.218652
|
||||
vt 0.468652 0.249805
|
||||
vt 0.406348 0.249805
|
||||
vt 0.624805 0.625195
|
||||
vt 0.500195 0.749805
|
||||
vt 0.500195 0.625195
|
||||
vt 0.749805 0.625195
|
||||
vt 0.625195 0.749805
|
||||
vt 0.625195 0.625195
|
||||
vt 0.124805 0.500195
|
||||
vt 0.000195 0.624805
|
||||
vt 0.000195 0.500195
|
||||
vt 0.249805 0.500195
|
||||
vt 0.125195 0.624805
|
||||
vt 0.125195 0.500195
|
||||
vt 0.874805 0.586133
|
||||
vt 0.999805 0.500195
|
||||
vt 0.999805 0.672070
|
||||
vt 0.499805 0.156055
|
||||
vt 0.874805 0.374805
|
||||
vt 0.375195 0.245052
|
||||
vt 0.874805 0.500195
|
||||
vt 0.999805 0.586133
|
||||
vt 0.874805 0.672070
|
||||
vt 0.124805 0.625195
|
||||
vt 0.000195 0.749805
|
||||
vt 0.000195 0.625195
|
||||
vt 0.249805 0.625195
|
||||
vt 0.125195 0.749805
|
||||
vt 0.125195 0.625195
|
||||
vt 0.375195 0.136513
|
||||
vt 0.874805 0.582092
|
||||
vt 0.750195 0.625195
|
||||
vt 0.874805 0.749805
|
||||
vt 0.874805 0.625195
|
||||
vt 0.124805 0.999805
|
||||
vt 0.000195 0.968555
|
||||
vt 0.124805 0.968555
|
||||
vt 0.062500 0.999805
|
||||
vt 0.062500 0.968555
|
||||
vt 0.124805 0.875195
|
||||
vt 0.000195 0.906445
|
||||
vt 0.000195 0.875195
|
||||
vt 0.000195 0.999805
|
||||
vt 0.031445 0.875195
|
||||
vt 0.031445 0.999805
|
||||
vt 0.624805 0.750195
|
||||
vt 0.500195 0.874805
|
||||
vt 0.500195 0.750195
|
||||
vt 0.999805 0.374805
|
||||
vt 0.999805 0.499805
|
||||
vt 0.624805 0.624805
|
||||
vt 0.749805 0.624805
|
||||
vt 0.000195 0.249805
|
||||
vt 0.375195 0.156055
|
||||
vt 0.624805 0.749805
|
||||
vt 0.749805 0.749805
|
||||
vt 0.124805 0.624805
|
||||
vt 0.249805 0.624805
|
||||
vt 0.124805 0.749805
|
||||
vt 0.249805 0.749805
|
||||
vt 0.375195 0.148271
|
||||
vt 0.750195 0.749805
|
||||
vt 0.124805 0.906445
|
||||
vt 0.624805 0.874805
|
||||
s 0
|
||||
usemtl tileset
|
||||
f 7/1/1 4/2/1 1/3/1
|
||||
f 15/4/1 152/5/1 7/6/1
|
||||
f 152/7/1 30/8/1 4/9/1
|
||||
f 145/10/1 184/11/1 152/12/1
|
||||
f 6/6/1 170/13/1 145/2/1
|
||||
f 170/14/2 185/15/2 182/14/2
|
||||
f 66/1/1 16/2/1 115/3/1
|
||||
f 20/4/1 10/5/1 66/6/1
|
||||
f 10/7/1 15/8/1 16/9/1
|
||||
f 136/10/1 6/11/1 10/12/1
|
||||
f 118/1/1 26/2/1 119/3/1
|
||||
f 115/4/1 21/5/1 118/6/1
|
||||
f 21/7/1 1/8/1 26/9/1
|
||||
f 16/10/1 7/11/1 21/12/1
|
||||
f 83/1/1 27/2/1 114/3/1
|
||||
f 119/4/1 24/5/1 83/6/1
|
||||
f 24/7/1 77/8/1 27/9/1
|
||||
f 26/10/1 22/11/1 24/12/1
|
||||
f 22/1/1 154/2/1 77/3/1
|
||||
f 1/4/1 51/5/1 22/6/1
|
||||
f 51/7/1 168/8/1 154/9/1
|
||||
f 4/10/1 187/11/1 51/12/1
|
||||
f 187/1/1 8/2/1 168/3/1
|
||||
f 30/4/1 28/5/1 187/6/1
|
||||
f 28/7/1 3/8/1 8/9/1
|
||||
f 29/10/1 87/11/1 28/12/1
|
||||
f 184/1/1 29/2/1 30/3/1
|
||||
f 43/4/1 37/5/1 184/6/1
|
||||
f 37/7/1 95/8/1 29/9/1
|
||||
f 41/10/1 103/11/1 37/12/1
|
||||
f 42/7/1 106/8/1 41/9/1
|
||||
f 38/10/1 33/11/1 42/12/1
|
||||
f 9/1/1 38/2/1 182/3/1
|
||||
f 47/4/1 45/5/1 9/6/1
|
||||
f 45/7/1 44/8/1 38/9/1
|
||||
f 46/10/1 50/11/1 45/12/1
|
||||
f 57/1/1 178/2/1 58/3/1
|
||||
f 18/4/1 54/5/1 57/6/1
|
||||
f 54/7/1 182/8/1 178/9/1
|
||||
f 53/10/1 9/11/1 54/12/1
|
||||
f 17/1/1 136/2/1 20/3/1
|
||||
f 48/4/1 35/5/1 17/6/1
|
||||
f 35/7/1 58/8/1 136/9/1
|
||||
f 55/10/1 57/11/1 35/12/1
|
||||
f 59/1/1 67/2/1 56/3/1
|
||||
f 60/4/1 63/5/1 59/6/1
|
||||
f 63/7/1 20/8/1 67/9/1
|
||||
f 61/10/1 17/11/1 63/12/1
|
||||
f 65/1/1 71/2/1 70/3/1
|
||||
f 56/4/1 68/5/1 65/6/1
|
||||
f 68/7/1 115/8/1 71/9/1
|
||||
f 67/10/1 66/11/1 68/12/1
|
||||
f 14/1/1 52/2/1 74/3/1
|
||||
f 70/4/1 69/5/1 14/6/1
|
||||
f 69/7/1 119/8/1 52/9/1
|
||||
f 71/10/1 118/11/1 69/12/1
|
||||
f 73/1/1 91/2/1 62/3/1
|
||||
f 74/4/1 72/5/1 73/6/1
|
||||
f 72/7/1 114/8/1 91/9/1
|
||||
f 52/10/1 83/11/1 72/12/1
|
||||
f 78/1/1 79/2/1 76/3/1
|
||||
f 168/4/1 80/5/1 78/6/1
|
||||
f 80/7/1 93/8/1 79/9/1
|
||||
f 8/10/1 82/11/1 80/12/1
|
||||
f 134/1/1 84/2/1 81/3/1
|
||||
f 77/4/1 212/5/1 134/6/1
|
||||
f 212/7/1 76/8/1 84/9/1
|
||||
f 154/10/1 78/11/1 212/12/1
|
||||
f 89/1/1 25/2/1 85/3/1
|
||||
f 114/4/1 127/5/1 89/6/1
|
||||
f 127/7/1 81/8/1 25/9/1
|
||||
f 27/10/1 134/11/1 127/12/1
|
||||
f 88/1/1 94/2/1 90/3/1
|
||||
f 62/4/1 92/5/1 88/6/1
|
||||
f 92/7/1 85/8/1 94/9/1
|
||||
f 91/10/1 89/11/1 92/12/1
|
||||
f 82/1/1 11/2/1 93/3/1
|
||||
f 3/4/1 96/5/1 82/6/1
|
||||
f 96/7/1 97/8/1 11/9/1
|
||||
f 101/10/1 99/11/1 96/12/1
|
||||
f 87/1/1 101/2/1 3/3/1
|
||||
f 95/4/1 102/5/1 87/6/1
|
||||
f 102/7/1 98/8/1 101/9/1
|
||||
f 100/10/1 39/11/1 102/12/1
|
||||
f 103/1/1 100/2/1 95/3/1
|
||||
f 106/4/1 105/5/1 103/6/1
|
||||
f 105/7/1 23/8/1 100/9/1
|
||||
f 109/10/1 107/11/1 105/12/1
|
||||
f 33/1/1 109/2/1 106/3/1
|
||||
f 44/4/1 104/5/1 33/6/1
|
||||
f 104/7/1 110/8/1 109/9/1
|
||||
f 34/10/1 111/11/1 104/12/1
|
||||
f 50/1/1 34/2/1 44/3/1
|
||||
f 108/4/1 36/5/1 50/6/1
|
||||
f 36/7/1 19/8/1 34/9/1
|
||||
f 113/10/1 2/11/1 36/12/1
|
||||
f 114/16/3 75/17/3 89/14/3
|
||||
f 83/16/3 49/17/3 114/14/3
|
||||
f 119/16/3 126/17/3 83/14/3
|
||||
f 118/16/3 124/17/3 119/14/3
|
||||
f 115/16/3 121/17/3 118/14/3
|
||||
f 66/16/3 122/17/3 115/14/3
|
||||
f 20/16/3 123/17/3 66/14/3
|
||||
f 139/16/3 125/17/3 123/14/3
|
||||
f 123/16/3 133/17/3 122/14/3
|
||||
f 122/16/3 237/17/3 121/14/3
|
||||
f 121/16/3 235/17/3 124/14/3
|
||||
f 124/16/3 236/17/3 126/14/3
|
||||
f 126/16/3 129/17/3 49/14/3
|
||||
f 49/16/3 130/17/3 75/14/3
|
||||
f 129/16/3 157/17/3 130/14/3
|
||||
f 236/16/3 160/17/3 129/14/3
|
||||
f 235/18/3 159/19/3 236/20/3
|
||||
f 237/21/3 116/22/3 235/23/3
|
||||
f 133/16/3 163/17/3 237/14/3
|
||||
f 125/16/3 165/17/3 133/14/3
|
||||
f 142/16/3 135/17/3 125/14/3
|
||||
f 136/24/4 139/25/4 20/26/4
|
||||
f 58/27/4 138/28/4 136/29/4
|
||||
f 178/26/4 120/30/4 58/24/4
|
||||
f 180/16/4 140/17/4 120/14/4
|
||||
f 120/16/4 141/17/4 138/14/4
|
||||
f 138/16/4 142/17/4 139/14/4
|
||||
f 226/31/4 132/32/4 229/33/4
|
||||
f 137/16/4 227/34/4 169/16/4
|
||||
f 228/35/4 166/17/4 132/36/4
|
||||
f 134/16/5 153/17/5 212/14/5
|
||||
f 127/16/5 128/17/5 134/14/5
|
||||
f 89/16/5 146/17/5 127/14/5
|
||||
f 75/16/5 149/17/5 146/14/5
|
||||
f 146/16/5 148/17/5 128/14/5
|
||||
f 128/16/5 213/17/5 153/14/5
|
||||
f 231/37/5 151/38/5 155/39/5
|
||||
f 208/40/5 86/41/5 195/42/5
|
||||
f 230/43/5 214/14/5 213/14/5
|
||||
f 157/16/5 232/44/5 231/37/5
|
||||
f 155/39/5 86/45/5 230/43/5
|
||||
f 160/16/3 172/17/3 157/14/3
|
||||
f 159/16/3 161/17/3 160/14/3
|
||||
f 116/46/3 162/47/3 159/48/3
|
||||
f 163/49/3 158/50/3 116/51/3
|
||||
f 165/16/3 164/17/3 163/14/3
|
||||
f 135/16/3 5/17/3 165/14/3
|
||||
f 166/16/3 177/17/3 135/14/3
|
||||
f 229/33/4 141/14/4 140/16/4
|
||||
f 132/36/4 142/14/4 141/16/4
|
||||
f 169/16/4 181/14/4 188/16/4
|
||||
f 161/52/6 167/53/6 172/54/6
|
||||
f 162/55/6 174/56/6 161/57/6
|
||||
f 158/52/6 225/53/6 162/54/6
|
||||
f 164/55/6 217/56/6 158/57/6
|
||||
f 5/52/6 175/53/6 164/54/6
|
||||
f 177/55/6 176/56/6 5/57/6
|
||||
f 64/52/6 173/53/6 177/54/6
|
||||
f 182/24/4 180/25/4 178/26/4
|
||||
f 196/16/4 181/17/4 180/14/4
|
||||
f 195/58/5 151/59/5 192/60/5
|
||||
f 179/61/4 140/14/4 181/16/4
|
||||
f 170/6/1 42/62/1 43/3/1
|
||||
f 184/16/2 40/17/2 43/14/2
|
||||
f 30/16/2 191/17/2 184/14/2
|
||||
f 187/16/2 190/17/2 30/14/2
|
||||
f 168/16/2 189/17/2 187/14/2
|
||||
f 78/16/2 12/17/2 168/14/2
|
||||
f 211/16/2 202/17/2 12/14/2
|
||||
f 12/16/2 193/17/2 189/14/2
|
||||
f 189/16/2 194/17/2 190/14/2
|
||||
f 190/16/2 200/17/2 191/14/2
|
||||
f 191/16/2 199/17/2 40/14/2
|
||||
f 40/16/2 186/17/2 185/14/2
|
||||
f 185/16/2 188/17/2 196/14/2
|
||||
f 186/16/2 137/17/2 169/63/2
|
||||
f 199/16/2 197/17/2 186/14/2
|
||||
f 200/16/2 150/17/2 199/14/2
|
||||
f 194/16/2 204/17/2 200/14/2
|
||||
f 193/16/2 206/17/2 194/14/2
|
||||
f 202/16/2 203/17/2 193/14/2
|
||||
f 214/16/2 198/17/2 202/14/2
|
||||
f 147/16/2 218/17/2 198/14/2
|
||||
f 198/16/2 216/17/2 203/14/2
|
||||
f 203/16/2 31/17/2 206/14/2
|
||||
f 206/16/2 209/17/2 204/14/2
|
||||
f 204/16/2 210/17/2 150/14/2
|
||||
f 150/16/2 171/17/2 197/14/2
|
||||
f 197/16/2 201/17/2 137/14/2
|
||||
f 212/16/5 211/17/5 78/14/5
|
||||
f 153/16/5 214/17/5 211/14/5
|
||||
f 230/43/5 208/17/5 147/17/5
|
||||
f 151/64/5 167/65/5 192/66/5
|
||||
f 171/52/7 183/53/7 201/54/7
|
||||
f 210/55/7 215/56/7 171/57/7
|
||||
f 209/52/7 205/53/7 210/54/7
|
||||
f 31/55/7 221/56/7 209/57/7
|
||||
f 216/52/7 223/53/7 31/54/7
|
||||
f 218/55/7 222/56/7 216/57/7
|
||||
f 208/52/7 219/53/7 218/54/7
|
||||
f 195/67/7 207/68/7 219/69/7
|
||||
f 215/67/7 143/68/7 183/69/7
|
||||
f 205/70/7 13/71/7 215/72/7
|
||||
f 221/67/7 156/68/7 205/69/7
|
||||
f 223/70/7 144/71/7 221/72/7
|
||||
f 222/67/7 224/68/7 223/69/7
|
||||
f 219/70/7 32/71/7 222/72/7
|
||||
f 174/67/6 192/68/6 167/69/6
|
||||
f 225/70/6 207/71/6 174/72/6
|
||||
f 217/67/6 32/68/6 225/69/6
|
||||
f 175/70/6 224/71/6 217/72/6
|
||||
f 176/67/6 144/68/6 175/69/6
|
||||
f 173/70/6 156/71/6 176/72/6
|
||||
f 220/67/6 13/68/6 173/69/6
|
||||
f 227/35/4 229/73/4 179/61/4
|
||||
f 64/40/4 228/41/4 220/42/4
|
||||
f 227/40/4 201/41/4 183/74/4
|
||||
f 226/59/4 220/58/4 228/64/4
|
||||
f 226/64/4 183/65/4 143/66/4
|
||||
f 167/74/5 232/40/5 172/41/5
|
||||
f 213/14/5 155/39/5 230/43/5
|
||||
f 148/14/5 231/37/5 155/39/5
|
||||
f 149/14/5 157/16/5 231/37/5
|
||||
f 131/75/1 236/76/1 233/77/1
|
||||
f 117/75/1 235/76/1 131/77/1
|
||||
f 238/78/3 131/79/3 117/80/3
|
||||
f 239/81/4 117/82/4 237/82/4
|
||||
f 233/83/5 243/84/5 236/85/5
|
||||
f 241/86/3 233/87/3 131/88/3
|
||||
f 241/85/1 243/78/1 242/83/1
|
||||
f 238/85/1 240/78/1 241/83/1
|
||||
f 241/89/3 244/90/3 242/91/3
|
||||
f 238/89/3 246/90/3 241/91/3
|
||||
f 242/89/5 247/90/5 243/91/5
|
||||
f 239/89/4 245/90/4 238/91/4
|
||||
f 7/1/1 152/62/1 4/2/1
|
||||
f 15/4/1 145/92/1 152/5/1
|
||||
f 152/7/1 184/13/1 30/8/1
|
||||
f 145/10/1 43/93/1 184/11/1
|
||||
f 6/6/1 58/4/1 178/10/1
|
||||
f 178/10/1 182/93/1 170/13/1
|
||||
f 170/13/1 43/8/1 145/2/1
|
||||
f 145/2/1 15/3/1 6/6/1
|
||||
f 6/6/1 178/10/1 170/13/1
|
||||
f 170/14/2 43/16/2 40/15/2
|
||||
f 185/15/2 196/17/2 182/14/2
|
||||
f 170/14/2 40/15/2 185/15/2
|
||||
f 66/1/1 10/62/1 16/2/1
|
||||
f 20/4/1 136/92/1 10/5/1
|
||||
f 10/7/1 6/13/1 15/8/1
|
||||
f 136/10/1 58/93/1 6/11/1
|
||||
f 118/1/1 21/62/1 26/2/1
|
||||
f 115/4/1 16/92/1 21/5/1
|
||||
f 21/7/1 7/13/1 1/8/1
|
||||
f 16/10/1 15/93/1 7/11/1
|
||||
f 83/1/1 24/62/1 27/2/1
|
||||
f 119/4/1 26/92/1 24/5/1
|
||||
f 24/7/1 22/13/1 77/8/1
|
||||
f 26/10/1 1/93/1 22/11/1
|
||||
f 22/1/1 51/62/1 154/2/1
|
||||
f 1/4/1 4/92/1 51/5/1
|
||||
f 51/7/1 187/13/1 168/8/1
|
||||
f 4/10/1 30/93/1 187/11/1
|
||||
f 187/1/1 28/62/1 8/2/1
|
||||
f 30/4/1 29/92/1 28/5/1
|
||||
f 28/7/1 87/13/1 3/8/1
|
||||
f 29/10/1 95/93/1 87/11/1
|
||||
f 184/1/1 37/62/1 29/2/1
|
||||
f 43/4/1 41/92/1 37/5/1
|
||||
f 37/7/1 103/13/1 95/8/1
|
||||
f 41/10/1 106/93/1 103/11/1
|
||||
f 42/7/1 33/13/1 106/8/1
|
||||
f 38/10/1 44/93/1 33/11/1
|
||||
f 9/1/1 45/62/1 38/2/1
|
||||
f 47/4/1 46/92/1 45/5/1
|
||||
f 45/7/1 50/13/1 44/8/1
|
||||
f 46/10/1 108/93/1 50/11/1
|
||||
f 57/1/1 54/62/1 178/2/1
|
||||
f 18/4/1 53/92/1 54/5/1
|
||||
f 54/7/1 9/13/1 182/8/1
|
||||
f 53/10/1 47/93/1 9/11/1
|
||||
f 17/1/1 35/62/1 136/2/1
|
||||
f 48/4/1 55/92/1 35/5/1
|
||||
f 35/7/1 57/13/1 58/8/1
|
||||
f 55/10/1 18/93/1 57/11/1
|
||||
f 59/1/1 63/62/1 67/2/1
|
||||
f 60/4/1 61/92/1 63/5/1
|
||||
f 63/7/1 17/13/1 20/8/1
|
||||
f 61/10/1 48/93/1 17/11/1
|
||||
f 65/1/1 68/62/1 71/2/1
|
||||
f 56/4/1 67/92/1 68/5/1
|
||||
f 68/7/1 66/13/1 115/8/1
|
||||
f 67/10/1 20/93/1 66/11/1
|
||||
f 14/1/1 69/62/1 52/2/1
|
||||
f 70/4/1 71/92/1 69/5/1
|
||||
f 69/7/1 118/13/1 119/8/1
|
||||
f 71/10/1 115/93/1 118/11/1
|
||||
f 73/1/1 72/62/1 91/2/1
|
||||
f 74/4/1 52/92/1 72/5/1
|
||||
f 72/7/1 83/13/1 114/8/1
|
||||
f 52/10/1 119/93/1 83/11/1
|
||||
f 78/1/1 80/62/1 79/2/1
|
||||
f 168/4/1 8/92/1 80/5/1
|
||||
f 80/7/1 82/13/1 93/8/1
|
||||
f 8/10/1 3/93/1 82/11/1
|
||||
f 134/1/1 212/62/1 84/2/1
|
||||
f 77/4/1 154/92/1 212/5/1
|
||||
f 212/7/1 78/13/1 76/8/1
|
||||
f 154/10/1 168/93/1 78/11/1
|
||||
f 89/1/1 127/62/1 25/2/1
|
||||
f 114/4/1 27/92/1 127/5/1
|
||||
f 127/7/1 134/13/1 81/8/1
|
||||
f 27/10/1 77/93/1 134/11/1
|
||||
f 88/1/1 92/62/1 94/2/1
|
||||
f 62/4/1 91/92/1 92/5/1
|
||||
f 92/7/1 89/13/1 85/8/1
|
||||
f 91/10/1 114/93/1 89/11/1
|
||||
f 82/1/1 96/62/1 11/2/1
|
||||
f 3/4/1 101/92/1 96/5/1
|
||||
f 96/7/1 99/13/1 97/8/1
|
||||
f 101/10/1 98/93/1 99/11/1
|
||||
f 87/1/1 102/62/1 101/2/1
|
||||
f 95/4/1 100/92/1 102/5/1
|
||||
f 102/7/1 39/13/1 98/8/1
|
||||
f 100/10/1 23/93/1 39/11/1
|
||||
f 103/1/1 105/62/1 100/2/1
|
||||
f 106/4/1 109/92/1 105/5/1
|
||||
f 105/7/1 107/13/1 23/8/1
|
||||
f 109/10/1 110/93/1 107/11/1
|
||||
f 33/1/1 104/62/1 109/2/1
|
||||
f 44/4/1 34/92/1 104/5/1
|
||||
f 104/7/1 111/13/1 110/8/1
|
||||
f 34/10/1 19/93/1 111/11/1
|
||||
f 50/1/1 36/62/1 34/2/1
|
||||
f 108/4/1 113/92/1 36/5/1
|
||||
f 36/7/1 2/13/1 19/8/1
|
||||
f 113/10/1 112/93/1 2/11/1
|
||||
f 114/16/3 49/15/3 75/17/3
|
||||
f 83/16/3 126/15/3 49/17/3
|
||||
f 119/16/3 124/15/3 126/17/3
|
||||
f 118/16/3 121/15/3 124/17/3
|
||||
f 115/16/3 122/15/3 121/17/3
|
||||
f 66/16/3 123/15/3 122/17/3
|
||||
f 20/16/3 139/15/3 123/17/3
|
||||
f 139/16/3 142/15/3 125/17/3
|
||||
f 123/16/3 125/15/3 133/17/3
|
||||
f 122/16/3 133/15/3 237/17/3
|
||||
f 121/16/3 237/15/3 235/17/3
|
||||
f 124/16/3 235/15/3 236/17/3
|
||||
f 126/16/3 236/15/3 129/17/3
|
||||
f 49/16/3 129/15/3 130/17/3
|
||||
f 129/16/3 160/15/3 157/17/3
|
||||
f 236/16/3 159/15/3 160/17/3
|
||||
f 235/18/3 116/94/3 159/19/3
|
||||
f 237/21/3 163/95/3 116/22/3
|
||||
f 133/16/3 165/15/3 163/17/3
|
||||
f 125/16/3 135/15/3 165/17/3
|
||||
f 142/16/3 166/15/3 135/17/3
|
||||
f 136/24/4 138/30/4 139/25/4
|
||||
f 58/27/4 120/96/4 138/28/4
|
||||
f 178/26/4 180/25/4 120/30/4
|
||||
f 180/16/4 181/15/4 140/17/4
|
||||
f 120/16/4 140/15/4 141/17/4
|
||||
f 138/16/4 141/15/4 142/17/4
|
||||
f 226/31/4 228/34/4 132/32/4
|
||||
f 137/16/4 201/15/4 227/34/4
|
||||
f 227/34/4 179/97/4 169/16/4
|
||||
f 228/35/4 64/17/4 166/17/4
|
||||
f 134/16/5 128/15/5 153/17/5
|
||||
f 127/16/5 146/15/5 128/17/5
|
||||
f 89/16/5 75/15/5 146/17/5
|
||||
f 75/16/5 130/15/5 149/17/5
|
||||
f 146/16/5 149/15/5 148/17/5
|
||||
f 128/16/5 148/15/5 213/17/5
|
||||
f 231/37/5 232/44/5 151/38/5
|
||||
f 230/43/5 147/17/5 214/14/5
|
||||
f 157/16/5 172/15/5 232/44/5
|
||||
f 155/39/5 151/38/5 86/45/5
|
||||
f 160/16/3 161/15/3 172/17/3
|
||||
f 159/16/3 162/15/3 161/17/3
|
||||
f 116/46/3 158/98/3 162/47/3
|
||||
f 163/49/3 164/99/3 158/50/3
|
||||
f 165/16/3 5/15/3 164/17/3
|
||||
f 135/16/3 177/15/3 5/17/3
|
||||
f 166/16/3 64/15/3 177/17/3
|
||||
f 229/33/4 132/32/4 141/14/4
|
||||
f 132/36/4 166/17/4 142/14/4
|
||||
f 169/16/4 179/97/4 181/14/4
|
||||
f 161/52/6 174/100/6 167/53/6
|
||||
f 162/55/6 225/101/6 174/56/6
|
||||
f 158/52/6 217/100/6 225/53/6
|
||||
f 164/55/6 175/101/6 217/56/6
|
||||
f 5/52/6 176/100/6 175/53/6
|
||||
f 177/55/6 173/101/6 176/56/6
|
||||
f 64/52/6 220/100/6 173/53/6
|
||||
f 182/24/4 196/30/4 180/25/4
|
||||
f 196/16/4 188/15/4 181/17/4
|
||||
f 195/58/5 86/64/5 151/59/5
|
||||
f 179/61/4 229/73/4 140/14/4
|
||||
f 170/6/1 182/4/1 38/92/1
|
||||
f 42/62/1 41/2/1 43/3/1
|
||||
f 170/6/1 38/92/1 42/62/1
|
||||
f 184/16/2 191/15/2 40/17/2
|
||||
f 30/16/2 190/15/2 191/17/2
|
||||
f 187/16/2 189/15/2 190/17/2
|
||||
f 168/16/2 12/15/2 189/17/2
|
||||
f 78/16/2 211/15/2 12/17/2
|
||||
f 211/16/2 214/15/2 202/17/2
|
||||
f 12/16/2 202/15/2 193/17/2
|
||||
f 189/16/2 193/15/2 194/17/2
|
||||
f 190/16/2 194/15/2 200/17/2
|
||||
f 191/16/2 200/15/2 199/17/2
|
||||
f 40/16/2 199/15/2 186/17/2
|
||||
f 185/16/2 186/15/2 188/17/2
|
||||
f 169/63/2 188/14/2 186/16/2
|
||||
f 186/16/2 197/15/2 137/17/2
|
||||
f 199/16/2 150/15/2 197/17/2
|
||||
f 200/16/2 204/15/2 150/17/2
|
||||
f 194/16/2 206/15/2 204/17/2
|
||||
f 193/16/2 203/15/2 206/17/2
|
||||
f 202/16/2 198/15/2 203/17/2
|
||||
f 214/16/2 147/15/2 198/17/2
|
||||
f 147/16/2 208/15/2 218/17/2
|
||||
f 198/16/2 218/15/2 216/17/2
|
||||
f 203/16/2 216/15/2 31/17/2
|
||||
f 206/16/2 31/15/2 209/17/2
|
||||
f 204/16/2 209/15/2 210/17/2
|
||||
f 150/16/2 210/15/2 171/17/2
|
||||
f 197/16/2 171/15/2 201/17/2
|
||||
f 212/16/5 153/15/5 211/17/5
|
||||
f 153/16/5 213/15/5 214/17/5
|
||||
f 230/43/5 86/45/5 208/17/5
|
||||
f 151/64/5 232/59/5 167/65/5
|
||||
f 171/52/7 215/100/7 183/53/7
|
||||
f 210/55/7 205/101/7 215/56/7
|
||||
f 209/52/7 221/100/7 205/53/7
|
||||
f 31/55/7 223/101/7 221/56/7
|
||||
f 216/52/7 222/100/7 223/53/7
|
||||
f 218/55/7 219/101/7 222/56/7
|
||||
f 208/52/7 195/100/7 219/53/7
|
||||
f 195/67/7 192/102/7 207/68/7
|
||||
f 215/67/7 13/102/7 143/68/7
|
||||
f 205/70/7 156/103/7 13/71/7
|
||||
f 221/67/7 144/102/7 156/68/7
|
||||
f 223/70/7 224/103/7 144/71/7
|
||||
f 222/67/7 32/102/7 224/68/7
|
||||
f 219/70/7 207/103/7 32/71/7
|
||||
f 174/67/6 207/102/6 192/68/6
|
||||
f 225/70/6 32/103/6 207/71/6
|
||||
f 217/67/6 224/102/6 32/68/6
|
||||
f 175/70/6 144/103/6 224/71/6
|
||||
f 176/67/6 156/102/6 144/68/6
|
||||
f 173/70/6 13/103/6 156/71/6
|
||||
f 220/67/6 143/102/6 13/68/6
|
||||
f 227/35/4 226/104/4 229/73/4
|
||||
f 226/59/4 143/60/4 220/58/4
|
||||
f 226/64/4 227/59/4 183/65/4
|
||||
f 213/14/5 148/14/5 155/39/5
|
||||
f 148/14/5 149/14/5 231/37/5
|
||||
f 149/14/5 130/16/5 157/16/5
|
||||
f 131/75/1 235/105/1 236/76/1
|
||||
f 117/75/1 237/105/1 235/76/1
|
||||
f 238/78/3 241/86/3 131/79/3
|
||||
f 239/81/4 238/81/4 117/82/4
|
||||
f 233/83/5 242/106/5 243/84/5
|
||||
f 241/86/3 242/85/3 233/87/3
|
||||
f 241/85/1 240/86/1 243/78/1
|
||||
f 238/85/1 239/86/1 240/78/1
|
||||
f 241/89/3 246/107/3 244/90/3
|
||||
f 238/89/3 245/107/3 246/90/3
|
||||
f 242/89/5 244/107/5 247/90/5
|
||||
f 239/89/4 234/107/4 245/90/4
|
||||
92
assets/macintosh.mtl
Normal file
92
assets/macintosh.mtl
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
# Blender 4.5.3 LTS MTL File: 'None'
|
||||
# www.blender.org
|
||||
|
||||
newmtl M_lam_black
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.000000 0.000000 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_lam_browngrey
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.224800 0.188290 0.178042
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_lam_browngreylighter
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.323200 0.283784 0.247571
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_lam_darkgrey
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.045600 0.040462 0.037894
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_lam_teal
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.022422 0.243757 0.246400
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_plastic_bone
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.556560 0.487840 0.354160
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_plastic_bone_shad
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.426400 0.376163 0.288246
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_screen_blue
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.010400 0.105033 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
|
||||
newmtl M_screen_whitetext
|
||||
Ns 39.999996
|
||||
Ka 0.200000 0.200000 0.200000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.500000
|
||||
d 1.000000
|
||||
illum 3
|
||||
1989
assets/macintosh.obj
Normal file
1989
assets/macintosh.obj
Normal file
File diff suppressed because it is too large
Load diff
BIN
assets/tileset.png
Normal file
BIN
assets/tileset.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
8
build.fish
Normal file
8
build.fish
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set links -lX11 -lXi -lXcursor -ldl -lpthread -lm -lGL
|
||||
set options -g -pthread -std=gnu23
|
||||
set defines -D_GNU_SOURCE
|
||||
|
||||
clang -o build/3d src/main.c $options $links || exit 1
|
||||
build/3d
|
||||
1
src/cglm
Submodule
1
src/cglm
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit a4602f2d5f1f275c02ef608ef27d4021572d9d6c
|
||||
1
src/colla
Submodule
1
src/colla
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 7e7c371b9e1f35c1cab530cf1c6b49781fb105e8
|
||||
5046
src/glad/glad.c
Normal file
5046
src/glad/glad.c
Normal file
File diff suppressed because it is too large
Load diff
3170
src/glad/glad.h
Normal file
3170
src/glad/glad.h
Normal file
File diff suppressed because it is too large
Load diff
312
src/glad/khrplatform.h
Normal file
312
src/glad/khrplatform.h
Normal file
|
|
@ -0,0 +1,312 @@
|
|||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID:
|
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by filing pull requests or issues on
|
||||
* the EGL Registry repository linked above.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif defined(__ANDROID__)
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
|
||||
550
src/gldefs.h
Normal file
550
src/gldefs.h
Normal file
|
|
@ -0,0 +1,550 @@
|
|||
#include "colla/colla.h"
|
||||
|
||||
void gl_init(void);
|
||||
void gl_cleanup(void);
|
||||
|
||||
#if COLLA_WIN
|
||||
|
||||
#pragma comment(lib, "Opengl32.lib")
|
||||
|
||||
// X Macro list of GL function names and signatures
|
||||
#define GL_FUNCTIONS \
|
||||
XMACRO(glBindVertexArray, void, (GLuint array)) \
|
||||
XMACRO(glFramebufferTextureLayer, void, (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)) \
|
||||
XMACRO(glGenFramebuffers, void, (GLsizei n, GLuint * framebuffers)) \
|
||||
XMACRO(glBindFramebuffer, void, (GLenum target, GLuint framebuffer)) \
|
||||
XMACRO(glBindRenderbuffer, void, (GLenum target, GLuint renderbuffer)) \
|
||||
XMACRO(glGetStringi, const GLubyte *, (GLenum name, GLuint index)) \
|
||||
XMACRO(glClearBufferfi, void, (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)) \
|
||||
XMACRO(glClearBufferfv, void, (GLenum buffer, GLint drawbuffer, const GLfloat * value)) \
|
||||
XMACRO(glClearBufferuiv, void, (GLenum buffer, GLint drawbuffer, const GLuint * value)) \
|
||||
XMACRO(glClearBufferiv, void, (GLenum buffer, GLint drawbuffer, const GLint * value)) \
|
||||
XMACRO(glDeleteRenderbuffers, void, (GLsizei n, const GLuint * renderbuffers)) \
|
||||
XMACRO(glUniform1fv, void, (GLint location, GLsizei count, const GLfloat * value)) \
|
||||
XMACRO(glUniform2fv, void, (GLint location, GLsizei count, const GLfloat * value)) \
|
||||
XMACRO(glUniform3fv, void, (GLint location, GLsizei count, const GLfloat * value)) \
|
||||
XMACRO(glUniform4fv, void, (GLint location, GLsizei count, const GLfloat * value)) \
|
||||
XMACRO(glUniform1iv, void, (GLint location, GLsizei count, const GLint * value)) \
|
||||
XMACRO(glUniform2iv, void, (GLint location, GLsizei count, const GLint * value)) \
|
||||
XMACRO(glUniform3iv, void, (GLint location, GLsizei count, const GLint * value)) \
|
||||
XMACRO(glUniform4iv, void, (GLint location, GLsizei count, const GLint * value)) \
|
||||
XMACRO(glUniformMatrix4fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)) \
|
||||
XMACRO(glUseProgram, void, (GLuint program)) \
|
||||
XMACRO(glShaderSource, void, (GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length)) \
|
||||
XMACRO(glLinkProgram, void, (GLuint program)) \
|
||||
XMACRO(glGetUniformLocation, GLint, (GLuint program, const GLchar * name)) \
|
||||
XMACRO(glGetShaderiv, void, (GLuint shader, GLenum pname, GLint * params)) \
|
||||
XMACRO(glGetProgramInfoLog, void, (GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)) \
|
||||
XMACRO(glGetAttribLocation, GLint, (GLuint program, const GLchar * name)) \
|
||||
XMACRO(glDisableVertexAttribArray, void, (GLuint index)) \
|
||||
XMACRO(glDeleteShader, void, (GLuint shader)) \
|
||||
XMACRO(glDeleteProgram, void, (GLuint program)) \
|
||||
XMACRO(glCompileShader, void, (GLuint shader)) \
|
||||
XMACRO(glStencilFuncSeparate, void, (GLenum face, GLenum func, GLint ref, GLuint mask)) \
|
||||
XMACRO(glStencilOpSeparate, void, (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)) \
|
||||
XMACRO(glRenderbufferStorageMultisample, void, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) \
|
||||
XMACRO(glDrawBuffers, void, (GLsizei n, const GLenum * bufs)) \
|
||||
XMACRO(glVertexAttribDivisor, void, (GLuint index, GLuint divisor)) \
|
||||
XMACRO(glBufferSubData, void, (GLenum target, GLintptr offset, GLsizeiptr size, const void * data)) \
|
||||
XMACRO(glGenBuffers, void, (GLsizei n, GLuint * buffers)) \
|
||||
XMACRO(glCheckFramebufferStatus, GLenum, (GLenum target)) \
|
||||
XMACRO(glFramebufferRenderbuffer, void, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) \
|
||||
XMACRO(glCompressedTexImage2D, void, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data)) \
|
||||
XMACRO(glCompressedTexImage3D, void, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data)) \
|
||||
XMACRO(glActiveTexture, void, (GLenum texture)) \
|
||||
XMACRO(glTexSubImage3D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels)) \
|
||||
XMACRO(glRenderbufferStorage, void, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) \
|
||||
XMACRO(glGenTextures, void, (GLsizei n, GLuint * textures)) \
|
||||
XMACRO(glPolygonOffset, void, (GLfloat factor, GLfloat units)) \
|
||||
XMACRO(glDrawElements, void, (GLenum mode, GLsizei count, GLenum type, const void * indices)) \
|
||||
XMACRO(glDeleteFramebuffers, void, (GLsizei n, const GLuint * framebuffers)) \
|
||||
XMACRO(glBlendEquationSeparate, void, (GLenum modeRGB, GLenum modeAlpha)) \
|
||||
XMACRO(glDeleteTextures, void, (GLsizei n, const GLuint * textures)) \
|
||||
XMACRO(glGetProgramiv, void, (GLuint program, GLenum pname, GLint * params)) \
|
||||
XMACRO(glBindTexture, void, (GLenum target, GLuint texture)) \
|
||||
XMACRO(glTexImage3D, void, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels)) \
|
||||
XMACRO(glCreateShader, GLuint, (GLenum type)) \
|
||||
XMACRO(glTexSubImage2D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels)) \
|
||||
XMACRO(glFramebufferTexture2D, void, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) \
|
||||
XMACRO(glCreateProgram, GLuint, (void)) \
|
||||
XMACRO(glViewport, void, (GLint x, GLint y, GLsizei width, GLsizei height)) \
|
||||
XMACRO(glDeleteBuffers, void, (GLsizei n, const GLuint * buffers)) \
|
||||
XMACRO(glDrawArrays, void, (GLenum mode, GLint first, GLsizei count)) \
|
||||
XMACRO(glDrawElementsInstanced, void, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount)) \
|
||||
XMACRO(glVertexAttribPointer, void, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer)) \
|
||||
XMACRO(glVertexAttribIPointer, void, (GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer)) \
|
||||
XMACRO(glUniform1i, void, (GLint location, GLint v0)) \
|
||||
XMACRO(glDisable, void, (GLenum cap)) \
|
||||
XMACRO(glColorMask, void, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) \
|
||||
XMACRO(glColorMaski, void, (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) \
|
||||
XMACRO(glBindBuffer, void, (GLenum target, GLuint buffer)) \
|
||||
XMACRO(glDeleteVertexArrays, void, (GLsizei n, const GLuint * arrays)) \
|
||||
XMACRO(glDepthMask, void, (GLboolean flag)) \
|
||||
XMACRO(glDrawArraysInstanced, void, (GLenum mode, GLint first, GLsizei count, GLsizei instancecount)) \
|
||||
XMACRO(glScissor, void, (GLint x, GLint y, GLsizei width, GLsizei height)) \
|
||||
XMACRO(glGenRenderbuffers, void, (GLsizei n, GLuint * renderbuffers)) \
|
||||
XMACRO(glBufferData, void, (GLenum target, GLsizeiptr size, const void * data, GLenum usage)) \
|
||||
XMACRO(glBlendFuncSeparate, void, (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)) \
|
||||
XMACRO(glTexParameteri, void, (GLenum target, GLenum pname, GLint param)) \
|
||||
XMACRO(glGetIntegerv, void, (GLenum pname, GLint * data)) \
|
||||
XMACRO(glEnable, void, (GLenum cap)) \
|
||||
XMACRO(glBlitFramebuffer, void, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)) \
|
||||
XMACRO(glStencilMask, void, (GLuint mask)) \
|
||||
XMACRO(glAttachShader, void, (GLuint program, GLuint shader)) \
|
||||
XMACRO(glGetError, GLenum, (void)) \
|
||||
XMACRO(glBlendColor, void, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) \
|
||||
XMACRO(glTexParameterf, void, (GLenum target, GLenum pname, GLfloat param)) \
|
||||
XMACRO(glTexParameterfv, void, (GLenum target, GLenum pname, const GLfloat* params)) \
|
||||
XMACRO(glGetShaderInfoLog, void, (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)) \
|
||||
XMACRO(glDepthFunc, void, (GLenum func)) \
|
||||
XMACRO(glStencilOp , void, (GLenum fail, GLenum zfail, GLenum zpass)) \
|
||||
XMACRO(glStencilFunc, void, (GLenum func, GLint ref, GLuint mask)) \
|
||||
XMACRO(glEnableVertexAttribArray, void, (GLuint index)) \
|
||||
XMACRO(glBlendFunc, void, (GLenum sfactor, GLenum dfactor)) \
|
||||
XMACRO(glReadBuffer, void, (GLenum src)) \
|
||||
XMACRO(glTexImage2D, void, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels)) \
|
||||
XMACRO(glGenVertexArrays, void, (GLsizei n, GLuint * arrays)) \
|
||||
XMACRO(glFrontFace, void, (GLenum mode)) \
|
||||
XMACRO(glCullFace, void, (GLenum mode)) \
|
||||
XMACRO(glPixelStorei, void, (GLenum pname, GLint param)) \
|
||||
XMACRO(glBindSampler, void, (GLuint unit, GLuint sampler)) \
|
||||
XMACRO(glGenSamplers, void, (GLsizei n, GLuint* samplers)) \
|
||||
XMACRO(glSamplerParameteri, void, (GLuint sampler, GLenum pname, GLint param)) \
|
||||
XMACRO(glSamplerParameterf, void, (GLuint sampler, GLenum pname, GLfloat param)) \
|
||||
XMACRO(glSamplerParameterfv, void, (GLuint sampler, GLenum pname, const GLfloat* params)) \
|
||||
XMACRO(glDeleteSamplers, void, (GLsizei n, const GLuint* samplers)) \
|
||||
XMACRO(glBindBufferBase, void, (GLenum target, GLuint index, GLuint buffer)) \
|
||||
XMACRO(glBindBufferRange, void, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) \
|
||||
XMACRO(glTexImage2DMultisample, void, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)) \
|
||||
XMACRO(glTexImage3DMultisample, void, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)) \
|
||||
XMACRO(glDispatchCompute, void, (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)) \
|
||||
XMACRO(glMemoryBarrier, void, (GLbitfield barriers)) \
|
||||
XMACRO(glBindImageTexture, void, (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)) \
|
||||
XMACRO(glTexStorage2DMultisample, void, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)) \
|
||||
XMACRO(glTexStorage2D, void, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)) \
|
||||
XMACRO(glTexStorage3DMultisample, void, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)) \
|
||||
XMACRO(glTexStorage3D, void, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)) \
|
||||
XMACRO(glCompressedTexSubImage2D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data)) \
|
||||
XMACRO(glCompressedTexSubImage3D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data)) \
|
||||
XMACRO(glTextureView, void, (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers))
|
||||
|
||||
#define __gl_h_ 1
|
||||
#define __gl32_h_ 1
|
||||
#define __gl31_h_ 1
|
||||
#define __GL_H__ 1
|
||||
#define __glext_h_ 1
|
||||
#define __GLEXT_H_ 1
|
||||
#define __gltypes_h_ 1
|
||||
#define __glcorearb_h_ 1
|
||||
#define __gl_glcorearb_h_ 1
|
||||
#define GL_APIENTRY APIENTRY
|
||||
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned int GLuint;
|
||||
typedef int GLsizei;
|
||||
typedef char GLchar;
|
||||
typedef ptrdiff_t GLintptr;
|
||||
typedef ptrdiff_t GLsizeiptr;
|
||||
typedef double GLclampd;
|
||||
typedef unsigned short GLushort;
|
||||
typedef unsigned char GLubyte;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef uint64_t GLuint64;
|
||||
typedef double GLdouble;
|
||||
typedef unsigned short GLhalf;
|
||||
typedef float GLclampf;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef signed char GLbyte;
|
||||
typedef short GLshort;
|
||||
typedef void GLvoid;
|
||||
typedef int64_t GLint64;
|
||||
typedef float GLfloat;
|
||||
typedef int GLint;
|
||||
#define GL_INT_2_10_10_10_REV 0x8D9F
|
||||
#define GL_R32F 0x822E
|
||||
#define GL_PROGRAM_POINT_SIZE 0x8642
|
||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
||||
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
|
||||
#define GL_COLOR_ATTACHMENT2 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||
#define GL_R16F 0x822D
|
||||
#define GL_COLOR_ATTACHMENT22 0x8CF6
|
||||
#define GL_DRAW_FRAMEBUFFER 0x8CA9
|
||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||
#define GL_NUM_EXTENSIONS 0x821D
|
||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
#define GL_INCR 0x1E02
|
||||
#define GL_DYNAMIC_DRAW 0x88E8
|
||||
#define GL_STATIC_DRAW 0x88E4
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
||||
#define GL_FUNC_SUBTRACT 0x800A
|
||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
#define GL_DECR_WRAP 0x8508
|
||||
#define GL_R8 0x8229
|
||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_SHORT 0x1402
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_RGBA16F 0x881A
|
||||
#define GL_CONSTANT_ALPHA 0x8003
|
||||
#define GL_READ_FRAMEBUFFER 0x8CA8
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE_MIN_LOD 0x813A
|
||||
#define GL_CLAMP_TO_EDGE 0x812F
|
||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||
#define GL_TEXTURE_WRAP_R 0x8072
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
#define GL_STREAM_DRAW 0x88E0
|
||||
#define GL_ONE 1
|
||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||
#define GL_RGB10_A2 0x8059
|
||||
#define GL_RGBA8 0x8058
|
||||
#define GL_SRGB8_ALPHA8 0x8C43
|
||||
#define GL_COLOR_ATTACHMENT1 0x8CE1
|
||||
#define GL_RGBA4 0x8056
|
||||
#define GL_RGB8 0x8051
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_STENCIL 0x1802
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_DEPTH 0x1801
|
||||
#define GL_FRONT 0x0404
|
||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||
#define GL_REPEAT 0x2901
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
||||
#define GL_DECR 0x1E03
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_COMPUTE_SHADER 0x91B9
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_TEXTURE_MAX_LOD 0x813B
|
||||
#define GL_DEPTH_COMPONENT 0x1902
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
#define GL_COLOR 0x1800
|
||||
#define GL_TEXTURE_2D_ARRAY 0x8C1A
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
||||
#define GL_NONE 0
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_BYTE 0x1400
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
||||
#define GL_LINE_STRIP 0x0003
|
||||
#define GL_TEXTURE_3D 0x806F
|
||||
#define GL_CW 0x0900
|
||||
#define GL_LINEAR 0x2601
|
||||
#define GL_RENDERBUFFER 0x8D41
|
||||
#define GL_GEQUAL 0x0206
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
#define GL_RGBA32F 0x8814
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_REPLACE 0x1E01
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_CCW 0x0901
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
|
||||
#define GL_RGB 0x1907
|
||||
#define GL_TRIANGLE_STRIP 0x0005
|
||||
#define GL_FALSE 0
|
||||
#define GL_ZERO 0
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_INVERT 0x150A
|
||||
#define GL_INT 0x1404
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_LEQUAL 0x0203
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_DITHER 0x0BD0
|
||||
#define GL_DEPTH_COMPONENT32F 0x8CAC
|
||||
#define GL_EQUAL 0x0202
|
||||
#define GL_FRAMEBUFFER 0x8D40
|
||||
#define GL_RGB5 0x8050
|
||||
#define GL_LINES 0x0001
|
||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_INCR_WRAP 0x8507
|
||||
#define GL_LESS 0x0201
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||
#define GL_BACK 0x0405
|
||||
#define GL_ALWAYS 0x0207
|
||||
#define GL_FUNC_ADD 0x8006
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_NOTEQUAL 0x0205
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_RED 0x1903
|
||||
#define GL_COLOR_ATTACHMENT3 0x8CE3
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_RGB5_A1 0x8057
|
||||
#define GL_GREATER 0x0204
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_TRUE 1
|
||||
#define GL_NEVER 0x0200
|
||||
#define GL_POINTS 0x0000
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_MIRRORED_REPEAT 0x8370
|
||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
||||
#define GL_R11F_G11F_B10F 0x8C3A
|
||||
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
|
||||
#define GL_RGB9_E5 0x8C3D
|
||||
#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
|
||||
#define GL_RGBA32UI 0x8D70
|
||||
#define GL_RGB32UI 0x8D71
|
||||
#define GL_RGBA16UI 0x8D76
|
||||
#define GL_RGB16UI 0x8D77
|
||||
#define GL_RGBA8UI 0x8D7C
|
||||
#define GL_RGB8UI 0x8D7D
|
||||
#define GL_RGBA32I 0x8D82
|
||||
#define GL_RGB32I 0x8D83
|
||||
#define GL_RGBA16I 0x8D88
|
||||
#define GL_RGB16I 0x8D89
|
||||
#define GL_RGBA8I 0x8D8E
|
||||
#define GL_RGB8I 0x8D8F
|
||||
#define GL_RED_INTEGER 0x8D94
|
||||
#define GL_RG 0x8227
|
||||
#define GL_RG_INTEGER 0x8228
|
||||
#define GL_R8 0x8229
|
||||
#define GL_R16 0x822A
|
||||
#define GL_RG8 0x822B
|
||||
#define GL_RG16 0x822C
|
||||
#define GL_R16F 0x822D
|
||||
#define GL_R32F 0x822E
|
||||
#define GL_RG16F 0x822F
|
||||
#define GL_RG32F 0x8230
|
||||
#define GL_R8I 0x8231
|
||||
#define GL_R8UI 0x8232
|
||||
#define GL_R16I 0x8233
|
||||
#define GL_R16UI 0x8234
|
||||
#define GL_R32I 0x8235
|
||||
#define GL_R32UI 0x8236
|
||||
#define GL_RG8I 0x8237
|
||||
#define GL_RG8UI 0x8238
|
||||
#define GL_RG16I 0x8239
|
||||
#define GL_RG16UI 0x823A
|
||||
#define GL_RG32I 0x823B
|
||||
#define GL_RG32UI 0x823C
|
||||
#define GL_RGBA_INTEGER 0x8D99
|
||||
#define GL_R8_SNORM 0x8F94
|
||||
#define GL_RG8_SNORM 0x8F95
|
||||
#define GL_RGB8_SNORM 0x8F96
|
||||
#define GL_RGBA8_SNORM 0x8F97
|
||||
#define GL_R16_SNORM 0x8F98
|
||||
#define GL_RG16_SNORM 0x8F99
|
||||
#define GL_RGB16_SNORM 0x8F9A
|
||||
#define GL_RGBA16_SNORM 0x8F9B
|
||||
#define GL_RGBA16 0x805B
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||
#define GL_MAX_3D_TEXTURE_SIZE 0x8073
|
||||
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
|
||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||
#define GL_CLAMP_TO_BORDER 0x812D
|
||||
#define GL_TEXTURE_BORDER_COLOR 0x1004
|
||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_FRAMEBUFFER_SRGB 0x8DB9
|
||||
#define GL_TEXTURE_COMPARE_MODE 0x884C
|
||||
#define GL_TEXTURE_COMPARE_FUNC 0x884D
|
||||
#define GL_COMPARE_REF_TO_TEXTURE 0x884E
|
||||
#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
|
||||
#define GL_TEXTURE_MAX_LEVEL 0x813D
|
||||
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
|
||||
#define GL_MAJOR_VERSION 0x821B
|
||||
#define GL_MINOR_VERSION 0x821C
|
||||
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
|
||||
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
|
||||
#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
|
||||
#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
|
||||
#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
|
||||
#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
|
||||
#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
|
||||
#define GL_MIN 0x8007
|
||||
#define GL_MAX 0x8008
|
||||
#define GL_WRITE_ONLY 0x88B9
|
||||
#define GL_READ_WRITE 0x88BA
|
||||
#define GL_MAX_DRAW_BUFFERS 0x8824
|
||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||
#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
|
||||
#define GL_MAX_IMAGE_UNITS 0x8F38
|
||||
|
||||
// generate GL function pointer typedefs
|
||||
#define XMACRO(name, ret, args) typedef ret (GL_APIENTRY* PFN_ ## name) args;
|
||||
GL_FUNCTIONS
|
||||
#undef XMACRO
|
||||
|
||||
// generate GL function pointers
|
||||
#define XMACRO(name, ret, args) static PFN_ ## name name;
|
||||
GL_FUNCTIONS
|
||||
#undef XMACRO
|
||||
|
||||
static PROC gl__dll = NULL;
|
||||
|
||||
// helper function to lookup GL functions in GL DLL
|
||||
typedef PROC (WINAPI * gl__wglGetProcAddress)(LPCSTR);
|
||||
void* gl__getprocaddr(const char* name, gl__wglGetProcAddress wgl_getprocaddress) {
|
||||
void* proc_addr = (void *)wgl_getprocaddress(name);
|
||||
if (!proc_addr) {
|
||||
proc_addr = (void *)GetProcAddress(gl__dll, name);
|
||||
}
|
||||
colla_assert(proc_addr);
|
||||
return proc_addr;
|
||||
}
|
||||
|
||||
// populate GL function pointers
|
||||
void gl__load_opengl(void) {
|
||||
colla_assert(gl__dll == NULL);
|
||||
gl__dll = LoadLibraryA("opengl32.dll");
|
||||
colla_assert(gl__dll);
|
||||
gl__wglGetProcAddress wgl_getprocaddress = (gl__wglGetProcAddress) GetProcAddress(gl__dll, "wglGetProcAddress");
|
||||
colla_assert(wgl_getprocaddress);
|
||||
#define XMACRO(name, ret, args) name = (PFN_ ## name) gl__getprocaddr(#name, wgl_getprocaddress);
|
||||
GL_FUNCTIONS
|
||||
#undef XMACRO
|
||||
}
|
||||
|
||||
void gl__unload_opengl(void) {
|
||||
colla_assert(gl__dll);
|
||||
FreeLibrary(gl__dll);
|
||||
gl__dll = NULL;
|
||||
}
|
||||
|
||||
void gl_init(void) {
|
||||
gl__load_opengl();
|
||||
}
|
||||
|
||||
void gl_cleanup(void) {
|
||||
gl__unload_opengl();
|
||||
}
|
||||
#else
|
||||
void gl_init(void) {
|
||||
// noop
|
||||
}
|
||||
|
||||
void gl_cleanup(void) {
|
||||
// noop
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
|
||||
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
|
||||
#endif
|
||||
#ifndef GL_UNSIGNED_INT_24_8
|
||||
#define GL_UNSIGNED_INT_24_8 0x84FA
|
||||
#endif
|
||||
#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
#endif
|
||||
#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RED_RGTC1
|
||||
#define GL_COMPRESSED_RED_RGTC1 0x8DBB
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SIGNED_RED_RGTC1
|
||||
#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RED_GREEN_RGTC2
|
||||
#define GL_COMPRESSED_RED_GREEN_RGTC2 0x8DBD
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2
|
||||
#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 0x8DBE
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
|
||||
#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB
|
||||
#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
|
||||
#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGB8_ETC2
|
||||
#define GL_COMPRESSED_RGB8_ETC2 0x9274
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SRGB8_ETC2
|
||||
#define GL_COMPRESSED_SRGB8_ETC2 0x9275
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGBA8_ETC2_EAC
|
||||
#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
|
||||
#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_R11_EAC
|
||||
#define GL_COMPRESSED_R11_EAC 0x9270
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SIGNED_R11_EAC
|
||||
#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RG11_EAC
|
||||
#define GL_COMPRESSED_RG11_EAC 0x9272
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SIGNED_RG11_EAC
|
||||
#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_RGBA_ASTC_4x4_KHR
|
||||
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
|
||||
#endif
|
||||
#ifndef GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
|
||||
#endif
|
||||
#ifndef GL_DEPTH24_STENCIL8
|
||||
#define GL_DEPTH24_STENCIL8 0x88F0
|
||||
#endif
|
||||
#ifndef GL_HALF_FLOAT
|
||||
#define GL_HALF_FLOAT 0x140B
|
||||
#endif
|
||||
#ifndef GL_DEPTH_STENCIL
|
||||
#define GL_DEPTH_STENCIL 0x84F9
|
||||
#endif
|
||||
#ifndef GL_LUMINANCE
|
||||
#define GL_LUMINANCE 0x1909
|
||||
#endif
|
||||
#ifndef GL_COMPUTE_SHADER
|
||||
#define GL_COMPUTE_SHADER 0x91B9
|
||||
#endif
|
||||
|
||||
336
src/main.c
Normal file
336
src/main.c
Normal file
|
|
@ -0,0 +1,336 @@
|
|||
#define COLLA_NO_NET 1
|
||||
#include "colla/colla.c"
|
||||
|
||||
#include "glad/glad.c"
|
||||
|
||||
#define SOKOL_GLCORE
|
||||
#define SOKOL_ASSERT(c) colla_assert(c)
|
||||
#define SOKOL_IMPL
|
||||
|
||||
#include "sokol/sokol_app.h"
|
||||
|
||||
#define TINYOBJ_LOADER_C_IMPLEMENTATION
|
||||
#include "tinyobjloader/tinyobjloader.h"
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb/stb_image.h"
|
||||
|
||||
#include "obj.c"
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#define SHADER(...) \
|
||||
"#version 330 core\n" \
|
||||
#__VA_ARGS__
|
||||
|
||||
const char *vert_shader = SHADER(
|
||||
layout (location = 0) in vec3 pos;
|
||||
layout (location = 1) in vec3 norm;
|
||||
layout (location = 2) in vec3 col;
|
||||
layout (location = 3) in vec2 uv;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 proj;
|
||||
|
||||
out vec3 fs_norm;
|
||||
out vec2 fs_uv;
|
||||
|
||||
void main() {
|
||||
gl_Position = proj * view * model * vec4(pos, 1.0);
|
||||
fs_norm = norm;
|
||||
fs_uv = uv;
|
||||
}
|
||||
);
|
||||
|
||||
const char *frag_shader = SHADER(
|
||||
in vec3 fs_norm;
|
||||
in vec2 fs_uv;
|
||||
out vec4 colour;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
// colour = vec4(fs_norm * vec3(0.5) + vec3(0.5), 1);
|
||||
colour = texture(tex, fs_uv);
|
||||
if (colour.a == 0) discard;
|
||||
}
|
||||
);
|
||||
|
||||
typedef struct camera_t camera_t;
|
||||
struct camera_t {
|
||||
vec3 pos;
|
||||
vec3 target;
|
||||
vec3 up;
|
||||
};
|
||||
|
||||
void camera_event(camera_t *cam, const sapp_event *ev) {
|
||||
const float spd = 10.f;
|
||||
|
||||
switch (ev->type) {
|
||||
case SAPP_EVENTTYPE_KEY_DOWN:
|
||||
{
|
||||
int strafe = (ev->key_code == SAPP_KEYCODE_A) - (ev->key_code == SAPP_KEYCODE_D);
|
||||
int forward = (ev->key_code == SAPP_KEYCODE_S) - (ev->key_code == SAPP_KEYCODE_W);
|
||||
vec3 fwd = {0};
|
||||
|
||||
if (strafe || forward) {
|
||||
glm_vec3_sub(cam->pos, cam->target, fwd);
|
||||
glm_vec3_normalize(fwd);
|
||||
}
|
||||
|
||||
if (strafe) {
|
||||
vec3 right = {0};
|
||||
glm_vec3_cross(fwd, cam->up, right);
|
||||
glm_vec3_normalize(right);
|
||||
float str = (float)strafe * sapp_frame_duration() * spd;
|
||||
right[0] *= str;
|
||||
right[1] *= str;
|
||||
right[2] *= str;
|
||||
glm_vec3_add(cam->pos, right, cam->pos);
|
||||
}
|
||||
if (forward) {
|
||||
float forw = (float)forward * sapp_frame_duration() * spd;
|
||||
fwd[0] *= forw;
|
||||
fwd[1] *= forw;
|
||||
fwd[2] *= forw;
|
||||
glm_vec3_add(cam->pos, fwd, cam->pos);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SAPP_EVENTTYPE_MOUSE_MOVE:
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
struct {
|
||||
arena_t arena;
|
||||
model_t model;
|
||||
camera_t cam;
|
||||
uint model_id;
|
||||
uint view_id;
|
||||
uint proj_id;
|
||||
uint tex_id;
|
||||
uint prog;
|
||||
} state = {0};
|
||||
|
||||
void gfx__get_file_data_cb(
|
||||
void *udata,
|
||||
const char *fname,
|
||||
int is_mtl,
|
||||
const char *obj_fname,
|
||||
char **data,
|
||||
usize *len
|
||||
) {
|
||||
arena_t *arena = udata;
|
||||
buffer_t buf = os_file_read_all(arena, strv(fname));
|
||||
*data = (char*)buf.data;
|
||||
*len = buf.len;
|
||||
}
|
||||
|
||||
uint gfx__compile_shader(int type, const char *src) {
|
||||
uint shd = glCreateShader(type);
|
||||
glShaderSource(shd, 1, &src, NULL);
|
||||
glCompileShader(shd);
|
||||
|
||||
int success = 0;
|
||||
char buf[512];
|
||||
glGetShaderiv(shd, GL_COMPILE_STATUS, &success);
|
||||
if (!success) {
|
||||
glGetShaderInfoLog(shd, arrlen(buf), NULL, buf);
|
||||
fatal("[shader]: %s", buf);
|
||||
}
|
||||
|
||||
return shd;
|
||||
}
|
||||
|
||||
uint gfx__load_texture(arena_t scratch, strview_t fname) {
|
||||
buffer_t file_data = os_file_read_all(&scratch, fname);
|
||||
int w, h;
|
||||
uchar *data = stbi_load_from_memory(file_data.data, file_data.len, &w, &h, NULL, 4);
|
||||
|
||||
if (!data) {
|
||||
fatal("could not load image %v", fname);
|
||||
}
|
||||
|
||||
uint id = 0l;
|
||||
glGenTextures(1, &id);
|
||||
glBindTexture(GL_TEXTURE_2D, id);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
|
||||
stbi_image_free(data);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
void init(void) {
|
||||
colla_init(COLLA_ALL);
|
||||
state.arena = arena_make(ARENA_VIRTUAL, GB(1));
|
||||
|
||||
gladLoadGL();
|
||||
|
||||
stbi_set_flip_vertically_on_load(1);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glClearColor(0.1f, 0.2f, 0.4f, 1.0f);
|
||||
|
||||
float verts[] = {
|
||||
-.5f, -.5f, .0f,
|
||||
.5f, -.5f, .5f,
|
||||
.0f, .5f, .0f
|
||||
};
|
||||
|
||||
uint vert = gfx__compile_shader(GL_VERTEX_SHADER, vert_shader);
|
||||
uint frag = gfx__compile_shader(GL_FRAGMENT_SHADER, frag_shader);
|
||||
|
||||
state.prog = glCreateProgram();
|
||||
glAttachShader(state.prog, vert);
|
||||
glAttachShader(state.prog, frag);
|
||||
glLinkProgram(state.prog);
|
||||
int success = 0;
|
||||
char buf[512];
|
||||
glGetProgramiv(state.prog, GL_LINK_STATUS, &success);
|
||||
if (!success) {
|
||||
glGetShaderInfoLog(state.prog, arrlen(buf), NULL, buf);
|
||||
fatal("[program]: %s", buf);
|
||||
}
|
||||
|
||||
glDeleteShader(vert);
|
||||
glDeleteShader(frag);
|
||||
|
||||
glUseProgram(state.prog);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glUniform1i(glGetUniformLocation(state.prog, "tex"), 0);
|
||||
|
||||
glUseProgram(0);
|
||||
|
||||
state.model = obj_load(&state.arena, strv("assets/lil-house.obj"));
|
||||
state.model_id = glGetUniformLocation(state.prog, "model");
|
||||
state.view_id = glGetUniformLocation(state.prog, "view");
|
||||
state.proj_id = glGetUniformLocation(state.prog, "proj");
|
||||
|
||||
state.tex_id = gfx__load_texture(state.arena, strv("assets/tileset.png"));
|
||||
|
||||
state.cam = (camera_t){
|
||||
.pos = { 0, 0, 0, },
|
||||
.target = { 0, 0, -1, },
|
||||
.up = { 0, 1, 0, },
|
||||
};
|
||||
|
||||
// state.cam = (camera_t) {
|
||||
// .pos = v3_zero(),
|
||||
// .fwd = v3(0, 0, -1),
|
||||
// .up = v3(0, 1, 0),
|
||||
// };
|
||||
}
|
||||
|
||||
void frame(void) {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
int width = sapp_width();
|
||||
int height = sapp_height();
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
glUseProgram(state.prog);
|
||||
glBindTexture(GL_TEXTURE_2D, state.tex_id);
|
||||
static float t = 0.f;
|
||||
t += (float)sapp_frame_duration() * 100.f;
|
||||
float f = t; //(sinf(t) * 0.5 + 0.5) * 10.f;
|
||||
|
||||
mat4 model = GLM_MAT4_IDENTITY_INIT;
|
||||
vec3 rot = { 0, 1, 0 };
|
||||
vec3 model_trans = { 0, -4, -50 };
|
||||
vec3 model_scale = { 5, 5, 5 };
|
||||
glm_vec3_normalize(rot);
|
||||
glm_translate(model, model_trans);
|
||||
glm_rotate(model, glm_rad(f), rot);
|
||||
glm_scale(model, model_scale);
|
||||
|
||||
mat4 view = GLM_MAT4_IDENTITY_INIT;
|
||||
glm_lookat(state.cam.pos, state.cam.target, state.cam.up, view);
|
||||
vec3 trans = { 0, 0, -0.5 };
|
||||
glm_translate(view, trans);
|
||||
|
||||
mat4 proj = GLM_MAT4_IDENTITY_INIT;
|
||||
glm_perspective(glm_rad(45.f), sapp_widthf() / sapp_heightf(), 0.1f, 100.f, proj);
|
||||
|
||||
glUniformMatrix4fv(state.model_id, 1, GL_FALSE, (float*)model);
|
||||
glUniformMatrix4fv(state.view_id, 1, GL_FALSE, (float*)view);
|
||||
glUniformMatrix4fv(state.proj_id, 1, GL_FALSE, (float*)proj);
|
||||
|
||||
#if 0
|
||||
float fov = deg_to_rad(60.f);
|
||||
float aspect = sapp_widthf() / sapp_heightf();
|
||||
|
||||
vec3 model_translation = v3(0, -10, f);
|
||||
|
||||
mat4 model = m4_identity(); // m4_trans(model_translation);
|
||||
mat4 proj = m4_proj(pi * 4, aspect, 0.1f, 100.f);
|
||||
mat4 view = m4_identity(); // cam_lookat(&state.cam);
|
||||
|
||||
// mat4 mv = m4_mul(proj, view);
|
||||
// mat4 mvp = m4_mul(mv, model);
|
||||
|
||||
mat4 mv = m4_mul(view, model);
|
||||
mat4 mvp = m4_mul(proj, mv);
|
||||
|
||||
glUniformMatrix4fv(state.matrix_id, 1, GL_TRUE, mvp.data);
|
||||
#endif
|
||||
|
||||
for_each (mesh, state.model.meshes) {
|
||||
glBindVertexArray(mesh->vao);
|
||||
glDrawArrays(GL_TRIANGLES, 0, mesh->vcount);
|
||||
}
|
||||
glBindVertexArray(0);
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void event(const sapp_event *ev) {
|
||||
switch (ev->type) {
|
||||
case SAPP_EVENTTYPE_KEY_UP:
|
||||
switch (ev->key_code) {
|
||||
case SAPP_KEYCODE_Q:
|
||||
case SAPP_KEYCODE_ESCAPE:
|
||||
sapp_quit();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
camera_event(&state.cam, ev);
|
||||
}
|
||||
|
||||
void cleanup(void) {
|
||||
}
|
||||
|
||||
void sokol_log(const char* tag, uint32_t level, uint32_t id, const char* msg, uint32_t line, const char* fname, void* udata) {
|
||||
COLLA_UNUSED(id);
|
||||
COLLA_UNUSED(udata);
|
||||
os_log_level_e levels[] = { LOG_FATAL, LOG_ERR, LOG_WARN, LOG_INFO };
|
||||
os_log_print(levels[level], "%s: (%s:%d) %s", tag, fname, line, msg);
|
||||
}
|
||||
|
||||
sapp_desc sokol_main(int argc, char **argv) {
|
||||
return (sapp_desc) {
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.init_cb = init,
|
||||
.frame_cb = frame,
|
||||
.event_cb = event,
|
||||
.cleanup_cb = cleanup,
|
||||
.logger.func = sokol_log,
|
||||
.win32_console_attach = true,
|
||||
};
|
||||
}
|
||||
204
src/obj.c
Normal file
204
src/obj.c
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
#include "colla/colla.h"
|
||||
|
||||
#include "glad/glad.h"
|
||||
#include "cglm/include/cglm/cglm.h"
|
||||
#include "cglm/include/cglm/struct.h"
|
||||
// #include "vecmath.h"
|
||||
|
||||
#if 0
|
||||
ka: ambient
|
||||
kd: diffuse
|
||||
ks: specular
|
||||
ns: specular highlights
|
||||
ni: optical density
|
||||
d: dissolve
|
||||
illum: illumination model
|
||||
map_kd: color texture file
|
||||
#endif
|
||||
|
||||
typedef struct vertex_t vertex_t;
|
||||
struct vertex_t {
|
||||
vec3s pos;
|
||||
vec3s norm;
|
||||
vec3s col;
|
||||
vec2s uv;
|
||||
};
|
||||
|
||||
typedef struct material_t material_t;
|
||||
struct material_t {
|
||||
vec3s ambient;
|
||||
vec3s diffuse;
|
||||
vec3s specular;
|
||||
};
|
||||
|
||||
typedef struct mesh_t mesh_t;
|
||||
struct mesh_t {
|
||||
uint vbo, vao;
|
||||
int vcount;
|
||||
material_t *material;
|
||||
mesh_t *next;
|
||||
};
|
||||
|
||||
typedef struct model_t model_t;
|
||||
struct model_t {
|
||||
mesh_t *meshes;
|
||||
};
|
||||
|
||||
#define vec(T) struct { usize len, cap; T *items; }
|
||||
|
||||
#define vec_push(v, ...) \
|
||||
do { \
|
||||
if ((v)->len + 1 >= (v)->cap) { \
|
||||
(v)->cap = (v)->cap ? (v)->cap * 2 : 16; \
|
||||
void *new_items = os_alloc(sizeof(*((v)->items)) * (v)->cap); \
|
||||
memmove(new_items, (v)->items, sizeof(*((v)->items)) * (v)->len); \
|
||||
os_free((v)->items); \
|
||||
(v)->items = new_items; \
|
||||
} \
|
||||
(v)->items[(v)->len++] = (__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define vec_free(v) os_free((v)->items)
|
||||
|
||||
#define vec_resize(v, n) \
|
||||
do { \
|
||||
if ((v)->len < (n)) { \
|
||||
(v)->len = (n); \
|
||||
} \
|
||||
while ((v)->cap <= (v)->len) { \
|
||||
(v)->cap = (v)->cap ? (v)->cap * 2 : 16; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
model_t obj_load(arena_t *arena, strview_t filename) {
|
||||
model_t out = {0};
|
||||
|
||||
arena_t scratch = arena_make(ARENA_MALLOC, MB(1));
|
||||
str_t obj = os_file_read_all_str(&scratch, filename);
|
||||
instream_t in = istr_init(strv(obj));
|
||||
|
||||
vec(vec3s) positions = {0};
|
||||
vec(vec3s) normals = {0};
|
||||
vec(vec3s) colours = {0};
|
||||
vec(vec2s) texcoords = {0};
|
||||
|
||||
vec(vertex_t) verts = {0};
|
||||
|
||||
usize cur_v = 0;
|
||||
usize cur_n = 0;
|
||||
usize cur_t = 0;
|
||||
usize cur_c = 0;
|
||||
|
||||
#define vert_get(v, i) \
|
||||
do { \
|
||||
vec_resize(&verts, i + 1); \
|
||||
v = &verts.items[i]; \
|
||||
} while (0)
|
||||
|
||||
vec3s v = {0};
|
||||
vec2s t = {0};
|
||||
vec_push(&positions, v);
|
||||
vec_push(&normals, v);
|
||||
vec_push(&texcoords, t);
|
||||
|
||||
while (!istr_is_finished(&in)) {
|
||||
strview_t line_str = strv_trim(istr_get_line(&in));
|
||||
instream_t line = istr_init(line_str);
|
||||
strview_t type = istr_get_view(&line, ' ');
|
||||
#define IS(v) strv_equals(type, strv(v))
|
||||
|
||||
if (type.len == 0) {
|
||||
continue;
|
||||
}
|
||||
if (IS("#")) {
|
||||
continue;
|
||||
}
|
||||
// position
|
||||
else if (IS("v")) {
|
||||
istr_get_float(&line, &v.x);
|
||||
istr_skip_whitespace(&line);
|
||||
istr_get_float(&line, &v.y);
|
||||
istr_skip_whitespace(&line);
|
||||
istr_get_float(&line, &v.z);
|
||||
vec_push(&positions, v);
|
||||
}
|
||||
// normal
|
||||
else if (IS("vn")) {
|
||||
istr_get_float(&line, &v.x);
|
||||
istr_skip_whitespace(&line);
|
||||
istr_get_float(&line, &v.y);
|
||||
istr_skip_whitespace(&line);
|
||||
istr_get_float(&line, &v.z);
|
||||
vec_push(&normals, v);
|
||||
}
|
||||
// tex coord
|
||||
else if (IS("vt")) {
|
||||
istr_get_float(&line, &t.u);
|
||||
istr_skip_whitespace(&line);
|
||||
istr_get_float(&line, &t.v);
|
||||
vec_push(&texcoords, t);
|
||||
}
|
||||
// triangle
|
||||
else if (IS("f")) {
|
||||
int vid, tid, nid;
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
istr_get_i32(&line, &vid);
|
||||
istr_skip(&line, 1);
|
||||
istr_get_i32(&line, &tid);
|
||||
istr_skip(&line, 1);
|
||||
istr_get_i32(&line, &nid);
|
||||
istr_skip(&line, 1);
|
||||
|
||||
vec_push(&verts, (vertex_t){
|
||||
.pos = positions.items[vid],
|
||||
.norm = normals.items[nid],
|
||||
.uv = texcoords.items[tid],
|
||||
});
|
||||
}
|
||||
}
|
||||
// material name
|
||||
else if (IS("usemtl")) {
|
||||
// TODO
|
||||
}
|
||||
// material file
|
||||
else if (IS("mtllib")) {
|
||||
// TODO: parse mtl
|
||||
}
|
||||
}
|
||||
|
||||
uint vbo, vao;
|
||||
|
||||
glGenBuffers(1, &vbo);
|
||||
glGenVertexArrays(1, &vao);
|
||||
|
||||
glBindVertexArray(vao);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_t) * verts.len, verts.items, GL_STATIC_DRAW);
|
||||
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (void*)offsetof(vertex_t, pos));
|
||||
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (void*)offsetof(vertex_t, norm));
|
||||
glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (void*)offsetof(vertex_t, col));
|
||||
glVertexAttribPointer(3, 2, GL_FLOAT, GL_FALSE, sizeof(vertex_t), (void*)offsetof(vertex_t, uv));
|
||||
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
glEnableVertexAttribArray(2);
|
||||
glEnableVertexAttribArray(3);
|
||||
|
||||
glBindVertexArray(0);
|
||||
|
||||
mesh_t *m = alloc(arena, mesh_t);
|
||||
m->vao = vao;
|
||||
m->vbo = vbo;
|
||||
m->vcount = verts.len;
|
||||
|
||||
out.meshes = m;
|
||||
|
||||
arena_cleanup(&scratch);
|
||||
vec_free(&positions);
|
||||
vec_free(&normals);
|
||||
vec_free(&verts);
|
||||
|
||||
return out;
|
||||
}
|
||||
13186
src/sokol/sokol_app.h
Normal file
13186
src/sokol/sokol_app.h
Normal file
File diff suppressed because it is too large
Load diff
7988
src/stb/stb_image.h
Normal file
7988
src/stb/stb_image.h
Normal file
File diff suppressed because it is too large
Load diff
1764
src/tinyobjloader/tinyobjloader.h
Normal file
1764
src/tinyobjloader/tinyobjloader.h
Normal file
File diff suppressed because it is too large
Load diff
314
src/vecmath.h
Normal file
314
src/vecmath.h
Normal file
|
|
@ -0,0 +1,314 @@
|
|||
#pragma once
|
||||
|
||||
// defines MIN/MAX
|
||||
#include "colla/colla.h"
|
||||
#include <math.h>
|
||||
|
||||
#define pi 3.14159265359f
|
||||
#define pi2 6.28318530718f
|
||||
|
||||
#define d2r_mul 0.0314159265359f
|
||||
#define r2d_mul 31.8309886184f
|
||||
|
||||
#define deg_to_rad(deg) ((deg) * d2r_mul)
|
||||
#define rad_to_deg(rad) ((rad) * r2d_mul)
|
||||
|
||||
typedef union vec2 vec2;
|
||||
typedef union vec3 vec3;
|
||||
typedef union vec4 vec4;
|
||||
typedef union mat3 mat3;
|
||||
typedef union mat4 mat4;
|
||||
typedef union mat3x4 mat3x4;
|
||||
|
||||
union vec2 {
|
||||
float data[2];
|
||||
struct { float x, y; };
|
||||
struct { float u, v; };
|
||||
};
|
||||
|
||||
union vec3 {
|
||||
float data[3];
|
||||
struct { float x, y, z; };
|
||||
struct { float r, g, b; };
|
||||
};
|
||||
|
||||
union vec4 {
|
||||
float data[4];
|
||||
struct { float x, y, z, w; };
|
||||
struct { vec3 v3; float v4; };
|
||||
struct { vec2 pos, size; };
|
||||
};
|
||||
|
||||
union mat3 {
|
||||
float data[9];
|
||||
vec3 cols[3];
|
||||
struct {
|
||||
float m00, m01, m02;
|
||||
float m10, m11, m12;
|
||||
float m20, m21, m22;
|
||||
};
|
||||
};
|
||||
|
||||
union mat4 {
|
||||
float data[16];
|
||||
vec4 cols[4];
|
||||
struct {
|
||||
float m00, m01, m02, m03;
|
||||
float m10, m11, m12, m13;
|
||||
float m20, m21, m22, m23;
|
||||
float m30, m31, m32, m33;
|
||||
};
|
||||
};
|
||||
|
||||
union mat3x4 {
|
||||
float data[12];
|
||||
vec4 cols[3];
|
||||
struct {
|
||||
float m00, m01, m02;
|
||||
float m10, m11, m12;
|
||||
float m20, m21, m22;
|
||||
float m30, m31, m32;
|
||||
};
|
||||
};
|
||||
|
||||
// vec2
|
||||
|
||||
#define v2(vx, vy) (vec2) { .x = (vx), .y = (vy) }
|
||||
#define v2_zero() v2(0, 0)
|
||||
#define v2_value(v) v2(v, v)
|
||||
|
||||
#define v2_add(a, b) v2((a).x + (b).x, (a).y + (b).y)
|
||||
#define v2_sub(a, b) v2((a).x - (b).x, (a).y - (b).y)
|
||||
#define v2_mul(a, b) v2((a).x * (b).x, (a).y * (b).y)
|
||||
#define v2_div(a, b) v2((a).x / (b).x, (a).y / (b).y)
|
||||
|
||||
#define v2_add_val(vec, val) v2((vec).x + val, (vec).y + val)
|
||||
#define v2_sub_val(vec, val) v2((vec).x - val, (vec).y - val)
|
||||
#define v2_mul_val(vec, val) v2((vec).x * val, (vec).y * val)
|
||||
#define v2_div_val(vec, val) v2((vec).x / val, (vec).y / val)
|
||||
|
||||
#define v2_mag2(v) (((v).x * (v).x) + ((v).y * (v).y))
|
||||
#define v2_mag(v) sqrtf(v2_mag2(v))
|
||||
#define v2_dot(a, b) (((a).x * (b).x) + ((a).y * (b).y))
|
||||
|
||||
inline vec2 v2_norm(vec2 v) {
|
||||
float mag = v2_mag(v);
|
||||
return mag ? v2_div_val(v, mag) : v;
|
||||
}
|
||||
|
||||
#define v2_clamp(vmin, vmax, v) v2(MIN(MAX((v).x, (vmin).x), (vmax).x), MIN(MAX((v).y, (vmin).y), (vmax).y))
|
||||
#define v2_clamp_val(vmin, vmax, v) v2(MIN(MAX((v).x, (vmin)), (vmax)), MIN(MAX((v).y, (vmin)), (vmax)))
|
||||
|
||||
// vec3
|
||||
|
||||
#define v3(vx, vy, vz) (vec3) { .x = (vx), .y = (vy), .z = (vz) }
|
||||
#define v3_zero() v3(0, 0, 0)
|
||||
#define v3_value(v) v3(v, v, v)
|
||||
|
||||
#define v3_add(a, b) v3((a).x + (b).x, (a).y + (b).y, (a).z + (b).z)
|
||||
#define v3_sub(a, b) v3((a).x - (b).x, (a).y - (b).y, (a).z - (b).z)
|
||||
#define v3_mul(a, b) v3((a).x * (b).x, (a).y * (b).y, (a).z * (b).z)
|
||||
#define v3_div(a, b) v3((a).x / (b).x, (a).y / (b).y, (a).z / (b).z)
|
||||
|
||||
#define v3_add_val(vec, val) v3((vec).x + val, (vec).y + val, (vec).z + val)
|
||||
#define v3_sub_val(vec, val) v3((vec).x - val, (vec).y - val, (vec).z - val)
|
||||
#define v3_mul_val(vec, val) v3((vec).x * val, (vec).y * val, (vec).z * val)
|
||||
#define v3_div_val(vec, val) v3((vec).x / val, (vec).y / val, (vec).z / val)
|
||||
|
||||
#define v3_mag2(v) (((v).x * (v).x) + ((v).y * (v).y) + ((v).z * (v).z))
|
||||
#define v3_mag(v) sqrtf(v3_mag2(v))
|
||||
#define v3_dot(a, b) (((a).x * (b).x) + ((a).y * (b).y) + ((a).z * (b).z))
|
||||
#define v3_cross(a, b) v3( \
|
||||
(a).y * (b).z - (a).z * (b).y,\
|
||||
(a).z * (b).x - (a).x * (b).z,\
|
||||
(a).x * (b).y - (a).y * (b).x \
|
||||
)
|
||||
|
||||
inline vec3 v3_norm(vec3 v) {
|
||||
float mag = v3_mag(v);
|
||||
return mag ? v3_div_val(v, mag) : v;
|
||||
}
|
||||
|
||||
#define v3_clamp(vmin, vmax, v) v3(MIN(MAX((v).x, (vmin).x), (vmax).x), MIN(MAX((v).y, (vmin).y), (vmax).y), MIN(MAX((v).z, (vmin).z), (vmax).z))
|
||||
#define v3_clamp_val(vmin, vmax, v) v3(MIN(MAX((v).x, (vmin)), (vmax)), MIN(MAX((v).y, (vmin)), (vmax)), MIN(MAX((v).z, (vmin)), (vmax)))
|
||||
|
||||
// vec4
|
||||
|
||||
#define v4(vx, vy, vz, vw) (vec4) { .x = (vx), .y = (vy), .z = (vz), .w = (vw) }
|
||||
#define v4_zero() v4(0, 0, 0, 0)
|
||||
#define v4_value(v) v4(v, v, v, v)
|
||||
|
||||
#define v4_add(a, b) v4((a).x + (b).x, (a).y + (b).y, (a).z + (b).z, (a).w + (b).w)
|
||||
#define v4_sub(a, b) v4((a).x - (b).x, (a).y - (b).y, (a).z - (b).z, (a).w - (b).w)
|
||||
#define v4_mul(a, b) v4((a).x * (b).x, (a).y * (b).y, (a).z * (b).z, (a).w * (b).w)
|
||||
#define v4_div(a, b) v4((a).x / (b).x, (a).y / (b).y, (a).z / (b).z, (a).w / (b).w)
|
||||
|
||||
#define v4_add_val(vec, val) v4((vec).x + val, (vec).y + val, (vec).z + val, (vec).w + val)
|
||||
#define v4_sub_val(vec, val) v4((vec).x - val, (vec).y - val, (vec).z - val, (vec).w - val)
|
||||
#define v4_mul_val(vec, val) v4((vec).x * val, (vec).y * val, (vec).z * val, (vec).w * val)
|
||||
#define v4_div_val(vec, val) v4((vec).x / val, (vec).y / val, (vec).z / val, (vec).w / val)
|
||||
|
||||
#define v4_mag2(v) (((v).x * (v).x) + ((v).y * (v).y) + ((v).z * (v).z) + ((v).w * (v).w))
|
||||
#define v4_mag(v) sqrtf(v4_mag2(v))
|
||||
#define v4_dot(a, b) (((a).x * (b).x) + ((a).y * (b).y) + ((a).z * (b).z) + ((a).w * (b).w))
|
||||
|
||||
inline vec4 v4_norm(vec4 v) {
|
||||
float mag = v4_mag(v);
|
||||
return mag ? v4_div_val(v, mag) : v;
|
||||
}
|
||||
|
||||
#define v4_clamp(vmin, vmax, v) v4(MIN(MAX((v).x, (vmin).x), (vmax).x), MIN(MAX((v).y, (vmin).y), (vmax).y), MIN(MAX((v).z, (vmin).z), (vmax).z), MIN(MAX((v).w, (vmin).w), (vmax).w))
|
||||
#define v4_clamp_val(vmin, vmax, v) v4(MIN(MAX((v).x, (vmin)), (vmax)), MIN(MAX((v).y, (vmin)), (vmax)), MIN(MAX((v).z, (vmin)), (vmax)), MIN(MAX((v).w, (vmin)), (vmax)))
|
||||
|
||||
// mat3
|
||||
|
||||
#define m3(...) (mat3) { __VA_ARGS__ }
|
||||
|
||||
#define m3_identity() m3( \
|
||||
1, 0, 0, \
|
||||
0, 1, 0, \
|
||||
0, 0, 1, \
|
||||
)
|
||||
|
||||
#define m3_mul(a, b) m3( \
|
||||
(a).m00 * (b).m00 + (a).m01 * (b).m10 + (a).m02 * (b).m20, \
|
||||
(a).m00 * (b).m01 + (a).m01 * (b).m11 + (a).m02 * (b).m21, \
|
||||
(a).m00 * (b).m02 + (a).m01 * (b).m12 + (a).m02 * (b).m22, \
|
||||
\
|
||||
(a).m10 * (b).m00 + (a).m11 * (b).m10 + (a).m12 * (b).m20, \
|
||||
(a).m10 * (b).m01 + (a).m11 * (b).m11 + (a).m12 * (b).m21, \
|
||||
(a).m10 * (b).m02 + (a).m11 * (b).m12 + (a).m12 * (b).m22, \
|
||||
\
|
||||
(a).m20 * (b).m00 + (a).m21 * (b).m10 + (a).m22 * (b).m20, \
|
||||
(a).m20 * (b).m01 + (a).m21 * (b).m11 + (a).m22 * (b).m21, \
|
||||
(a).m20 * (b).m02 + (a).m21 * (b).m12 + (a).m22 * (b).m22, \
|
||||
)
|
||||
|
||||
#define m3_mul_v3(m, v) v3( \
|
||||
(m).m00 * (v).x + (m).m01 * (v).y + (m).m02 * (v).z, \
|
||||
(m).m10 * (v).x + (m).m11 * (v).y + (m).m12 * (v).z, \
|
||||
(m).m20 * (v).x + (m).m21 * (v).y + (m).m22 * (v).z \
|
||||
)
|
||||
|
||||
// mat4
|
||||
|
||||
#define m4(...) (mat4) { __VA_ARGS__ }
|
||||
|
||||
#define m4_identity() m4( \
|
||||
1, 0, 0, 0, \
|
||||
0, 1, 0, 0, \
|
||||
0, 0, 1, 0, \
|
||||
0, 0, 0, 1, \
|
||||
)
|
||||
|
||||
#define m4_scale(s) m4( \
|
||||
(s.x), 0, 0, 0, \
|
||||
0, (s.y), 0, 0, \
|
||||
0, 0, (s.z), 0, \
|
||||
0, 0, 0, 1, \
|
||||
)
|
||||
|
||||
#define m4_scale_val(s) m4( \
|
||||
(s), 0, 0, 0, \
|
||||
0, (s), 0, 0, \
|
||||
0, 0, (s), 0, \
|
||||
0, 0, 0, 1, \
|
||||
)
|
||||
|
||||
#define m4_trans(t) m4( \
|
||||
1, 0, 0, (t).x, \
|
||||
0, 1, 0, (t).y, \
|
||||
0, 0, 1, (t).z, \
|
||||
0, 0, 0, 1, \
|
||||
)
|
||||
|
||||
inline mat4 m4_rotx(float angle) {
|
||||
float c = cosf(angle);
|
||||
float s = sinf(angle);
|
||||
return m4(
|
||||
1, 0, 0, 0,
|
||||
0, c, -s, 0,
|
||||
0, s, c, 0,
|
||||
0, 0, 0, 1,
|
||||
);
|
||||
}
|
||||
|
||||
inline mat4 m4_roty(float angle) {
|
||||
float c = cosf(angle);
|
||||
float s = sinf(angle);
|
||||
return m4(
|
||||
c, 0, s, 0,
|
||||
0, 1, 0, 0,
|
||||
-s, 0, c, 0,
|
||||
0, 0, 0, 1,
|
||||
);
|
||||
}
|
||||
|
||||
inline mat4 m4_rotz(float angle) {
|
||||
float c = cosf(angle);
|
||||
float s = sinf(angle);
|
||||
return m4(
|
||||
c, -s, 0, 0,
|
||||
s, c, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1,
|
||||
);
|
||||
}
|
||||
|
||||
inline mat4 m4_proj(float fovy, float aspect, float znear, float zfar) {
|
||||
float f = 1.f / tanf(fovy * 0.5f);
|
||||
float nf = 1.f / (znear - zfar);
|
||||
|
||||
mat4 out = m4_identity();
|
||||
|
||||
out.m00 = f / aspect;
|
||||
out.m11 = f;
|
||||
out.m22 = (znear + zfar) * nf;
|
||||
out.m23 = -1.f;
|
||||
out.m33 = 2.f * znear * zfar * nf;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
inline mat4 m4_perspective(float fov_rad, float aspect, float zn, float zf) {
|
||||
float f = 1.f / tanf(fov_rad * 0.5f);
|
||||
float nf = 1.f / (zn - zf);
|
||||
|
||||
return m4(
|
||||
f / aspect, 0, 0, 0,
|
||||
0, f, 0, 0,
|
||||
0, 0, (zf+zn) * nf, (zf * zn * 2) * nf,
|
||||
0, 0, -1, 0,
|
||||
);
|
||||
}
|
||||
|
||||
#define m4_mul(a, b) m4( \
|
||||
/* row 0 */ \
|
||||
(a).m00 * (b).m00 + (a).m01 * (b).m10 + (a).m02 * (b).m20 + (a).m03 * (b).m30, \
|
||||
(a).m00 * (b).m01 + (a).m01 * (b).m11 + (a).m02 * (b).m21 + (a).m03 * (b).m31, \
|
||||
(a).m00 * (b).m02 + (a).m01 * (b).m12 + (a).m02 * (b).m22 + (a).m03 * (b).m32, \
|
||||
(a).m00 * (b).m03 + (a).m01 * (b).m13 + (a).m02 * (b).m23 + (a).m03 * (b).m33, \
|
||||
/* row 1 */ \
|
||||
(a).m10 * (b).m00 + (a).m11 * (b).m10 + (a).m12 * (b).m20 + (a).m13 * (b).m30, \
|
||||
(a).m10 * (b).m01 + (a).m11 * (b).m11 + (a).m12 * (b).m21 + (a).m13 * (b).m31, \
|
||||
(a).m10 * (b).m02 + (a).m11 * (b).m12 + (a).m12 * (b).m22 + (a).m13 * (b).m32, \
|
||||
(a).m10 * (b).m03 + (a).m11 * (b).m13 + (a).m12 * (b).m23 + (a).m13 * (b).m33, \
|
||||
/* row 2 */ \
|
||||
(a).m20 * (b).m00 + (a).m21 * (b).m10 + (a).m22 * (b).m20 + (a).m23 * (b).m30, \
|
||||
(a).m20 * (b).m01 + (a).m21 * (b).m11 + (a).m22 * (b).m21 + (a).m23 * (b).m31, \
|
||||
(a).m20 * (b).m02 + (a).m21 * (b).m12 + (a).m22 * (b).m22 + (a).m23 * (b).m32, \
|
||||
(a).m20 * (b).m03 + (a).m21 * (b).m13 + (a).m22 * (b).m23 + (a).m23 * (b).m33, \
|
||||
/* row 3 */ \
|
||||
(a).m30 * (b).m00 + (a).m31 * (b).m10 + (a).m32 * (b).m20 + (a).m33 * (b).m30, \
|
||||
(a).m30 * (b).m01 + (a).m31 * (b).m11 + (a).m32 * (b).m21 + (a).m33 * (b).m31, \
|
||||
(a).m30 * (b).m02 + (a).m31 * (b).m12 + (a).m32 * (b).m22 + (a).m33 * (b).m32, \
|
||||
(a).m30 * (b).m03 + (a).m31 * (b).m13 + (a).m32 * (b).m23 + (a).m33 * (b).m33, \
|
||||
)
|
||||
|
||||
#define m4_mul_v4(m, v) v4( \
|
||||
(m).m00 * (v).x + (m).m01 * (v).y + (m).m02 * (v).z + (m).m03 * (v).w, \
|
||||
(m).m10 * (v).x + (m).m11 * (v).y + (m).m12 * (v).z + (m).m13 * (v).w, \
|
||||
(m).m20 * (v).x + (m).m21 * (v).y + (m).m22 * (v).z + (m).m23 * (v).w, \
|
||||
(m).m30 * (v).x + (m).m31 * (v).y + (m).m32 * (v).z + (m).m33 * (v).w \
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue