shithub: tinygl

Download patch

ref: 2b4c5ed7478d344ad416f1ebe12d4b23e214f3e5
parent: 9463cec601d1f54c10b2d398ebc4bd6e9533456f
author: David <gek@katherine>
date: Tue Feb 16 11:04:33 EST 2021

Minor feature update

--- a/README.md
+++ b/README.md
@@ -33,7 +33,9 @@
 
 ![model loading demo](model.gif)
 
+This is a demo of the NO_DRAW_COLOR feature. Notice that the object appears to have a hole in it.
 
+![model loading demo](model_hole.gif)
 
 TinyGL 0.8 (c) 1997-2021 Fabrice Bellard, C-Chads, Gek (see License, it's free software)
 
--- a/SDL_Examples/model.c
+++ b/SDL_Examples/model.c
@@ -366,7 +366,11 @@
 	GLuint tex = 0;
 	if (doTextures) {
 		int sw = 0, sh = 0, sc = 0; // sc goes unused.
+#if TGL_FEATURE_NO_DRAW_COLOR == 1
+		uchar* source_data = stbi_load("tex_hole.png", &sw, &sh, &sc, 3);
+#else 
 		uchar* source_data = stbi_load("tex.jpg", &sw, &sh, &sc, 3);
+#endif		
 		if (source_data) {
 			tex = loadRGBTexture(source_data, sw, sh);
 			free(source_data);
binary files /dev/null b/SDL_Examples/tex_hole.png differ
binary files /dev/null b/SDL_Examples/tex_old.jpg differ
binary files /dev/null b/model_hole.gif differ