]> git.tdb.fi Git - libs/gl.git/commitdiff
Compatibility fixes
authorMikko Rasa <tdb@tdb.fi>
Sat, 8 Sep 2012 15:53:51 +0000 (18:53 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 8 Sep 2012 16:06:55 +0000 (19:06 +0300)
Fix a template parameter deduction on 64-bit system

Fix a shader type mismatch

source/programbuilder.cpp
source/vertexarray.cpp

index 4043fc4471648f6dec62d611c7cf07479548c545..636d87a92018bdd7542007f9b7437193c33780f1 100644 (file)
@@ -66,7 +66,7 @@ const ProgramBuilder::StandardVariable ProgramBuilder::standard_variables[] =
        { FRAGMENT, "tex_sample", "vec4", "texture2D(texture, texture_coord)", 0 },
 
        { VERTEX, "gl_Position", 0, "gl_ProjectionMatrix*eye_vertex", 0 },
-       { VERTEX, "shd_vertex", "vec3", "eye_vertex*eye_shd_rmatrix", 0 },
+       { VERTEX, "shd_vertex", "vec3", "(eye_vertex*eye_shd_rmatrix).xyz", 0 },
        { VERTEX, "eye_shd_rmatrix", "mat4", "mat4(gl_EyePlaneS[shadow_unit], gl_EyePlaneT[shadow_unit], gl_EyePlaneR[shadow_unit], vec4(0.0, 0.0, 0.0, 1.0))", 0 },
        { VERTEX, "tbn_light_dir", "vec3", "eye_light_dir*eye_tbn_matrix", 0 },
        { VERTEX, "eye_light_dir", "vec3", "normalize(gl_LightSource[0].position.xyz-eye_vertex.xyz*gl_LightSource[0].position.w)", 0 },
index 6c0e5f1aea363c8de02eeaea1c714f7ac1196645..79eecf58a2970ea53e850477e81ed11f6a96ce22 100644 (file)
@@ -143,7 +143,7 @@ void VertexArray::apply() const
        unsigned active_tex = 0;
        unsigned n_arrays = arrays.size();
        if(old)
-               n_arrays = max(n_arrays, old->arrays.size());
+               n_arrays = max<unsigned>(n_arrays, old->arrays.size());
        for(unsigned i=0; i<n_arrays; ++i)
        {
                const Array *arr = ((i<arrays.size() && arrays[i].component) ? &arrays[i] : 0);