shithub: tinygl

Download patch

ref: 656b46af3c851a8f2eae195a5553f79057ffb9b6
parent: 441fcdcad62c32e17c72e11ba1e7312aed46b1d1
author: David <gek@katherine>
date: Thu Mar 11 12:56:49 EST 2021

Automatic commit.

--- a/README.md
+++ b/README.md
@@ -327,7 +327,7 @@
 
 These are functions not in the GL 1.1 spec that i've added to make this library more useful.
 
-These functions cannot be added as opcodes to display lists.
+These functions cannot be added as opcodes to display lists unless specifically listed.
 
 ### glDeleteList
 
@@ -335,6 +335,8 @@
 
 ### glSetEnableSpecular(int shouldenablespecular);
 
+This function can be added to display lists.
+
 Allows you to configure specular rendering. Turn it off
 if you want to use GL_LIGHTING but don't plan on using
 specular lighting. it will save cycles.
@@ -345,7 +347,7 @@
 
 ### glDrawText(const unsigned char* text, int x, int y, unsigned int pixel)
 
-This function can be added to display lists.
+This function can be added to display lists as glPlotPixel calls, the text is not saved in a display list.
 
 Draws a pre-made 8x8 font to the screen. You can change its displayed size with...
 
--- a/SDL_Examples/texture.c
+++ b/SDL_Examples/texture.c
@@ -274,7 +274,7 @@
 		draw();
 		glDrawText((unsigned char*)"\nBlitting text\nto the screen!", 0, 0, 0x000000FF);
 		glPixelZoom(2.0,0.7);
-		glRasterPos3f(-1,-1,fabs(sinf(frames_notreset/200.0)));
+		glRasterPos3f(0,-1,fabs(sinf(frames_notreset/200.0)));
 		{
 			GLint xsize, ysize;
 			void* data = glGetTexturePixmap(tex, 0, &xsize,  &ysize);
--- a/config.mk
+++ b/config.mk
@@ -4,7 +4,7 @@
 CC= gcc
 #CFLAGS= -Wall -w -O3 -g -std=c99 -mtune=native -DNDEBUG
 #CFLAGS= -Wall -w -O3 -g -std=c99 -march=native -DNDEBUG
-CFLAGS= -Wall -O3 -std=c99 -DNDEBUG -g -fopenmp -Wno-uninitialized
+CFLAGS= -Wall -O3 -std=gnu99 -DNDEBUG -g -fopenmp -Wno-uninitialized
 #CFLAGS= -Wall -O1 -g -std=c99 -Wno-undef -DNDEBUG
 LFLAGS=
 
--- a/src/light.c
+++ b/src/light.c
@@ -220,10 +220,15 @@
 }
 
 // FEATURES
-
-void glSetEnableSpecular(GLint s) { 
+void glSetEnableSpecular(GLint s){
+	GLParam p[2];
+	p[1].i = s;
+	p[0].op = OP_SetEnableSpecular;
+	gl_add_op(p);
+}
+void glopSetEnableSpecular(GLParam* p) {
 #include "error_check_no_context.h"
-	gl_get_context()->zEnableSpecular = s; 
+	gl_get_context()->zEnableSpecular = p[0].i; 
 }
 /* non optimized lightening model */
 void gl_shade_vertex(GLVertex* v) {
--- a/src/opinfo.h
+++ b/src/opinfo.h
@@ -87,6 +87,7 @@
 /* Gek's Added Functions */
 ADD_OP(PlotPixel, 2, "%d %d")
 ADD_OP(TextSize, 1, "%d")
+ADD_OP(SetEnableSpecular, 1, "%d")
 
 
 #undef ADD_OP