example_recursive_cube(void)
	 : tex_side(512)
	 , rnd_tex(tex_side)
	 , cube(prog)
	 , current_buf(0)
	 , rad(0.0f)
	{
		gl.clear_color(0.8f, 0.8f, 0.8f, 0.0f);
		gl.clear_depth(1.0f);

		gl.enable(GL.depth_test);
		gl.enable(GL.cull_face);
		gl.cull_face(GL.back);
		gl.front_face(GL.ccw);
	}
Esempio n. 2
0
    cube_example(
        const example_state_view& state,
        eagine::memory::buffer& temp_buffer
    ): prog()
        , cube(
            temp_buffer,
            shapes::vertex_attrib_kind::position+
            shapes::vertex_attrib_kind::normal+
            shapes::vertex_attrib_kind::box_coord+
            shapes::vertex_attrib_kind::face_coord
        ), cam_orbit(0.5)
        , cam_turns(0.12f)
        , cam_pitch(0.72f)
        , cam_dist_dir(-1)
        , cam_turn_dir(1)
        , cam_elev_dir(1)
    {
        gl.clear_color(0.6f, 0.6f, 0.5f, 0);
        gl.clear_depth(1);
        gl.enable(GL.depth_test);

        set_projection(state);
    }