shithub: tinygl

Download patch

ref: 155aaa1821874e9f56d2ee672713bb27bad8e43a
parent: cbd8813fdc7ad789ad1a349c8e2765467d6e3371
author: David <gek@katherine>
date: Sat Feb 13 08:32:48 EST 2021

New demo and bug fixes

--- a/README.md
+++ b/README.md
@@ -27,6 +27,10 @@
 NEW FUNCTIONS
 ###
 
+### glDeleteList
+
+Replaces glDeleteLists. Allows you to delete display lists.
+
 ### glSetEnableSpecular(int shouldenablespecular);
 
 Allows you to configure specular rendering. Turn it off
--- a/src/SDL_Examples/Makefile
+++ b/src/SDL_Examples/Makefile
@@ -2,11 +2,13 @@
 CFLAGS = -g -Wall -O3
 GL_LIBS= -L../ 
 GL_INCLUDES= -I../include/
-ALL_T= gears texture
+ALL_T= gears texture model
 all: $(ALL_T)
 clean:
 	rm -f $(ALL_T)
 texture:
 	gcc texture.c ../libTinyGL.a -o texture $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
+model:
+	gcc model.c ../libTinyGL.a -o model $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
 gears:
 	gcc gears.c ../libTinyGL.a -o gears $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
--- /dev/null
+++ b/src/SDL_Examples/extrude.obj
@@ -1,0 +1,783 @@
+# Blender v2.79 (sub 0) GK OBJ File: ''
+# www.blender.org
+o Cube_Cube.001
+v 0.811661 2.216974 -1.931772
+v 2.323689 2.216974 -1.931772
+v 0.913664 1.000000 -2.797861
+v 0.913664 1.000000 -0.797861
+v 0.811661 1.818548 -0.777435
+v 2.323689 1.818548 -0.777435
+v 2.221686 1.000000 -2.797861
+v 2.221686 1.000000 -0.797861
+v 0.811661 2.415470 -0.585981
+v 2.323689 2.415470 -0.585981
+v 2.323689 3.048750 -1.630104
+v 0.811661 3.048750 -1.630104
+v 0.811661 2.857485 -0.399356
+v 2.323689 2.857485 -0.399356
+v 2.323689 3.902826 -1.030624
+v 0.811661 3.902826 -1.030624
+v 0.811661 3.382273 0.450644
+v 2.323689 3.382273 0.450644
+v 2.323689 4.523608 0.016371
+v 0.811661 4.523608 0.016371
+v 0.811661 3.755768 1.258112
+v 2.323689 3.755768 1.258112
+v 2.323689 4.971911 1.368714
+v 0.811661 4.971911 1.368714
+v 0.811661 3.820066 1.627031
+v 2.323689 3.820066 1.627031
+v 2.323689 5.038886 1.702634
+v 0.811661 5.038886 1.702634
+v 0.567675 4.009006 3.436100
+v 2.567675 4.009006 3.436100
+v 2.567675 4.625515 3.511703
+v 0.567675 4.625515 3.511703
+v -1.689306 1.000000 -0.797861
+v -1.689306 1.000000 -2.797861
+v 4.669999 1.000000 -0.797861
+v 4.669999 1.000000 -2.797861
+v -4.908812 3.820066 1.627031
+v -4.908812 5.038886 1.702634
+v -5.152798 4.009006 3.436100
+v -5.152798 4.625515 3.511703
+v -3.897536 5.038886 1.702634
+v -4.141521 4.625515 3.511703
+v -4.141521 4.009006 3.436100
+v -3.897536 3.820066 1.627031
+v -4.759183 2.884075 -0.275725
+v -4.759183 3.672287 -0.619190
+v -4.047164 3.672287 -0.619190
+v -4.047164 2.884075 -0.275725
+v -4.759183 2.380524 -0.821642
+v -4.759183 2.971745 -1.445905
+v -4.047164 2.971745 -1.445905
+v -4.047164 2.380524 -0.821642
+v -4.759183 1.764819 -1.533181
+v -4.759183 1.839585 -2.389719
+v -4.047164 1.839585 -2.389719
+v -4.047164 1.764819 -1.533181
+v -4.750454 0.000815 -1.522121
+v -4.750454 -0.000815 -2.381914
+v -4.038435 -0.000815 -2.381914
+v -4.038435 0.000815 -1.522121
+v 0.811661 -2.216974 -1.931772
+v 2.323689 -2.216974 -1.931772
+v 0.913664 -1.000000 -2.797861
+v 0.913664 -1.000000 -0.797861
+v 0.811661 -1.818548 -0.777435
+v 2.323689 -1.818548 -0.777435
+v 2.221686 -1.000000 -2.797861
+v 2.221686 -1.000000 -0.797861
+v 0.702598 -0.000000 -2.797861
+v 0.702598 -0.000000 -0.797861
+v 2.432752 -0.000000 -2.797861
+v 2.432752 -0.000000 -0.797861
+v 0.811661 -2.415470 -0.585981
+v 2.323689 -2.415470 -0.585981
+v 2.323689 -3.048750 -1.630104
+v 0.811661 -3.048750 -1.630104
+v 0.811661 -2.857485 -0.399356
+v 2.323689 -2.857485 -0.399356
+v 2.323689 -3.902826 -1.030624
+v 0.811661 -3.902826 -1.030624
+v 0.811661 -3.382273 0.450644
+v 2.323689 -3.382273 0.450644
+v 2.323689 -4.523608 0.016371
+v 0.811661 -4.523608 0.016371
+v 0.811661 -3.755768 1.258112
+v 2.323689 -3.755768 1.258112
+v 2.323689 -4.971911 1.368714
+v 0.811661 -4.971911 1.368714
+v 0.811661 -3.820066 1.627031
+v 2.323689 -3.820066 1.627031
+v 2.323689 -5.038886 1.702634
+v 0.811661 -5.038886 1.702634
+v 0.567675 -4.009006 3.436100
+v 2.567675 -4.009006 3.436100
+v 2.567675 -4.625515 3.511703
+v 0.567675 -4.625515 3.511703
+v -1.900373 -0.000000 -0.797861
+v -1.689306 -1.000000 -0.797861
+v -1.689306 -1.000000 -2.797861
+v -1.900373 -0.000000 -2.797861
+v 4.669999 -1.000000 -0.797861
+v 4.669999 -1.000000 -2.797861
+v 4.881065 -0.000000 -2.797861
+v 4.881065 -0.000000 -0.797861
+v -4.908812 -3.820066 1.627031
+v -4.908812 -5.038886 1.702634
+v -5.152798 -4.009006 3.436100
+v -5.152798 -4.625515 3.511703
+v -3.897536 -5.038886 1.702634
+v -4.141521 -4.625515 3.511703
+v -4.141521 -4.009006 3.436100
+v -3.897536 -3.820066 1.627031
+v -4.759183 -2.884075 -0.275725
+v -4.759183 -3.672287 -0.619190
+v -4.047164 -3.672287 -0.619190
+v -4.047164 -2.884075 -0.275725
+v -4.759183 -2.380524 -0.821642
+v -4.759183 -2.971745 -1.445905
+v -4.047164 -2.971745 -1.445905
+v -4.047164 -2.380524 -0.821642
+v -4.759183 -1.764819 -1.533181
+v -4.759183 -1.839585 -2.389719
+v -4.047164 -1.839585 -2.389719
+v -4.047164 -1.764819 -1.533181
+v -4.750454 -0.000815 -1.522121
+v -4.750454 0.000815 -2.381914
+v -4.038435 0.000815 -2.381914
+v -4.038435 -0.000815 -1.522121
+vt 0.116078 0.195390
+vt 0.003566 0.233215
+vt 0.093830 0.153009
+vt 0.683870 0.515694
+vt 0.673216 0.592166
+vt 0.646814 0.564297
+vt 0.867370 0.632098
+vt 0.792173 0.642462
+vt 0.837491 0.608786
+vt 0.614913 0.731559
+vt 0.655559 0.780280
+vt 0.600589 0.770763
+vt 0.104555 0.063245
+vt 0.139188 0.112705
+vt 0.654065 0.478435
+vt 0.372768 0.855137
+vt 0.283223 0.971167
+vt 0.283223 0.855137
+vt 0.690302 0.722826
+vt 0.621117 0.661017
+vt 0.648857 0.801928
+vt 0.595903 0.819973
+vt 0.052122 0.109836
+vt 0.079200 0.032479
+vt 0.820331 0.585014
+vt 0.716051 0.535983
+vt 0.694577 0.609725
+vt 0.753229 0.561397
+vt 0.811728 0.518439
+vt 0.808809 0.565679
+vt 0.026767 0.079070
+vt 0.052433 0.000000
+vt 0.769183 0.607989
+vt 0.737412 0.553542
+vt 0.710394 0.622728
+vt 0.757779 0.503912
+vt 0.819155 0.476992
+vt 0.453732 0.720214
+vt 0.416888 0.648556
+vt 0.453732 0.648556
+vt 0.662639 0.847049
+vt 0.613642 0.874631
+vt 0.525598 0.282667
+vt 0.566973 0.354325
+vt 0.525598 0.354325
+vt 0.647079 0.932530
+vt 0.690302 0.899133
+vt 0.656636 0.945256
+vt 0.416888 0.720214
+vt 0.381450 0.648556
+vt 0.679454 0.885422
+vt 0.566973 0.282667
+vt 0.623547 0.354325
+vt 0.783139 0.424619
+vt 0.867370 0.385721
+vt 0.826506 0.460973
+vt 0.623547 0.282667
+vt 0.637904 0.354325
+vt 0.776812 0.439359
+vt 0.381450 0.720214
+vt 0.364887 0.648556
+vt 1.000000 0.636993
+vt 0.971862 0.731777
+vt 0.971862 0.636993
+vt 0.364887 0.720214
+vt 0.283223 0.636993
+vt 0.722564 0.047926
+vt 0.637904 0.011563
+vt 0.722564 0.000000
+vt 0.637904 0.282667
+vt 0.722564 0.365888
+vt 0.418409 0.855137
+vt 0.464050 0.950083
+vt 0.418409 0.949906
+vt 0.605050 0.542724
+vt 0.573074 0.661017
+vt 0.531310 0.639444
+vt 0.463781 0.731777
+vt 0.374236 0.855137
+vt 0.374236 0.731777
+vt 0.842774 0.737970
+vt 0.888415 0.832563
+vt 0.842774 0.832739
+vt 0.753229 0.424721
+vt 0.176075 0.142078
+vt 0.224089 0.037264
+vt 0.260975 0.066637
+vt 0.885473 0.666618
+vt 0.971862 0.700026
+vt 0.952136 0.721168
+vt 0.971862 0.413815
+vt 1.000000 0.365888
+vt 1.000000 0.413815
+vt 0.637904 0.059489
+vt 0.546062 0.018654
+vt 0.283223 0.413815
+vt 0.364887 0.377451
+vt 0.364887 0.425378
+vt 0.690302 0.884195
+vt 0.746022 0.661017
+vt 0.746022 0.884195
+vt 0.722564 0.271104
+vt 0.905206 0.529431
+vt 0.868548 0.488899
+vt 0.907439 0.494313
+vt 0.083954 0.739355
+vt 0.009088 0.812575
+vt 0.051213 0.692521
+vt 0.926589 0.627545
+vt 0.867370 0.540234
+vt 0.448199 0.418287
+vt 0.000336 0.863114
+vt 0.032322 0.909866
+vt 0.000000 0.932963
+vt 0.044073 0.831031
+vt 0.255745 0.692598
+vt 0.223168 0.728936
+vt 0.223248 0.692521
+vt 0.448199 0.384543
+vt 0.471280 0.418287
+vt 0.468863 0.868634
+vt 0.501359 0.952068
+vt 0.468863 0.952235
+vt 0.255665 0.729013
+vt 0.223041 0.786204
+vt 0.471280 0.384543
+vt 0.501504 0.418287
+vt 0.908906 0.449750
+vt 0.947273 0.365888
+vt 0.971862 0.397636
+vt 0.053737 1.000000
+vt 0.255539 0.786281
+vt 0.223248 0.873077
+vt 0.062701 0.304969
+vt 0.152964 0.224763
+vt 0.543064 0.485176
+vt 0.612301 0.456862
+vt 0.575245 0.505465
+vt 0.836704 0.077282
+vt 0.761507 0.066918
+vt 0.783879 0.000000
+vt 0.520514 0.874714
+vt 0.561160 0.825992
+vt 0.572306 0.853353
+vt 0.235654 0.222321
+vt 0.198323 0.184458
+vt 0.753229 0.832739
+vt 0.844243 0.948770
+vt 0.753229 0.948770
+vt 0.595903 0.883447
+vt 0.526718 0.945256
+vt 0.506190 0.835509
+vt 0.554458 0.804345
+vt 0.259485 0.251238
+vt 0.183221 0.268912
+vt 0.789666 0.124365
+vt 0.806826 0.100593
+vt 0.521703 0.467617
+vt 0.585899 0.428993
+vt 0.781063 0.190941
+vt 0.722564 0.147983
+vt 0.778144 0.143701
+vt 0.283223 0.280042
+vt 0.207052 0.297828
+vt 0.738518 0.101390
+vt 0.505886 0.454615
+vt 0.564538 0.411434
+vt 0.788489 0.232387
+vt 0.727113 0.205468
+vt 0.422443 0.083221
+vt 0.465151 0.011563
+vt 0.465151 0.083221
+vt 0.501504 0.786300
+vt 0.568241 0.759223
+vt 0.159417 0.680958
+vt 0.209235 0.609300
+vt 0.209235 0.680958
+vt 0.552680 0.673743
+vt 0.595903 0.707140
+vt 0.585055 0.720851
+vt 0.382981 0.083221
+vt 0.422443 0.011563
+vt 0.519244 0.731641
+vt 0.096308 0.680958
+vt 0.159417 0.609300
+vt 0.836704 0.323659
+vt 0.752474 0.284760
+vt 0.795840 0.248406
+vt 0.080878 0.680958
+vt 0.096308 0.609300
+vt 0.746147 0.270020
+vt 0.365894 0.083221
+vt 0.382981 0.011563
+vt 0.259530 0.692521
+vt 0.231392 0.597737
+vt 0.259530 0.597737
+vt 0.283223 0.094784
+vt 0.365894 0.011563
+vt 0.000000 0.374559
+vt 0.080878 0.338195
+vt 0.080878 0.386122
+vt 0.000000 0.692521
+vt 0.080878 0.609300
+vt 0.372768 0.950083
+vt 0.753229 0.709380
+vt 0.842774 0.832739
+vt 0.753229 0.832739
+vt 0.501504 0.602185
+vt 0.374236 0.855137
+vt 0.283223 0.731777
+vt 0.374236 0.731777
+vt 0.934056 0.737970
+vt 0.934056 0.832739
+vt 0.681660 0.365888
+vt 0.283223 0.109018
+vt 0.933787 0.948770
+vt 0.844243 0.832739
+vt 0.933787 0.832739
+vt 0.854808 0.054550
+vt 0.941196 0.021141
+vt 0.895923 0.093622
+vt 0.231392 0.326632
+vt 0.259530 0.374559
+vt 0.231392 0.374559
+vt 0.191319 0.345286
+vt 0.365894 0.354325
+vt 0.283223 0.317962
+vt 0.365894 0.306399
+vt 0.167909 0.692521
+vt 0.223041 0.915699
+vt 0.167909 0.915699
+vt 0.000000 0.597737
+vt 0.874541 0.191736
+vt 0.837883 0.232269
+vt 0.836704 0.180934
+vt 0.093043 0.879946
+vt 0.167909 0.953165
+vt 0.135168 1.000000
+vt 0.459380 0.313490
+vt 0.084291 0.829407
+vt 0.116276 0.782655
+vt 0.123438 0.826620
+vt 0.128027 0.861490
+vt 0.231392 0.345286
+vt 0.191319 0.379030
+vt 0.488284 0.313490
+vt 0.459380 0.347234
+vt 0.223041 0.956755
+vt 0.255538 0.873321
+vt 0.255538 0.956922
+vt 0.468863 0.818815
+vt 0.501504 0.868365
+vt 0.469007 0.868467
+vt 0.525598 0.313490
+vt 0.488284 0.347234
+vt 0.878241 0.271418
+vt 0.876773 0.226855
+vt 0.916607 0.355279
+vt 0.851032 0.300771
+vt 0.137692 0.692521
+vt 0.083955 0.759558
+vt 0.469007 0.731879
+vt 0.501360 0.818713
+vt 0.025814 0.275596
+vt 0.814544 0.709380
+vt 0.666705 0.752919
+vt 0.372768 0.971167
+vt 0.000000 0.046591
+vt 0.753229 0.566544
+vt 0.846421 0.365888
+vt 1.000000 0.731777
+vt 0.283223 0.731777
+vt 0.464050 0.855313
+vt 0.463781 0.855137
+vt 0.888415 0.737794
+vt 0.723424 0.387462
+vt 0.971862 0.365888
+vt 0.546062 0.052398
+vt 0.283223 0.365888
+vt 0.690302 0.661017
+vt 0.039483 0.865901
+vt 0.501359 0.868467
+vt 0.501504 0.384543
+vt 0.881697 0.420397
+vt 0.083955 0.974012
+vt 0.255745 0.873154
+vt 0.844243 0.832739
+vt 0.230790 0.326632
+vt 0.548721 0.398431
+vt 0.562238 0.661017
+vt 0.815755 0.343491
+vt 0.231392 0.692521
+vt 0.283223 0.000000
+vt 0.000000 0.326632
+vt 0.372768 0.855313
+vt 0.842774 0.709380
+vt 0.283223 0.855137
+vt 0.844243 0.948770
+vt 0.921470 0.000000
+vt 0.259530 0.326632
+vt 0.283223 0.365888
+vt 0.223041 0.692521
+vt 0.231392 0.379030
+vt 0.223041 0.873154
+vt 0.525598 0.347234
+vt 0.941196 0.323532
+vt 0.167909 0.718508
+vt 0.501504 0.731777
+vn 0.0000 -0.0000 -1.0000
+vn 0.0000 -0.0249 0.9997
+vn 0.9916 -0.1225 -0.0423
+vn -1.0000 -0.0000 0.0000
+vn 0.0000 0.5798 -0.8147
+vn 0.0000 0.0000 1.0000
+vn 0.0000 1.0000 0.0000
+vn -0.9965 -0.0835 0.0000
+vn 0.0000 0.3409 -0.9401
+vn 1.0000 -0.0000 0.0000
+vn 0.0000 -0.3054 0.9522
+vn 0.0000 0.5745 -0.8185
+vn 0.0000 -0.3890 0.9213
+vn 0.0000 -0.8509 0.5253
+vn 0.0000 0.8602 -0.5100
+vn 0.0000 -0.9076 0.4198
+vn 0.0000 0.9492 -0.3147
+vn 0.9909 0.0083 -0.1345
+vn 0.0000 0.9805 -0.1967
+vn 0.0000 -0.9851 0.1717
+vn 0.0000 -0.1217 0.9926
+vn 0.0000 -0.9946 0.1039
+vn 0.0000 0.9749 0.2228
+vn -0.9784 0.2065 0.0000
+vn 0.9784 0.2065 0.0000
+vn -0.9914 0.0159 -0.1301
+vn 0.0000 0.8618 -0.5072
+vn 0.0000 0.0619 -0.9981
+vn 0.9978 0.0041 -0.0667
+vn -0.9975 -0.0281 -0.0646
+vn 0.0000 -0.8973 0.4414
+vn 0.0000 0.7629 -0.6465
+vn 0.0000 -0.7351 0.6780
+vn 0.0000 0.0063 1.0000
+vn 0.0000 0.6403 -0.7681
+vn 0.0000 -0.7562 0.6543
+vn -1.0000 -0.0049 0.0000
+vn 1.0000 0.0047 0.0004
+vn 0.0000 -0.0042 -1.0000
+vn 0.0000 0.0249 0.9997
+vn 0.9965 0.0835 0.0000
+vn 0.0000 -0.5798 -0.8147
+vn 0.0000 -1.0000 0.0000
+vn -0.9965 0.0835 0.0000
+vn 0.0000 -0.3409 -0.9401
+vn 0.0000 0.3054 0.9522
+vn 0.0000 -0.5745 -0.8185
+vn 0.0000 0.3890 0.9213
+vn 0.0000 0.8509 0.5253
+vn 0.0000 -0.8602 -0.5100
+vn 0.0000 0.9076 0.4198
+vn 0.0000 -0.9492 -0.3147
+vn 0.9909 -0.0083 -0.1345
+vn 0.0000 -0.9805 -0.1967
+vn 0.0000 0.9851 0.1717
+vn 0.0000 0.1217 0.9926
+vn 0.0000 0.9946 0.1039
+vn 0.0000 -0.9749 0.2228
+vn -0.9784 -0.2065 0.0000
+vn 0.9784 -0.2065 0.0000
+vn -0.9909 -0.0083 -0.1345
+vn 0.0000 -0.8618 -0.5072
+vn 0.0000 -0.0619 -0.9981
+vn 0.9978 -0.0041 -0.0667
+vn -0.9978 -0.0041 -0.0667
+vn 0.0000 0.8973 0.4414
+vn 0.0000 -0.7629 -0.6465
+vn 0.0000 0.7351 0.6780
+vn 0.0000 -0.0063 1.0000
+vn 0.0000 -0.6403 -0.7681
+vn 0.0000 0.7562 0.6543
+vn -1.0000 0.0047 -0.0004
+vn 1.0000 -0.0047 0.0004
+vn 0.0000 0.0042 -1.0000
+vn 0.9965 -0.0835 0.0000
+vn -0.9916 -0.1225 -0.0423
+vn 0.9914 0.0159 -0.1301
+vn -0.9909 0.0083 -0.1345
+vn 0.9975 -0.0281 -0.0646
+vn -0.9978 0.0041 -0.0667
+vn -1.0000 -0.0047 -0.0004
+vn 1.0000 0.0049 -0.0000
+vn 0.9916 0.1225 -0.0423
+vn -0.9916 0.1225 -0.0423
+vn 0.9914 -0.0159 -0.1301
+vn -0.9914 -0.0159 -0.1301
+vn 0.9975 0.0281 -0.0646
+vn -0.9975 0.0281 -0.0646
+vn -1.0000 0.0049 0.0000
+vn 1.0000 -0.0049 -0.0000
+vc 1 1 1
+s off
+f 69/1/1/1 34/2/1/1 3/3/1/1
+f 8/4/2/1 5/5/2/1 4/6/2/1
+f 8/7/3/1 2/8/3/1 6/9/3/1
+f 1/10/4/1 9/11/4/1 12/12/4/1
+f 3/3/5/1 2/13/5/1 7/14/5/1
+f 4/6/6/1 72/15/6/1 8/4/6/1
+f 7/14/1/1 69/1/1/1 3/3/1/1
+f 8/16/7/1 36/17/7/1 7/18/7/1
+f 4/19/8/1 1/10/8/1 3/20/8/1
+f 12/12/4/1 13/21/4/1 16/22/4/1
+f 1/23/9/1 11/24/9/1 2/13/9/1
+f 2/8/10/1 10/25/10/1 6/9/10/1
+f 6/26/11/1 9/27/11/1 5/5/11/1
+f 15/28/10/1 18/29/10/1 14/30/10/1
+f 12/31/12/1 15/32/12/1 11/24/12/1
+f 11/33/10/1 14/30/10/1 10/25/10/1
+f 10/34/13/1 13/35/13/1 9/27/13/1
+f 19/36/10/1 22/37/10/1 18/29/10/1
+f 14/38/14/1 17/39/14/1 13/40/14/1
+f 16/22/4/1 17/41/4/1 20/42/4/1
+f 16/43/15/1 19/44/15/1 15/45/15/1
+f 24/46/4/1 25/47/4/1 28/48/4/1
+f 18/49/16/1 21/50/16/1 17/39/16/1
+f 20/42/4/1 21/51/4/1 24/46/4/1
+f 20/52/17/1 23/53/17/1 19/44/17/1
+f 27/54/18/1 30/55/18/1 26/56/18/1
+f 24/57/19/1 27/58/19/1 23/53/19/1
+f 23/59/10/1 26/56/10/1 22/37/10/1
+f 22/60/20/1 25/61/20/1 21/50/20/1
+f 29/62/21/1 31/63/21/1 32/64/21/1
+f 26/65/22/1 29/66/22/1 25/61/22/1
+f 42/67/23/1 38/68/23/1 40/69/23/1
+f 28/70/23/1 31/71/23/1 27/58/23/1
+f 97/72/24/1 34/73/24/1 100/74/24/1
+f 70/75/6/1 33/76/6/1 97/77/6/1
+f 3/78/7/1 33/79/7/1 4/80/7/1
+f 35/81/25/1 103/82/25/1 36/83/25/1
+f 72/15/6/1 35/84/6/1 8/4/6/1
+f 71/85/1/1 36/86/1/1 103/87/1/1
+f 38/88/26/1 39/89/26/1 40/90/26/1
+f 42/91/21/1 39/92/21/1 43/93/21/1
+f 41/94/27/1 46/95/27/1 38/68/27/1
+f 43/96/22/1 37/97/22/1 44/98/22/1
+f 29/66/22/1 44/98/22/1 25/61/22/1
+f 25/99/28/1 41/100/28/1 28/101/28/1
+f 32/64/21/1 43/93/21/1 29/62/21/1
+f 32/102/23/1 41/94/23/1 42/67/23/1
+f 45/103/4/1 50/104/4/1 49/105/4/1
+f 44/106/29/1 47/107/29/1 41/108/29/1
+f 37/109/30/1 46/110/30/1 45/103/30/1
+f 37/97/31/1 48/111/31/1 44/98/31/1
+f 51/112/10/1 56/113/10/1 55/114/10/1
+f 48/115/10/1 51/112/10/1 47/107/10/1
+f 47/116/32/1 50/117/32/1 46/118/32/1
+f 45/119/33/1 52/120/33/1 48/111/33/1
+f 56/121/34/1 57/122/34/1 60/123/34/1
+f 51/124/35/1 54/125/35/1 50/117/35/1
+f 49/126/36/1 56/127/36/1 52/120/36/1
+f 50/104/4/1 53/128/4/1 49/105/4/1
+f 53/128/37/1 58/129/37/1 57/130/37/1
+f 56/113/38/1 59/131/38/1 55/114/38/1
+f 55/132/39/1 58/133/39/1 54/125/39/1
+f 99/134/1/1 69/1/1/1 63/135/1/1
+f 65/136/40/1 68/137/40/1 64/138/40/1
+f 68/139/41/1 62/140/41/1 67/141/41/1
+f 61/142/4/1 73/143/4/1 65/144/4/1
+f 62/145/42/1 63/135/42/1 67/146/42/1
+f 72/15/6/1 64/138/6/1 68/137/6/1
+f 69/1/1/1 67/146/1/1 63/135/1/1
+f 102/147/43/1 68/148/43/1 67/149/43/1
+f 61/142/44/1 64/150/44/1 63/151/44/1
+f 76/152/4/1 77/153/4/1 73/143/4/1
+f 75/154/45/1 61/155/45/1 62/145/45/1
+f 74/156/10/1 62/140/10/1 66/157/10/1
+f 73/158/46/1 66/159/46/1 65/136/46/1
+f 82/160/10/1 79/161/10/1 78/162/10/1
+f 79/163/47/1 76/164/47/1 75/154/47/1
+f 78/162/10/1 75/165/10/1 74/156/10/1
+f 77/166/48/1 74/167/48/1 73/158/48/1
+f 86/168/10/1 83/169/10/1 82/160/10/1
+f 81/170/49/1 78/171/49/1 77/172/49/1
+f 80/173/4/1 81/174/4/1 77/153/4/1
+f 83/175/50/1 80/176/50/1 79/177/50/1
+f 88/178/4/1 89/179/4/1 85/180/4/1
+f 85/181/51/1 82/182/51/1 81/170/51/1
+f 84/183/4/1 85/180/4/1 81/174/4/1
+f 87/184/52/1 84/185/52/1 83/175/52/1
+f 94/186/53/1 91/187/53/1 90/188/53/1
+f 91/189/54/1 88/190/54/1 87/184/54/1
+f 90/188/10/1 87/191/10/1 86/168/10/1
+f 89/192/55/1 86/193/55/1 85/181/55/1
+f 95/194/56/1 93/195/56/1 96/196/56/1
+f 93/197/57/1 90/198/57/1 89/192/57/1
+f 110/199/58/1 106/200/58/1 109/201/58/1
+f 95/202/58/1 92/203/58/1 91/189/58/1
+f 99/204/59/1 97/72/59/1 100/74/59/1
+f 100/205/7/1 70/206/7/1 69/207/7/1
+f 70/75/6/1 98/208/6/1 64/138/6/1
+f 98/209/43/1 63/210/43/1 64/211/43/1
+f 103/82/60/1 101/212/60/1 102/213/60/1
+f 101/214/6/1 72/15/6/1 68/137/6/1
+f 71/85/1/1 102/215/1/1 67/146/1/1
+f 104/216/7/1 71/217/7/1 72/218/7/1
+f 106/219/61/1 107/220/61/1 105/221/61/1
+f 107/222/56/1 110/223/56/1 111/224/56/1
+f 114/225/62/1 109/201/62/1 106/200/62/1
+f 105/226/57/1 111/227/57/1 112/228/57/1
+f 112/228/57/1 93/197/57/1 89/192/57/1
+f 109/229/63/1 89/230/63/1 92/231/63/1
+f 111/224/56/1 96/196/56/1 93/195/56/1
+f 96/232/58/1 109/201/58/1 92/203/58/1
+f 113/233/4/1 118/234/4/1 114/235/4/1
+f 115/236/64/1 112/237/64/1 109/238/64/1
+f 105/221/65/1 114/235/65/1 106/219/65/1
+f 116/239/66/1 105/226/66/1 112/228/66/1
+f 119/240/10/1 124/241/10/1 120/242/10/1
+f 119/240/10/1 116/243/10/1 115/236/10/1
+f 118/244/67/1 115/245/67/1 114/225/67/1
+f 120/246/68/1 113/247/68/1 116/239/68/1
+f 124/248/69/1 125/249/69/1 121/250/69/1
+f 122/251/70/1 119/252/70/1 118/253/70/1
+f 124/254/71/1 117/255/71/1 120/246/71/1
+f 121/256/4/1 118/234/4/1 117/257/4/1
+f 121/256/72/1 126/258/72/1 122/259/72/1
+f 127/260/73/1 124/241/73/1 123/261/73/1
+f 126/262/74/1 123/263/74/1 122/251/74/1
+f 69/1/1/1 100/264/1/1 34/2/1/1
+f 8/4/2/1 6/26/2/1 5/5/2/1
+f 8/7/75/1 7/265/75/1 2/8/75/1
+f 1/10/4/1 5/266/4/1 9/11/4/1
+f 3/3/5/1 1/23/5/1 2/13/5/1
+f 4/6/6/1 70/75/6/1 72/15/6/1
+f 7/14/1/1 71/85/1/1 69/1/1/1
+f 8/16/7/1 35/267/7/1 36/17/7/1
+f 4/19/76/1 5/266/76/1 1/10/76/1
+f 12/12/4/1 9/11/4/1 13/21/4/1
+f 1/23/9/1 12/31/9/1 11/24/9/1
+f 2/8/10/1 11/33/10/1 10/25/10/1
+f 6/26/11/1 10/34/11/1 9/27/11/1
+f 15/28/10/1 19/36/10/1 18/29/10/1
+f 12/31/12/1 16/268/12/1 15/32/12/1
+f 11/33/10/1 15/28/10/1 14/30/10/1
+f 10/34/13/1 14/269/13/1 13/35/13/1
+f 19/36/10/1 23/59/10/1 22/37/10/1
+f 14/38/14/1 18/49/14/1 17/39/14/1
+f 16/22/4/1 13/21/4/1 17/41/4/1
+f 16/43/15/1 20/52/15/1 19/44/15/1
+f 24/46/4/1 21/51/4/1 25/47/4/1
+f 18/49/16/1 22/60/16/1 21/50/16/1
+f 20/42/4/1 17/41/4/1 21/51/4/1
+f 20/52/17/1 24/57/17/1 23/53/17/1
+f 27/54/77/1 31/270/77/1 30/55/77/1
+f 24/57/19/1 28/70/19/1 27/58/19/1
+f 23/59/10/1 27/54/10/1 26/56/10/1
+f 22/60/20/1 26/65/20/1 25/61/20/1
+f 29/62/21/1 30/271/21/1 31/63/21/1
+f 26/65/22/1 30/272/22/1 29/66/22/1
+f 42/67/23/1 41/94/23/1 38/68/23/1
+f 28/70/23/1 32/102/23/1 31/71/23/1
+f 97/72/24/1 33/273/24/1 34/73/24/1
+f 70/75/6/1 4/6/6/1 33/76/6/1
+f 3/78/7/1 34/274/7/1 33/79/7/1
+f 35/81/25/1 104/275/25/1 103/82/25/1
+f 72/15/6/1 104/276/6/1 35/84/6/1
+f 71/85/1/1 7/14/1/1 36/86/1/1
+f 38/88/78/1 37/109/78/1 39/89/78/1
+f 42/91/21/1 40/277/21/1 39/92/21/1
+f 41/94/27/1 47/278/27/1 46/95/27/1
+f 43/96/22/1 39/279/22/1 37/97/22/1
+f 29/66/22/1 43/96/22/1 44/98/22/1
+f 25/99/28/1 44/280/28/1 41/100/28/1
+f 32/64/21/1 42/91/21/1 43/93/21/1
+f 32/102/23/1 28/70/23/1 41/94/23/1
+f 45/103/4/1 46/110/4/1 50/104/4/1
+f 44/106/79/1 48/115/79/1 47/107/79/1
+f 37/109/80/1 38/88/80/1 46/110/80/1
+f 37/97/31/1 45/119/31/1 48/111/31/1
+f 51/112/10/1 52/281/10/1 56/113/10/1
+f 48/115/10/1 52/281/10/1 51/112/10/1
+f 47/116/32/1 51/124/32/1 50/117/32/1
+f 45/119/33/1 49/126/33/1 52/120/33/1
+f 56/121/34/1 53/282/34/1 57/122/34/1
+f 51/124/35/1 55/132/35/1 54/125/35/1
+f 49/126/36/1 53/283/36/1 56/127/36/1
+f 50/104/4/1 54/284/4/1 53/128/4/1
+f 53/128/81/1 54/284/81/1 58/129/81/1
+f 56/113/82/1 60/285/82/1 59/131/82/1
+f 55/132/39/1 59/286/39/1 58/133/39/1
+f 99/134/1/1 100/264/1/1 69/1/1/1
+f 65/136/40/1 66/159/40/1 68/137/40/1
+f 68/139/83/1 66/157/83/1 62/140/83/1
+f 61/142/4/1 76/152/4/1 73/143/4/1
+f 62/145/42/1 61/155/42/1 63/135/42/1
+f 72/15/6/1 70/75/6/1 64/138/6/1
+f 69/1/1/1 71/85/1/1 67/146/1/1
+f 102/147/43/1 101/287/43/1 68/148/43/1
+f 61/142/84/1 65/144/84/1 64/150/84/1
+f 76/152/4/1 80/173/4/1 77/153/4/1
+f 75/154/45/1 76/164/45/1 61/155/45/1
+f 74/156/10/1 75/165/10/1 62/140/10/1
+f 73/158/46/1 74/167/46/1 66/159/46/1
+f 82/160/10/1 83/169/10/1 79/161/10/1
+f 79/163/47/1 80/288/47/1 76/164/47/1
+f 78/162/10/1 79/161/10/1 75/165/10/1
+f 77/166/48/1 78/289/48/1 74/167/48/1
+f 86/168/10/1 87/191/10/1 83/169/10/1
+f 81/170/49/1 82/182/49/1 78/171/49/1
+f 80/173/4/1 84/183/4/1 81/174/4/1
+f 83/175/50/1 84/185/50/1 80/176/50/1
+f 88/178/4/1 92/290/4/1 89/179/4/1
+f 85/181/51/1 86/193/51/1 82/182/51/1
+f 84/183/4/1 88/178/4/1 85/180/4/1
+f 87/184/52/1 88/190/52/1 84/185/52/1
+f 94/186/85/1 95/291/85/1 91/187/85/1
+f 91/189/54/1 92/203/54/1 88/190/54/1
+f 90/188/10/1 91/187/10/1 87/191/10/1
+f 89/192/55/1 90/198/55/1 86/193/55/1
+f 95/194/56/1 94/292/56/1 93/195/56/1
+f 93/197/57/1 94/293/57/1 90/198/57/1
+f 110/199/58/1 108/294/58/1 106/200/58/1
+f 95/202/58/1 96/232/58/1 92/203/58/1
+f 99/204/59/1 98/295/59/1 97/72/59/1
+f 100/205/7/1 97/296/7/1 70/206/7/1
+f 70/75/6/1 97/77/6/1 98/208/6/1
+f 98/209/43/1 99/297/43/1 63/210/43/1
+f 103/82/60/1 104/275/60/1 101/212/60/1
+f 101/214/6/1 104/276/6/1 72/15/6/1
+f 71/85/1/1 103/87/1/1 102/215/1/1
+f 104/216/7/1 103/298/7/1 71/217/7/1
+f 106/219/86/1 108/299/86/1 107/220/86/1
+f 107/222/56/1 108/300/56/1 110/223/56/1
+f 114/225/62/1 115/245/62/1 109/201/62/1
+f 105/226/57/1 107/301/57/1 111/227/57/1
+f 112/228/57/1 111/227/57/1 93/197/57/1
+f 109/229/63/1 112/302/63/1 89/230/63/1
+f 111/224/56/1 110/223/56/1 96/196/56/1
+f 96/232/58/1 110/199/58/1 109/201/58/1
+f 113/233/4/1 117/257/4/1 118/234/4/1
+f 115/236/87/1 116/243/87/1 112/237/87/1
+f 105/221/88/1 113/233/88/1 114/235/88/1
+f 116/239/66/1 113/247/66/1 105/226/66/1
+f 119/240/10/1 123/261/10/1 124/241/10/1
+f 119/240/10/1 120/242/10/1 116/243/10/1
+f 118/244/67/1 119/303/67/1 115/245/67/1
+f 120/246/68/1 117/255/68/1 113/247/68/1
+f 124/248/69/1 128/304/69/1 125/249/69/1
+f 122/251/70/1 123/263/70/1 119/252/70/1
+f 124/254/71/1 121/305/71/1 117/255/71/1
+f 121/256/4/1 122/259/4/1 118/234/4/1
+f 121/256/89/1 125/306/89/1 126/258/89/1
+f 127/260/90/1 128/307/90/1 124/241/90/1
+f 126/262/74/1 127/308/74/1 123/263/74/1
--- a/src/SDL_Examples/gears.c
+++ b/src/SDL_Examples/gears.c
@@ -439,6 +439,9 @@
     }
     printf("%i frames in %f secs, %f frames per second.\n",frames,(float)(tNow-tLastFps)*0.001f,(float)frames*1000.0f/(float)(tNow-tLastFps));
     // cleanup:
+    glDeleteList(gear1);
+    glDeleteList(gear2);
+    glDeleteList(gear3);
     ZB_close(frameBuffer);
     if(SDL_WasInit(SDL_INIT_VIDEO))
         SDL_QuitSubSystem(SDL_INIT_VIDEO);
--- /dev/null
+++ b/src/SDL_Examples/model.c
@@ -1,0 +1,556 @@
+/* sdlGears.c */
+/*
+ * 3-D gear wheels by Brian Paul. This program is in the public domain.
+ *
+ * ported to libSDL/TinyGL by Gerald Franz (gfz@o2online.de)
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "../include/GL/gl.h"
+#define STB_IMAGE_IMPLEMENTATION
+#include "../include/stb_image.h"
+#define CHAD_MATH_IMPL
+#include "../include/3dMath.h"
+#include "../include/tobjparse.h"
+#define CHAD_API_IMPL
+#include "include/api_audio.h"
+#include <SDL/SDL.h>
+#include "../zbuffer.h"
+#include <time.h>
+
+#ifndef M_PI
+#  define M_PI 3.14159265
+#endif
+
+
+
+
+vec3 campos = (vec3){.d[0]=0,.d[1]=0,.d[2]=-3};
+vec3 camforw = (vec3){.d[0]=0,.d[1]=0,.d[2]=-1};
+vec3 camup = (vec3){.d[0]=0,.d[1]=1,.d[2]=0};
+uint wasdstate[4] = {0,0,0,0};
+const float mouseratiox = 1.0/300.0f;
+const float mouseratioy = 1.0/300.0f;
+int mousex = 0, mousey = 0;
+
+void rotateCamera(){
+	vec3 a;
+	a.d[1] = (float)mousex * mouseratiox;
+	a.d[2] = (float)mousey * mouseratioy;
+	//if(fabsf(camforw.d[0]) < 0.001) camforw.d[0] = 0.001;
+	vec3 right = normalizev3(
+					crossv3(
+						normalizev3(camforw),
+						normalizev3(camup)
+					)
+				);right.d[1]=0;
+	vec3 result = rotatev3(camforw,right,-a.d[2]);
+	camup = crossv3(right,camforw);
+	camforw = rotatev3(result,camup,-a.d[1]);
+	//if(fabsf(camforw.d[0]) < 0.001) camforw.d[0] = 0.001;
+}
+
+
+
+GLuint loadRGBTexture(unsigned char* buf, unsigned int w, unsigned int h){
+	GLuint t = 0;
+	glGenTextures(1, &t);
+	// for(unsigned int i = 0; i < w * h; i++)
+		// {
+			// unsigned char t = 0;
+			// unsigned char* r = buf + i*3;
+			// // unsigned char* g = buf + i*3+1;
+			// unsigned char* b = buf + i*3+2;
+			// t = *r;
+			// *r = *b;
+			// *b = t;
+		// }
+	glBindTexture(GL_TEXTURE_2D,t);
+	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_MAG_FILTER, GL_NEAREST);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+	glTexImage2D(GL_TEXTURE_2D,0,3,w,h,0,GL_RGB,GL_UNSIGNED_BYTE,buf);
+	return t;
+}
+
+
+void drawModel(
+//HUGE important note! these depend on the math library using 
+//f_ as float and not double!
+//Remember that!
+	vec3* points, uint npoints,
+	vec3* colors,
+	vec3* normals,
+	vec3* texcoords
+){
+	if(!points)return;
+	glBegin(GL_TRIANGLES);
+	for(uint i = 0; i < npoints;i++){
+		if(colors){ //Fix for TinyGL color interpolation.
+			glColor3f(colors[i].d[0],colors[i].d[1],colors[i].d[2]);
+		}
+		if(texcoords)
+			glTexCoord2f(texcoords[i].d[0],texcoords[i].d[1]);
+		if(normals)
+			glNormal3f(normals[i].d[0],normals[i].d[1],normals[i].d[2]);
+		glVertex3f(points[i].d[0],points[i].d[1],points[i].d[2]);
+	}
+	glEnd();
+}
+
+
+
+
+GLuint createModelDisplayList(
+//HUGE important note! these depend on the math library using 
+//f_ as float and not double!
+//Remember that!
+	vec3* points, uint npoints,
+	vec3* colors,
+	vec3* normals,
+	vec3* texcoords
+){
+	GLuint ret = 0;
+	if(!points)return 0;
+	ret = glGenLists(1);
+	glNewList(ret, GL_COMPILE);
+		glBegin(GL_TRIANGLES);
+		for(uint i = 0; i < npoints; i++){
+			if(colors){
+				glColor3f(colors[i].d[0],colors[i].d[1],colors[i].d[2]);
+			}
+			if(texcoords)
+				glTexCoord2f(texcoords[i].d[0],texcoords[i].d[1]);
+			if(normals)
+				glNormal3f(normals[i].d[0],normals[i].d[1],normals[i].d[2]);
+			glVertex3f(points[i].d[0],points[i].d[1],points[i].d[2]);
+		}
+		//printf("\ncreateModelDisplayList is not the problem.\n");
+		glEnd();
+	glEndList();
+	return ret;
+}
+
+
+GLubyte stipplepattern[128] = {
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA,
+	0xAA,0xAA,0xAA,0xAA,
+	~0xAA,~0xAA,~0xAA,~0xAA
+};
+
+
+#define BEGIN_EVENT_HANDLER void events(SDL_Event* e){switch(e->type){
+#define E_KEYSYM e->key.keysym.sym
+#define END_EVENT_HANDLER }}
+#define EVENT_HANDLER events
+#define E_MOTION e->motion
+#define E_BUTTON e->button.button
+#define E_WINEVENT e->window.event
+#define E_WINW e->window.data1
+#define E_WINH e->window.data2
+
+int isRunning=1;
+
+/*
+mousex = (kHeld & KEY_Y)?-30:0 + (kHeld & KEY_A)?30:0;
+		mousey = (kHeld & KEY_X)?-30:0 + (kHeld & KEY_B)?30:0;
+*/
+BEGIN_EVENT_HANDLER
+case SDL_KEYDOWN:
+	switch(E_KEYSYM) {
+		case SDLK_w:
+			wasdstate[0] = 1;break;
+		case SDLK_a:
+			wasdstate[1] = 1;break;
+		case SDLK_s:
+			wasdstate[2] = 1;break;
+		case SDLK_d:
+			wasdstate[3] = 1;break;
+		case SDLK_UP:
+			mousey = -30;
+			break;
+		case SDLK_DOWN:
+			mousey = 30;
+			break;
+		case SDLK_LEFT:
+			mousex = -30;
+			break;
+		case SDLK_RIGHT:
+			mousex = 30;
+			break;
+		case SDLK_ESCAPE :
+		case SDLK_q :
+			isRunning=0;break;
+		default:
+			break;
+	}
+	break;
+case SDL_KEYUP:
+	switch(E_KEYSYM) {
+		case SDLK_w:
+			wasdstate[0] = 0;break;
+		case SDLK_a:
+			wasdstate[1] = 0;break;
+		case SDLK_s:
+			wasdstate[2] = 0;break;
+		case SDLK_d:
+			wasdstate[3] = 0;break;
+		case SDLK_UP:
+		case SDLK_DOWN:
+			mousey = 0; break;
+		case SDLK_LEFT:
+		case SDLK_RIGHT:
+			mousex = 0; break;
+		default:
+			break;
+	}
+	break;
+case SDL_QUIT:
+	isRunning=0;
+	break;
+END_EVENT_HANDLER
+
+int main(int argc, char **argv) {
+    // initialize SDL video:
+    int winSizeX=640;
+    int winSizeY=480;
+    unsigned int count = 40;
+    GLuint modelDisplayList = 0; int dlExists = 0;
+	char* modelName = "extrude.obj";
+	track* myTrack = NULL;
+	unsigned int fps =0;
+    if(argc > 2){
+    	char* larg = argv[1];
+    	for(int i = 0; i < argc; i++){
+    		if(!strcmp(larg,"-w"))
+				winSizeX = atoi(argv[i]);
+    		if(!strcmp(larg,"-h"))
+				winSizeY = atoi(argv[i]);
+			if(!strcmp(larg,"-fps"))
+				fps = strtoull(argv[i],0,10);
+			if(!strcmp(larg,"-count"))
+				count = strtoull(argv[i],0,10);
+			if(!strcmp(larg,"-m"))
+				modelName = argv[i];
+			larg = argv[i];
+    	}
+    }
+    if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)<0) {
+        fprintf(stderr,"ERROR: cannot initialize SDL video.\n");
+        return 1;
+    }
+    ainit(0);
+    SDL_Surface* screen = NULL;
+    if((screen=SDL_SetVideoMode( winSizeX, winSizeY, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == 0 ) {
+        fprintf(stderr,"ERROR: Video mode set failed.\n");
+        return 1;
+    }
+    printf("\nRMASK IS %u",screen->format->Rmask);
+    printf("\nGMASK IS %u",screen->format->Gmask);
+    printf("\nBMASK IS %u",screen->format->Bmask);
+    printf("\nAMASK IS %u",screen->format->Amask);
+
+
+    printf("\nRSHIFT IS %u",screen->format->Rshift);
+    printf("\nGSHIFT IS %u",screen->format->Gshift);
+    printf("\nBSHIFT IS %u",screen->format->Bshift);
+    printf("\nASHIFT IS %u",screen->format->Ashift);
+    fflush(stdout);
+    
+    myTrack = lmus("WWGW.mp3");
+    mplay(myTrack, -1, 1000);
+    SDL_ShowCursor(SDL_DISABLE);
+    SDL_WM_SetCaption(argv[0],0);
+
+    // initialize TinyGL:
+    unsigned int pitch;
+    int	mode;
+    switch( screen->format->BitsPerPixel ) {
+    case  8:
+        fprintf(stderr,"ERROR: Palettes are currently not supported.\n");
+        fprintf(stderr,"\nUnsupported by maintainer!!!");
+        return 1;
+    case 16:
+        pitch = screen->pitch;
+        fprintf(stderr,"\nUnsupported by maintainer!!!");
+        mode = ZB_MODE_5R6G5B;
+        return 1;
+        break;
+    case 24:
+        pitch = ( screen->pitch * 2 ) / 3;
+        fprintf(stderr,"\nUnsupported by maintainer!!!");
+        mode = ZB_MODE_RGB24;
+        return 1;
+        break;
+    case 32:
+        pitch = screen->pitch / 2;
+        mode = ZB_MODE_RGBA;
+        break;
+    default:
+        return 1;
+        break;
+    }
+
+    ZBuffer *frameBuffer = ZB_open( winSizeX, winSizeY, mode, 0, 0, 0, 0);
+    glInit( frameBuffer );
+
+	srand(time(NULL));
+//	initGL(winSizeX,winSizeY);
+    // initialize GL:
+    glShadeModel(GL_SMOOTH);
+   	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
+   	glEnable(GL_DEPTH_TEST);
+   	glEnable(GL_LIGHTING);
+   	glEnable(GL_CULL_FACE);
+   	glCullFace(GL_BACK);
+   	//	glEnable(GL_TEXTURE_2D);
+   	glEnable(GL_COLOR_MATERIAL);
+   	//	glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,1);
+   	glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,0);
+   	glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
+   	glClearColor(0,0,0,0);
+   	glClearDepth(1.0f);
+
+
+	glClearColor(0,0,0.3,0);
+	glDisable(GL_TEXTURE_2D);
+	
+	glEnable(GL_DEPTH_TEST);
+	glDisable(GL_LIGHTING);
+	glShadeModel(GL_SMOOTH);
+	//glDisable(GL_DEPTH_TEST);
+	double t = 0;
+	glViewport(0,0,winSizeX,winSizeY);
+	//glEnable(GL_POLYGON_STIPPLE);
+	//glPolygonStipple(stipplepattern);
+    //initScene();
+	{
+		objraw omodel; model m = initmodel();
+		omodel = tobj_load(modelName);
+		
+		if(!omodel.positions) {puts("\nERROR! No positions in model. Aborting...\n");} else {
+		m = tobj_tomodel(&omodel);
+		printf("\nHas %d points.\n",m.npoints); 
+		modelDisplayList = createModelDisplayList(
+			m.d, m.npoints,
+			m.c,
+			m.n,
+			m.t
+		);dlExists = 1;
+		freemodel(&m);
+		}
+		freeobjraw(&omodel);
+	}
+
+	GLuint tex = 0;
+	{
+		int sw = 0, sh = 0, sc = 0; //sc goes unused.
+		uchar* source_data = stbi_load("tex.jpg", &sw, &sh, &sc, 3);
+		if(source_data){
+			tex = loadRGBTexture(source_data, sw, sh);
+			free(source_data);
+		}
+	//tex = 
+	}
+	glDisable(GL_LIGHTING);
+    // variables for timing:
+    unsigned int frames=0;
+    unsigned int tNow=SDL_GetTicks();
+    unsigned int tLastFps=tNow;
+
+    // main loop:
+    
+    while(isRunning) {
+        ++frames;
+        t+=0.016666f;
+        tNow=SDL_GetTicks();
+        // do event handling:
+        SDL_Event evt;
+        mousex = 0; mousey = 0;
+        while( SDL_PollEvent( &evt ) ) EVENT_HANDLER(&evt) ;
+/*
+        switch(evt.type) {
+        	
+	        
+        }
+*/
+        // draw scene:
+#define WIDTH winSizeX
+#define HEIGHT winSizeY
+		glMatrixMode(GL_PROJECTION);
+		glLoadIdentity();
+		//gluPerspective(70,(float)WIDTH/(float)HEIGHT,1,512);
+		mat4 matrix = perspective(70,(float)WIDTH/(float)HEIGHT,1,512);
+		glLoadMatrixf(matrix.d);
+		glMatrixMode(GL_MODELVIEW);
+		glLoadIdentity();
+		glPushMatrix(); //Pushing on the LookAt Matrix.
+
+		vec3 right = normalizev3(
+					crossv3(
+						normalizev3(camforw),
+						normalizev3(camup)
+					)
+				);right.d[1]=0;
+		matrix = (lookAt(campos,addv3(campos,camforw),camup)); //Using right vector to correct for screen rotation.
+		glLoadMatrixf(matrix.d);
+		if(wasdstate[0])
+			campos = addv3(campos,
+				scalev3(0.1,
+					camforw
+				)
+			);
+		if(wasdstate[2])
+			campos = addv3(campos,
+				scalev3(-0.1,
+					camforw
+				)
+			);
+		if(wasdstate[1])
+			campos = addv3(campos,
+				scalev3(-0.1,
+					right
+				)
+			);
+		if(wasdstate[3])
+			campos = addv3(campos,
+				scalev3(0.1,
+					right
+				)
+			);
+		glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+		glEnable(GL_DEPTH_TEST);
+		glBindTexture(GL_TEXTURE_2D,tex);
+		//glDisable(GL_BLEND);
+		//glDisable(GL_TEXTURE_2D);
+		//printf("\nNew triangle!\n");
+		if(!dlExists){
+			glDisable(GL_TEXTURE_2D);
+			glBegin(GL_TRIANGLES);
+				//glColor3f(0,0,1);
+				glColor3f(1,0,0);glTexCoord2f(0,0);glVertex3f(-1,-1,-10); 
+				glColor3f(0,1,0);glTexCoord2f(1,0);glVertex3f(1,-1,-10);
+				glColor3f(0,0,1);glTexCoord2f(0.5,1);glVertex3f(0,1,-10);
+				//glColor3f(0,1,0);
+			glEnd();
+		} else {
+			glEnable(GL_TEXTURE_2D);
+			//glDisable(GL_TEXTURE_2D);
+			glEnable(GL_POLYGON_STIPPLE);
+			//glDisable(GL_COLOR_MATERIAL);
+			for(unsigned int i = 0; i < count; i++){
+				glPushMatrix();
+				glTranslatef((float)(i%10) * 8.0,(float)(i/10) * 8.0,-10);
+				glCallList(modelDisplayList);
+				// drawModel(
+					// m.d, m.npoints,
+					// m.c,
+					// m.n,
+					// m.t
+				// );
+				glPopMatrix();
+			}
+			glDisable(GL_POLYGON_STIPPLE);
+			glDisable(GL_TEXTURE_2D);
+		}
+        //draw();
+		glPopMatrix(); //The view transform.
+
+		rotateCamera();
+		glTextSize(GL_TEXT_SIZE16x16);
+		glDrawText((unsigned char*)"\nModel Viewer Demo-\nTinyGL\nSDL 1.2\n", 0, 0, 0x000000FF);
+
+
+
+
+
+        // swap buffers:
+        if ( SDL_MUSTLOCK(screen) && (SDL_LockSurface(screen)<0) ) {
+            fprintf(stderr, "SDL ERROR: Can't lock screen: %s\n", SDL_GetError());
+            return 1;
+        }
+        /*
+		printf("\nRMASK IS %u",screen->format->Rmask);
+		printf("\nGMASK IS %u",screen->format->Gmask);
+		printf("\nBMASK IS %u",screen->format->Bmask);
+		printf("\nAMASK IS %u",screen->format->Amask);
+        */
+        //Quickly convert all pixels to the correct format
+        for(int i = 0; i < frameBuffer->xsize* frameBuffer->ysize;i++){
+#define DATONE (frameBuffer->pbuf[i])
+			DATONE = ((DATONE & 0x000000FF)     ) << screen->format->Rshift | 
+					 ((DATONE & 0x0000FF00) >> 8) << screen->format->Gshift |
+					 ((DATONE & 0x00FF0000) >>16) << screen->format->Bshift;
+        }
+        ZB_copyFrameBuffer(frameBuffer, screen->pixels, screen->pitch);
+        if ( SDL_MUSTLOCK(screen) ) SDL_UnlockSurface(screen);
+        SDL_Flip(screen);
+        if(fps>0)
+			if((1000/fps)>(SDL_GetTicks()-tNow))
+			{
+				SDL_Delay((1000/fps)-(SDL_GetTicks()-tNow)); //Yay stable framerate!
+			}
+        // check for error conditions:
+        char* sdl_error = SDL_GetError( );
+        if( sdl_error[0] != '\0' ) {
+            fprintf(stderr,"SDL ERROR: \"%s\"\n",sdl_error);
+            SDL_ClearError();
+        }
+        // update fps:
+        if(tNow>=tLastFps+5000) {
+            printf("%i frames in %f secs, %f frames per second.\n",frames,(float)(tNow-tLastFps)*0.001f,(float)frames*1000.0f/(float)(tNow-tLastFps));
+            tLastFps=tNow;
+            frames=0;
+        }
+    }
+    printf("%i frames in %f secs, %f frames per second.\n",frames,(float)(tNow-tLastFps)*0.001f,(float)frames*1000.0f/(float)(tNow-tLastFps));
+    // cleanup:
+	glDeleteTextures(1, &tex);
+	glDeleteList(modelDisplayList);
+    ZB_close(frameBuffer);
+    
+    if(SDL_WasInit(SDL_INIT_VIDEO))
+        SDL_QuitSubSystem(SDL_INIT_VIDEO);
+    mhalt();
+    Mix_FreeMusic(myTrack);
+    acleanup();
+    SDL_Quit();
+    return 0;
+}
binary files /dev/null b/src/SDL_Examples/tex.jpg differ
--- a/src/include/GL/gl.h
+++ b/src/include/GL/gl.h
@@ -763,7 +763,7 @@
 void glNewList(unsigned int list,int mode);
 void glEndList(void);
 void glCallList(unsigned int list);
-
+void glDeleteList(int list);
 /* clear */
 void glClear(int mask);
 void glClearColor(float r,float g,float b,float a);
--- /dev/null
+++ b/src/include/stretchy_buffer.h
@@ -1,0 +1,263 @@
+// stretchy_buffer.h - v1.04 - public domain - nothings.org/stb
+// a vector<>-like dynamic array for C
+//
+// version history:
+//      1.04 -  fix warning
+//      1.03 -  compile as C++ maybe
+//      1.02 -  tweaks to syntax for no good reason
+//      1.01 -  added a "common uses" documentation section
+//      1.0  -  fixed bug in the version I posted prematurely
+//      0.9  -  rewrite to try to avoid strict-aliasing optimization
+//              issues, but won't compile as C++
+//
+// Will probably not work correctly with strict-aliasing optimizations.
+//
+// The idea:
+//
+//    This implements an approximation to C++ vector<> for C, in that it
+//    provides a generic definition for dynamic arrays which you can
+//    still access in a typesafe way using arr[i] or *(arr+i). However,
+//    it is simply a convenience wrapper around the common idiom of
+//    of keeping a set of variables (in a struct or globals) which store
+//        - pointer to array
+//        - the length of the "in-use" part of the array
+//        - the current size of the allocated array
+//
+//    I find it to be the single most useful non-built-in-structure when
+//    programming in C (hash tables a close second), but to be clear
+//    it lacks many of the capabilities of C++ vector<>: there is no
+//    range checking, the object address isn't stable (see next section
+//    for details), the set of methods available is small (although
+//    the file stb.h has another implementation of stretchy buffers
+//    called 'stb_arr' which provides more methods, e.g. for insertion
+//    and deletion).
+//
+// How to use:
+//
+//    Unlike other stb header file libraries, there is no need to
+//    define an _IMPLEMENTATION symbol. Every #include creates as
+//    much implementation is needed.
+//
+//    stretchy_buffer.h does not define any types, so you do not
+//    need to #include it to before defining data types that are
+//    stretchy buffers, only in files that *manipulate* stretchy
+//    buffers.
+//
+//    If you want a stretchy buffer aka dynamic array containing
+//    objects of TYPE, declare such an array as:
+//
+//       TYPE *myarray = NULL;
+//
+//    (There is no typesafe way to distinguish between stretchy
+//    buffers and regular arrays/pointers; this is necessary to
+//    make ordinary array indexing work on these objects.)
+//
+//    Unlike C++ vector<>, the stretchy_buffer has the same
+//    semantics as an object that you manually malloc and realloc.
+//    The pointer may relocate every time you add a new object
+//    to it, so you:
+//
+//         1. can't take long-term pointers to elements of the array
+//         2. have to return the pointer from functions which might expand it
+//            (either as a return value or by storing it to a ptr-to-ptr)
+//
+//    Now you can do the following things with this array:
+//
+//         sb_free(TYPE *a)           free the array
+//         sb_count(TYPE *a)          the number of elements in the array
+//         sb_push(TYPE *a, TYPE v)   adds v on the end of the array, a la push_back
+//         sb_add(TYPE *a, int n)     adds n uninitialized elements at end of array & returns pointer to first added
+//         sb_last(TYPE *a)           returns an lvalue of the last item in the array
+//         a[n]                       access the nth (counting from 0) element of the array
+//
+//     #define STRETCHY_BUFFER_NO_SHORT_NAMES to only export
+//     names of the form 'stb_sb_' if you have a name that would
+//     otherwise collide.
+//
+//     Note that these are all macros and many of them evaluate
+//     their arguments more than once, so the arguments should
+//     be side-effect-free.
+//
+//     Note that 'TYPE *a' in sb_push and sb_add must be lvalues
+//     so that the library can overwrite the existing pointer if
+//     the object has to be reallocated.
+//
+//     In an out-of-memory condition, the code will try to
+//     set up a null-pointer or otherwise-invalid-pointer
+//     exception to happen later. It's possible optimizing
+//     compilers could detect this write-to-null statically
+//     and optimize away some of the code, but it should only
+//     be along the failure path. Nevertheless, for more security
+//     in the face of such compilers, #define STRETCHY_BUFFER_OUT_OF_MEMORY
+//     to a statement such as assert(0) or exit(1) or something
+//     to force a failure when out-of-memory occurs.
+//
+// Common use:
+//
+//    The main application for this is when building a list of
+//    things with an unknown quantity, either due to loading from
+//    a file or through a process which produces an unpredictable
+//    number.
+//
+//    My most common idiom is something like:
+//
+//       SomeStruct *arr = NULL;
+//       while (something)
+//       {
+//          SomeStruct new_one;
+//          new_one.whatever = whatever;
+//          new_one.whatup   = whatup;
+//          new_one.foobar   = barfoo;
+//          sb_push(arr, new_one);
+//       }
+//
+//    and various closely-related factorings of that. For example,
+//    you might have several functions to create/init new SomeStructs,
+//    and if you use the above idiom, you might prefer to make them
+//    return structs rather than take non-const-pointers-to-structs,
+//    so you can do things like:
+//
+//       SomeStruct *arr = NULL;
+//       while (something)
+//       {
+//          if (case_A) {
+//             sb_push(arr, some_func1());
+//          } else if (case_B) {
+//             sb_push(arr, some_func2());
+//          } else {
+//             sb_push(arr, some_func3());
+//          }
+//       }
+//
+//    Note that the above relies on the fact that sb_push doesn't
+//    evaluate its second argument more than once. The macros do
+//    evaluate the *array* argument multiple times, and numeric
+//    arguments may be evaluated multiple times, but you can rely
+//    on the second argument of sb_push being evaluated only once.
+//
+//    Of course, you don't have to store bare objects in the array;
+//    if you need the objects to have stable pointers, store an array
+//    of pointers instead:
+//
+//       SomeStruct **arr = NULL;
+//       while (something)
+//       {
+//          SomeStruct *new_one = malloc(sizeof(*new_one));
+//          new_one->whatever = whatever;
+//          new_one->whatup   = whatup;
+//          new_one->foobar   = barfoo;
+//          sb_push(arr, new_one);
+//       }
+//
+// How it works:
+//
+//    A long-standing tradition in things like malloc implementations
+//    is to store extra data before the beginning of the block returned
+//    to the user. The stretchy buffer implementation here uses the
+//    same trick; the current-count and current-allocation-size are
+//    stored before the beginning of the array returned to the user.
+//    (This means you can't directly free() the pointer, because the
+//    allocated pointer is different from the type-safe pointer provided
+//    to the user.)
+//
+//    The details are trivial and implementation is straightforward;
+//    the main trick is in realizing in the first place that it's
+//    possible to do this in a generic, type-safe way in C.
+//
+// Contributors:
+//
+// Timothy Wright (github:ZenToad)
+//
+// LICENSE
+//
+//   See end of file for license information.
+
+#ifndef STB_STRETCHY_BUFFER_H_INCLUDED
+#define STB_STRETCHY_BUFFER_H_INCLUDED
+
+#ifndef NO_STRETCHY_BUFFER_SHORT_NAMES
+#define sb_free   stb_sb_free
+#define sb_push   stb_sb_push
+#define sb_count  stb_sb_count
+#define sb_add    stb_sb_add
+#define sb_last   stb_sb_last
+#endif
+
+#define stb_sb_free(a)         ((a) ? free(stb__sbraw(a)),0 : 0)
+#define stb_sb_push(a,v)       (stb__sbmaybegrow(a,1), (a)[stb__sbn(a)++] = (v))
+#define stb_sb_count(a)        ((a) ? stb__sbn(a) : 0)
+#define stb_sb_add(a,n)        (stb__sbmaybegrow(a,n), stb__sbn(a)+=(n), &(a)[stb__sbn(a)-(n)])
+#define stb_sb_last(a)         ((a)[stb__sbn(a)-1])
+
+#define stb__sbraw(a) ((int *) (void *) (a) - 2)
+#define stb__sbm(a)   stb__sbraw(a)[0]
+#define stb__sbn(a)   stb__sbraw(a)[1]
+
+#define stb__sbneedgrow(a,n)  ((a)==0 || stb__sbn(a)+(n) >= stb__sbm(a))
+#define stb__sbmaybegrow(a,n) (stb__sbneedgrow(a,(n)) ? stb__sbgrow(a,n) : 0)
+#define stb__sbgrow(a,n)      (*((void **)&(a)) = stb__sbgrowf((a), (n), sizeof(*(a))))
+
+#include <stdlib.h>
+
+static void * stb__sbgrowf(void *arr, int increment, int itemsize)
+{
+   int dbl_cur = arr ? 2*stb__sbm(arr) : 0;
+   int min_needed = stb_sb_count(arr) + increment;
+   int m = dbl_cur > min_needed ? dbl_cur : min_needed;
+   int *p = (int *) realloc(arr ? stb__sbraw(arr) : 0, itemsize * m + sizeof(int)*2);
+   if (p) {
+      if (!arr)
+         p[1] = 0;
+      p[0] = m;
+      return p+2;
+   } else {
+      #ifdef STRETCHY_BUFFER_OUT_OF_MEMORY
+      STRETCHY_BUFFER_OUT_OF_MEMORY ;
+      #endif
+      return (void *) (2*sizeof(int)); // try to force a NULL pointer exception later
+   }
+}
+#endif // STB_STRETCHY_BUFFER_H_INCLUDED
+
+
+/*
+------------------------------------------------------------------------------
+This software is available under 2 licenses -- choose whichever you prefer.
+------------------------------------------------------------------------------
+ALTERNATIVE A - MIT License
+Copyright (c) 2017 Sean Barrett
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is 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 Software.
+THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+------------------------------------------------------------------------------
+ALTERNATIVE B - Public Domain (www.unlicense.org)
+This is free and unencumbered software released into the public domain.
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
+commercial or non-commercial, and by any means.
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+THE SOFTWARE IS 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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+------------------------------------------------------------------------------
+*/
--- a/src/list.c
+++ b/src/list.c
@@ -32,6 +32,7 @@
   return c->shared_state.lists[list];
 }
 
+
 static void delete_list(GLContext *c,int list)
 {
   GLParamBuffer *pb,*pb1;
@@ -50,6 +51,9 @@
   
   gl_free(l);
   c->shared_state.lists[list]=NULL;
+}
+void glDeleteList(int list){
+	delete_list(gl_get_context(), list);
 }
 
 static GLList *alloc_list(GLContext *c,int list)