shithub: tinygl

Download patch

ref: a256a597ea623ff8972fe332e7c9f352e9f36c20
parent: d360857b634010648582ad3b0413a996106c8fdb
author: gek <6974902+gordonfreeman424@users.noreply.github.com>
date: Fri Mar 11 16:09:26 EST 2022

gitap from gek@Katherine.

--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
 LIB=lib/$(LIBNAME)
 LIBDIR=/usr/local/lib
 INCDIR=/usr/local/include
+BINDIR=/usr/local/bin
 
 all: $(LIB) RDMOS
 	@echo Done!
@@ -23,6 +24,10 @@
 SDL_Examples: $(LIB)
 	@echo "These demos require SDL 1.2 to compile."
 	cd SDL_Examples && $(MAKE) && cd ..
+
+tglgears: $(LIB)
+	@echo "These demos require SDL 1.2 to compile."
+	cd SDL_Examples && $(MAKE) install_tglgears && cd ..
 
 RDMOS: $(LIB)
 	@echo "Building the RAW DEMOS. These do not require anything special on your system, so they should succeed."
--- a/SDL_Examples/Makefile
+++ b/SDL_Examples/Makefile
@@ -10,8 +10,8 @@
 SDL_LIBS= -lSDL 
 #for MinGW users:
 #SDL_LIBS= -lmingw32 -lSDLmain -lSDL 
+BINDIR=/usr/local/bin
 
-
 #SDL_MIXERLIBS= -lSDL_mixer -lmad -logg -lmikmod -logg -DPLAY_MUSIC
 SDL_MIXERLIBS= 
 all: $(ALL_T)
@@ -29,3 +29,6 @@
 	$(CC) game.c $(LIB) -o game $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) $(SDL_LIBS) $(SDL_MIXERLIBS) -lm
 gears:
 	$(CC) gears.c $(LIB) -o gears $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) $(SDL_LIBS) $(SDL_MIXERLIBS) -lm
+
+install_tglgears: gears
+	cp gears $(BINDIR)/tglgears
--- a/SDL_Examples/gears.c
+++ b/SDL_Examples/gears.c
@@ -244,26 +244,26 @@
 	/* make the gears */
 	gear1 = glGenLists(1);
 	glNewList(gear1, GL_COMPILE);
-	glMaterialfv(GL_FRONT, GL_DIFFUSE, blue);
+	glMaterialfv(GL_FRONT, GL_DIFFUSE, red);
 	glMaterialfv(GL_FRONT, GL_SPECULAR, white);
 	glMaterialfv(GL_FRONT, GL_SHININESS, &shininess);
-	glColor3fv(blue);
+	glColor3fv(red);
 	gear(1.0, 4.0, 1.0, 20, 0.7); // The largest gear.
 	glEndList();
 
 	gear2 = glGenLists(1);
 	glNewList(gear2, GL_COMPILE);
-	glMaterialfv(GL_FRONT, GL_DIFFUSE, red);
+	glMaterialfv(GL_FRONT, GL_DIFFUSE, green);
 	glMaterialfv(GL_FRONT, GL_SPECULAR, white);
-	glColor3fv(red);
+	glColor3fv(green);
 	gear(0.5, 2.0, 2.0, 10, 0.7); // The small gear with the smaller hole, to the right.
 	glEndList();
 
 	gear3 = glGenLists(1);
 	glNewList(gear3, GL_COMPILE);
-	glMaterialfv(GL_FRONT, GL_DIFFUSE, green);
+	glMaterialfv(GL_FRONT, GL_DIFFUSE, blue);
 	glMaterialfv(GL_FRONT, GL_SPECULAR, white);
-	glColor3fv(green);
+	glColor3fv(blue);
 	gear(1.3, 2.0, 0.5, 10, 0.7); // The small gear above with the large hole.
 	glEndList();
 	// glEnable( GL_NORMALIZE );