495 lines
14 KiB
Diff
495 lines
14 KiB
Diff
--- a/src/demos/fslight.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/demos/fslight.c 2020-12-13 23:34:11.491342096 +0300
|
|
@@ -396,7 +396,7 @@
|
|
GLsizei len;
|
|
glGetShaderInfoLog(shader, 1000, &len, log);
|
|
fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log);
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
}
|
|
|
|
@@ -413,7 +413,7 @@
|
|
FILE *f = fopen(filename, "r");
|
|
if (!f) {
|
|
fprintf(stderr, "fslight: Unable to open shader file %s\n", filename);
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
|
|
n = fread(buffer, 1, max, f);
|
|
@@ -465,7 +465,13 @@
|
|
|
|
if (!GLEW_VERSION_2_0) {
|
|
printf("This program requires OpenGL 2.x or higher\n");
|
|
- exit(1);
|
|
+ exit(0);
|
|
+ }
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
}
|
|
|
|
fragShader = glCreateShader(GL_FRAGMENT_SHADER);
|
|
|
|
--- a/src/demos/pointblast.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/demos/pointblast.c 2020-12-13 21:16:36.786095901 +0300
|
|
@@ -474,7 +474,7 @@
|
|
|
|
if (!glutExtensionSupported("GL_ARB_point_parameters")) {
|
|
fprintf(stderr, "Sorry, GL_ARB_point_parameters is not supported.\n");
|
|
- return -1;
|
|
+ return 0;
|
|
}
|
|
|
|
glShadeModel(GL_FLAT);
|
|
|
|
--- a/src/glsl/brick.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/brick.c 2020-12-13 21:17:51.499553579 +0300
|
|
@@ -140,7 +140,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
|
|
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
|
|
|
--- a/src/glsl/bump.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/bump.c 2020-12-13 21:18:50.880712146 +0300
|
|
@@ -253,7 +253,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
|
|
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
|
|
|
--- a/src/glsl/deriv.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/deriv.c 2020-12-13 21:19:22.481328705 +0300
|
|
@@ -182,7 +182,13 @@
|
|
"}\n";
|
|
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
|
|
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText);
|
|
|
|
--- a/src/glsl/gsraytrace.cpp 2022-04-29 13:06:08.000000000 +0300
|
|
+++ b/src/glsl/gsraytrace.cpp 2022-12-29 16:32:25.003548031 +0300
|
|
@@ -844,6 +844,12 @@
|
|
exit(-1);
|
|
}
|
|
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
+
|
|
if (!GLAD_GL_VERSION_3_2)
|
|
{
|
|
fprintf(stderr, "OpenGL 3.2 (needed for transform feedback and "
|
|
@@ -925,7 +931,7 @@
|
|
glutInit(&argc, argv);
|
|
|
|
#ifdef HAVE_FREEGLUT
|
|
- glutInitContextVersion(3, 2);
|
|
+ glutInitContextVersion(2, 1);
|
|
glutInitContextProfile(GLUT_CORE_PROFILE);
|
|
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
|
#elif defined __APPLE__
|
|
|
|
--- a/src/glsl/linktest.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/linktest.c 2020-12-13 23:00:59.868389948 +0300
|
|
@@ -187,7 +187,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
|
|
|
--- a/src/glsl/mandelbrot.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/mandelbrot.c 2020-12-13 23:01:46.729305901 +0300
|
|
@@ -151,7 +151,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
|
|
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
|
|
|
--- a/src/glsl/multinoise.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/multinoise.c 2020-12-13 23:03:26.879263434 +0300
|
|
@@ -195,7 +195,7 @@
|
|
GLsizei len;
|
|
glGetShaderInfoLog(shader, 1000, &len, log);
|
|
fprintf(stderr, "multinoise: problem compiling shader: %s\n", log);
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
else {
|
|
printf("Shader compiled OK\n");
|
|
@@ -227,7 +227,13 @@
|
|
|
|
if (!GLEW_VERSION_2_0) {
|
|
printf("Warning: this program expects OpenGL 2.0\n");
|
|
- /*exit(1);*/
|
|
+ /*exit(0);*/
|
|
+ }
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
}
|
|
|
|
vertShader = glCreateShader(GL_VERTEX_SHADER);
|
|
|
|
--- a/src/glsl/noise.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/noise.c 2020-12-13 23:04:02.443958578 +0300
|
|
@@ -172,7 +172,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderText(GL_VERTEX_SHADER, VertShaderText);
|
|
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderText);
|
|
|
|
--- a/src/glsl/pointcoord.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/pointcoord.c 2020-12-13 23:04:54.640978810 +0300
|
|
@@ -150,7 +150,13 @@
|
|
"}\n";
|
|
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
|
|
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText);
|
|
|
|
--- a/src/glsl/points.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/points.c 2020-12-13 23:06:11.170474630 +0300
|
|
@@ -221,7 +221,13 @@
|
|
"}\n";
|
|
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
VertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
|
|
FragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText);
|
|
|
|
--- a/src/glsl/skinning.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/skinning.c 2020-12-13 23:08:35.805301584 +0300
|
|
@@ -220,7 +220,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
|
|
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
|
|
|
--- a/src/glsl/texdemo1.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/texdemo1.c 2020-12-13 23:11:37.428851443 +0300
|
|
@@ -263,7 +263,7 @@
|
|
GLubyte *img = LoadRGBImage(filename, &w, &h, &format);
|
|
if (!img) {
|
|
printf("Error: couldn't load texture image %s\n", filename);
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
assert(format == GL_RGB);
|
|
|
|
@@ -401,10 +401,16 @@
|
|
Init(GLboolean useImageFiles)
|
|
{
|
|
if (!ShadersSupported()) {
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
|
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
+
|
|
InitTextures(useImageFiles);
|
|
InitPrograms();
|
|
|
|
--- a/src/glsl/toyball.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/toyball.c 2020-12-13 23:12:30.657891801 +0300
|
|
@@ -165,7 +165,13 @@
|
|
Init(void)
|
|
{
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
|
|
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
|
|
|
--- a/src/glsl/vert-or-frag-only.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/vert-or-frag-only.c 2020-12-13 23:13:03.342530618 +0300
|
|
@@ -125,7 +125,13 @@
|
|
"}\n";
|
|
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
|
|
if (FragProgFile)
|
|
FragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
|
|
|
|
--- a/src/glsl/vsraytrace.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/glsl/vsraytrace.c 2020-12-13 23:13:56.159562915 +0300
|
|
@@ -354,6 +354,12 @@
|
|
exit(-1);
|
|
}
|
|
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
+
|
|
vertShader = CompileShaderText(GL_VERTEX_SHADER, vsSource);
|
|
program = LinkShaders(vertShader, 0);
|
|
glUseProgram(0);
|
|
|
|
--- a/src/samples/overlay.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/samples/overlay.c 2020-12-10 21:34:39.256393221 +0300
|
|
@@ -250,7 +250,7 @@
|
|
|
|
switch (key) {
|
|
case 27:
|
|
- exit(1);
|
|
+ exit(0);
|
|
case 32:
|
|
flag = (flag == NORMAL) ? WEIRD : NORMAL;
|
|
break;
|
|
@@ -347,7 +347,7 @@
|
|
if (!glutLayerGet(GLUT_OVERLAY_POSSIBLE))
|
|
{
|
|
fprintf(stderr, "Overlay not available\n");
|
|
- return(1);
|
|
+ return(0);
|
|
}
|
|
|
|
if (Args(argc, argv) == GL_FALSE) {
|
|
|
|
--- a/src/tests/bufferobj.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/tests/bufferobj.c 2020-12-08 11:34:55.597501508 +0300
|
|
@@ -461,7 +461,7 @@
|
|
|
|
static void Init( void )
|
|
{
|
|
- if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) {
|
|
+ if (!glutExtensionSupported("GL_ARB_vertex_array_object")) {
|
|
printf("GL_ARB_vertex_buffer_object not found!\n");
|
|
exit(0);
|
|
}
|
|
|
|
--- a/src/tests/prog_parameter.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/tests/prog_parameter.c 2020-12-10 21:47:13.559245689 +0300
|
|
@@ -198,7 +198,7 @@
|
|
|
|
if ( !GLEW_ARB_vertex_program ) {
|
|
printf("Sorry, this program requires GL_ARB_vertex_program\n");
|
|
- exit(2);
|
|
+ exit(0);
|
|
}
|
|
|
|
|
|
@@ -261,7 +261,7 @@
|
|
|
|
if (! pass) {
|
|
printf("FAIL!\n");
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
|
|
printf("PASS!\n");
|
|
|
|
--- a/src/tests/shader_api.c 2012-09-19 13:36:31.000000000 +0400
|
|
+++ b/src/tests/shader_api.c 2020-12-13 23:22:02.401069830 +0300
|
|
@@ -54,7 +54,7 @@
|
|
fprintf(stderr, "Compilation/link failure:\n");
|
|
glGetInfoLogARB(id, sizeof(info), NULL, info);
|
|
fprintf(stderr, "%s\n", info);
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
}
|
|
|
|
@@ -330,6 +330,12 @@
|
|
exit(0);
|
|
}
|
|
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
+ }
|
|
+
|
|
RUN_TEST(test_uniform_size_type);
|
|
RUN_TEST(test_attrib_size_type);
|
|
RUN_TEST(test_uniform_array_overflow);
|
|
|
|
--- a/src/trivial/fs-tri.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/trivial/fs-tri.c 2020-12-13 23:22:32.605661162 +0300
|
|
@@ -118,7 +118,7 @@
|
|
GLsizei len;
|
|
glGetShaderInfoLog(shader, 1000, &len, log);
|
|
fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log);
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
}
|
|
|
|
@@ -158,7 +158,13 @@
|
|
|
|
if (!GLEW_VERSION_2_0) {
|
|
printf("This program requires OpenGL 2.x\n");
|
|
- exit(1);
|
|
+ exit(0);
|
|
+ }
|
|
+
|
|
+ float glslVersion = (float) atoll((const char *) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
|
+ if (glslVersion < 3.30) {
|
|
+ fprintf(stderr, "GLSL 3.30 not supported\n");
|
|
+ exit(0);
|
|
}
|
|
|
|
fragShader = glCreateShader(GL_FRAGMENT_SHADER);
|
|
|
|
--- a/src/xdemos/glsync.c 2012-06-25 19:34:58.000000000 +0400
|
|
+++ b/src/xdemos/glsync.c 2020-12-10 21:19:24.894379361 +0300
|
|
@@ -96,7 +96,7 @@
|
|
printf("\t\tb: buffer swap\n");
|
|
printf("\t-i<swap interval>\n");
|
|
printf("\t-v: verbose (print count)\n");
|
|
- exit(-1);
|
|
+ exit(0);
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
@@ -178,7 +178,7 @@
|
|
|
|
if (!GLXExtensionSupported(disp, "GLX_SGI_video_sync")) {
|
|
fprintf(stderr, "GLX_SGI_video_sync not supported, exiting\n");
|
|
- return -1;
|
|
+ return 0;
|
|
}
|
|
|
|
if (waitforsync != buffer_swap) {
|
|
|
|
--- a/src/glsl/geom-outlining-150.c 2022-04-29 13:06:08.000000000 +0300
|
|
+++ b/src/glsl/geom-outlining-150.c 2022-12-29 16:29:33.912019655 +0300
|
|
@@ -307,11 +307,11 @@
|
|
};
|
|
|
|
if (!ShadersSupported())
|
|
- exit(1);
|
|
+ exit(0);
|
|
|
|
if (!GLAD_GL_VERSION_3_2) {
|
|
fprintf(stderr, "Sorry, OpenGL 3.2 or later required.\n");
|
|
- exit(1);
|
|
+ exit(0);
|
|
}
|
|
|
|
VertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
|
|
@@ -364,7 +364,7 @@
|
|
glutInit(&argc, argv);
|
|
glutInitWindowSize(WinWidth, WinHeight);
|
|
#ifdef HAVE_FREEGLUT
|
|
- glutInitContextVersion(3, 2);
|
|
+ glutInitContextVersion(2, 1);
|
|
glutInitContextProfile(GLUT_CORE_PROFILE);
|
|
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
|
|
#elif defined __APPLE__
|