lighting_example(
		const example_params& params,
		const example_state_view& state,
		eagine::memory::buffer& temp_buffer
	): erase_prog(params)
	 , light_prog(params)
	 , background(
		temp_buffer,
		(shapes::vertex_attrib_kind::position  |0),
		36, 72
	), shape(
		temp_buffer,
		(shapes::vertex_attrib_kind::position  |0)+
		(shapes::vertex_attrib_kind::normal    |1)+
		(shapes::vertex_attrib_kind::wrap_coord|2),
		96, 144
	), shp_turns(0.0f)
	 , cam_orbit(0.0f)
	 , cam_turns(0.0f)
	 , cam_pitch(0.5f)
	 , cam_dist_dir(-1)
	 , cam_turn_dir(1)
	 , cam_elev_dir(1)
	{
		gl.clear_depth(1);
		gl.disable(GL.cull_face);

		set_projection(state);
	}
	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);
	}
Beispiel #3
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);
    }