]> git.tdb.fi Git - libs/gl.git/blobdiff - demos/desertpillars.cpp
Remove an obsolete #include
[libs/gl.git] / demos / desertpillars.cpp
index 61db0badcf8e0b1756f306ce4e1028bb77212f0b..373297e20caab6c437bdb809944f307fc090bf34 100644 (file)
@@ -202,11 +202,12 @@ const char DesertPillars::texture_fragment_src[] =
        "}\n";
 
 const char DesertPillars::skybox_vertex_src[] =
+       "#version 120\n"
        "varying vec3 v_texcoord;\n"
        "void main()\n"
        "{\n"
        "       gl_Position = gl_ProjectionMatrix*vec4(mat3(gl_ModelViewMatrix)*gl_Vertex.xyz, 1.0);\n"
-       "       v_texcoord = gl_Vertex;\n"
+       "       v_texcoord = gl_Vertex.xyz;\n"
        "}";
 
 const char DesertPillars::skybox_fragment_src[] =
@@ -239,11 +240,11 @@ const char DesertPillars::ground_colorify_src[] =
        "varying float v_ground_type;\n"
        "vec4 sample_texture(vec2 coord)\n"
        "{\n"
-       "       return mix(texture2D(texture1, coord*3), texture2D(texture2, coord), v_ground_type);\n"
+       "       return mix(texture2D(texture1, coord*3.0), texture2D(texture2, coord), v_ground_type);\n"
        "}\n"
        "vec3 sample_normalmap(vec2 coord)\n"
        "{\n"
-       "       return mix(texture2D(normalmap1, coord*3), texture2D(normalmap2, coord), v_ground_type);\n"
+       "       return mix(texture2D(normalmap1, coord*3.0).rgb, texture2D(normalmap2, coord).rgb, v_ground_type);\n"
        "}\n";
 
 const char DesertPillars::cube_transform_src[] =
@@ -251,7 +252,7 @@ const char DesertPillars::cube_transform_src[] =
        "attribute vec3 sphere_coord;\n"
        "vec4 transform_vertex(vec4 vertex)\n"
        "{\n"
-       "       return gl_ModelViewMatrix*vec4(mix(vertex, sphere_coord, spherify), 1.0);\n"
+       "       return gl_ModelViewMatrix*vec4(mix(vertex.xyz, sphere_coord, spherify), 1.0);\n"
        "}\n"
        "vec3 transform_normal(vec3 normal)\n"
        "{\n"
@@ -303,7 +304,7 @@ DesertPillars::DesertPillars(int argc, char **argv):
        window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &DesertPillars::exit), 0));
        if(options.window_opts.fullscreen)
                window.show_cursor(false);
-       keyboard.signal_button_press.connect(sigc::mem_fun(this, &DesertPillars::key_press));
+       keyboard.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &DesertPillars::key_press), false));
 
        create_pipeline();
        create_skybox();