diff options
Diffstat (limited to 'progs/glsl')
-rw-r--r-- | progs/glsl/CH18-mandel.frag | 2 | ||||
-rw-r--r-- | progs/glsl/bump.c | 2 | ||||
-rw-r--r-- | progs/glsl/deriv.c | 1 | ||||
-rw-r--r-- | progs/glsl/multinoise.c | 11 | ||||
-rw-r--r-- | progs/glsl/multitex.c | 7 | ||||
-rw-r--r-- | progs/glsl/shtest.c | 2 | ||||
-rw-r--r-- | progs/glsl/texaaline.c | 6 | ||||
-rw-r--r-- | progs/glsl/texdemo1.c | 7 |
8 files changed, 18 insertions, 20 deletions
diff --git a/progs/glsl/CH18-mandel.frag b/progs/glsl/CH18-mandel.frag index a472d81252..a972d68bcf 100644 --- a/progs/glsl/CH18-mandel.frag +++ b/progs/glsl/CH18-mandel.frag @@ -31,7 +31,7 @@ void main() float iter; // for (iter = 0.0; iter < MaxIterations && r2 < 4.0; ++iter) - for (iter = 0.0; iter < 12 && r2 < 4.0; ++iter) + for (iter = 0.0; iter < 12.0 && r2 < 4.0; ++iter) { float tempreal = real; diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index 87669aec73..50a0900f1c 100644 --- a/progs/glsl/bump.c +++ b/progs/glsl/bump.c @@ -36,7 +36,7 @@ static GLint win = 0; static GLfloat xRot = 20.0f, yRot = 0.0f, zRot = 0.0f; -static GLuint tangentAttrib; +static GLint tangentAttrib; static GLboolean Anim = GL_FALSE; diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c index 265a515715..30f2b75fef 100644 --- a/progs/glsl/deriv.c +++ b/progs/glsl/deriv.c @@ -140,6 +140,7 @@ MakeSphere(void) glNewList(SphereList, GL_COMPILE); gluSphere(obj, 2.0f, 30, 15); glEndList(); + gluDeleteQuadric(obj); } diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c index 0d4026e29c..d504ba1cc4 100644 --- a/progs/glsl/multinoise.c +++ b/progs/glsl/multinoise.c @@ -22,22 +22,22 @@ static const char *FragShaderText[ 4 ] = { "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].w ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n", "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xw ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n", "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xyw ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n", "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xyzw ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n" }; @@ -125,6 +125,7 @@ Key(unsigned char key, int x, int y) case 'a': Anim = !Anim; glutIdleFunc(Anim ? Idle : NULL); + break; case 's': Slice -= step; break; @@ -193,7 +194,7 @@ LoadAndCompileShader(GLuint shader, const char *text) GLchar log[1000]; GLsizei len; glGetShaderInfoLog(shader, 1000, &len, log); - fprintf(stderr, "noise: problem compiling shader: %s\n", log); + fprintf(stderr, "multinoise: problem compiling shader: %s\n", log); exit(1); } else { diff --git a/progs/glsl/multitex.c b/progs/glsl/multitex.c index bf46fd5210..49b32253ee 100644 --- a/progs/glsl/multitex.c +++ b/progs/glsl/multitex.c @@ -369,12 +369,9 @@ InitPrograms(void) static void InitGL(void) { - const char *version = (const char *) glGetString(GL_VERSION); + if (!ShadersSupported()) + exit(1); - if (version[0] != '2' || version[1] != '.') { - printf("Warning: this program expects OpenGL 2.0\n"); - /*exit(1);*/ - } printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); printf("Usage:\n"); printf(" a - toggle arrays vs. immediate mode rendering\n"); diff --git a/progs/glsl/shtest.c b/progs/glsl/shtest.c index 628a7dd5b9..9d76e018e3 100644 --- a/progs/glsl/shtest.c +++ b/progs/glsl/shtest.c @@ -627,7 +627,7 @@ Init(void) NumAttribs = GetAttribs(Program, Attribs); PrintAttribs(Attribs); - //assert(glGetError() == 0); + /*assert(glGetError() == 0);*/ glClearColor(0.4f, 0.4f, 0.8f, 0.0f); diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c index 2e4f932ad6..4ad5a761c6 100644 --- a/progs/glsl/texaaline.c +++ b/progs/glsl/texaaline.c @@ -310,8 +310,10 @@ MakeMipmap(void) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4); - ////glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5); + /* + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5); + */ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); #undef SZ diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c index 5b1913a722..2076e6aef9 100644 --- a/progs/glsl/texdemo1.c +++ b/progs/glsl/texdemo1.c @@ -400,11 +400,8 @@ InitPrograms(void) static void Init(GLboolean useImageFiles) { - const char *version = (const char *) glGetString(GL_VERSION); - - if (version[0] != '2' || version[1] != '.') { - printf("Warning: this program expects OpenGL 2.0\n"); - /*exit(1);*/ + if (!ShadersSupported()) { + exit(1); } printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); |