X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=demos%2Fdesertpillars.cpp;h=297619c74a2f5532d7de22dac9e5c5b2e73df40a;hb=fa5b232a16e11d7950e80764497f0167ec9e3b41;hp=61db0badcf8e0b1756f306ce4e1028bb77212f0b;hpb=7f08a54a61db86c60f06f4ddef529aa37e0d3d9c;p=libs%2Fgl.git diff --git a/demos/desertpillars.cpp b/demos/desertpillars.cpp index 61db0bad..297619c7 100644 --- a/demos/desertpillars.cpp +++ b/demos/desertpillars.cpp @@ -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" @@ -261,7 +262,7 @@ const char DesertPillars::cube_transform_src[] = const float DesertPillars::cube_shapes[] = { -0.4, 0.5, 1.0, 0.3 }; -DesertPillars::Options::Options(const Graphics::Display &display, int argc, char **argv) +DesertPillars::Options::Options(const Graphics::Display &dpy, int argc, char **argv) { GetOpt getopt; getopt.add_option('f', "fullscreen", window_opts.fullscreen, GetOpt::NO_ARG).set_help("Run in fullscreen mode"); @@ -269,7 +270,7 @@ DesertPillars::Options::Options(const Graphics::Display &display, int argc, char if(window_opts.fullscreen) { - const Graphics::VideoMode &mode = display.get_desktop_mode(); + const Graphics::VideoMode &mode = dpy.get_desktop_mode(); window_opts.width = mode.width; window_opts.height = mode.height; } @@ -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();