]> git.sesse.net Git - movit/blobdiff - util.cpp
Add separate shaders for GLSL 1.50.
[movit] / util.cpp
index c2ac59301778906894410cb27971ea4956289e56..9c077e92909d639f203299b3162f805c8bd975e3 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -19,6 +19,7 @@
 #include <epoxy/wgl.h>
 #else
 #include <epoxy/glx.h>
+#include <epoxy/egl.h>
 #endif
 
 using namespace std;
@@ -128,6 +129,8 @@ string read_version_dependent_file(const string &base, const string &extension)
 {
        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);
        } else if (movit_shader_model == MOVIT_ESSL_300) {
                return read_file(base + ".300es." + extension);
        } else {
@@ -331,7 +334,11 @@ void *get_gl_context_identifier()
 #elif defined(WIN32)
        return (void *)wglGetCurrentContext();
 #else
-       return (void *)glXGetCurrentContext();
+       void *ret = (void *)glXGetCurrentContext();
+       if (ret != NULL) {
+               return ret;
+       }
+       return (void *)eglGetCurrentContext();
 #endif
 }