X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=util.cpp;h=675b25b4940c3d9a9048d3d4488220340b31817b;hp=9c077e92909d639f203299b3162f805c8bd975e3;hb=825c90789c229f502520bf0b665596d473f2636d;hpb=d4cade9004a527206e1360ae24f833a6bcf6d476 diff --git a/util.cpp b/util.cpp index 9c077e9..675b25b 100644 --- a/util.cpp +++ b/util.cpp @@ -127,7 +127,12 @@ string read_file(const string &filename) string read_version_dependent_file(const string &base, const string &extension) { - if (movit_shader_model == MOVIT_GLSL_130) { + if (movit_shader_model == MOVIT_GLSL_130_AS_110) { + string contents = read_file(base + ".130." + extension); + assert(contents.find("#version 130") == 0); + contents[10] = '1'; // Change from 130 to 110. + return contents; + } else if (movit_shader_model == MOVIT_GLSL_130) { return read_file(base + ".130." + extension); } else if (movit_shader_model == MOVIT_GLSL_150) { return read_file(base + ".150." + extension); @@ -334,11 +339,11 @@ void *get_gl_context_identifier() #elif defined(WIN32) return (void *)wglGetCurrentContext(); #else - void *ret = (void *)glXGetCurrentContext(); + void *ret = (void *)eglGetCurrentContext(); if (ret != NULL) { return ret; } - return (void *)eglGetCurrentContext(); + return (void *)glXGetCurrentContext(); #endif }